bc-deeplib 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js ADDED
@@ -0,0 +1,1894 @@
1
+ /* eslint-disable */
2
+ /******/ (() => { // webpackBootstrap
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 734:
6
+ /***/ ((__unused_webpack_module, exports) => {
7
+
8
+ // Bondage Club Mod Development Kit (1.2.0)
9
+ // For more info see: https://github.com/Jomshir98/bondage-club-mod-sdk
10
+ /** @type {ModSDKGlobalAPI} */
11
+ var bcModSdk=function(){"use strict";const o="1.2.0";function e(o){alert("Mod ERROR:\n"+o);const e=new Error(o);throw console.error(e),e}const t=new TextEncoder;function n(o){return!!o&&"object"==typeof o&&!Array.isArray(o)}function r(o){const e=new Set;return o.filter((o=>!e.has(o)&&e.add(o)))}const i=new Map,a=new Set;function c(o){a.has(o)||(a.add(o),console.warn(o))}function s(o){const e=[],t=new Map,n=new Set;for(const r of f.values()){const i=r.patching.get(o.name);if(i){e.push(...i.hooks);for(const[e,a]of i.patches.entries())t.has(e)&&t.get(e)!==a&&c(`ModSDK: Mod '${r.name}' is patching function ${o.name} with same pattern that is already applied by different mod, but with different pattern:\nPattern:\n${e}\nPatch1:\n${t.get(e)||""}\nPatch2:\n${a}`),t.set(e,a),n.add(r.name)}}e.sort(((o,e)=>e.priority-o.priority));const r=function(o,e){if(0===e.size)return o;let t=o.toString().replaceAll("\r\n","\n");for(const[n,r]of e.entries())t.includes(n)||c(`ModSDK: Patching ${o.name}: Patch ${n} not applied`),t=t.replaceAll(n,r);return(0,eval)(`(${t})`)}(o.original,t);let i=function(e){var t,i;const a=null===(i=(t=m.errorReporterHooks).hookChainExit)||void 0===i?void 0:i.call(t,o.name,n),c=r.apply(this,e);return null==a||a(),c};for(let t=e.length-1;t>=0;t--){const n=e[t],r=i;i=function(e){var t,i;const a=null===(i=(t=m.errorReporterHooks).hookEnter)||void 0===i?void 0:i.call(t,o.name,n.mod),c=n.hook.apply(this,[e,o=>{if(1!==arguments.length||!Array.isArray(e))throw new Error(`Mod ${n.mod} failed to call next hook: Expected args to be array, got ${typeof o}`);return r.call(this,o)}]);return null==a||a(),c}}return{hooks:e,patches:t,patchesSources:n,enter:i,final:r}}function l(o,e=!1){let r=i.get(o);if(r)e&&(r.precomputed=s(r));else{let e=window;const a=o.split(".");for(let t=0;t<a.length-1;t++)if(e=e[a[t]],!n(e))throw new Error(`ModSDK: Function ${o} to be patched not found; ${a.slice(0,t+1).join(".")} is not object`);const c=e[a[a.length-1]];if("function"!=typeof c)throw new Error(`ModSDK: Function ${o} to be patched not found`);const l=function(o){let e=-1;for(const n of t.encode(o)){let o=255&(e^n);for(let e=0;e<8;e++)o=1&o?-306674912^o>>>1:o>>>1;e=e>>>8^o}return((-1^e)>>>0).toString(16).padStart(8,"0").toUpperCase()}(c.toString().replaceAll("\r\n","\n")),d={name:o,original:c,originalHash:l};r=Object.assign(Object.assign({},d),{precomputed:s(d),router:()=>{},context:e,contextProperty:a[a.length-1]}),r.router=function(o){return function(...e){return o.precomputed.enter.apply(this,[e])}}(r),i.set(o,r),e[r.contextProperty]=r.router}return r}function d(){for(const o of i.values())o.precomputed=s(o)}function p(){const o=new Map;for(const[e,t]of i)o.set(e,{name:e,original:t.original,originalHash:t.originalHash,sdkEntrypoint:t.router,currentEntrypoint:t.context[t.contextProperty],hookedByMods:r(t.precomputed.hooks.map((o=>o.mod))),patchedByMods:Array.from(t.precomputed.patchesSources)});return o}const f=new Map;function u(o){f.get(o.name)!==o&&e(`Failed to unload mod '${o.name}': Not registered`),f.delete(o.name),o.loaded=!1,d()}function g(o,t){o&&"object"==typeof o||e("Failed to register mod: Expected info object, got "+typeof o),"string"==typeof o.name&&o.name||e("Failed to register mod: Expected name to be non-empty string, got "+typeof o.name);let r=`'${o.name}'`;"string"==typeof o.fullName&&o.fullName||e(`Failed to register mod ${r}: Expected fullName to be non-empty string, got ${typeof o.fullName}`),r=`'${o.fullName} (${o.name})'`,"string"!=typeof o.version&&e(`Failed to register mod ${r}: Expected version to be string, got ${typeof o.version}`),o.repository||(o.repository=void 0),void 0!==o.repository&&"string"!=typeof o.repository&&e(`Failed to register mod ${r}: Expected repository to be undefined or string, got ${typeof o.version}`),null==t&&(t={}),t&&"object"==typeof t||e(`Failed to register mod ${r}: Expected options to be undefined or object, got ${typeof t}`);const i=!0===t.allowReplace,a=f.get(o.name);a&&(a.allowReplace&&i||e(`Refusing to load mod ${r}: it is already loaded and doesn't allow being replaced.\nWas the mod loaded multiple times?`),u(a));const c=o=>{let e=g.patching.get(o.name);return e||(e={hooks:[],patches:new Map},g.patching.set(o.name,e)),e},s=(o,t)=>(...n)=>{var i,a;const c=null===(a=(i=m.errorReporterHooks).apiEndpointEnter)||void 0===a?void 0:a.call(i,o,g.name);g.loaded||e(`Mod ${r} attempted to call SDK function after being unloaded`);const s=t(...n);return null==c||c(),s},p={unload:s("unload",(()=>u(g))),hookFunction:s("hookFunction",((o,t,n)=>{"string"==typeof o&&o||e(`Mod ${r} failed to patch a function: Expected function name string, got ${typeof o}`);const i=l(o),a=c(i);"number"!=typeof t&&e(`Mod ${r} failed to hook function '${o}': Expected priority number, got ${typeof t}`),"function"!=typeof n&&e(`Mod ${r} failed to hook function '${o}': Expected hook function, got ${typeof n}`);const s={mod:g.name,priority:t,hook:n};return a.hooks.push(s),d(),()=>{const o=a.hooks.indexOf(s);o>=0&&(a.hooks.splice(o,1),d())}})),patchFunction:s("patchFunction",((o,t)=>{"string"==typeof o&&o||e(`Mod ${r} failed to patch a function: Expected function name string, got ${typeof o}`);const i=l(o),a=c(i);n(t)||e(`Mod ${r} failed to patch function '${o}': Expected patches object, got ${typeof t}`);for(const[n,i]of Object.entries(t))"string"==typeof i?a.patches.set(n,i):null===i?a.patches.delete(n):e(`Mod ${r} failed to patch function '${o}': Invalid format of patch '${n}'`);d()})),removePatches:s("removePatches",(o=>{"string"==typeof o&&o||e(`Mod ${r} failed to patch a function: Expected function name string, got ${typeof o}`);const t=l(o);c(t).patches.clear(),d()})),callOriginal:s("callOriginal",((o,t,n)=>{"string"==typeof o&&o||e(`Mod ${r} failed to call a function: Expected function name string, got ${typeof o}`);const i=l(o);return Array.isArray(t)||e(`Mod ${r} failed to call a function: Expected args array, got ${typeof t}`),i.original.apply(null!=n?n:globalThis,t)})),getOriginalHash:s("getOriginalHash",(o=>{"string"==typeof o&&o||e(`Mod ${r} failed to get hash: Expected function name string, got ${typeof o}`);return l(o).originalHash}))},g={name:o.name,fullName:o.fullName,version:o.version,repository:o.repository,allowReplace:i,api:p,loaded:!0,patching:new Map};return f.set(o.name,g),Object.freeze(p)}function h(){const o=[];for(const e of f.values())o.push({name:e.name,fullName:e.fullName,version:e.version,repository:e.repository});return o}let m;const y=void 0===window.bcModSdk?window.bcModSdk=function(){const e={version:o,apiVersion:1,registerMod:g,getModsInfo:h,getPatchingInfo:p,errorReporterHooks:Object.seal({apiEndpointEnter:null,hookEnter:null,hookChainExit:null})};return m=e,Object.freeze(e)}():(n(window.bcModSdk)||e("Failed to init Mod SDK: Name already in use"),1!==window.bcModSdk.apiVersion&&e(`Failed to init Mod SDK: Different version already loaded ('1.2.0' vs '${window.bcModSdk.version}')`),window.bcModSdk.version!==o&&alert(`Mod SDK warning: Loading different but compatible versions ('1.2.0' vs '${window.bcModSdk.version}')\nOne of mods you are using is using an old version of SDK. It will work for now but please inform author to update`),window.bcModSdk);return true&&(Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=y),y}();
12
+
13
+
14
+ /***/ }),
15
+
16
+ /***/ 63:
17
+ /***/ ((module, __unused_webpack___webpack_exports__, __webpack_require__) => {
18
+
19
+ "use strict";
20
+ /* harmony import */ var _node_modules_pnpm_css_loader_7_1_2_webpack_5_97_1_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(973);
21
+ /* harmony import */ var _node_modules_pnpm_css_loader_7_1_2_webpack_5_97_1_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_pnpm_css_loader_7_1_2_webpack_5_97_1_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
22
+ /* harmony import */ var _node_modules_pnpm_css_loader_7_1_2_webpack_5_97_1_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(163);
23
+ /* harmony import */ var _node_modules_pnpm_css_loader_7_1_2_webpack_5_97_1_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_pnpm_css_loader_7_1_2_webpack_5_97_1_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
24
+ // Imports
25
+
26
+
27
+ var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_css_loader_7_1_2_webpack_5_97_1_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_pnpm_css_loader_7_1_2_webpack_5_97_1_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
28
+ // Module
29
+ ___CSS_LOADER_EXPORT___.push([module.id, `.deeplib-subscreen {
30
+ --deeplib-background-color: var(--main, white);
31
+ --deeplib-element-color: var(--element, white);
32
+ --deeplib-element-hover-color: var(--accentHover, cyan);
33
+ --deeplib-text-color: var(--text, black);
34
+ --deeplib-icon-color: var(--accent, white);
35
+ --deeplib-border-color: var(--accent, black);
36
+ }
37
+
38
+ /************/
39
+ /* ELEMENTS */
40
+ /************/
41
+
42
+ .deeplib-text {
43
+ color: var(--deeplib-text-color);
44
+ }
45
+
46
+ .deeplib-subscreen {
47
+ padding: 0;
48
+ margin: 0;
49
+ }
50
+
51
+ .deeplib-subscreen * {
52
+ box-sizing: border-box;
53
+ }
54
+
55
+ .deeplib-settings {
56
+ display: flex;
57
+ flex-direction: column;
58
+ padding: min(1.0dvh, 0.5dvw);
59
+ gap: 0.3em;
60
+ overflow-y: auto;
61
+ }
62
+
63
+ .deeplib-misc {
64
+ display: flex;
65
+ align-items: center;
66
+ justify-content: space-between;
67
+ flex-direction: column-reverse;
68
+ }
69
+
70
+ .deeplib-button.button-styling {
71
+ border-radius: min(1.0dvh, 0.5dvw);
72
+ color: var(--deeplib-text-color);
73
+ }
74
+
75
+ .deeplib-button.button-styling img {
76
+ position: absolute;
77
+ top: 0%;
78
+ left: 0%;
79
+ width: 100%;
80
+ height: 100%;
81
+ background-position: left;
82
+ background-color: var(--deeplib-icon-color);
83
+ background-blend-mode: multiply;
84
+ background-size: contain;
85
+ mask-position: left;
86
+ mask-size: contain;
87
+ background-repeat: no-repeat;
88
+ mask-repeat: no-repeat;
89
+ color: transparent;
90
+
91
+ background-image: var(--image);
92
+ mask-image: var(--image);
93
+ }
94
+
95
+ .deeplib-button.button-styling .button-label {
96
+ width: 100%;
97
+ background-color: transparent;
98
+ color: var(--deeplib-text-color);
99
+ font-size: min(3.6dvh, 1.8dvw);
100
+ }
101
+
102
+ #deeplib-subscreen-title {
103
+ text-align: center;
104
+ color: var(--deeplib-text-color);
105
+ }
106
+
107
+ #deeplib-reset-button {
108
+ background-color: indianred;
109
+ }
110
+
111
+ #deeplib-wiki-button {
112
+ background-color: #BDA203;
113
+ }
114
+
115
+ #deeplib-support-button {
116
+ background-color: #5e4969;
117
+ }
118
+
119
+ .deeplib-checkbox-container {
120
+ display: flex;
121
+ flex-direction: row;
122
+ align-items: center;
123
+ gap: 0.3em;
124
+ }
125
+
126
+ .deeplib-input {
127
+ border-radius: min(1.0dvh, 0.5dvw);
128
+ }
129
+
130
+ .deeplib-input-container {
131
+ position: relative;
132
+ margin-top: min(1vh, 0.5vw);
133
+ }
134
+
135
+ .deeplib-input-container input.deeplib-input {
136
+ font-size: 20px;
137
+ width: 100%;
138
+ padding: 5px 0;
139
+ background-color: transparent;
140
+ outline: none;
141
+ padding-left: min(1vh, 0.5vw);
142
+ padding-right: min(1vh, 0.5vw);
143
+ }
144
+
145
+ .deeplib-input-container label.deeplib-text {
146
+ position: absolute;
147
+ top: min(0.6vh, 0.3vw);
148
+ left: min(0.6vh, 0.3vw);
149
+ transition: all 0.3s ease;
150
+ pointer-events: none;
151
+ }
152
+
153
+ .deeplib-input-container input.deeplib-input:focus~label,
154
+ .deeplib-input-container input.deeplib-input:not(:placeholder-shown)~label {
155
+ font-size: 0.7em;
156
+ transform: translate(20%, -70%);
157
+ background-color: var(--deeplib-background-color);
158
+ padding: 0px min(1vh, 0.5vw);
159
+ }
160
+
161
+ .deeplib-input-container .deeplib-underline {
162
+ position: absolute;
163
+ bottom: 0;
164
+ left: 0;
165
+ height: 2px;
166
+ width: 100%;
167
+ background-color: var(--deeplib-element-hover-color);
168
+ transform: scaleX(0);
169
+ transition: all 0.3s ease;
170
+ }
171
+
172
+ .deeplib-input-container input.deeplib-input:focus~.deeplib-underline,
173
+ .deeplib-input-container input.deeplib-input:not(:placeholder-shown)~.deeplib-underline {
174
+ transform: scaleX(0.98);
175
+ }
176
+
177
+ .deeplib-tooltip {
178
+ background-color: var(--deeplib-element-color);
179
+ color: var(--deeplib-text-color);
180
+ display: flex;
181
+ align-items: center;
182
+ justify-content: center;
183
+ border-radius: min(1.0dvh, 0.5dvw);
184
+ padding: min(1vh, 0.5vw);
185
+ font-size: 0.8em;
186
+ border: min(0.2vh, 0.1vw) solid var(--deeplib-border-color);
187
+ }
188
+
189
+ input::-webkit-outer-spin-button,
190
+ input::-webkit-inner-spin-button {
191
+ -webkit-appearance: none;
192
+ margin: 0;
193
+ }
194
+
195
+ input[type=number] {
196
+ appearance: textfield;
197
+ -moz-appearance: textfield;
198
+ }
199
+
200
+ /*************/
201
+ /* MESSAGES */
202
+ /*************/
203
+
204
+ .deeplib-highlight-text {
205
+ font-weight: bold;
206
+ color: rgb(203, 185, 23);
207
+ }
208
+
209
+ #TextAreaChatLog[data-colortheme='dark'] div.ChatMessage.deeplib-message,
210
+ #TextAreaChatLog[data-colortheme='dark2'] div.ChatMessage.deeplib-message {
211
+ background-color: var(--deeplib-element-color);
212
+ border: min(0.2dvh, 0.1dvw) solid var(--deeplib-border-color);
213
+ color: var(--deeplib-text-color);
214
+ }
215
+
216
+ #TextAreaChatLog div.ChatMessage.deeplib-message {
217
+ background-color: #eee;
218
+ border: min(0.2dvh, 0.1dvw) solid #440171;
219
+ color: #111;
220
+ padding-left: min(0.6dvh, 0.3dvw);
221
+ display: block;
222
+ white-space: normal;
223
+ }
224
+
225
+ #TextAreaChatLog[data-colortheme='dark'] div.ChatMessage.deeplib-message a,
226
+ #TextAreaChatLog[data-colortheme='dark2'] div.ChatMessage.deeplib-message a {
227
+ color: var(--deeplib-text-color);
228
+ }
229
+
230
+ #TextAreaChatLog div.ChatMessage.deeplib-message a {
231
+ cursor: pointer;
232
+ font-weight: bold;
233
+ color: #111;
234
+ }
235
+ `, "",{"version":3,"sources":["webpack://./public/styles/DeepLib.css"],"names":[],"mappings":"AAAA;EACE,8CAA8C;EAC9C,8CAA8C;EAC9C,uDAAuD;EACvD,wCAAwC;EACxC,0CAA0C;EAC1C,4CAA4C;AAC9C;;AAEA,aAAa;AACb,aAAa;AACb,aAAa;;AAEb;EACE,gCAAgC;AAClC;;AAEA;EACE,UAAU;EACV,SAAS;AACX;;AAEA;EACE,sBAAsB;AACxB;;AAEA;EACE,aAAa;EACb,sBAAsB;EACtB,4BAA4B;EAC5B,UAAU;EACV,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,8BAA8B;AAChC;;AAEA;EACE,kCAAkC;EAClC,gCAAgC;AAClC;;AAEA;EACE,kBAAkB;EAClB,OAAO;EACP,QAAQ;EACR,WAAW;EACX,YAAY;EACZ,yBAAyB;EACzB,2CAA2C;EAC3C,+BAA+B;EAC/B,wBAAwB;EACxB,mBAAmB;EACnB,kBAAkB;EAClB,4BAA4B;EAC5B,sBAAsB;EACtB,kBAAkB;;EAElB,8BAA8B;EAC9B,wBAAwB;AAC1B;;AAEA;EACE,WAAW;EACX,6BAA6B;EAC7B,gCAAgC;EAChC,8BAA8B;AAChC;;AAEA;EACE,kBAAkB;EAClB,gCAAgC;AAClC;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,yBAAyB;AAC3B;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,UAAU;AACZ;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,kBAAkB;EAClB,2BAA2B;AAC7B;;AAEA;EACE,eAAe;EACf,WAAW;EACX,cAAc;EACd,6BAA6B;EAC7B,aAAa;EACb,6BAA6B;EAC7B,8BAA8B;AAChC;;AAEA;EACE,kBAAkB;EAClB,sBAAsB;EACtB,uBAAuB;EACvB,yBAAyB;EACzB,oBAAoB;AACtB;;AAEA;;EAEE,gBAAgB;EAChB,+BAA+B;EAC/B,iDAAiD;EACjD,4BAA4B;AAC9B;;AAEA;EACE,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,WAAW;EACX,WAAW;EACX,oDAAoD;EACpD,oBAAoB;EACpB,yBAAyB;AAC3B;;AAEA;;EAEE,uBAAuB;AACzB;;AAEA;EACE,8CAA8C;EAC9C,gCAAgC;EAChC,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,kCAAkC;EAClC,wBAAwB;EACxB,gBAAgB;EAChB,2DAA2D;AAC7D;;AAEA;;EAEE,wBAAwB;EACxB,SAAS;AACX;;AAEA;EACE,qBAAqB;EACrB,0BAA0B;AAC5B;;AAEA,cAAc;AACd,aAAa;AACb,cAAc;;AAEd;EACE,iBAAiB;EACjB,wBAAwB;AAC1B;;AAEA;;EAEE,8CAA8C;EAC9C,6DAA6D;EAC7D,gCAAgC;AAClC;;AAEA;EACE,sBAAsB;EACtB,yCAAyC;EACzC,WAAW;EACX,iCAAiC;EACjC,cAAc;EACd,mBAAmB;AACrB;;AAEA;;EAEE,gCAAgC;AAClC;;AAEA;EACE,eAAe;EACf,iBAAiB;EACjB,WAAW;AACb","sourcesContent":[".deeplib-subscreen {\n --deeplib-background-color: var(--main, white);\n --deeplib-element-color: var(--element, white);\n --deeplib-element-hover-color: var(--accentHover, cyan);\n --deeplib-text-color: var(--text, black);\n --deeplib-icon-color: var(--accent, white);\n --deeplib-border-color: var(--accent, black);\n}\n\n/************/\n/* ELEMENTS */\n/************/\n\n.deeplib-text {\n color: var(--deeplib-text-color);\n}\n\n.deeplib-subscreen {\n padding: 0;\n margin: 0;\n}\n\n.deeplib-subscreen * {\n box-sizing: border-box;\n}\n\n.deeplib-settings {\n display: flex;\n flex-direction: column;\n padding: min(1.0dvh, 0.5dvw);\n gap: 0.3em;\n overflow-y: auto;\n}\n\n.deeplib-misc {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: column-reverse;\n}\n\n.deeplib-button.button-styling {\n border-radius: min(1.0dvh, 0.5dvw);\n color: var(--deeplib-text-color);\n}\n\n.deeplib-button.button-styling img {\n position: absolute;\n top: 0%;\n left: 0%;\n width: 100%;\n height: 100%;\n background-position: left;\n background-color: var(--deeplib-icon-color);\n background-blend-mode: multiply;\n background-size: contain;\n mask-position: left;\n mask-size: contain;\n background-repeat: no-repeat;\n mask-repeat: no-repeat;\n color: transparent;\n\n background-image: var(--image);\n mask-image: var(--image);\n}\n\n.deeplib-button.button-styling .button-label {\n width: 100%;\n background-color: transparent;\n color: var(--deeplib-text-color);\n font-size: min(3.6dvh, 1.8dvw);\n}\n\n#deeplib-subscreen-title {\n text-align: center;\n color: var(--deeplib-text-color);\n}\n\n#deeplib-reset-button {\n background-color: indianred;\n}\n\n#deeplib-wiki-button {\n background-color: #BDA203;\n}\n\n#deeplib-support-button {\n background-color: #5e4969;\n}\n\n.deeplib-checkbox-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 0.3em;\n}\n\n.deeplib-input {\n border-radius: min(1.0dvh, 0.5dvw);\n}\n\n.deeplib-input-container {\n position: relative;\n margin-top: min(1vh, 0.5vw);\n}\n\n.deeplib-input-container input.deeplib-input {\n font-size: 20px;\n width: 100%;\n padding: 5px 0;\n background-color: transparent;\n outline: none;\n padding-left: min(1vh, 0.5vw);\n padding-right: min(1vh, 0.5vw);\n}\n\n.deeplib-input-container label.deeplib-text {\n position: absolute;\n top: min(0.6vh, 0.3vw);\n left: min(0.6vh, 0.3vw);\n transition: all 0.3s ease;\n pointer-events: none;\n}\n\n.deeplib-input-container input.deeplib-input:focus~label,\n.deeplib-input-container input.deeplib-input:not(:placeholder-shown)~label {\n font-size: 0.7em;\n transform: translate(20%, -70%);\n background-color: var(--deeplib-background-color);\n padding: 0px min(1vh, 0.5vw);\n}\n\n.deeplib-input-container .deeplib-underline {\n position: absolute;\n bottom: 0;\n left: 0;\n height: 2px;\n width: 100%;\n background-color: var(--deeplib-element-hover-color);\n transform: scaleX(0);\n transition: all 0.3s ease;\n}\n\n.deeplib-input-container input.deeplib-input:focus~.deeplib-underline,\n.deeplib-input-container input.deeplib-input:not(:placeholder-shown)~.deeplib-underline {\n transform: scaleX(0.98);\n}\n\n.deeplib-tooltip {\n background-color: var(--deeplib-element-color);\n color: var(--deeplib-text-color);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: min(1.0dvh, 0.5dvw);\n padding: min(1vh, 0.5vw);\n font-size: 0.8em;\n border: min(0.2vh, 0.1vw) solid var(--deeplib-border-color);\n}\n\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput[type=number] {\n appearance: textfield;\n -moz-appearance: textfield;\n}\n\n/*************/\n/* MESSAGES */\n/*************/\n\n.deeplib-highlight-text {\n font-weight: bold;\n color: rgb(203, 185, 23);\n}\n\n#TextAreaChatLog[data-colortheme='dark'] div.ChatMessage.deeplib-message,\n#TextAreaChatLog[data-colortheme='dark2'] div.ChatMessage.deeplib-message {\n background-color: var(--deeplib-element-color);\n border: min(0.2dvh, 0.1dvw) solid var(--deeplib-border-color);\n color: var(--deeplib-text-color);\n}\n\n#TextAreaChatLog div.ChatMessage.deeplib-message {\n background-color: #eee;\n border: min(0.2dvh, 0.1dvw) solid #440171;\n color: #111;\n padding-left: min(0.6dvh, 0.3dvw);\n display: block;\n white-space: normal;\n}\n\n#TextAreaChatLog[data-colortheme='dark'] div.ChatMessage.deeplib-message a,\n#TextAreaChatLog[data-colortheme='dark2'] div.ChatMessage.deeplib-message a {\n color: var(--deeplib-text-color);\n}\n\n#TextAreaChatLog div.ChatMessage.deeplib-message a {\n cursor: pointer;\n font-weight: bold;\n color: #111;\n}\n"],"sourceRoot":""}]);
236
+ // Exports
237
+ /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (___CSS_LOADER_EXPORT___)));
238
+
239
+
240
+ /***/ }),
241
+
242
+ /***/ 163:
243
+ /***/ ((module) => {
244
+
245
+ "use strict";
246
+
247
+
248
+ /*
249
+ MIT License http://www.opensource.org/licenses/mit-license.php
250
+ Author Tobias Koppers @sokra
251
+ */
252
+ module.exports = function (cssWithMappingToString) {
253
+ var list = [];
254
+
255
+ // return the list of modules as css string
256
+ list.toString = function toString() {
257
+ return this.map(function (item) {
258
+ var content = "";
259
+ var needLayer = typeof item[5] !== "undefined";
260
+ if (item[4]) {
261
+ content += "@supports (".concat(item[4], ") {");
262
+ }
263
+ if (item[2]) {
264
+ content += "@media ".concat(item[2], " {");
265
+ }
266
+ if (needLayer) {
267
+ content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
268
+ }
269
+ content += cssWithMappingToString(item);
270
+ if (needLayer) {
271
+ content += "}";
272
+ }
273
+ if (item[2]) {
274
+ content += "}";
275
+ }
276
+ if (item[4]) {
277
+ content += "}";
278
+ }
279
+ return content;
280
+ }).join("");
281
+ };
282
+
283
+ // import a list of modules into the list
284
+ list.i = function i(modules, media, dedupe, supports, layer) {
285
+ if (typeof modules === "string") {
286
+ modules = [[null, modules, undefined]];
287
+ }
288
+ var alreadyImportedModules = {};
289
+ if (dedupe) {
290
+ for (var k = 0; k < this.length; k++) {
291
+ var id = this[k][0];
292
+ if (id != null) {
293
+ alreadyImportedModules[id] = true;
294
+ }
295
+ }
296
+ }
297
+ for (var _k = 0; _k < modules.length; _k++) {
298
+ var item = [].concat(modules[_k]);
299
+ if (dedupe && alreadyImportedModules[item[0]]) {
300
+ continue;
301
+ }
302
+ if (typeof layer !== "undefined") {
303
+ if (typeof item[5] === "undefined") {
304
+ item[5] = layer;
305
+ } else {
306
+ item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
307
+ item[5] = layer;
308
+ }
309
+ }
310
+ if (media) {
311
+ if (!item[2]) {
312
+ item[2] = media;
313
+ } else {
314
+ item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
315
+ item[2] = media;
316
+ }
317
+ }
318
+ if (supports) {
319
+ if (!item[4]) {
320
+ item[4] = "".concat(supports);
321
+ } else {
322
+ item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
323
+ item[4] = supports;
324
+ }
325
+ }
326
+ list.push(item);
327
+ }
328
+ };
329
+ return list;
330
+ };
331
+
332
+ /***/ }),
333
+
334
+ /***/ 973:
335
+ /***/ ((module) => {
336
+
337
+ "use strict";
338
+
339
+
340
+ module.exports = function (item) {
341
+ var content = item[1];
342
+ var cssMapping = item[3];
343
+ if (!cssMapping) {
344
+ return content;
345
+ }
346
+ if (typeof btoa === "function") {
347
+ var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
348
+ var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
349
+ var sourceMapping = "/*# ".concat(data, " */");
350
+ return [content].concat([sourceMapping]).join("\n");
351
+ }
352
+ return [content].join("\n");
353
+ };
354
+
355
+ /***/ })
356
+
357
+ /******/ });
358
+ /************************************************************************/
359
+ /******/ // The module cache
360
+ /******/ var __webpack_module_cache__ = {};
361
+ /******/
362
+ /******/ // The require function
363
+ /******/ function __webpack_require__(moduleId) {
364
+ /******/ // Check if module is in cache
365
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
366
+ /******/ if (cachedModule !== undefined) {
367
+ /******/ return cachedModule.exports;
368
+ /******/ }
369
+ /******/ // Create a new module (and put it into the cache)
370
+ /******/ var module = __webpack_module_cache__[moduleId] = {
371
+ /******/ id: moduleId,
372
+ /******/ // no module.loaded needed
373
+ /******/ exports: {}
374
+ /******/ };
375
+ /******/
376
+ /******/ // Execute the module function
377
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
378
+ /******/
379
+ /******/ // Return the exports of the module
380
+ /******/ return module.exports;
381
+ /******/ }
382
+ /******/
383
+ /************************************************************************/
384
+ /******/ /* webpack/runtime/compat get default export */
385
+ /******/ (() => {
386
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
387
+ /******/ __webpack_require__.n = (module) => {
388
+ /******/ var getter = module && module.__esModule ?
389
+ /******/ () => (module['default']) :
390
+ /******/ () => (module);
391
+ /******/ __webpack_require__.d(getter, { a: getter });
392
+ /******/ return getter;
393
+ /******/ };
394
+ /******/ })();
395
+ /******/
396
+ /******/ /* webpack/runtime/define property getters */
397
+ /******/ (() => {
398
+ /******/ // define getter functions for harmony exports
399
+ /******/ __webpack_require__.d = (exports, definition) => {
400
+ /******/ for(var key in definition) {
401
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
402
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
403
+ /******/ }
404
+ /******/ }
405
+ /******/ };
406
+ /******/ })();
407
+ /******/
408
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
409
+ /******/ (() => {
410
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
411
+ /******/ })();
412
+ /******/
413
+ /************************************************************************/
414
+ var __webpack_exports__ = {};
415
+ // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
416
+ (() => {
417
+ "use strict";
418
+
419
+ // EXPORTS
420
+ __webpack_require__.d(__webpack_exports__, {
421
+ WO: () => (/* reexport */ BaseModule_BaseModule),
422
+ Ms: () => (/* reexport */ BaseSubscreen),
423
+ cL: () => (/* reexport */ GUI_GUI),
424
+ vG: () => (/* reexport */ GuiDebug),
425
+ bo: () => (/* reexport */ GuiSupport),
426
+ zU: () => (/* reexport */ MainMenu),
427
+ r7: () => (/* reexport */ Data_PlayerStorage),
428
+ yG: () => (/* reexport */ SupportHelper),
429
+ Lu: () => (/* reexport */ _String),
430
+ Q: () => (/* reexport */ SDK_bcSdkMod),
431
+ c0: () => (/* reexport */ Data_dataStore),
432
+ eh: () => (/* reexport */ Logger_deepLibLogger),
433
+ ys: () => (/* reexport */ elementAdjustFontSize),
434
+ XD: () => (/* reexport */ elementAppendToMiscDiv),
435
+ wu: () => (/* reexport */ elementAppendToSettingsDiv),
436
+ Xc: () => (/* reexport */ elementAppendToSubscreenDiv),
437
+ RZ: () => (/* reexport */ elementCreateButton),
438
+ mn: () => (/* reexport */ elementCreateCheckbox),
439
+ lQ: () => (/* reexport */ elementCreateInput),
440
+ l$: () => (/* reexport */ elementCreateLabel),
441
+ g_: () => (/* reexport */ elementCreateMiscDiv),
442
+ vx: () => (/* reexport */ elementCreateSettingsDiv),
443
+ m7: () => (/* reexport */ elementCreateSubscreenDiv),
444
+ kq: () => (/* reexport */ elementCreateTooltip),
445
+ Rd: () => (/* reexport */ elementGetSettingsDiv),
446
+ cb: () => (/* reexport */ elementGetSubscreenDiv),
447
+ GU: () => (/* reexport */ elementGetTooltip),
448
+ hv: () => (/* reexport */ elementHide),
449
+ Y: () => (/* reexport */ elementRemoveSubscreenDiv),
450
+ Jg: () => (/* reexport */ elementSetPosSizeFont),
451
+ _Z: () => (/* reexport */ elementSetPosition),
452
+ Ql: () => (/* reexport */ elementSetSize),
453
+ ox: () => (/* reexport */ elementSetTooltip),
454
+ Ck: () => (/* reexport */ getRelativeHeight),
455
+ rF: () => (/* reexport */ getRelativeWidth),
456
+ Pn: () => (/* reexport */ getRelativeX),
457
+ W1: () => (/* reexport */ getRelativeY),
458
+ q4: () => (/* reexport */ getText),
459
+ av: () => (/* reexport */ Modules_modules),
460
+ hN: () => (/* reexport */ setSubscreen)
461
+ });
462
+
463
+ // UNUSED EXPORTS: BaseMigrator, ExtensionStorage, HookPriority, Localization, Logger, Style, VersionModule, dataTake, elementGetMiscDiv, elementUnhide, getCurrentSubscreen, getModule, init, initMod, modulesMap, registerModule, sendActionMessage, sendLocalMessage, setMainMenuOptions, unloadMod
464
+
465
+ ;// ./src/Base/BaseModule.ts
466
+
467
+ class BaseModule_BaseModule {
468
+ get settingsScreen() {
469
+ return null;
470
+ }
471
+ get settingsStorage() {
472
+ return this.constructor.name;
473
+ }
474
+ get settings() {
475
+ const modName = SDK_bcSdkMod.ModInfo.name;
476
+ if (!this.settingsStorage)
477
+ return {};
478
+ if (!Data_PlayerStorage()) {
479
+ Player[modName] = {};
480
+ this.registerDefaultSettings();
481
+ }
482
+ else if (!Data_PlayerStorage()[this.settingsStorage])
483
+ this.registerDefaultSettings();
484
+ return Data_PlayerStorage()[this.settingsStorage];
485
+ }
486
+ init() {
487
+ this.registerDefaultSettings();
488
+ }
489
+ registerDefaultSettings() {
490
+ const storage = this.settingsStorage;
491
+ const defaults = this.defaultSettings;
492
+ if (!storage || !defaults)
493
+ return;
494
+ Player[SDK_bcSdkMod.ModInfo.name][storage] = Object.assign(defaults, Player[SDK_bcSdkMod.ModInfo.name][storage] ?? {});
495
+ }
496
+ get defaultSettings() {
497
+ return null;
498
+ }
499
+ load() { }
500
+ run() { }
501
+ unload() { }
502
+ }
503
+
504
+ ;// ./src/Base/BaseSubscreen.ts
505
+
506
+ class BaseSubscreen {
507
+ static currentElements = [];
508
+ static currentPage = 1;
509
+ module;
510
+ constructor(module) {
511
+ if (module)
512
+ this.module = module;
513
+ }
514
+ get name() {
515
+ return 'UNKNOWN';
516
+ }
517
+ get icon() {
518
+ return '';
519
+ }
520
+ get subscreenName() {
521
+ return this.constructor.name;
522
+ }
523
+ setSubscreen(screen) {
524
+ return setSubscreen(screen);
525
+ }
526
+ get settings() {
527
+ return this.module.settings;
528
+ }
529
+ get pageStructure() {
530
+ return [[]];
531
+ }
532
+ get currentPage() {
533
+ return this.pageStructure[Math.min(PreferencePageCurrent - 1, this.pageStructure.length - 1)];
534
+ }
535
+ hideElements() {
536
+ this.pageStructure.forEach((item, ix) => {
537
+ if (ix != PreferencePageCurrent - 1) {
538
+ item.forEach((setting) => {
539
+ elementHide({ elementId: setting.id });
540
+ });
541
+ }
542
+ });
543
+ }
544
+ load() {
545
+ for (const module of Modules_modules()) {
546
+ if (!module.settingsScreen)
547
+ continue;
548
+ if (!module.settings || !Object.keys(module.settings).length)
549
+ module.registerDefaultSettings();
550
+ }
551
+ elementCreateSubscreenDiv();
552
+ const settingsElement = elementCreateSettingsDiv();
553
+ elementAppendToSubscreenDiv(settingsElement);
554
+ const subscreenTitle = elementCreateLabel({
555
+ type: 'label',
556
+ id: 'deeplib-subscreen-title',
557
+ label: getText('mainmenu.title').replace('$ModVersion', SDK_bcSdkMod.ModInfo.version) + ' ' + SupportHelper.getSupporter(),
558
+ });
559
+ elementAppendToSubscreenDiv(subscreenTitle);
560
+ if (this.name !== 'mainmenu') {
561
+ const exitButton = elementCreateButton({
562
+ type: 'button',
563
+ id: 'deeplib-exit',
564
+ position: [1815, 75],
565
+ size: [90, 90],
566
+ image: 'Icons/Exit.png',
567
+ onClick: () => {
568
+ setSubscreen('mainmenu');
569
+ },
570
+ tooltip: getText('settings.button.back_button_hint')
571
+ });
572
+ elementAppendToSubscreenDiv(exitButton);
573
+ }
574
+ const tooltip = elementCreateTooltip();
575
+ elementAppendToSubscreenDiv(tooltip);
576
+ this.pageStructure.forEach((s) => s.forEach((item) => {
577
+ let element;
578
+ switch (item.type) {
579
+ case 'text':
580
+ case 'number':
581
+ element = elementCreateInput(item);
582
+ break;
583
+ case 'checkbox':
584
+ element = elementCreateCheckbox(item);
585
+ break;
586
+ case 'button':
587
+ element = elementCreateButton(item);
588
+ break;
589
+ case 'label':
590
+ element = elementCreateLabel(item);
591
+ break;
592
+ }
593
+ elementAppendToSettingsDiv(element);
594
+ }));
595
+ CharacterAppearanceForceUpCharacter = Player.MemberNumber ?? -1;
596
+ }
597
+ run() {
598
+ const newTitle = getText('mainmenu.title').replace('$ModVersion', SDK_bcSdkMod.ModInfo.version) + ' ' + SupportHelper.getSupporter();
599
+ const oldTitle = ElementContent('deeplib-subscreen-title');
600
+ if (newTitle !== oldTitle) {
601
+ ElementContent('deeplib-subscreen-title', newTitle);
602
+ }
603
+ DrawCharacter(Player, 50, 50, 0.9, false);
604
+ if (this.pageStructure.length > 1) {
605
+ MainCanvas.textAlign = 'center';
606
+ PreferencePageChangeDraw(1595, 75, this.pageStructure.length);
607
+ MainCanvas.textAlign = 'left';
608
+ }
609
+ this.hideElements();
610
+ }
611
+ click() {
612
+ if (this.pageStructure.length > 1)
613
+ PreferencePageChangeClick(1595, 75, this.pageStructure.length);
614
+ }
615
+ exit() {
616
+ CharacterAppearanceForceUpCharacter = -1;
617
+ CharacterLoadCanvas(Player);
618
+ setSubscreen('mainmenu');
619
+ Data_dataStore();
620
+ }
621
+ resize(onLoad = false) {
622
+ elementSetPosSizeFont({ element: elementGetSubscreenDiv() }, 0, 0, 2000, 1000);
623
+ if (this.name === 'mainmenu') {
624
+ elementSetPosSizeFont({ element: elementGetSettingsDiv() }, 530, 170, 800, 660);
625
+ }
626
+ else {
627
+ elementSetPosSizeFont({ element: elementGetSettingsDiv() }, 530, 170, 1000, 660);
628
+ }
629
+ elementSetPosSizeFont({ elementId: 'deeplib-subscreen-title' }, 530, 75, 800, 60);
630
+ elementSetPosition({ element: elementGetTooltip() }, 250, 850);
631
+ elementSetSize({ element: elementGetTooltip() }, 1500, 60);
632
+ BaseSubscreen.currentElements.forEach((item) => {
633
+ const options = item[1];
634
+ const elementDataAttrs = item[0].dataset;
635
+ if (options.position || elementDataAttrs.position) {
636
+ const position = elementDataAttrs?.position?.split('x');
637
+ const xPos = options?.position?.[0] || parseInt(position?.[0] || 0);
638
+ const yPos = options?.position?.[1] || parseInt(position?.[1] || 0);
639
+ elementSetPosition({ elementId: options.id }, xPos, yPos);
640
+ }
641
+ if (options.size || elementDataAttrs.size) {
642
+ const size = elementDataAttrs?.size?.split('x');
643
+ const width = options?.size?.[0] || parseInt(size?.[0] || 0);
644
+ const height = options?.size?.[1] || parseInt(size?.[1] || 0);
645
+ elementSetSize({ elementId: options.id }, width, height);
646
+ }
647
+ elementAdjustFontSize({ elementId: options.id });
648
+ });
649
+ }
650
+ unload() {
651
+ this.pageStructure.forEach((s) => s.forEach((item) => {
652
+ switch (item.type) {
653
+ case 'text':
654
+ item.setSettingValue(ElementValue(item.id));
655
+ break;
656
+ case 'checkbox': {
657
+ const elem = document.getElementById(item.id);
658
+ const checked = elem.checked;
659
+ item.setSettingValue(checked);
660
+ break;
661
+ }
662
+ }
663
+ }));
664
+ BaseSubscreen.currentElements = [];
665
+ elementRemoveSubscreenDiv();
666
+ }
667
+ }
668
+
669
+ // EXTERNAL MODULE: ./public/styles/DeepLib.css
670
+ var DeepLib = __webpack_require__(63);
671
+ ;// ./src/Base/Initialization.ts
672
+
673
+
674
+ function initMod(initFunction, modules, pathToTranslationsFolder) {
675
+ const MOD_NAME = bcSdkMod.ModInfo.name;
676
+ deepLibLogger.debug(`Init wait for ${MOD_NAME}`);
677
+ if (CurrentScreen == null || CurrentScreen === 'Login') {
678
+ bcSdkMod.prototype.hookFunction('LoginResponse', 0, (args, next) => {
679
+ deepLibLogger.debug(`Init for ${MOD_NAME}! LoginResponse caught: `, args);
680
+ next(args);
681
+ const response = args[0];
682
+ if (response === 'InvalidNamePassword')
683
+ return next(args);
684
+ if (response && typeof response.Name === 'string' && typeof response.AccountName === 'string') {
685
+ init(initFunction, modules, pathToTranslationsFolder);
686
+ }
687
+ });
688
+ }
689
+ else {
690
+ deepLibLogger.debug(`Already logged in, initing ${MOD_NAME}`);
691
+ init(initFunction, modules, pathToTranslationsFolder);
692
+ }
693
+ }
694
+ async function init(initFunction, modules, pathToTranslationsFolder) {
695
+ const MOD_NAME = bcSdkMod.ModInfo.name;
696
+ const MOD_VERSION = bcSdkMod.ModInfo.version;
697
+ if (window[MOD_NAME + 'Loaded'])
698
+ return;
699
+ dataTake();
700
+ Style.inject('deeplib-style', deeplib_style);
701
+ new Localization({ pathToTranslationsFolder: pathToTranslationsFolder });
702
+ await Localization.init();
703
+ if (!initModules(modules)) {
704
+ unloadMod();
705
+ return;
706
+ }
707
+ await initFunction();
708
+ VersionModule.checkVersionUpdate();
709
+ VersionModule.checkVersionMigration();
710
+ window[MOD_NAME + 'Loaded'] = true;
711
+ deepLibLogger.log(`Loaded ${MOD_NAME}! Version: ${MOD_VERSION}`);
712
+ }
713
+ function initModules(modulesToRegister) {
714
+ const MOD_NAME = bcSdkMod.ModInfo.name;
715
+ for (const module of modulesToRegister) {
716
+ registerModule(module);
717
+ }
718
+ for (const module of modules()) {
719
+ module.init();
720
+ }
721
+ for (const module of modules()) {
722
+ module.load();
723
+ }
724
+ for (const module of modules()) {
725
+ module.run();
726
+ }
727
+ deepLibLogger.debug(`Modules Loaded for ${MOD_NAME}.`);
728
+ return true;
729
+ }
730
+ function unloadMod() {
731
+ const MOD_NAME = bcSdkMod.ModInfo.name;
732
+ unloadModules();
733
+ delete window[MOD_NAME + 'Loaded'];
734
+ deepLibLogger.debug(`Unloaded ${MOD_NAME}.`);
735
+ return true;
736
+ }
737
+ function unloadModules() {
738
+ for (const module of modules()) {
739
+ module.unload();
740
+ }
741
+ }
742
+
743
+ ;// ./src/Base/Modules.ts
744
+ const modulesMap = new Map();
745
+ function Modules_modules() {
746
+ return [...modulesMap.values()];
747
+ }
748
+ function Modules_registerModule(module) {
749
+ modulesMap.set(module.constructor.name, module);
750
+ return module;
751
+ }
752
+ function getModule(moduleType) {
753
+ return modulesMap.get(moduleType);
754
+ }
755
+
756
+ ;// ./src/Base/SettingDefinitions.ts
757
+
758
+ function getCurrentSubscreen() {
759
+ return GUI.instance && GUI.instance.currentSubscreen;
760
+ }
761
+ function setSubscreen(subscreen) {
762
+ if (!GUI_GUI.instance) {
763
+ throw new Error('Attempt to set subscreen before init');
764
+ }
765
+ GUI_GUI.instance.currentSubscreen = subscreen;
766
+ return GUI_GUI.instance.currentSubscreen;
767
+ }
768
+
769
+ ;// ./src/Modules/GUI.ts
770
+
771
+ class GUI_GUI extends BaseModule_BaseModule {
772
+ static instance = null;
773
+ _subscreens;
774
+ _mainMenu;
775
+ _currentSubscreen = null;
776
+ _modButtonOptions;
777
+ get subscreens() {
778
+ return this._subscreens;
779
+ }
780
+ get mainMenu() {
781
+ return this._mainMenu;
782
+ }
783
+ get currentSubscreen() {
784
+ return this._currentSubscreen;
785
+ }
786
+ set currentSubscreen(subscreen) {
787
+ if (this._currentSubscreen) {
788
+ this._currentSubscreen.unload();
789
+ }
790
+ if (typeof subscreen === 'string') {
791
+ const scr = this._subscreens?.find((s) => s.name === subscreen);
792
+ if (!scr)
793
+ throw `Failed to find screen name ${subscreen}`;
794
+ this._currentSubscreen = scr;
795
+ }
796
+ else {
797
+ this._currentSubscreen = subscreen;
798
+ }
799
+ PreferenceMessage = '';
800
+ PreferencePageCurrent = 1;
801
+ if (this._currentSubscreen) {
802
+ this._currentSubscreen.load();
803
+ this._currentSubscreen.resize(true);
804
+ }
805
+ }
806
+ constructor(modButtonOptions) {
807
+ super();
808
+ if (GUI_GUI.instance) {
809
+ throw new Error('Duplicate initialization');
810
+ }
811
+ for (const module of Modules_modules()) {
812
+ if (!module.settingsScreen)
813
+ continue;
814
+ }
815
+ this._mainMenu = new MainMenu(this);
816
+ this._subscreens = [this._mainMenu];
817
+ this._modButtonOptions = modButtonOptions;
818
+ GUI_GUI.instance = this;
819
+ }
820
+ get defaultSettings() {
821
+ return null;
822
+ }
823
+ load() {
824
+ for (const module of Modules_modules()) {
825
+ if (!module.settingsScreen)
826
+ continue;
827
+ this._subscreens.push(new module.settingsScreen(module));
828
+ }
829
+ this._mainMenu.subscreens = this._subscreens;
830
+ PreferenceRegisterExtensionSetting({
831
+ Identifier: this._modButtonOptions.Identifier,
832
+ ButtonText: this._modButtonOptions.ButtonText,
833
+ Image: this._modButtonOptions.Image,
834
+ load: this._modButtonOptions.load || (() => {
835
+ setSubscreen(new MainMenu(this));
836
+ }),
837
+ run: this._modButtonOptions.run || (() => {
838
+ if (this._currentSubscreen) {
839
+ MainCanvas.textAlign = 'left';
840
+ this._currentSubscreen.run();
841
+ MainCanvas.textAlign = 'center';
842
+ const newCanvasPosition = [MainCanvas.canvas.offsetLeft, MainCanvas.canvas.offsetTop, MainCanvas.canvas.clientWidth, MainCanvas.canvas.clientHeight];
843
+ if (!CommonArraysEqual(newCanvasPosition, DrawCanvasPosition)) {
844
+ DrawCanvasPosition = newCanvasPosition;
845
+ this._currentSubscreen.resize(false);
846
+ }
847
+ }
848
+ }),
849
+ click: this._modButtonOptions.click || (() => {
850
+ if (this._currentSubscreen) {
851
+ this._currentSubscreen.click();
852
+ }
853
+ }),
854
+ exit: this._modButtonOptions.exit || (() => {
855
+ if (this._currentSubscreen) {
856
+ this._currentSubscreen.exit();
857
+ }
858
+ }),
859
+ unload: this._modButtonOptions.unload || (() => {
860
+ if (this._currentSubscreen) {
861
+ this._currentSubscreen.unload();
862
+ }
863
+ })
864
+ });
865
+ }
866
+ }
867
+
868
+ ;// ./src/Modules/Version.ts
869
+
870
+ class Version_VersionModule extends (/* unused pure expression or super */ null && (BaseModule)) {
871
+ static isItNewVersion = (/* unused pure expression or super */ null && (false));
872
+ static Version;
873
+ static NewVersionMessage = (/* unused pure expression or super */ null && (''));
874
+ static Migrators = (/* unused pure expression or super */ null && ([]));
875
+ load() {
876
+ Version_VersionModule.Version = bcSdkMod.ModInfo.version;
877
+ bcSdkMod.prototype.hookFunction('ChatRoomSync', HookPriority.Observe, (args, next) => {
878
+ next(args);
879
+ if (PlayerStorage().GlobalModule.doShowNewVersionMessage && Version_VersionModule.isItNewVersion) {
880
+ Version_VersionModule.sendNewVersionMessage();
881
+ }
882
+ }, 999);
883
+ }
884
+ static checkVersionUpdate() {
885
+ const PreviousVersion = Version_VersionModule.loadVersion();
886
+ const CurrentVersion = Version_VersionModule.Version;
887
+ if (Version_VersionModule.isNewVersion(PreviousVersion, CurrentVersion)) {
888
+ Version_VersionModule.isItNewVersion = true;
889
+ Version_VersionModule.saveVersion();
890
+ }
891
+ }
892
+ static checkVersionMigration() {
893
+ const PreviousVersion = Version_VersionModule.loadVersion();
894
+ let saveRequired = false;
895
+ for (const migrator of Version_VersionModule.Migrators) {
896
+ if (Version_VersionModule.isNewVersion(PreviousVersion, migrator.MigrationVersion)) {
897
+ saveRequired = saveRequired || migrator.Migrate();
898
+ deepLibLogger.info(`Migrating ${bcSdkMod.ModInfo.name} from ${PreviousVersion} to ${migrator.MigrationVersion} with ${migrator.constructor.name}`);
899
+ }
900
+ }
901
+ if (saveRequired) {
902
+ dataStore();
903
+ }
904
+ }
905
+ static registerMigrator(migrator) {
906
+ Version_VersionModule.Migrators.push(migrator);
907
+ }
908
+ static setNewVersionMessage(newVersionMessage) {
909
+ Version_VersionModule.NewVersionMessage = newVersionMessage;
910
+ }
911
+ static sendNewVersionMessage() {
912
+ sendLocalMessage('deeplib-new-version', Version_VersionModule.NewVersionMessage);
913
+ }
914
+ static isNewVersion(current, candidate) {
915
+ if (current !== undefined) {
916
+ const CURRENT_ = current.split('.'), CANDIDATE_ = candidate.split('.');
917
+ for (let i = 0; i < 3; i++) {
918
+ if (CURRENT_[i] === CANDIDATE_[i]) {
919
+ continue;
920
+ }
921
+ return CANDIDATE_[i] > CURRENT_[i];
922
+ }
923
+ }
924
+ if (current === undefined || current === '' || !current) {
925
+ return true;
926
+ }
927
+ return false;
928
+ }
929
+ static saveVersion() {
930
+ if (PlayerStorage()) {
931
+ Player[bcSdkMod.ModInfo.name].Version = Version_VersionModule.Version;
932
+ }
933
+ }
934
+ static loadVersion() {
935
+ return PlayerStorage()?.Version;
936
+ }
937
+ }
938
+
939
+ ;// ./src/Screens/Debug.ts
940
+
941
+ class GuiDebug extends BaseSubscreen {
942
+ get name() {
943
+ return 'debug';
944
+ }
945
+ get pageStructure() {
946
+ return [[
947
+ {
948
+ type: 'button',
949
+ roundness: 50,
950
+ id: 'test-deeplib-big-button',
951
+ size: [405, 80],
952
+ label: 'Big Button',
953
+ tooltip: 'This is a big button',
954
+ image: 'Icons/Exit.png',
955
+ onClick() {
956
+ Logger_deepLibLogger.info('Big Button Clicked');
957
+ }
958
+ },
959
+ {
960
+ type: 'button',
961
+ roundness: 5,
962
+ id: 'test-deeplib-small-button',
963
+ size: [90, 90],
964
+ tooltip: 'This is a small button',
965
+ image: 'Icons/Exit.png',
966
+ onClick() {
967
+ Logger_deepLibLogger.info('Small Button Clicked');
968
+ }
969
+ },
970
+ {
971
+ type: 'checkbox',
972
+ id: 'test-deeplib-checkbox',
973
+ label: 'Checkbox',
974
+ description: 'This is a checkbox',
975
+ checked: false,
976
+ getSettingValue() {
977
+ return true;
978
+ },
979
+ setSettingValue(val) {
980
+ Logger_deepLibLogger.info('Checkbox value:', val);
981
+ },
982
+ },
983
+ {
984
+ type: 'text',
985
+ id: 'test-deeplib-text-input',
986
+ label: 'Input',
987
+ description: 'This is a text input',
988
+ getElementValue() {
989
+ return 'Input Value';
990
+ },
991
+ setSettingValue(val) {
992
+ Logger_deepLibLogger.info('Input value:', val);
993
+ },
994
+ },
995
+ {
996
+ type: 'number',
997
+ id: 'test-deeplib-number-input',
998
+ label: 'Input',
999
+ description: 'This is a number input',
1000
+ getElementValue() {
1001
+ return '123';
1002
+ },
1003
+ setSettingValue(val) {
1004
+ Logger_deepLibLogger.info('Input value:', val);
1005
+ },
1006
+ },
1007
+ {
1008
+ type: 'label',
1009
+ id: 'test-deeplib-label',
1010
+ label: 'Label',
1011
+ description: 'This is a label',
1012
+ }
1013
+ ]];
1014
+ }
1015
+ load() {
1016
+ super.load();
1017
+ }
1018
+ run() {
1019
+ super.run();
1020
+ }
1021
+ click() { }
1022
+ exit() {
1023
+ super.exit();
1024
+ }
1025
+ resize() {
1026
+ super.resize();
1027
+ }
1028
+ }
1029
+
1030
+ ;// ./src/Screens/MainMenu.ts
1031
+
1032
+ class MainMenu extends BaseSubscreen {
1033
+ subscreens = [];
1034
+ static wikiLink = '';
1035
+ static resetSubscreen = null;
1036
+ get name() {
1037
+ return 'mainmenu';
1038
+ }
1039
+ constructor(module) {
1040
+ super(module);
1041
+ this.subscreens = module.subscreens;
1042
+ }
1043
+ load() {
1044
+ if (!GUI_GUI.instance?.currentSubscreen) {
1045
+ this.setSubscreen(this);
1046
+ return;
1047
+ }
1048
+ super.load();
1049
+ const exitButton = elementCreateButton({
1050
+ type: 'button',
1051
+ id: 'exit',
1052
+ position: [1815, 75],
1053
+ size: [90, 90],
1054
+ image: 'Icons/Exit.png',
1055
+ onClick: () => {
1056
+ this.exit();
1057
+ },
1058
+ tooltip: getText('settings.button.back_button_hint')
1059
+ });
1060
+ elementAppendToSubscreenDiv(exitButton);
1061
+ for (const screen of this.subscreens) {
1062
+ if (screen.name == 'mainmenu')
1063
+ continue;
1064
+ const button = elementCreateButton({
1065
+ type: 'button',
1066
+ id: `${screen.name}-button`,
1067
+ image: screen.icon,
1068
+ label: getText(`mainmenu.button.${screen.name}`),
1069
+ onClick: () => {
1070
+ this.setSubscreen(screen);
1071
+ },
1072
+ size: [450, 90],
1073
+ });
1074
+ elementAppendToSettingsDiv(button);
1075
+ }
1076
+ const miscDiv = elementCreateMiscDiv();
1077
+ elementAppendToSubscreenDiv(miscDiv);
1078
+ if (MainMenu.resetSubscreen) {
1079
+ const resetButton = elementCreateButton({
1080
+ type: 'button',
1081
+ id: 'deeplib-reset-button',
1082
+ image: 'Icons/ServiceBell.png',
1083
+ label: 'Reset',
1084
+ onClick: () => {
1085
+ this.setSubscreen(MainMenu.resetSubscreen);
1086
+ },
1087
+ size: [405, 80],
1088
+ });
1089
+ elementAppendToMiscDiv(resetButton);
1090
+ }
1091
+ if (MainMenu.wikiLink) {
1092
+ const wikiButton = elementCreateButton({
1093
+ type: 'button',
1094
+ id: 'deeplib-wiki-button',
1095
+ image: 'Icons/Introduction.png',
1096
+ label: 'Wiki',
1097
+ onClick: () => {
1098
+ window.open(MainMenu.wikiLink, '_blank');
1099
+ },
1100
+ size: [405, 80],
1101
+ });
1102
+ elementAppendToMiscDiv(wikiButton);
1103
+ }
1104
+ const supportButton = elementCreateButton({
1105
+ type: 'button',
1106
+ id: 'deeplib-support-button',
1107
+ image: 'Assets/Female3DCG/Emoticon/Coffee/Icon.png',
1108
+ label: 'Support',
1109
+ onClick: () => {
1110
+ this.setSubscreen(new GuiSupport());
1111
+ },
1112
+ size: [405, 80],
1113
+ });
1114
+ elementAppendToMiscDiv(supportButton);
1115
+ elementSetPosSizeFont({ elementId: 'deeplib-misc' }, 1500, 670, 405, 260);
1116
+ const debugButton = elementCreateButton({
1117
+ type: 'button',
1118
+ id: 'deeplib-debug-button',
1119
+ image: 'Assets/Female3DCG/Emoticon/Coffee/Icon.png',
1120
+ onClick: () => {
1121
+ this.setSubscreen(new GuiDebug());
1122
+ },
1123
+ size: [90, 90],
1124
+ position: [75, 75],
1125
+ });
1126
+ elementAppendToMiscDiv(debugButton);
1127
+ }
1128
+ run() {
1129
+ super.run();
1130
+ }
1131
+ click() { }
1132
+ exit() {
1133
+ CharacterAppearanceForceUpCharacter = -1;
1134
+ CharacterLoadCanvas(Player);
1135
+ this.setSubscreen(null);
1136
+ PreferenceSubscreenExtensionsClear();
1137
+ }
1138
+ resize() {
1139
+ super.resize();
1140
+ elementSetPosSizeFont({ elementId: 'deeplib-misc' }, 1500, 670, 405, 260);
1141
+ }
1142
+ }
1143
+ function setMainMenuOptions(wikiLink, resetSubscreen) {
1144
+ MainMenu.wikiLink = wikiLink;
1145
+ MainMenu.resetSubscreen = resetSubscreen;
1146
+ }
1147
+
1148
+ ;// ./src/Screens/Support.ts
1149
+
1150
+ class SupportHelper {
1151
+ static thankYouList = ['Ellena', 'weboos', 'Jamie'];
1152
+ static thankYouNext = 0;
1153
+ static thankYou = '';
1154
+ static getSupporter() {
1155
+ if (SupportHelper.thankYouNext < CommonTime())
1156
+ SupportHelper.doNextThankYou();
1157
+ return `${getText('support.other.thankyou')}, ${SupportHelper.thankYou}`;
1158
+ }
1159
+ static doNextThankYou() {
1160
+ if (SupportHelper.thankYou && SupportHelper.thankYouList.length < 2)
1161
+ return;
1162
+ SupportHelper.thankYou = CommonRandomItemFromList(SupportHelper.thankYou, SupportHelper.thankYouList);
1163
+ SupportHelper.thankYouNext = CommonTime() + 5000;
1164
+ }
1165
+ }
1166
+ class GuiSupport extends BaseSubscreen {
1167
+ get name() {
1168
+ return 'Support';
1169
+ }
1170
+ get currentPage() {
1171
+ return [
1172
+ {
1173
+ type: 'button',
1174
+ id: 'deeplib-support-kofi',
1175
+ size: [405, 80],
1176
+ label: getText('support.button.ko-fi'),
1177
+ image: 'https://storage.ko-fi.com/cdn/nav-logo-stroke.png',
1178
+ onClick() {
1179
+ window.open('https://ko-fi.com/monikka_bc', '_blank');
1180
+ }
1181
+ },
1182
+ {
1183
+ type: 'button',
1184
+ id: 'deeplib-support-patreon',
1185
+ size: [405, 80],
1186
+ label: getText('support.button.patreon'),
1187
+ image: 'https://c5.patreon.com/external/favicon/rebrand/favicon-32.png?v=af5597c2ef',
1188
+ onClick() {
1189
+ window.open('https://patreon.com/monikka_bc', '_blank');
1190
+ }
1191
+ }
1192
+ ];
1193
+ }
1194
+ load() {
1195
+ SupportHelper.doNextThankYou();
1196
+ super.load();
1197
+ ElementRemove('deeplib-settngs');
1198
+ ElementCreateDiv('deeplib-gratitude');
1199
+ const elm = document.getElementById('deeplib-gratitude');
1200
+ ElementContent('deeplib-gratitude', gratitudeHtml);
1201
+ elementSetPosSizeFont({ element: elm }, 1000, 250, 400, 400);
1202
+ }
1203
+ run() {
1204
+ super.run();
1205
+ }
1206
+ click() {
1207
+ super.click();
1208
+ }
1209
+ exit() {
1210
+ ElementRemove('deeplib-gratitude');
1211
+ super.exit();
1212
+ }
1213
+ resize() {
1214
+ super.resize();
1215
+ elementSetPosSizeFont({ elementId: 'deeplib-gratitude' }, 1000, 250, 400, 400);
1216
+ }
1217
+ }
1218
+ const gratitudeHtml = `
1219
+ <h1>Dear Supporters!</h1>
1220
+ <p>
1221
+ I want to take a moment to express my heartfelt gratitude for considering supporting me. Your willingness to stand by
1222
+ my side in this creative journey means the world to me, and I am truly humbled by your generosity.
1223
+ </p>
1224
+ <p>
1225
+ Your support goes far beyond the financial contributions; it represents belief in my work and a shared passion for
1226
+ what I do. Your encouragement inspires me to continue developing.
1227
+ </p>
1228
+ <p>
1229
+ Your support not only helps me sustain and grow as a developer, but also enables me to dedicate more time and
1230
+ resources to producing high-quality mods. It allows me to explore new ideas, enhance my skills, and bring even more
1231
+ meaningful and enjoyable content to you.
1232
+ </p>
1233
+ <p>Thank you all~</p>
1234
+ <p>With love, Monikka♥</p>
1235
+ `;
1236
+
1237
+ ;// ./src/Utilities/Data.ts
1238
+
1239
+ const Data_PlayerStorage = () => (typeof Player?.[SDK_bcSdkMod.ModInfo.name] === 'object' ?
1240
+ CommonCloneDeep(Player?.[SDK_bcSdkMod.ModInfo.name]) :
1241
+ undefined);
1242
+ const ExtensionStorage = () => Player.ExtensionSettings[SDK_bcSdkMod.ModInfo.name];
1243
+ function Data_dataTake(modName = bcSdkMod.ModInfo.name) {
1244
+ if (ExtensionStorage()) {
1245
+ const parsed = JSON.parse(LZString.decompressFromBase64(ExtensionStorage()) || '');
1246
+ Player[modName] = Object.hasOwn(parsed, 'Version') ? parsed : undefined;
1247
+ }
1248
+ else {
1249
+ Player[modName] = {};
1250
+ }
1251
+ }
1252
+ function Data_dataStore() {
1253
+ const modName = SDK_bcSdkMod.ModInfo.name;
1254
+ const modVersion = SDK_bcSdkMod.ModInfo.version;
1255
+ if (!ExtensionStorage())
1256
+ Player.ExtensionSettings[modName] = '';
1257
+ const Data = {
1258
+ GlobalModule: {
1259
+ modEnabled: false,
1260
+ doShowNewVersionMessage: false
1261
+ },
1262
+ Version: modVersion
1263
+ };
1264
+ for (const module of Modules_modules()) {
1265
+ if (!module.settingsStorage)
1266
+ continue;
1267
+ Data[module.settingsStorage] = Data_PlayerStorage()[module.settingsStorage];
1268
+ }
1269
+ Player.ExtensionSettings[modName] = _String.encode(Data);
1270
+ ServerPlayerExtensionSettingsSync(modName);
1271
+ }
1272
+
1273
+ ;// ./src/Utilities/Elements/.AdvancedElements.ts
1274
+ function elementCreateSubscreenDiv() {
1275
+ const subscreenDiv = elementGetSubscreenDiv();
1276
+ if (subscreenDiv) {
1277
+ console.error('Subscreen already exists');
1278
+ return subscreenDiv;
1279
+ }
1280
+ const div = document.createElement('div');
1281
+ div.id = 'deeplib-subscreen';
1282
+ div.classList.add('deeplib-subscreen', 'HideOnPopup');
1283
+ return document.body.appendChild(div);
1284
+ }
1285
+ function elementGetSubscreenDiv() {
1286
+ return document.getElementById('deeplib-subscreen') ?? undefined;
1287
+ }
1288
+ function elementRemoveSubscreenDiv() {
1289
+ return elementGetSubscreenDiv()?.remove();
1290
+ }
1291
+ function elementAppendToSubscreenDiv(element) {
1292
+ return elementGetSubscreenDiv()?.appendChild(element);
1293
+ }
1294
+ function elementCreateSettingsDiv() {
1295
+ const settingsDiv = elementGetSettingsDiv();
1296
+ if (settingsDiv) {
1297
+ console.error('Settings screen already exists');
1298
+ return settingsDiv;
1299
+ }
1300
+ const div = document.createElement('div');
1301
+ div.id = 'deeplib-settings';
1302
+ div.classList.add('deeplib-settings');
1303
+ return div;
1304
+ }
1305
+ function elementGetSettingsDiv() {
1306
+ return document.getElementById('deeplib-settings') ?? undefined;
1307
+ }
1308
+ function elementAppendToSettingsDiv(element) {
1309
+ return elementGetSettingsDiv()?.appendChild(element);
1310
+ }
1311
+ function elementCreateMiscDiv() {
1312
+ const miscDiv = elementGetMiscDiv();
1313
+ if (miscDiv) {
1314
+ console.error('Settings screen already exists');
1315
+ return miscDiv;
1316
+ }
1317
+ const div = document.createElement('div');
1318
+ div.id = 'deeplib-misc';
1319
+ div.classList.add('deeplib-misc');
1320
+ return div;
1321
+ }
1322
+ function elementGetMiscDiv() {
1323
+ return document.getElementById('deeplib-misc');
1324
+ }
1325
+ function elementAppendToMiscDiv(element) {
1326
+ return elementGetMiscDiv()?.appendChild(element);
1327
+ }
1328
+
1329
+ ;// ./src/Utilities/Elements/.ElementHelpers.ts
1330
+
1331
+ const mainCanvasHeight = 1000;
1332
+ const mainCanvasWidth = 2000;
1333
+ function getRelativeHeight(height) {
1334
+ return height * (MainCanvas.canvas.clientHeight / mainCanvasHeight);
1335
+ }
1336
+ function getRelativeWidth(width) {
1337
+ return width * (MainCanvas.canvas.clientWidth / mainCanvasWidth);
1338
+ }
1339
+ function getRelativeY(yPos) {
1340
+ return MainCanvas.canvas.offsetTop + yPos * (MainCanvas.canvas.clientHeight / mainCanvasHeight);
1341
+ }
1342
+ function getRelativeX(xPos) {
1343
+ return MainCanvas.canvas.offsetLeft + xPos * (MainCanvas.canvas.clientWidth / mainCanvasWidth);
1344
+ }
1345
+ function elementSetPosition(_, xPos, yPos) {
1346
+ const element = elementGet(_, 'elementSetPosition');
1347
+ if (!element)
1348
+ return;
1349
+ const Top = getRelativeY(yPos);
1350
+ const Left = getRelativeX(xPos);
1351
+ Object.assign(element.style, {
1352
+ position: 'fixed',
1353
+ left: Left + 'px',
1354
+ top: Top + 'px'
1355
+ });
1356
+ }
1357
+ function elementSetSize(_, width, height) {
1358
+ const element = elementGet(_, 'elementSetSize');
1359
+ if (!element)
1360
+ return;
1361
+ const Height = getRelativeHeight(height);
1362
+ const Width = getRelativeWidth(width);
1363
+ Object.assign(element.style, {
1364
+ width: Width + 'px',
1365
+ height: Height + 'px',
1366
+ });
1367
+ }
1368
+ function elementAdjustFontSize(_) {
1369
+ const element = elementGet(_, 'elementAdjustFontSize');
1370
+ if (!element)
1371
+ return;
1372
+ const Font = MainCanvas.canvas.clientWidth <= MainCanvas.canvas.clientHeight * 2 ? MainCanvas.canvas.clientWidth / 50 : MainCanvas.canvas.clientHeight / 25;
1373
+ Object.assign(element.style, {
1374
+ fontSize: Font + 'px',
1375
+ fontFamily: CommonGetFontName()
1376
+ });
1377
+ }
1378
+ function elementSetPosSizeFont(_, xPos, yPos, width, height) {
1379
+ if (elementGet(_, 'elementSetPosSizeFont') === null)
1380
+ return;
1381
+ elementSetPosition(_, xPos, yPos);
1382
+ elementSetSize(_, width, height);
1383
+ elementAdjustFontSize(_);
1384
+ }
1385
+ function elementHide(_) {
1386
+ const element = elementGet(_, 'elementHide');
1387
+ if (!element)
1388
+ return;
1389
+ element.style.display = 'none';
1390
+ }
1391
+ function elementUnhide(_) {
1392
+ const element = elementGet(_, 'elementUnhide');
1393
+ if (!element)
1394
+ return;
1395
+ element.style.display = '';
1396
+ }
1397
+ function elementGet(_, funcName) {
1398
+ if (!_) {
1399
+ Logger_deepLibLogger.warn(`${funcName} called without an elementId or element`);
1400
+ return null;
1401
+ }
1402
+ const elementId = _.elementId ?? _.element?.id;
1403
+ const element = _.element ?? document.getElementById(_.elementId);
1404
+ if (!element) {
1405
+ Logger_deepLibLogger.warn(`A call to ${funcName} was made on non-existent element with id ${elementId}`);
1406
+ return null;
1407
+ }
1408
+ return element;
1409
+ }
1410
+
1411
+ ;// ./src/Utilities/Elements/Button.ts
1412
+
1413
+ function elementCreateButton(options) {
1414
+ const width = options.size ? getRelativeWidth(options.size[0]) + 'px' : '';
1415
+ const height = options.size ? getRelativeHeight(options.size[1]) + 'px' : '';
1416
+ const left = options.position ? getRelativeX(options.position[0]) + 'px' : '';
1417
+ const top = options.position ? getRelativeY(options.position[1]) + 'px' : '';
1418
+ const position = options.position ? 'fixed' : '';
1419
+ const button = ElementButton.Create(options.id, () => options.onClick(), {
1420
+ tooltip: options.tooltip,
1421
+ label: options.label,
1422
+ labelPosition: 'center',
1423
+ }, {
1424
+ button: {
1425
+ classList: ['deeplib-button'],
1426
+ children: [
1427
+ {
1428
+ tag: 'img',
1429
+ attributes: {
1430
+ id: `${options.id}-image`,
1431
+ alt: '',
1432
+ disabled: options.disabled,
1433
+ decoding: 'async',
1434
+ loading: 'lazy',
1435
+ src: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
1436
+ },
1437
+ dataAttributes: {
1438
+ 'size': options.size?.join('x'),
1439
+ 'position': options.position?.join('x'),
1440
+ },
1441
+ style: {
1442
+ '--image': `url("${options.image}")`,
1443
+ }
1444
+ },
1445
+ ],
1446
+ style: {
1447
+ width: width,
1448
+ height: height,
1449
+ left: left,
1450
+ top: top,
1451
+ position: position,
1452
+ }
1453
+ },
1454
+ });
1455
+ BaseSubscreen.currentElements.push([button, options]);
1456
+ return button;
1457
+ }
1458
+
1459
+ ;// ./src/Utilities/Elements/Checkbox.ts
1460
+
1461
+ function elementCreateCheckbox(options) {
1462
+ const elem = document.getElementById(options.id);
1463
+ if (elem)
1464
+ return elem;
1465
+ const width = options.size ? getRelativeWidth(options.size[0]) + 'px' : '';
1466
+ const height = options.size ? getRelativeHeight(options.size[1]) + 'px' : '';
1467
+ const left = options.position ? getRelativeX(options.position[0]) + 'px' : '';
1468
+ const top = options.position ? getRelativeY(options.position[1]) + 'px' : '';
1469
+ const position = options.position ? 'fixed' : '';
1470
+ const retElem = ElementCreate({
1471
+ tag: 'div',
1472
+ classList: ['deeplib-checkbox-container'],
1473
+ style: {
1474
+ width: width,
1475
+ height: height,
1476
+ left: left,
1477
+ top: top,
1478
+ position: position,
1479
+ },
1480
+ dataAttributes: {
1481
+ 'size': options.size?.join('x'),
1482
+ 'position': options.position?.join('x'),
1483
+ },
1484
+ children: [
1485
+ {
1486
+ tag: 'input',
1487
+ classList: ['deeplib-input'],
1488
+ attributes: {
1489
+ type: 'checkbox',
1490
+ id: options.id,
1491
+ checked: options.getSettingValue() || undefined,
1492
+ },
1493
+ },
1494
+ {
1495
+ tag: 'label',
1496
+ classList: ['deeplib-text'],
1497
+ attributes: {
1498
+ for: options.id,
1499
+ },
1500
+ children: [options.label]
1501
+ },
1502
+ ]
1503
+ });
1504
+ if (options.description) {
1505
+ retElem.addEventListener('mouseover', () => {
1506
+ elementSetTooltip(options.description);
1507
+ });
1508
+ retElem.addEventListener('mouseout', () => {
1509
+ elementSetTooltip('');
1510
+ });
1511
+ }
1512
+ BaseSubscreen.currentElements.push([retElem, options]);
1513
+ return retElem;
1514
+ }
1515
+
1516
+ ;// ./src/Utilities/Elements/Input.ts
1517
+
1518
+ function elementCreateInput(options) {
1519
+ const elem = document.getElementById(options.id);
1520
+ if (elem)
1521
+ return elem;
1522
+ const width = options.size ? getRelativeWidth(options.size[0]) + 'px' : '';
1523
+ const height = options.size ? getRelativeHeight(options.size[1]) + 'px' : '';
1524
+ const left = options.position ? getRelativeX(options.position[0]) + 'px' : '';
1525
+ const top = options.position ? getRelativeY(options.position[1]) + 'px' : '';
1526
+ const position = options.position ? 'fixed' : '';
1527
+ const retElem = ElementCreate({
1528
+ tag: 'div',
1529
+ classList: ['deeplib-input-container'],
1530
+ style: {
1531
+ width: width,
1532
+ height: height,
1533
+ left: left,
1534
+ top: top,
1535
+ position: position,
1536
+ },
1537
+ dataAttributes: {
1538
+ 'size': options.size?.join('x'),
1539
+ 'position': options.position?.join('x'),
1540
+ },
1541
+ children: [
1542
+ {
1543
+ tag: 'input',
1544
+ classList: ['deeplib-input'],
1545
+ attributes: {
1546
+ type: options.type,
1547
+ id: options.id,
1548
+ placeholder: ' ',
1549
+ },
1550
+ },
1551
+ {
1552
+ tag: 'label',
1553
+ classList: ['deeplib-text'],
1554
+ attributes: {
1555
+ for: options.id,
1556
+ },
1557
+ children: [options.label]
1558
+ },
1559
+ {
1560
+ tag: 'div',
1561
+ classList: ['deeplib-underline'],
1562
+ }
1563
+ ]
1564
+ });
1565
+ if (options.getElementValue?.()) {
1566
+ const input = document.getElementById(options.id);
1567
+ if (input)
1568
+ input.value = options.getElementValue();
1569
+ }
1570
+ if (options.description) {
1571
+ retElem.addEventListener('mouseover', () => {
1572
+ elementSetTooltip(options.description);
1573
+ });
1574
+ retElem.addEventListener('mouseout', () => {
1575
+ elementSetTooltip('');
1576
+ });
1577
+ }
1578
+ BaseSubscreen.currentElements.push([retElem, options]);
1579
+ return retElem;
1580
+ }
1581
+
1582
+ ;// ./src/Utilities/Elements/Label.ts
1583
+
1584
+ function elementCreateLabel(options) {
1585
+ const elem = document.getElementById(options.id);
1586
+ if (elem)
1587
+ return elem;
1588
+ const width = options.size ? getRelativeWidth(options.size[0]) + 'px' : '';
1589
+ const height = options.size ? getRelativeHeight(options.size[1]) + 'px' : '';
1590
+ const left = options.position ? getRelativeX(options.position[0]) + 'px' : '';
1591
+ const top = options.position ? getRelativeY(options.position[1]) + 'px' : '';
1592
+ const position = options.position ? 'fixed' : '';
1593
+ const retElem = ElementCreate({
1594
+ tag: 'span',
1595
+ classList: ['deeplib-label', 'deeplib-text'],
1596
+ attributes: {
1597
+ id: options.id
1598
+ },
1599
+ style: {
1600
+ width: width,
1601
+ height: height,
1602
+ left: left,
1603
+ top: top,
1604
+ position: position,
1605
+ },
1606
+ dataAttributes: {
1607
+ 'size': options.size?.join('x'),
1608
+ 'position': options.position?.join('x'),
1609
+ },
1610
+ children: [
1611
+ options.label,
1612
+ ],
1613
+ });
1614
+ if (options.description) {
1615
+ retElem.addEventListener('mouseover', () => {
1616
+ elementSetTooltip(options.description);
1617
+ });
1618
+ retElem.addEventListener('mouseout', () => {
1619
+ elementSetTooltip('');
1620
+ });
1621
+ }
1622
+ BaseSubscreen.currentElements.push([retElem, options]);
1623
+ return retElem;
1624
+ }
1625
+
1626
+ ;// ./src/Utilities/Elements/Tooltip.ts
1627
+ function elementCreateTooltip() {
1628
+ const element = ElementCreate({
1629
+ tag: 'div',
1630
+ classList: ['deeplib-tooltip'],
1631
+ attributes: {
1632
+ id: 'deeplib-tooltip'
1633
+ },
1634
+ style: {
1635
+ display: 'none'
1636
+ }
1637
+ });
1638
+ return element;
1639
+ }
1640
+ function elementGetTooltip() {
1641
+ return document.getElementById('deeplib-tooltip') ?? undefined;
1642
+ }
1643
+ function elementSetTooltip(text) {
1644
+ const element = document.getElementById('deeplib-tooltip');
1645
+ if (!element)
1646
+ return false;
1647
+ element.innerHTML = text;
1648
+ if (text === '')
1649
+ element.style.display = 'none';
1650
+ else
1651
+ element.style.display = '';
1652
+ return true;
1653
+ }
1654
+
1655
+ ;// ./src/Utilities/Logger.ts
1656
+ class Logger extends Array {
1657
+ ModName = 'DeepLib';
1658
+ constructor(modName) {
1659
+ super();
1660
+ if (modName) {
1661
+ this.ModName = modName;
1662
+ }
1663
+ }
1664
+ _Log(level, ...args) {
1665
+ const logEntry = {
1666
+ logLevel: level,
1667
+ args: [...args],
1668
+ date: new Date(Date.now())
1669
+ };
1670
+ const userAgent = navigator.userAgent.toLowerCase();
1671
+ if (userAgent.includes('chrome') || userAgent.includes('firefox')) {
1672
+ const color = Logger.colorizeLog(level);
1673
+ args.forEach(arg => {
1674
+ if (typeof arg === 'string') {
1675
+ arg = `\n%c${arg}`;
1676
+ }
1677
+ });
1678
+ console.log(`%c${this.ModName}:`, color, ...args);
1679
+ }
1680
+ else {
1681
+ console.log(`${this.ModName}:`, ...args);
1682
+ }
1683
+ this.push(logEntry);
1684
+ }
1685
+ info(...args) {
1686
+ this._Log('info', ...args);
1687
+ }
1688
+ log(...args) {
1689
+ this._Log('log', ...args);
1690
+ }
1691
+ warn(...args) {
1692
+ this._Log('warn', ...args);
1693
+ }
1694
+ error(...args) {
1695
+ this._Log('error', ...args);
1696
+ }
1697
+ debug(...args) {
1698
+ this._Log('debug', ...args);
1699
+ }
1700
+ static colorizeLog(logLevel) {
1701
+ const colors = {
1702
+ info: 'color: #32CCCC',
1703
+ log: 'color: #CCCC32',
1704
+ warn: 'color: #eec355',
1705
+ error: 'color: #750b0b',
1706
+ debug: 'color: #9E4BCF',
1707
+ };
1708
+ return colors[logLevel];
1709
+ }
1710
+ }
1711
+ const Logger_deepLibLogger = new Logger();
1712
+
1713
+ // EXTERNAL MODULE: ./node_modules/.pnpm/bondage-club-mod-sdk@1.2.0/node_modules/bondage-club-mod-sdk/dist/bcmodsdk.js
1714
+ var bcmodsdk = __webpack_require__(734);
1715
+ var bcmodsdk_default = /*#__PURE__*/__webpack_require__.n(bcmodsdk);
1716
+ ;// ./src/Utilities/SDK.ts
1717
+
1718
+ var SDK_HookPriority;
1719
+ (function (HookPriority) {
1720
+ HookPriority[HookPriority["Observe"] = 0] = "Observe";
1721
+ HookPriority[HookPriority["AddBehavior"] = 1] = "AddBehavior";
1722
+ HookPriority[HookPriority["ModifyBehavior"] = 5] = "ModifyBehavior";
1723
+ HookPriority[HookPriority["OverrideBehavior"] = 10] = "OverrideBehavior";
1724
+ HookPriority[HookPriority["Top"] = 100] = "Top";
1725
+ })(SDK_HookPriority || (SDK_HookPriority = {}));
1726
+ class SDK_bcSdkMod {
1727
+ static SDK;
1728
+ static patchedFunctions = new Map();
1729
+ static ModInfo;
1730
+ constructor(info, options) {
1731
+ SDK_bcSdkMod.SDK = bcmodsdk_default().registerMod(info, options);
1732
+ SDK_bcSdkMod.ModInfo = info;
1733
+ }
1734
+ initPatchableFunction(target) {
1735
+ let result = SDK_bcSdkMod.patchedFunctions.get(target);
1736
+ if (!result) {
1737
+ result = {
1738
+ name: target,
1739
+ hooks: []
1740
+ };
1741
+ SDK_bcSdkMod.patchedFunctions.set(target, result);
1742
+ }
1743
+ return result;
1744
+ }
1745
+ hookFunction(target, priority, hook, module = null) {
1746
+ const data = this.initPatchableFunction(target);
1747
+ if (data.hooks.some((h) => h.hook === hook)) {
1748
+ return () => null;
1749
+ }
1750
+ const removeCallback = SDK_bcSdkMod.SDK?.hookFunction(target, priority, hook);
1751
+ data.hooks.push({
1752
+ hook,
1753
+ priority,
1754
+ module,
1755
+ removeCallback
1756
+ });
1757
+ data.hooks.sort((a, b) => b.priority - a.priority);
1758
+ return removeCallback;
1759
+ }
1760
+ patchFunction(target, patches) {
1761
+ this.patchFunction(target, patches);
1762
+ }
1763
+ removeHookByModule(target, module) {
1764
+ const data = this.initPatchableFunction(target);
1765
+ for (let i = data.hooks.length - 1; i >= 0; i--) {
1766
+ if (data.hooks[i].module === module) {
1767
+ data.hooks[i].removeCallback();
1768
+ data.hooks.splice(i, 1);
1769
+ }
1770
+ }
1771
+ return true;
1772
+ }
1773
+ removeAllHooksByModule(module) {
1774
+ for (const data of SDK_bcSdkMod.patchedFunctions.values()) {
1775
+ for (let i = data.hooks.length - 1; i >= 0; i--) {
1776
+ if (data.hooks[i].module === module) {
1777
+ data.hooks[i].removeCallback();
1778
+ data.hooks.splice(i, 1);
1779
+ }
1780
+ }
1781
+ }
1782
+ return true;
1783
+ }
1784
+ }
1785
+
1786
+ ;// ./src/Utilities/String.ts
1787
+
1788
+ class _String {
1789
+ static encode(string) {
1790
+ return LZString.compressToBase64(JSON.stringify(string));
1791
+ }
1792
+ static decode(string) {
1793
+ const d = LZString.decompressFromBase64(string);
1794
+ let data = {};
1795
+ try {
1796
+ const decoded = JSON.parse(d);
1797
+ data = decoded;
1798
+ }
1799
+ catch (error) {
1800
+ Logger_deepLibLogger.error(error);
1801
+ }
1802
+ if (data)
1803
+ return data;
1804
+ }
1805
+ static shuffle(string) {
1806
+ const temp = JSON.parse(JSON.stringify(string));
1807
+ const ret = [];
1808
+ while (temp.length > 0) {
1809
+ const d = Math.floor(Math.random() * temp.length);
1810
+ ret.push(temp[d]);
1811
+ temp.splice(d, 1);
1812
+ }
1813
+ return ret;
1814
+ }
1815
+ }
1816
+
1817
+ ;// ./src/Utilities/Translation.ts
1818
+ class Translation_Localization {
1819
+ Translation = {};
1820
+ static PathToTranslation;
1821
+ constructor(options) {
1822
+ Translation_Localization.PathToTranslation = options.pathToTranslationsFolder.endsWith('/') ? options.pathToTranslationsFolder : options.pathToTranslationsFolder + '/';
1823
+ }
1824
+ static async init() {
1825
+ const lang = TranslationLanguage.toLowerCase();
1826
+ const translation = await Translation_Localization.fetchLanguageFile(lang);
1827
+ if (lang === 'en') {
1828
+ Translation_Localization.prototype.Translation = translation;
1829
+ }
1830
+ else {
1831
+ const fallbackTranslation = await Translation_Localization.fetchLanguageFile('en');
1832
+ Translation_Localization.prototype.Translation = { ...fallbackTranslation, ...translation };
1833
+ }
1834
+ }
1835
+ static getText(srcTag) {
1836
+ return Translation_Localization.prototype.Translation?.[srcTag] || srcTag || '';
1837
+ }
1838
+ static async fetchLanguageFile(lang) {
1839
+ const response = await fetch(`${Translation_Localization.PathToTranslation}${lang}.lang`);
1840
+ if (lang !== 'en' && !response.ok) {
1841
+ return this.fetchLanguageFile('en');
1842
+ }
1843
+ const langFileContent = await response.text();
1844
+ return this.parseLanguageFile(langFileContent);
1845
+ }
1846
+ static parseLanguageFile(content) {
1847
+ const translations = {};
1848
+ const lines = content.split('\n');
1849
+ for (const line of lines) {
1850
+ if (line.trim() === '' || line.trim().startsWith('#')) {
1851
+ continue;
1852
+ }
1853
+ const [key, value] = line.split('=');
1854
+ translations[key.trim()] = value.trim();
1855
+ }
1856
+ return translations;
1857
+ }
1858
+ }
1859
+ const getText = (string) => Translation_Localization.getText(string);
1860
+
1861
+ ;// ./src/DeepLib.ts
1862
+
1863
+
1864
+
1865
+
1866
+
1867
+
1868
+
1869
+
1870
+
1871
+
1872
+
1873
+
1874
+
1875
+
1876
+
1877
+
1878
+
1879
+
1880
+
1881
+
1882
+
1883
+
1884
+
1885
+
1886
+
1887
+
1888
+
1889
+
1890
+ })();
1891
+
1892
+ /******/ })()
1893
+ ;
1894
+ //# sourceMappingURL=main.js.map