@froomle/frontend-sdk 0.0.9 → 0.0.49-TEMPLATE
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.
Potentially problematic release.
This version of @froomle/frontend-sdk might be problematic. Click here for more details.
- package/README.md +396 -5
- package/dist/Recommendations.d-HGeAMYU5.d.ts +49 -0
- package/dist/chunk-72IYS3TH.js +5 -0
- package/dist/froomle.global.js +5 -5
- package/dist/index.d.ts +113 -27
- package/dist/index.js +1 -5
- package/dist/react.d.ts +40 -0
- package/dist/react.js +1 -0
- package/package.json +17 -5
- package/LICENSE +0 -201
- package/dist/index.cjs +0 -5
- package/dist/index.d.cts +0 -62
- package/dist/testing/testing.cjs +0 -6
- package/dist/testing/testing.cjs.map +0 -1
- package/dist/testing/testing.d.cts +0 -144
- package/dist/testing/testing.d.ts +0 -144
- package/dist/testing/testing.js +0 -6
- package/dist/testing/testing.js.map +0 -1
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
-
Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
package/dist/index.cjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var we=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var rt=Object.prototype.hasOwnProperty;var st=(u,e)=>{for(var t in e)we(u,t,{get:e[t],enumerable:!0})},nt=(u,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of tt(e))!rt.call(u,n)&&n!==t&&we(u,n,{get:()=>e[n],enumerable:!(r=et(e,n))||r.enumerable});return u};var it=u=>nt(we({},"__esModule",{value:!0}),u);var ct={};st(ct,{RecommendationItem:()=>W,RecommendationList:()=>Q,Recommendations:()=>z,setConsent:()=>at,setDeviceId:()=>Qe,setEnvironment:()=>Ke,setPageVisit:()=>Xe,setRequestDomain:()=>We,setUserId:()=>ze});module.exports=it(ct);var s=class u{static global(e){return u.globals[e]?u.globals[e]:u.globals[e]={}}static createStatic(e,t,r){let n=null;Object.defineProperty(e,t,{enumerable:!0,get:function(){return r!=null&&(n=r(),r=null),n},set:function(i){r!=null&&(n=r(),r=null),n=i}})}static iterator(e){if(Array.isArray(e)){let t=e;return function(){return u.mkIter(t)}}else return typeof e.iterator=="function"?e.iterator.bind(e):e.iterator}static getIterator(e){return Array.isArray(e)?u.mkIter(e):e.iterator()}static mkIter(e){return new xe(e)}static extend(e){function t(){this[u.new].apply(this,arguments)}return Object.setPrototypeOf(t.prototype,e.prototype),t}static inherits(e,t){t==null&&(t=!1);function r(){t&&e&&r[u.init]&&r[u.init](),this[u.new].apply(this,arguments)}return t?r[u.init]=()=>{let n=e();n[u.init]&&n[u.init](),Object.setPrototypeOf(r.prototype,n.prototype),r[u.init]=void 0}:e&&e[u.init]?(t=!0,r[u.init]=()=>{e[u.init]&&e[u.init](),Object.setPrototypeOf(r.prototype,e.prototype),r[u.init]=void 0}):e&&Object.setPrototypeOf(r.prototype,e.prototype),r}static bind(e,t){if(t==null)return null;t.__id__==null&&(t.__id__=u.fid++);let r=null;return e.hx__closures__==null?e.hx__closures__={}:r=e.hx__closures__[t.__id__],r==null&&(r=t.bind(e),e.hx__closures__[t.__id__]=r),r}static get __name__(){return"genes.Register"}get __class__(){return u}};s.$global=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:void 0;s.globals={};s.new=Symbol();s.init=Symbol();s.fid=0;var xe=s.global("$hxClasses")["genes._Register.ArrayIterator"]=class Pe extends s.inherits(){[s.new](e){this.current=0,this.array=e}hasNext(){return this.current<this.array.length}next(){return this.array[this.current++]}static get __name__(){return"genes._Register.ArrayIterator"}get __class__(){return Pe}};xe.prototype.array=null;xe.prototype.current=null;var pt=s.$global,z=function(){};z.__isInterface__=!0;var Q=function(){};Q.__isInterface__=!0;var W=function(){};W.__isInterface__=!0;var yt=s.$global,me=s.global("$hxClasses")["haxe.ValueException"]=class Se extends s.inherits(()=>k,!0){[s.new](e,t,r){super[s.new](String(e),t,r),this.value=e}unwrap(){return this.value}static get __name__(){return"haxe.ValueException"}static get __super__(){return k}get __class__(){return Se}};me.prototype.value=null;var vt=s.$global,k=s.global("$hxClasses")["haxe.Exception"]=class ne extends s.inherits(()=>Error,!0){[s.new](e,t,r){Error.call(this,e),this.message=e,this.__previousException=t,this.__nativeException=r!=null?r:this}unwrap(){return this.__nativeException}get_native(){return this.__nativeException}static caught(e){return e instanceof ne?e:e instanceof Error?new ne(e.message,null,e):new me(e,null,e)}static thrown(e){return e instanceof ne?e.get_native():e instanceof Error?e:new me(e)}static get __name__(){return"haxe.Exception"}static get __super__(){return Error}get __class__(){return ne}};k.prototype.native=null;k.prototype.__skipStack=null;k.prototype.__nativeException=null;k.prototype.__previousException=null;var Dt=s.$global,ve=s.global("$hxClasses")["js.Browser"]=class $e{static get supported(){return this.get_supported()}static get_supported(){return typeof window!="undefined"&&typeof window.location!="undefined"?typeof window.location.protocol=="string":!1}static createXMLHttpRequest(){if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")return new"ActiveXObject"("Microsoft.XMLHTTP");throw k.thrown("Unable to create XMLHttpRequest object.")}static get __name__(){return"js.Browser"}get __class__(){return $e}};var Pt=s.$global,F=s.global("$hxEnums")["haxe.io.Error"]={__ename__:"haxe.io.Error",Blocked:{_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error"},Overflow:{_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error"},OutsideBounds:{_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error"},Custom:Object.assign(u=>({_hx_index:3,__enum__:"haxe.io.Error",e:u}),{_hx_name:"Custom",__params__:["e"]})};F.__constructs__=[F.Blocked,F.Overflow,F.OutsideBounds,F.Custom];F.__empty_constructs__=[F.Blocked,F.Overflow,F.OutsideBounds];var qt=s.$global,H=s.global("$hxEnums")["haxe.io.Encoding"]={__ename__:"haxe.io.Encoding",UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding"},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding"}};H.__constructs__=[H.UTF8,H.RawNative];H.__empty_constructs__=[H.UTF8,H.RawNative];var Tt=s.$global,G=s.global("$hxClasses")["haxe.io.Bytes"]=class Re extends s.inherits(){[s.new](e){this.length=e.byteLength,this.b=new Uint8Array(e),this.b.bufferValue=e,e.hxBytes=this,e.bytes=this.b}getString(e,t,r){if(e<0||t<0||e+t>this.length)throw k.thrown(F.OutsideBounds);r==null&&(r=H.UTF8);let n="",i=this.b,o=e,a=e+t;switch(r._hx_index){case 0:let y=e>0;for(;o<a;){let d=i[o++];if(d<128){if(d==0)break;n+=String.fromCodePoint(d)}else if(d<224){let c=(d&63)<<6|i[o++]&127;n+=String.fromCodePoint(c)}else if(d<240){let c=i[o++],g=(d&31)<<12|(c&127)<<6|i[o++]&127;n+=String.fromCodePoint(g)}else{let c=i[o++],g=i[o++],m=(d&15)<<18|(c&127)<<12|(g&127)<<6|i[o++]&127;n+=String.fromCodePoint(m)}}break;case 1:for(;o<a;){let d=i[o++]|i[o++]<<8;n+=String.fromCodePoint(d)}break}return n}static ofData(e){let t=e.hxBytes;return t!=null?t:new Re(e)}static get __name__(){return"haxe.io.Bytes"}get __class__(){return Re}};G.prototype.length=null;G.prototype.b=null;var jt=s.$global,T=s.global("$hxClasses")["haxe.http.HttpBase"]=class qe extends s.inherits(){[s.new](e){this.url=e,this.headers=[],this.params=[],this.emptyOnData=s.bind(this,this.onData)}get responseData(){return this.get_responseData()}setHeader(e,t){let r=0,n=this.headers.length;for(;r<n;){let i=r++;if(this.headers[i].name==e){this.headers[i]={name:e,value:t};return}}this.headers.push({name:e,value:t})}setPostData(e){this.postData=e,this.postBytes=null}onData(e){}onBytes(e){}onError(e){}onStatus(e){}hasOnData(){return s.bind(this,this.onData)!=this.emptyOnData}success(e){this.responseBytes=e,this.responseAsString=null,this.hasOnData()&&this.onData(this.get_responseData()),this.onBytes(this.responseBytes)}get_responseData(){return this.responseAsString==null&&this.responseBytes!=null&&(this.responseAsString=this.responseBytes.getString(0,this.responseBytes.length,H.UTF8)),this.responseAsString}static get __name__(){return"haxe.http.HttpBase"}get __class__(){return qe}};T.prototype.url=null;T.prototype.responseBytes=null;T.prototype.responseAsString=null;T.prototype.postData=null;T.prototype.postBytes=null;T.prototype.headers=null;T.prototype.params=null;T.prototype.emptyOnData=null;var Jt=s.$global,pe=s.global("$hxClasses")["haxe.iterators.MapKeyValueIterator"]=class Be extends s.inherits(){[s.new](e){this.map=e,this.keys=e.keys()}hasNext(){return this.keys.hasNext()}next(){let e=this.keys.next();return{value:this.map.get(e),key:e}}static get __name__(){return"haxe.iterators.MapKeyValueIterator"}get __class__(){return Be}};pe.prototype.map=null;pe.prototype.keys=null;var zt=s.$global,Ie=function(){};Ie.__isInterface__=!0;var Gt=s.$global,Ee=s.global("$hxClasses")["js.Boot"]=class ie{static __string_rec(e,t){if(e==null)return"null";if(t.length>=5)return"<...>";let r=typeof e;switch(r=="function"&&(e.__name__||e.__ename__)&&(r="object"),r){case"function":return"<function>";case"object":if(e.__enum__){let d=s.global("$hxEnums")[e.__enum__].__constructs__[e._hx_index],c=d._hx_name;return d.__params__?(t=t+" ",c+"("+(function(g){var m;let E=[];{let _=0,p=d.__params__;for(;_<p.length;){let v=p[_];_=_+1,E.push(ie.__string_rec(e[v],t))}}return m=E,m})(this).join(",")+")"):c}if(e instanceof Array){let y="[";t+=" ";let d=0,c=e.length;for(;d<c;){let g=d++;y+=(g>0?",":"")+ie.__string_rec(e[g],t)}return y+="]",y}let n;try{n=e.toString}catch{return"???"}if(n!=null&&n!=Object.toString&&typeof n=="function"){let y=e.toString();if(y!="[object Object]")return y}let i=`{
|
|
2
|
-
`;t+=" ";let o=e.hasOwnProperty!=null,a=null;for(a in e)o&&!e.hasOwnProperty(a)||a=="prototype"||a=="__class__"||a=="__super__"||a=="__interfaces__"||a=="__properties__"||(i.length!=2&&(i+=`,
|
|
3
|
-
`),i+=t+a+" : "+ie.__string_rec(e[a],t));return t=t.substring(1),i+=`
|
|
4
|
-
`+t+"}",i;break;case"string":return e;default:return String(e)}}static get __name__(){return"js.Boot"}get __class__(){return ie}};Ee.__toStr={}.toString;var tr=s.$global,$=s.global("$hxClasses").Std=class Ve{static string(e){return Ee.__string_rec(e,"")}static parseInt(e){let t=parseInt(e);return isNaN(t)?null:t}static get __name__(){return"Std"}get __class__(){return Ve}};String.__name__=!0,Array.__name__=!0;var ir=s.$global,de=s.global("$hxClasses")["genes.util.EsMap"]=class le extends s.inherits(){[s.new](){this.inst=new Map}set(e,t){this.inst.set(e,t)}get(e){return this.inst.get(e)}remove(e){return this.inst.delete(e)}exists(e){return this.inst.has(e)}keys(){return le.adaptIterator(this.inst.keys())}iterator(){return le.adaptIterator(this.inst.values())}toString(){let e=[],t=le.adaptIterator(this.inst.keys());for(;t.hasNext();){let r=t.next();e.push(""+$.string(r)+" => "+$.string(this.inst.get(r)))}return"{"+e.join(", ")+"}"}clear(){this.inst.clear()}static adaptIterator(e){let t,r,n=function(){let i=e.next();t=i.value,r=i.done};return{hasNext:function(){return r==null&&n(),!r},next:function(){r==null&&n();let i=t;return n(),i}}}static get __name__(){return"genes.util.EsMap"}get __class__(){return le}};de.prototype.inst=null;var gr=s.$global,Ae=s.global("$hxClasses")["haxe.ds.StringMap"]=class De extends s.inherits(de){[s.new](){super[s.new]()}copy(){let e=new De;return e.inst=new Map(this.inst),e}keyValueIterator(){return new pe(this)}static get __name__(){return"haxe.ds.StringMap"}static get __interfaces__(){return[Ie]}static get __super__(){return de}get __class__(){return De}};var pr=s.$global,B=s.global("$hxClasses").HxOverrides=class Oe{static cca(e,t){let r=e.charCodeAt(t);if(r==r)return r}static substr(e,t,r){if(r==null)r=e.length;else if(r<0)if(t==0)r=e.length+r;else return"";return e.substr(t,r)}static now(){return Date.now()}static get __name__(){return"HxOverrides"}get __class__(){return Oe}};typeof performance!="undefined"&&typeof performance.now=="function"&&(B.now=performance.now.bind(performance));var yr=s.$global,J=s.global("$hxClasses").StringTools=class he{static isSpace(e,t){let r=B.cca(e,t);return r>8&&r<14?!0:r==32}static ltrim(e){let t=e.length,r=0;for(;r<t&&he.isSpace(e,r);)++r;return r>0?B.substr(e,r,t-r):e}static rtrim(e){let t=e.length,r=0;for(;r<t&&he.isSpace(e,t-r-1);)++r;return r>0?B.substr(e,0,t-r):e}static replace(e,t,r){return e.split(t).join(r)}static get __name__(){return"StringTools"}get __class__(){return he}};var xr=s.$global,Fe=s.global("$hxClasses").Lambda=class Te{static exists(e,t){let r=s.getIterator(e);for(;r.hasNext();){let n=r.next();if(t(n))return!0}return!1}static get __name__(){return"Lambda"}get __class__(){return Te}};var kr=s.$global,oe=s.global("$hxClasses").EReg=class He extends s.inherits(){[s.new](e,t){this.r=new RegExp(e,t.split("u").join(""))}match(e){return this.r.global&&(this.r.lastIndex=0),this.r.m=this.r.exec(e),this.r.s=e,this.r.m!=null}matched(e){if(this.r.m!=null&&e>=0&&e<this.r.m.length)return this.r.m[e];throw k.thrown("EReg::matched")}matchedPos(){if(this.r.m==null)throw k.thrown("No string matched");return{pos:this.r.m.index,len:this.r.m[0].length}}matchSub(e,t,r){if(r==null&&(r=-1),this.r.global){this.r.lastIndex=t,this.r.m=this.r.exec(r<0?e:B.substr(e,0,t+r));let n=this.r.m!=null;return n&&(this.r.s=e),n}else{let n=this.match(r<0?B.substr(e,t,null):B.substr(e,t,r));return n&&(this.r.s=e,this.r.m.index+=t),n}}map(e,t){let r=0,n="";do{if(r>=e.length)break;if(!this.matchSub(e,r)){n+=$.string(B.substr(e,r,null));break}let i=this.matchedPos();n+=$.string(B.substr(e,r,i.pos-r)),n+=$.string(t(this)),i.len==0?(n+=$.string(B.substr(e,i.pos,1)),r=i.pos+1):r=i.pos+i.len}while(this.r.global);return!this.r.global&&r>0&&r<e.length&&(n+=$.string(B.substr(e,r,null))),n}static get __name__(){return"EReg"}get __class__(){return He}};oe.prototype.r=null;var Hr=s.$global,Y=s.global("$hxClasses")["haxe.http.HttpJs"]=class Le extends s.inherits(T){[s.new](e){this.async=!0,this.withCredentials=!1,super[s.new](e)}request(e){this.responseAsString=null,this.responseBytes=null,this.responseHeaders=null;let t=this.req=ve.createXMLHttpRequest(),r=this,n=function(c){if(t.readyState!=4)return;let g;try{g=t.status}catch{g=null}if(g==0&&ve.get_supported()&&s.$global.location!=null){let m=s.$global.location.protocol.toLowerCase();new oe("^(?:about|app|app-storage|.+-extension|file|res|widget):$","").match(m)&&(g=t.response!=null?200:404)}if(g==null&&(g=null),g!=null&&r.onStatus(g),g!=null&&g>=200&&g<400){r.req=null;let m=t.getAllResponseHeaders().split(`\r
|
|
5
|
-
`),E=[],_=0,p=m;for(;_<p.length;){let w=p[_];++_,w!=""&&E.push(w)}m=E;let v=new Ae;r.responseHeaders=v;let b=0;for(;b<m.length;){let w=m[b];++b;let q=w.split(": "),O=q.shift(),x=q.length==1?q[0]:q.join(": ");x=J.ltrim(J.rtrim(x)),r.responseHeaders.inst.set(O,x)}r.success(G.ofData(t.response))}else if(g==null||g==0&&t.response==null)r.req=null,r.onError("Failed to connect or resolve host");else if(g==null){r.req=null;let m=t.response!=null?G.ofData(t.response):null;r.responseBytes=m,r.onError("Http Error #"+t.status)}else switch(g){case 12007:r.req=null,r.onError("Unknown host");break;case 12029:r.req=null,r.onError("Failed to connect to host");break;default:r.req=null;let m=t.response!=null?G.ofData(t.response):null;r.responseBytes=m,r.onError("Http Error #"+t.status)}};this.async&&(t.onreadystatechange=n);let i,o=this.postData,a=this.postBytes;if(o==null)if(a==null)i=null;else{let c=a;i=new Blob([c.b.bufferValue])}else a==null?i=o:i=null;if(i!=null)e=!0;else{let c=0,g=this.params;for(;c<g.length;){let m=g[c];++c,i==null?i="":i=(i==null?"null":$.string(i))+"&";let E=m.name,_=(i==null?"null":$.string(i))+encodeURIComponent(E)+"=",p=m.value;i=_+encodeURIComponent(p)}}try{if(e)t.open("POST",this.url,this.async);else if(i!=null){let c=this.url.split("?").length<=1;t.open("GET",this.url+(c?"?":"&")+(i==null?"null":$.string(i)),this.async),i=null}else t.open("GET",this.url,this.async);t.responseType="arraybuffer"}catch(c){let g=k.caught(c).unwrap();this.req=null,this.onError(g.toString());return}t.withCredentials=this.withCredentials,!Fe.exists(this.headers,function(c){return c.name=="Content-Type"})&&e&&this.postData==null&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");let y=0,d=this.headers;for(;y<d.length;){let c=d[y];++y,t.setRequestHeader(c.name,c.value)}t.send(i),this.async||n(null)}static get __name__(){return"haxe.http.HttpJs"}static get __super__(){return T}get __class__(){return Le}};Y.prototype.async=null;Y.prototype.withCredentials=null;Y.prototype.responseHeaders=null;Y.prototype.req=null;var jr=s.$global,j=s.global("$hxClasses").SimpleFuture=class Ue extends s.inherits(){[s.new](){this._isFinished=!1}trigger(e){this._result=e,this._isFinished=!0,this._callback!=null&&this._callback(this._result)}then(e){this._callback=e,this._isFinished&&e(this._result)}static get __name__(){return"SimpleFuture"}get __class__(){return Ue}};j.prototype._callback=null;j.prototype._result=null;j.prototype._isFinished=null;var Jr=s.$global,I=s.global("$hxClasses").Reflect=class je{static field(e,t){try{return e[t]}catch{return null}}static getProperty(e,t){let r;if(e==null)return null;{let n;return e.__properties__?(r=e.__properties__["get_"+t],n=r):n=!1,n?e[r]():e[t]}}static setProperty(e,t,r){let n,i;e.__properties__?(n=e.__properties__["set_"+t],i=n):i=!1,i?e[n](r):e[t]=r}static fields(e){let t=[];if(e!=null){let n=Object.prototype.hasOwnProperty;for(var r in e)r!="__id__"&&r!="hx__closures__"&&n.call(e,r)&&t.push(r)}return t}static get __name__(){return"Reflect"}get __class__(){return je}};var es=s.$global,l=s.global("$hxClasses")["internal.RecoBackendV2"]=class f extends s.inherits(){[s.new](){}static _requestUri(){return"https://"+f._req_domain+"/api/"+f._environment+"/recommendations/requests"}static noConsentBody(){return{device_id:"no-consent",user_group:"no-consent",version:"no-consent"}}static buildRequestBody(e){let t={lists:e,page_type:f._page_visit!=null?f._page_visit:f._page_view,channel:"www-desktop"};if(f._consent==0){let r=f.noConsentBody(),n=0,i=I.fields(r);for(;n<i.length;){let o=i[n];++n,t[o]=I.field(r,o)}}else f._user_id!=null?t.user_id=f._user_id:t.device_id=f._device_id;return t}static _requestRecos(e){let t=new j,r=null,n=new Y(f._requestUri());n.setHeader("Content-Type","application/json"),n.setPostData(JSON.stringify(f.buildRequestBody(e))),n.onError=function(a){throw k.thrown("HTTP Request Error: "+a)},n.onStatus=function(a){if(a<200||a>=300)throw k.thrown("HTTP Status Error: "+a)};try{n.request(!1)}catch(a){let y=k.caught(a).unwrap();throw k.thrown("Failed to execute synchronous request: "+$.string(y))}let i=function(a){let y=JSON.parse(a),d=Z.fromRequestData(y);t.trigger(d)},o=n.get_responseData();return o!=null?i(o):n.onData=i,t}static getRawRecommendations(e){return f._requestRecos(e)}static setConsent(e){e>2&&(e=2),f._consent=e}static setChannel(e){f._channel=e}static setPageVisit(e){f._page_visit=e}static setEnvironment(e){f._environment=e}static setDeviceId(e){f._device_id=e}static setUserId(e){f._user_id=e}static setRequestDomain(e){f._req_domain=e}static setPageView(e){f._page_view=e}static getRequestDomain(){return f._req_domain}static getEnvironment(){return f._environment}static getPageVisit(){return f._page_visit}static getUserId(){return f._user_id}static getDeviceId(){return f._device_id}static getPageView(){return f._page_view}static getConsent(){return f._consent}static getChannel(){return f._channel}static get __name__(){return"internal.RecoBackendV2"}get __class__(){return f}};l._environment=null;l._device_id="no-consent";l._user_id=null;l._consent=0;l._req_domain="europe-west1.froomle.com";l._page_visit=null;l._page_view=null;l._channel="www-desktop";var lt=function(){};lt.__isInterface__=!0;var ot=function(){};ot.__isInterface__=!0;var Z=s.global("$hxClasses")["internal._RecommendationsInternal"]=class ke extends s.inherits(){[s.new](e,t,r,n,i){this.request_id=t,this.user_group=r,this.device_id=e,this.user_id=n,this._lists=i}items(){let e=[],t=0,r=this._lists;for(;t<r.length;){let n=r[t];++t;let i=0,o=n.items;for(;i<o.length;){let a=o[i];++i,e.push(a)}}return e}lists(){return this._lists}getItemsByListName(e){let t=0,r=this._lists;for(;t<r.length;){let n=r[t];if(++t,n.list_name==e)return n}return null}static fromRequestData(e){let t=I.getProperty(e,"lists"),r=[],n=0;for(;n<t.length;){let i=t[n];++n;let o=I.getProperty(i,"items"),a=[],y=0;for(;y<o.length;){let c=o[y];++y,a.push(new ae(c))}let d=new ee({limit:I.getProperty(i,"limit"),list_key:I.getProperty(i,"list_key"),list_name:I.getProperty(i,"list_name"),list_size:I.getProperty(i,"list_size"),items:a});r.push(d)}return new ke(I.getProperty(e,"device_id"),I.getProperty(e,"request_id"),I.getProperty(e,"user_group"),I.getProperty(e,"user_id"),r)}static get __name__(){return"internal._RecommendationsInternal"}static get __interfaces__(){return[z]}get __class__(){return ke}};Z.prototype.request_id=null;Z.prototype.user_group=null;Z.prototype.user_id=null;Z.prototype.device_id=null;Z.prototype._lists=null;var ee=s.global("$hxClasses")["internal._RecommendationsListInternal"]=class Ne extends s.inherits(){[s.new](e){this.items=e.items,this.limit=e.limit,this.list_key=e.list_key,this.list_name=e.list_name,this.list_size=e.list_size}static get __name__(){return"internal._RecommendationsListInternal"}static get __interfaces__(){return[Q]}get __class__(){return Ne}};ee.prototype.limit=null;ee.prototype.list_key=null;ee.prototype.list_name=null;ee.prototype.list_size=null;ee.prototype.items=null;var ae=s.global("$hxClasses")["internal._RecommendationItemInternal"]=class Me extends s.inherits(){[s.new](e){this._data={},this.Id=I.getProperty(e,"item_id"),this.RequestId=I.getProperty(e,"request_id"),this.UserGroup=I.getProperty(e,"user_group");let t=0,r=I.fields(e);for(;t<r.length;){let n=r[t];++t,this._data[n]=I.field(e,n)}}get(e){return this._data[e]}static get __name__(){return"internal._RecommendationItemInternal"}static get __interfaces__(){return[W]}get __class__(){return Me}};ae.prototype.Id=null;ae.prototype.RequestId=null;ae.prototype.UserGroup=null;ae.prototype._data=null;var C=s.global("$hxClasses")["internal._RecoBackendV2.RecoBackendV2_Fields_"]=class Je{static getRawRecommendations(e){return l.getRawRecommendations(e)}static setConsent(e){l.setConsent(e)}static setPageVisit(e){l.setPageVisit(e)}static setEnvironment(e){l.setEnvironment(e)}static setDeviceId(e){l.setDeviceId(e)}static setUserId(e){l.setUserId(e)}static setRequestDomain(e){l.setRequestDomain(e)}static setPageView(e){l.setPageView(e)}static setChannel(e){l.setChannel(e)}static getRequestDomain(){l.getRequestDomain()}static getConsent(){l.getConsent()}static getPageVisit(){l.getPageVisit()}static getEnvironment(){l.getEnvironment()}static getDeviceId(){l.getDeviceId()}static getUserId(){l.getUserId()}static getPageView(){l.getPageView()}static getChannel(){l.getChannel()}static get __name__(){return"internal._RecoBackendV2.RecoBackendV2_Fields_"}get __class__(){return Je}},ts=C.getRawRecommendations,rs=C.setConsent,ss=C.setPageVisit,ns=C.setEnvironment,is=C.setDeviceId,ls=C.setUserId,os=C.setRequestDomain,as=C.setPageView,us=C.setChannel,cs=C.getRequestDomain,gs=C.getConsent,_s=C.getPageVisit,ms=C.getEnvironment,ps=C.getDeviceId,ds=C.getUserId,hs=C.getPageView,fs=C.getChannel;var xs=s.$global,A=s.global("$hxClasses").FroomleSdk=class V{static register(){V.registered||V._env_set&&(!V._page_visit_set&&!V._page_view_set||(V.registered=!0))}static buildScriptTag(){let e='<script src="https://cdn.froomle.com/reco-backend-v2/0.0.9/reco-backend-v2.min.js" data-froomle-env="'+l.getEnvironment()+'" ';return l.getPageVisit()!=null&&(e+='data-froomle-page-visit="'+l.getPageVisit()+'" '),l.getPageView()!=null&&(e+='data-froomle-page-view="'+l.getPageView()+'" '),l.getDeviceId()!=null&&(e+='data-froomle-device-id="'+l.getDeviceId()+'" '),l.getUserId()!=null&&(e+='data-froomle-user-id="'+l.getUserId()+'" '),l.getConsent()>0&&(e+='data-froomle-consent="'+l.getConsent()+'" '),l.getRequestDomain()!=null&&(e+='data-froomle-request-domain="'+l.getRequestDomain()+'" '),e+="><\/script>",e}static setEnvironment(e){l.setEnvironment(e),V._env_set=!0,V.register()}static setDeviceId(e){l.setDeviceId(e)}static setUserId(e){l.setUserId(e)}static setConsent(e){l.setConsent(e)}static setPageView(e){l.setPageView(e),V._page_view_set=!0,V.register()}static setPageVisit(e){l.setPageVisit(e),V._page_visit_set=!0,V.register()}static setRequestDomain(e){l.setRequestDomain(e)}static getRawRecommendations(e){return l.getRawRecommendations(e)}static getVersion(){return"0.0.9"}static get __name__(){return"FroomleSdk"}get __class__(){return V}};A._env_set=!1;A._page_visit_set=!1;A._page_view_set=!1;A.registered=!1;var Is=s.$global,te=s.global("$hxClasses")["internal.domHandler.FroomleDomTree"]=class fe extends s.inherits(){[s.new](){}createElement(e){return window.document.createElement(e)}querySelectorAll(e){let t=this.root,r=[],n=t.querySelectorAll(e),i=0,o=n.length;for(;i<o;){let a=i++;r.push(n.item(a))}return r}getRoot(){return this.root}toString(){return this.root.outerHTML}static run(){}static fromHtml(e){return new fe}static fromDocument(){let e=new fe;return e.root=window.document,e}static get __name__(){return"internal.domHandler.FroomleDomTree"}get __class__(){return fe}};te.prototype.root=null;var ks=s.$global,L=s.global("$hxClasses")["internal._ADomNode.ADomNode"]=class Ce{static _new(e){return e}static fromElement(e){return e}static create(e,t){return window.document.createElement(t)}static replaceChild(e,t,r){e.replaceChild(t,r)}static get attributes(){return this.get_attributes()}static get_attributes(e){let t=e,r=[],n=0,i=t.attributes.length;for(;n<i;){let o=n++,a=t.attributes.item(o);r.push({name:a.name,value:a.value})}return r}static addChild(e,t){e.appendChild(t)}static removeChild(e,t){e.removeChild(t)}static getAttribute(e,t){return e.getAttribute(t)}static setAttribute(e,t,r){e.setAttribute(t,r)}static getText(e){return e.textContent}static setText(e,t){e.textContent=t}static get children(){return this.get_children()}static get_children(e){let t=[],n=e.children,i=0,o=n.length;for(;i<o;){let a=i++;t.push(n[a])}return t}static querySelectorAll(e,t){let r=e,n=[],i=r.querySelectorAll(t),o=0,a=i.length;for(;o<a;){let y=o++;n.push(i.item(y))}return n}static getFilterKeyValue(e){let t=0,r=Ce.get_attributes(e);for(;t<r.length;){let n=r[t];if(++t,n.name.startsWith("data-froomle-reco-filter-"))return{key:n.name.substring(25),value:n.value}}return{key:null,value:null}}static get __name__(){return"internal._ADomNode.ADomNode_Impl_"}get __class__(){return Ce}};var Hs=s.$global,ue=s.global("$hxClasses")["internal.domHandler.DomDomDom"]=class K extends s.inherits(){[s.new](){}static _fillRecoTargets(e){let t=new j;if(e==null)return t.trigger(!1),t;let r=[],n=e,i=[],o=n.querySelectorAll("*"),a=0,y=o.length;for(;a<y;){let h=a++;i.push(o.item(h))}let d=i,c=0;for(;c<d.length;){let h=d[c];++c;let D=0,R=L.get_attributes(h);for(;D<R.length;){let M=R[D];++D,M.name=="data-froomle-reco"&&r.push(h)}}let g=[],m=0;for(;m<r.length;){let h=r[m];++m,h.getAttribute("data-froomle-request-id")==null&&(h.getAttribute("data-froomle-id")==null||h.getAttribute("data-froomle-id")=="")&&g.push(h)}if(g.length<1)return new j;let E=[],_=[],p="",v="",b="",w=[],q=function(){let h={list_name:p,list_size:w.length,limit:w.length};v!=null&&I.setProperty(h,v,b),E.push(h),_.push(w)},O=function(h,D,R,M){p=h,v=D,b=R,w=[M]},x=0;for(;x<g.length;){let h=g[x];++x;let D=h.getAttribute("data-froomle-reco"),R=L.getFilterKeyValue(h);if(p==""){O(D,R.key,R.value,h);continue}else if(D==p&&R.key==v&&R.value==b){w.push(h);continue}else{q(),O(D,R.key,R.value,h);continue}}return p!=""&&q(),C.getRawRecommendations(E).then(function(h){let D=0,R=h.lists();for(;D<R.length;){let M=R[D],N=D++,U=M,X=U.items.length!=_[N].length,se=0,ye=U.items;for(;se<ye.length;){let be=ye[se],Ye=se++,Ze=be;K._fillParameters(_[N][Ye],Ze,h.request_id)}}t.trigger(!0)}),t}static _fillParameters(e,t,r){let n=function(m,E,_,p){p==null&&(p="");let v=function(b,w,q){q==null&&(q="fgh");try{w=new oe("\\\\[(\\\\w+)\\\\]","g").map(w,function(R){return"."+R.matched(1)}),w=J.replace(w,"[","."),w=J.replace(w,"]",""),B.cca(w,0)==46&&(w=B.substr(w,1,null));let x=w.split("."),S=b.get(x[0]),h=1,D=x.length;for(;h<D;){let R=h++;if(S==null)return null;S instanceof Array&&$.parseInt(x[R])!=null?S=S[$.parseInt(x[R])]:S=I.field(S,x[R])}return S}catch{return q}};try{let b=v(t,_,p);E=="inner"?m.textContent=b:m.setAttribute(E,b)}catch{}};e.setAttribute("data-froomle-id",t.Id),e.setAttribute("data-froomle-request-id",r);let i=e,o=[],a=i.querySelectorAll("*"),y=0,d=a.length;for(;y<d;){let m=y++;o.push(a.item(m))}let c=o,g=0;for(;g<c.length;){let m=c[g];++g;let E=0,_=L.get_attributes(m);for(;E<_.length;){let p=_[E];if(++E,p.name.startsWith("data-froomle-param-")){let v=J.replace(p.name,"data-froomle-param-",""),b=p.value;n(m,v,b)}}}}static _orderElements(e){let t=function(_,p,v){let b=[],w=L.get_children(_),q=0;for(;q<w.length;){let S=w[q];if(++q,S.getAttribute("data-froomle-ordervalue")!=null){b.push(S);let D=L.create(e,"span");D.setAttribute("data-froomle-tmp-node",""),L.replaceChild(_,D,S)}}let O=[],x=0;for(;x<b.length;){let S=b[x];++x,O.push(S.getAttribute("data-froomle-ordervalue"))}return{el:_,key:p,values:O,orderChildren:b,list_name:v}},r=new j,n=e.getRoot(),i=[],o=n.querySelectorAll("*"),a=0,y=o.length;for(;a<y;){let _=a++;i.push(o.item(_))}let d=i,c=[],g=0;for(;g<d.length;){let _=d[g];++g;let p=0,v=L.get_attributes(_);for(;p<v.length;){let b=v[p];++p,b.name.startsWith("data-froomle-order-")&&c.push(t(_,b.name.substring(19),b.value))}}if(c.length<1)return r.trigger(!1),r;let m=[],E=0;for(;E<c.length;){let _=c[E];++E;let p={list_name:_.list_name,limit:_.values.length,list_size:_.values.length},v={};I.setProperty(v,_.key,_.values),I.setProperty(p,"order",v),m.push(p)}return C.getRawRecommendations(m).then(function(_){let p=0,v=_.lists();for(;p<v.length;){let b=v[p],q=p++,O=b,x=c[q];x.el.setAttribute("data-froomle-request-id",_.request_id);let S=[],h=0,D=O.items;for(;h<D.length;){let _e=D[h];++h;let N=_e.get(x.key),U=0,X=x.values;for(;U<X.length;){let se=X[U],be=U++;if(N==se){S.push(x.orderChildren[be]);break}}}let R=0,M=S.length;for(;R<M;){let _e=R++,N=0,U=L.get_children(x.el);for(;N<U.length;){let X=U[N];if(++N,X.getAttribute("data-froomle-tmp-node")==""){L.replaceChild(x.el,S[_e],X);break}}}}r.trigger(!0)}),r}static domInit(e){K._orderElements(e).then(function(t){K._fillRecoTargets(e.getRoot())})}static fillElementRecos(e){K._fillRecoTargets(e)}static runFromHtml(e){if(e=="")return"";let t=te.fromHtml(e);return K.domInit(t),t.toString()}static get __name__(){return"internal.domHandler.DomDomDom"}get __class__(){return K}};var js=s.$global;var P=class P{static uri(){return"https://"+l.getRequestDomain()+"/api/"+l.getEnvironment()+"/events"}static generateBody(){let e=[];for(let t of P.impressionQueue){let r={event_type:"impression",page_type:l.getPageVisit(),action_item:t.getAttribute("data-froomle-id"),action_item_type:"article",channel:"www-desktop"};l.getUserId()?r.user_id=l.getUserId():r.device_id=l.getDeviceId();let n=t.getAttribute("data-froomle-reco");if(n){r.list_name=n;let i=t.getAttribute("data-froomle-request-id");if(!i)throw console.error("element need reco but doesnt have request id registered yet"),new Error("element need reco but doesnt have request id registered");r.request_id=i}}return P.impressionQueue=[],JSON.stringify({events:e})}static sendImpressions(){P.impressionQueue.length!==0&&fetch(P.uri(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:P.generateBody()})}static getViewPortRect(){let e=window.innerWidth||document.documentElement.clientWidth,t=window.innerHeight||document.documentElement.clientHeight;return{left:0,top:0,x:0,y:0,toJSON(){},right:e,bottom:t,width:e,height:t}}static intersectsWithViewPortRect(e){let t=e.getBoundingClientRect(),r=P.getViewPortRect();return t.right>r.left&&t.left<r.right&&t.bottom>r.top&&t.top<r.bottom}static addIntersectionImpressionListener(e){P.observer.observe(e)}static processDocument(){if(l.getDeviceId()!="no-consent"){for(let e of document.querySelectorAll("[data-froomle-id]"))P.intersectsWithViewPortRect(e)?P.impressionQueue.push(e):P.addIntersectionImpressionListener(e);P.sendImpressions()}}};P.impressionQueue=[],P.observer=new IntersectionObserver((e,t)=>{e.forEach(r=>{r.isIntersecting&&(P.impressionQueue.push(r.target),P.observer.unobserve(r.target))}),P.impressionQueue.length>0&&P.sendImpressions()});var re=P;var ce=class u{static uri(){return"https://"+l.getRequestDomain()+"/api/"+l.getEnvironment()+"/events"}static generateBody(){let e={event_type:"page_visit",page_type:l.getPageVisit(),channel:"www-desktop"};return l.getUserId()?e.user_id=l.getUserId():e.device_id=l.getDeviceId(),JSON.stringify(e)}static sendPageVisit(){l.getPageVisit()&&l.getDeviceId()!="no-consent"&&fetch(u.uri(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:u.generateBody()})}};var ge=class u{static uri(){return"https://"+l.getRequestDomain()+"/api/"+l.getEnvironment()+"/events"}static generateBody(){let e={event_type:"detail_pageview",page_type:"article_detail",action_item:l.getPageView(),action_item_type:"article",channel:"www-desktop"};return l.getUserId()?e.user_id=l.getUserId():e.device_id=l.getDeviceId(),JSON.stringify(e)}static sendPageView(){l.getPageView()&&l.getDeviceId()!="no-consent"&&fetch(u.uri(),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:u.generateBody()})}};var Ke=A.setEnvironment,Xe=A.setPageVisit,at=A.setConsent,ze=A.setUserId,Qe=A.setDeviceId,We=A.setRequestDomain,ut=A.setPageView;if(typeof document!="undefined"){let u=document.currentScript;if(u){let e=u.getAttribute("data-froomle-device-id"),t=u.getAttribute("data-froomle-user-id"),r=u.getAttribute("data-froomle-env"),n=u.getAttribute("data-froomle-page-visit"),i=u.getAttribute("data-froomle-request-domain"),o=u.getAttribute("data-froomle-page-view");Ke(r),o&&ut(o),n&&Xe(n),e&&Qe(e),t&&ze(t),i&&We(i)}else console.error("Froomle SDK: could not find the script tag where the sdk is included.");document.addEventListener("DOMContentLoaded",()=>{ue.domInit(te.fromDocument()),re.processDocument(),ce.sendPageVisit(),ge.sendPageView(),new MutationObserver(t=>{for(let r of t)if(r.type==="childList"&&re.processElement(r.target),r.type==="attributes")if(r.attributeName==="data-froomle-reco"){let n=r.target.getAttribute("data-froomle-request-id");(!n||n==="")&&ue.fillElementRecos(r.target)}else r.attributeName==="data-froomle-request-id"&&ue.fillElementRecos(r.target)}).observe(document,{childList:!0,subtree:!0})})}
|
package/dist/index.d.cts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
declare interface Recommendations {
|
|
2
|
-
request_id: string
|
|
3
|
-
user_group: string
|
|
4
|
-
user_id: string
|
|
5
|
-
device_id: string
|
|
6
|
-
lists(): RecommendationList[]
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare interface RecommendationList {
|
|
10
|
-
limit: number
|
|
11
|
-
list_key: string
|
|
12
|
-
list_name: string
|
|
13
|
-
list_size: number
|
|
14
|
-
items: RecommendationItem[]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
declare interface RecommendationItem {
|
|
18
|
-
get(key: string): any
|
|
19
|
-
Id: string
|
|
20
|
-
RequestId: string
|
|
21
|
-
UserGroup: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare class SimpleFuture<T> {
|
|
25
|
-
constructor()
|
|
26
|
-
protected _callback: (arg0: T) => void
|
|
27
|
-
protected _result: null | T
|
|
28
|
-
protected _isFinished: boolean
|
|
29
|
-
trigger(data: T): void
|
|
30
|
-
then(callback: ((arg0: T) => void)): void
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare class FroomleSdk {
|
|
34
|
-
protected static _env_set: boolean
|
|
35
|
-
protected static _page_visit_set: boolean
|
|
36
|
-
protected static _page_view_set: boolean
|
|
37
|
-
protected static registered: boolean
|
|
38
|
-
protected static register(): void
|
|
39
|
-
static buildScriptTag(): string
|
|
40
|
-
static setEnvironment(env: string): void
|
|
41
|
-
static setDeviceId(id: string): void
|
|
42
|
-
static setUserId(id: string): void
|
|
43
|
-
static setConsent(consent: number): void
|
|
44
|
-
static setPageView(page: string): void
|
|
45
|
-
static setPageVisit(page: string): void
|
|
46
|
-
static setRequestDomain(domain: string): void
|
|
47
|
-
static getRawRecommendations(lists: {
|
|
48
|
-
limit: number,
|
|
49
|
-
list_name: string,
|
|
50
|
-
list_size: number
|
|
51
|
-
}[]): SimpleFuture<Recommendations>
|
|
52
|
-
static getVersion(): string
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
declare const setPageVisit: typeof FroomleSdk.setPageVisit;
|
|
56
|
-
declare const setEnvironment: typeof FroomleSdk.setEnvironment;
|
|
57
|
-
declare const setConsent: typeof FroomleSdk.setConsent;
|
|
58
|
-
declare const setUserId: typeof FroomleSdk.setUserId;
|
|
59
|
-
declare const setDeviceId: typeof FroomleSdk.setDeviceId;
|
|
60
|
-
declare const setRequestDomain: typeof FroomleSdk.setRequestDomain;
|
|
61
|
-
|
|
62
|
-
export { type RecommendationItem, type RecommendationList, type Recommendations, setConsent, setDeviceId, setEnvironment, setPageVisit, setRequestDomain, setUserId };
|
package/dist/testing/testing.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";var he=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ge=Object.prototype.hasOwnProperty;var We=(f,e)=>{for(var t in e)he(f,t,{get:e[t],enumerable:!0})},Qe=(f,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ke(e))!Ge.call(f,n)&&n!==t&&he(f,n,{get:()=>e[n],enumerable:!(r=Je(e,n))||r.enumerable});return f};var Ye=f=>Qe(he({},"__esModule",{value:!0}),f);var pt={};We(pt,{DomDomDom:()=>je,FroomleDomTree:()=>ie,FroomleSdk:()=>L,RecoBackendV2:()=>i,RecommendationItem:()=>ee,RecommendationList:()=>Z,Recommendations:()=>Y,Version:()=>fe,_getAllItemsFromCache:()=>ut,_getRawRecommendationCache:()=>ct,_getRecoQueue:()=>at,_getRecommendedItemsCache:()=>_t,getFroomleEnvironment:()=>nt,getFroomleUserId:()=>rt,getRecommendationItem:()=>lt,getRecommendations:()=>ot,preloadRecommendations:()=>it,reset:()=>gt,setFroomleEnvironment:()=>st,setFroomleUserId:()=>tt,weirdReco:()=>mt});module.exports=Ye(pt);var s=class f{static global(e){return f.globals[e]?f.globals[e]:f.globals[e]={}}static createStatic(e,t,r){let n=null;Object.defineProperty(e,t,{enumerable:!0,get:function(){return r!=null&&(n=r(),r=null),n},set:function(l){r!=null&&(n=r(),r=null),n=l}})}static iterator(e){if(Array.isArray(e)){let t=e;return function(){return f.mkIter(t)}}else return typeof e.iterator=="function"?e.iterator.bind(e):e.iterator}static getIterator(e){return Array.isArray(e)?f.mkIter(e):e.iterator()}static mkIter(e){return new de(e)}static extend(e){function t(){this[f.new].apply(this,arguments)}return Object.setPrototypeOf(t.prototype,e.prototype),t}static inherits(e,t){t==null&&(t=!1);function r(){t&&e&&r[f.init]&&r[f.init](),this[f.new].apply(this,arguments)}return t?r[f.init]=()=>{let n=e();n[f.init]&&n[f.init](),Object.setPrototypeOf(r.prototype,n.prototype),r[f.init]=void 0}:e&&e[f.init]?(t=!0,r[f.init]=()=>{e[f.init]&&e[f.init](),Object.setPrototypeOf(r.prototype,e.prototype),r[f.init]=void 0}):e&&Object.setPrototypeOf(r.prototype,e.prototype),r}static bind(e,t){if(t==null)return null;t.__id__==null&&(t.__id__=f.fid++);let r=null;return e.hx__closures__==null?e.hx__closures__={}:r=e.hx__closures__[t.__id__],r==null&&(r=t.bind(e),e.hx__closures__[t.__id__]=r),r}static get __name__(){return"genes.Register"}get __class__(){return f}};s.$global=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:void 0;s.globals={};s.new=Symbol();s.init=Symbol();s.fid=0;var de=s.global("$hxClasses")["genes._Register.ArrayIterator"]=class Ee extends s.inherits(){[s.new](e){this.current=0,this.array=e}hasNext(){return this.current<this.array.length}next(){return this.array[this.current++]}static get __name__(){return"genes._Register.ArrayIterator"}get __class__(){return Ee}};de.prototype.array=null;de.prototype.current=null;var xt=s.$global,fe=s.global("$hxClasses").Version=class Ce{static get __name__(){return"Version"}get __class__(){return Ce}};fe.CURRENT="0.0.9";var wt=s.$global,Y=function(){};Y.__isInterface__=!0;var Z=function(){};Z.__isInterface__=!0;var ee=function(){};ee.__isInterface__=!0;var Et=s.$global,ae=s.global("$hxClasses")["haxe.ValueException"]=class $e extends s.inherits(()=>$,!0){[s.new](e,t,r){super[s.new](String(e),t,r),this.value=e}unwrap(){return this.value}static get __name__(){return"haxe.ValueException"}static get __super__(){return $}get __class__(){return $e}};ae.prototype.value=null;var Dt=s.$global,$=s.global("$hxClasses")["haxe.Exception"]=class te extends s.inherits(()=>Error,!0){[s.new](e,t,r){Error.call(this,e),this.message=e,this.__previousException=t,this.__nativeException=r!=null?r:this}unwrap(){return this.__nativeException}get_native(){return this.__nativeException}static caught(e){return e instanceof te?e:e instanceof Error?new te(e.message,null,e):new ae(e,null,e)}static thrown(e){return e instanceof te?e.get_native():e instanceof Error?e:new ae(e)}static get __name__(){return"haxe.Exception"}static get __super__(){return Error}get __class__(){return te}};$.prototype.native=null;$.prototype.__skipStack=null;$.prototype.__nativeException=null;$.prototype.__previousException=null;var Bt=s.$global,xe=s.global("$hxClasses")["js.Browser"]=class ke{static get supported(){return this.get_supported()}static get_supported(){return typeof window!="undefined"&&typeof window.location!="undefined"?typeof window.location.protocol=="string":!1}static createXMLHttpRequest(){if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")return new"ActiveXObject"("Microsoft.XMLHTTP");throw $.thrown("Unable to create XMLHttpRequest object.")}static get __name__(){return"js.Browser"}get __class__(){return ke}};var Ft=s.$global,A=s.global("$hxEnums")["haxe.io.Error"]={__ename__:"haxe.io.Error",Blocked:{_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error"},Overflow:{_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error"},OutsideBounds:{_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error"},Custom:Object.assign(f=>({_hx_index:3,__enum__:"haxe.io.Error",e:f}),{_hx_name:"Custom",__params__:["e"]})};A.__constructs__=[A.Blocked,A.Overflow,A.OutsideBounds,A.Custom];A.__empty_constructs__=[A.Blocked,A.Overflow,A.OutsideBounds];var Tt=s.$global,H=s.global("$hxEnums")["haxe.io.Encoding"]={__ename__:"haxe.io.Encoding",UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding"},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding"}};H.__constructs__=[H.UTF8,H.RawNative];H.__empty_constructs__=[H.UTF8,H.RawNative];var Xt=s.$global,J=s.global("$hxClasses")["haxe.io.Bytes"]=class ye extends s.inherits(){[s.new](e){this.length=e.byteLength,this.b=new Uint8Array(e),this.b.bufferValue=e,e.hxBytes=this,e.bytes=this.b}getString(e,t,r){if(e<0||t<0||e+t>this.length)throw $.thrown(A.OutsideBounds);r==null&&(r=H.UTF8);let n="",l=this.b,a=e,o=e+t;switch(r._hx_index){case 0:let x=e>0;for(;a<o;){let p=l[a++];if(p<128){if(p==0)break;n+=String.fromCodePoint(p)}else if(p<224){let u=(p&63)<<6|l[a++]&127;n+=String.fromCodePoint(u)}else if(p<240){let u=l[a++],_=(p&31)<<12|(u&127)<<6|l[a++]&127;n+=String.fromCodePoint(_)}else{let u=l[a++],_=l[a++],g=(p&15)<<18|(u&127)<<12|(_&127)<<6|l[a++]&127;n+=String.fromCodePoint(g)}}break;case 1:for(;a<o;){let p=l[a++]|l[a++]<<8;n+=String.fromCodePoint(p)}break}return n}static ofData(e){let t=e.hxBytes;return t!=null?t:new ye(e)}static get __name__(){return"haxe.io.Bytes"}get __class__(){return ye}};J.prototype.length=null;J.prototype.b=null;var Gt=s.$global,F=s.global("$hxClasses")["haxe.http.HttpBase"]=class De extends s.inherits(){[s.new](e){this.url=e,this.headers=[],this.params=[],this.emptyOnData=s.bind(this,this.onData)}get responseData(){return this.get_responseData()}setHeader(e,t){let r=0,n=this.headers.length;for(;r<n;){let l=r++;if(this.headers[l].name==e){this.headers[l]={name:e,value:t};return}}this.headers.push({name:e,value:t})}setPostData(e){this.postData=e,this.postBytes=null}onData(e){}onBytes(e){}onError(e){}onStatus(e){}hasOnData(){return s.bind(this,this.onData)!=this.emptyOnData}success(e){this.responseBytes=e,this.responseAsString=null,this.hasOnData()&&this.onData(this.get_responseData()),this.onBytes(this.responseBytes)}get_responseData(){return this.responseAsString==null&&this.responseBytes!=null&&(this.responseAsString=this.responseBytes.getString(0,this.responseBytes.length,H.UTF8)),this.responseAsString}static get __name__(){return"haxe.http.HttpBase"}get __class__(){return De}};F.prototype.url=null;F.prototype.responseBytes=null;F.prototype.responseAsString=null;F.prototype.postData=null;F.prototype.postBytes=null;F.prototype.headers=null;F.prototype.params=null;F.prototype.emptyOnData=null;var Yt=s.$global,ue=s.global("$hxClasses")["haxe.iterators.MapKeyValueIterator"]=class Se extends s.inherits(){[s.new](e){this.map=e,this.keys=e.keys()}hasNext(){return this.keys.hasNext()}next(){let e=this.keys.next();return{value:this.map.get(e),key:e}}static get __name__(){return"haxe.iterators.MapKeyValueIterator"}get __class__(){return Se}};ue.prototype.map=null;ue.prototype.keys=null;var tr=s.$global,be=function(){};be.__isInterface__=!0;var nr=s.$global,we=s.global("$hxClasses")["js.Boot"]=class re{static __string_rec(e,t){if(e==null)return"null";if(t.length>=5)return"<...>";let r=typeof e;switch(r=="function"&&(e.__name__||e.__ename__)&&(r="object"),r){case"function":return"<function>";case"object":if(e.__enum__){let p=s.global("$hxEnums")[e.__enum__].__constructs__[e._hx_index],u=p._hx_name;return p.__params__?(t=t+" ",u+"("+(function(_){var g;let E=[];{let c=0,m=p.__params__;for(;c<m.length;){let R=m[c];c=c+1,E.push(re.__string_rec(e[R],t))}}return g=E,g})(this).join(",")+")"):u}if(e instanceof Array){let x="[";t+=" ";let p=0,u=e.length;for(;p<u;){let _=p++;x+=(_>0?",":"")+re.__string_rec(e[_],t)}return x+="]",x}let n;try{n=e.toString}catch{return"???"}if(n!=null&&n!=Object.toString&&typeof n=="function"){let x=e.toString();if(x!="[object Object]")return x}let l=`{
|
|
2
|
-
`;t+=" ";let a=e.hasOwnProperty!=null,o=null;for(o in e)a&&!e.hasOwnProperty(o)||o=="prototype"||o=="__class__"||o=="__super__"||o=="__interfaces__"||o=="__properties__"||(l.length!=2&&(l+=`,
|
|
3
|
-
`),l+=t+o+" : "+re.__string_rec(e[o],t));return t=t.substring(1),l+=`
|
|
4
|
-
`+t+"}",l;break;case"string":return e;default:return String(e)}}static get __name__(){return"js.Boot"}get __class__(){return re}};we.__toStr={}.toString;var ar=s.$global,S=s.global("$hxClasses").Std=class Pe{static string(e){return we.__string_rec(e,"")}static parseInt(e){let t=parseInt(e);return isNaN(t)?null:t}static get __name__(){return"Std"}get __class__(){return Pe}};String.__name__=!0,Array.__name__=!0;var gr=s.$global,_e=s.global("$hxClasses")["genes.util.EsMap"]=class se extends s.inherits(){[s.new](){this.inst=new Map}set(e,t){this.inst.set(e,t)}get(e){return this.inst.get(e)}remove(e){return this.inst.delete(e)}exists(e){return this.inst.has(e)}keys(){return se.adaptIterator(this.inst.keys())}iterator(){return se.adaptIterator(this.inst.values())}toString(){let e=[],t=se.adaptIterator(this.inst.keys());for(;t.hasNext();){let r=t.next();e.push(""+S.string(r)+" => "+S.string(this.inst.get(r)))}return"{"+e.join(", ")+"}"}clear(){this.inst.clear()}static adaptIterator(e){let t,r,n=function(){let l=e.next();t=l.value,r=l.done};return{hasNext:function(){return r==null&&n(),!r},next:function(){r==null&&n();let l=t;return n(),l}}}static get __name__(){return"genes.util.EsMap"}get __class__(){return se}};_e.prototype.inst=null;var xr=s.$global,qe=s.global("$hxClasses")["haxe.ds.StringMap"]=class Re extends s.inherits(_e){[s.new](){super[s.new]()}copy(){let e=new Re;return e.inst=new Map(this.inst),e}keyValueIterator(){return new ue(this)}static get __name__(){return"haxe.ds.StringMap"}static get __interfaces__(){return[be]}static get __super__(){return _e}get __class__(){return Re}};var wr=s.$global,q=s.global("$hxClasses").HxOverrides=class Be{static cca(e,t){let r=e.charCodeAt(t);if(r==r)return r}static substr(e,t,r){if(r==null)r=e.length;else if(r<0)if(t==0)r=e.length+r;else return"";return e.substr(t,r)}static now(){return Date.now()}static get __name__(){return"HxOverrides"}get __class__(){return Be}};typeof performance!="undefined"&&typeof performance.now=="function"&&(q.now=performance.now.bind(performance));var Er=s.$global,M=s.global("$hxClasses").StringTools=class ce{static isSpace(e,t){let r=q.cca(e,t);return r>8&&r<14?!0:r==32}static ltrim(e){let t=e.length,r=0;for(;r<t&&ce.isSpace(e,r);)++r;return r>0?q.substr(e,r,t-r):e}static rtrim(e){let t=e.length,r=0;for(;r<t&&ce.isSpace(e,t-r-1);)++r;return r>0?q.substr(e,0,t-r):e}static replace(e,t,r){return e.split(t).join(r)}static get __name__(){return"StringTools"}get __class__(){return ce}};var kr=s.$global,Ve=s.global("$hxClasses").Lambda=class Ae{static exists(e,t){let r=s.getIterator(e);for(;r.hasNext();){let n=r.next();if(t(n))return!0}return!1}static get __name__(){return"Lambda"}get __class__(){return Ae}};var Vr=s.$global,ne=s.global("$hxClasses").EReg=class Fe extends s.inherits(){[s.new](e,t){this.r=new RegExp(e,t.split("u").join(""))}match(e){return this.r.global&&(this.r.lastIndex=0),this.r.m=this.r.exec(e),this.r.s=e,this.r.m!=null}matched(e){if(this.r.m!=null&&e>=0&&e<this.r.m.length)return this.r.m[e];throw $.thrown("EReg::matched")}matchedPos(){if(this.r.m==null)throw $.thrown("No string matched");return{pos:this.r.m.index,len:this.r.m[0].length}}matchSub(e,t,r){if(r==null&&(r=-1),this.r.global){this.r.lastIndex=t,this.r.m=this.r.exec(r<0?e:q.substr(e,0,t+r));let n=this.r.m!=null;return n&&(this.r.s=e),n}else{let n=this.match(r<0?q.substr(e,t,null):q.substr(e,t,r));return n&&(this.r.s=e,this.r.m.index+=t),n}}map(e,t){let r=0,n="";do{if(r>=e.length)break;if(!this.matchSub(e,r)){n+=S.string(q.substr(e,r,null));break}let l=this.matchedPos();n+=S.string(q.substr(e,r,l.pos-r)),n+=S.string(t(this)),l.len==0?(n+=S.string(q.substr(e,l.pos,1)),r=l.pos+1):r=l.pos+l.len}while(this.r.global);return!this.r.global&&r>0&&r<e.length&&(n+=S.string(q.substr(e,r,null))),n}static get __name__(){return"EReg"}get __class__(){return Fe}};ne.prototype.r=null;var zr=s.$global,K=s.global("$hxClasses")["haxe.http.HttpJs"]=class He extends s.inherits(F){[s.new](e){this.async=!0,this.withCredentials=!1,super[s.new](e)}request(e){this.responseAsString=null,this.responseBytes=null,this.responseHeaders=null;let t=this.req=xe.createXMLHttpRequest(),r=this,n=function(u){if(t.readyState!=4)return;let _;try{_=t.status}catch{_=null}if(_==0&&xe.get_supported()&&s.$global.location!=null){let g=s.$global.location.protocol.toLowerCase();new ne("^(?:about|app|app-storage|.+-extension|file|res|widget):$","").match(g)&&(_=t.response!=null?200:404)}if(_==null&&(_=null),_!=null&&r.onStatus(_),_!=null&&_>=200&&_<400){r.req=null;let g=t.getAllResponseHeaders().split(`\r
|
|
5
|
-
`),E=[],c=0,m=g;for(;c<m.length;){let b=m[c];++c,b!=""&&E.push(b)}g=E;let R=new qe;r.responseHeaders=R;let y=0;for(;y<g.length;){let b=g[y];++y;let P=b.split(": "),V=P.shift(),w=P.length==1?P[0]:P.join(": ");w=M.ltrim(M.rtrim(w)),r.responseHeaders.inst.set(V,w)}r.success(J.ofData(t.response))}else if(_==null||_==0&&t.response==null)r.req=null,r.onError("Failed to connect or resolve host");else if(_==null){r.req=null;let g=t.response!=null?J.ofData(t.response):null;r.responseBytes=g,r.onError("Http Error #"+t.status)}else switch(_){case 12007:r.req=null,r.onError("Unknown host");break;case 12029:r.req=null,r.onError("Failed to connect to host");break;default:r.req=null;let g=t.response!=null?J.ofData(t.response):null;r.responseBytes=g,r.onError("Http Error #"+t.status)}};this.async&&(t.onreadystatechange=n);let l,a=this.postData,o=this.postBytes;if(a==null)if(o==null)l=null;else{let u=o;l=new Blob([u.b.bufferValue])}else o==null?l=a:l=null;if(l!=null)e=!0;else{let u=0,_=this.params;for(;u<_.length;){let g=_[u];++u,l==null?l="":l=(l==null?"null":S.string(l))+"&";let E=g.name,c=(l==null?"null":S.string(l))+encodeURIComponent(E)+"=",m=g.value;l=c+encodeURIComponent(m)}}try{if(e)t.open("POST",this.url,this.async);else if(l!=null){let u=this.url.split("?").length<=1;t.open("GET",this.url+(u?"?":"&")+(l==null?"null":S.string(l)),this.async),l=null}else t.open("GET",this.url,this.async);t.responseType="arraybuffer"}catch(u){let _=$.caught(u).unwrap();this.req=null,this.onError(_.toString());return}t.withCredentials=this.withCredentials,!Ve.exists(this.headers,function(u){return u.name=="Content-Type"})&&e&&this.postData==null&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");let x=0,p=this.headers;for(;x<p.length;){let u=p[x];++x,t.setRequestHeader(u.name,u.value)}t.send(l),this.async||n(null)}static get __name__(){return"haxe.http.HttpJs"}static get __super__(){return F}get __class__(){return He}};K.prototype.async=null;K.prototype.withCredentials=null;K.prototype.responseHeaders=null;K.prototype.req=null;var Gr=s.$global,U=s.global("$hxClasses").SimpleFuture=class Oe extends s.inherits(){[s.new](){this._isFinished=!1}trigger(e){this._result=e,this._isFinished=!0,this._callback!=null&&this._callback(this._result)}then(e){this._callback=e,this._isFinished&&e(this._result)}static get __name__(){return"SimpleFuture"}get __class__(){return Oe}};U.prototype._callback=null;U.prototype._result=null;U.prototype._isFinished=null;var Yr=s.$global,I=s.global("$hxClasses").Reflect=class Te{static field(e,t){try{return e[t]}catch{return null}}static getProperty(e,t){let r;if(e==null)return null;{let n;return e.__properties__?(r=e.__properties__["get_"+t],n=r):n=!1,n?e[r]():e[t]}}static setProperty(e,t,r){let n,l;e.__properties__?(n=e.__properties__["set_"+t],l=n):l=!1,l?e[n](r):e[t]=r}static fields(e){let t=[];if(e!=null){let n=Object.prototype.hasOwnProperty;for(var r in e)r!="__id__"&&r!="hx__closures__"&&n.call(e,r)&&t.push(r)}return t}static get __name__(){return"Reflect"}get __class__(){return Te}};var os=s.$global,i=s.global("$hxClasses")["internal.RecoBackendV2"]=class d extends s.inherits(){[s.new](){}static _requestUri(){return"https://"+d._req_domain+"/api/"+d._environment+"/recommendations/requests"}static noConsentBody(){return{device_id:"no-consent",user_group:"no-consent",version:"no-consent"}}static buildRequestBody(e){let t={lists:e,page_type:d._page_visit!=null?d._page_visit:d._page_view,channel:"www-desktop"};if(d._consent==0){let r=d.noConsentBody(),n=0,l=I.fields(r);for(;n<l.length;){let a=l[n];++n,t[a]=I.field(r,a)}}else d._user_id!=null?t.user_id=d._user_id:t.device_id=d._device_id;return t}static _requestRecos(e){let t=new U,r=null,n=new K(d._requestUri());n.setHeader("Content-Type","application/json"),n.setPostData(JSON.stringify(d.buildRequestBody(e))),n.onError=function(o){throw $.thrown("HTTP Request Error: "+o)},n.onStatus=function(o){if(o<200||o>=300)throw $.thrown("HTTP Status Error: "+o)};try{n.request(!1)}catch(o){let x=$.caught(o).unwrap();throw $.thrown("Failed to execute synchronous request: "+S.string(x))}let l=function(o){let x=JSON.parse(o),p=G.fromRequestData(x);t.trigger(p)},a=n.get_responseData();return a!=null?l(a):n.onData=l,t}static getRawRecommendations(e){return d._requestRecos(e)}static setConsent(e){e>2&&(e=2),d._consent=e}static setChannel(e){d._channel=e}static setPageVisit(e){d._page_visit=e}static setEnvironment(e){d._environment=e}static setDeviceId(e){d._device_id=e}static setUserId(e){d._user_id=e}static setRequestDomain(e){d._req_domain=e}static setPageView(e){d._page_view=e}static getRequestDomain(){return d._req_domain}static getEnvironment(){return d._environment}static getPageVisit(){return d._page_visit}static getUserId(){return d._user_id}static getDeviceId(){return d._device_id}static getPageView(){return d._page_view}static getConsent(){return d._consent}static getChannel(){return d._channel}static get __name__(){return"internal.RecoBackendV2"}get __class__(){return d}};i._environment=null;i._device_id="no-consent";i._user_id=null;i._consent=0;i._req_domain="europe-west1.froomle.com";i._page_visit=null;i._page_view=null;i._channel="www-desktop";var Ze=function(){};Ze.__isInterface__=!0;var et=function(){};et.__isInterface__=!0;var G=s.global("$hxClasses")["internal._RecommendationsInternal"]=class ve extends s.inherits(){[s.new](e,t,r,n,l){this.request_id=t,this.user_group=r,this.device_id=e,this.user_id=n,this._lists=l}items(){let e=[],t=0,r=this._lists;for(;t<r.length;){let n=r[t];++t;let l=0,a=n.items;for(;l<a.length;){let o=a[l];++l,e.push(o)}}return e}lists(){return this._lists}getItemsByListName(e){let t=0,r=this._lists;for(;t<r.length;){let n=r[t];if(++t,n.list_name==e)return n}return null}static fromRequestData(e){let t=I.getProperty(e,"lists"),r=[],n=0;for(;n<t.length;){let l=t[n];++n;let a=I.getProperty(l,"items"),o=[],x=0;for(;x<a.length;){let u=a[x];++x,o.push(new le(u))}let p=new W({limit:I.getProperty(l,"limit"),list_key:I.getProperty(l,"list_key"),list_name:I.getProperty(l,"list_name"),list_size:I.getProperty(l,"list_size"),items:o});r.push(p)}return new ve(I.getProperty(e,"device_id"),I.getProperty(e,"request_id"),I.getProperty(e,"user_group"),I.getProperty(e,"user_id"),r)}static get __name__(){return"internal._RecommendationsInternal"}static get __interfaces__(){return[Y]}get __class__(){return ve}};G.prototype.request_id=null;G.prototype.user_group=null;G.prototype.user_id=null;G.prototype.device_id=null;G.prototype._lists=null;var W=s.global("$hxClasses")["internal._RecommendationsListInternal"]=class Ue extends s.inherits(){[s.new](e){this.items=e.items,this.limit=e.limit,this.list_key=e.list_key,this.list_name=e.list_name,this.list_size=e.list_size}static get __name__(){return"internal._RecommendationsListInternal"}static get __interfaces__(){return[Z]}get __class__(){return Ue}};W.prototype.limit=null;W.prototype.list_key=null;W.prototype.list_name=null;W.prototype.list_size=null;W.prototype.items=null;var le=s.global("$hxClasses")["internal._RecommendationItemInternal"]=class Le extends s.inherits(){[s.new](e){this._data={},this.Id=I.getProperty(e,"item_id"),this.RequestId=I.getProperty(e,"request_id"),this.UserGroup=I.getProperty(e,"user_group");let t=0,r=I.fields(e);for(;t<r.length;){let n=r[t];++t,this._data[n]=I.field(e,n)}}get(e){return this._data[e]}static get __name__(){return"internal._RecommendationItemInternal"}static get __interfaces__(){return[ee]}get __class__(){return Le}};le.prototype.Id=null;le.prototype.RequestId=null;le.prototype.UserGroup=null;le.prototype._data=null;var k=s.global("$hxClasses")["internal._RecoBackendV2.RecoBackendV2_Fields_"]=class Ne{static getRawRecommendations(e){return i.getRawRecommendations(e)}static setConsent(e){i.setConsent(e)}static setPageVisit(e){i.setPageVisit(e)}static setEnvironment(e){i.setEnvironment(e)}static setDeviceId(e){i.setDeviceId(e)}static setUserId(e){i.setUserId(e)}static setRequestDomain(e){i.setRequestDomain(e)}static setPageView(e){i.setPageView(e)}static setChannel(e){i.setChannel(e)}static getRequestDomain(){i.getRequestDomain()}static getConsent(){i.getConsent()}static getPageVisit(){i.getPageVisit()}static getEnvironment(){i.getEnvironment()}static getDeviceId(){i.getDeviceId()}static getUserId(){i.getUserId()}static getPageView(){i.getPageView()}static getChannel(){i.getChannel()}static get __name__(){return"internal._RecoBackendV2.RecoBackendV2_Fields_"}get __class__(){return Ne}},as=k.getRawRecommendations,us=k.setConsent,_s=k.setPageVisit,cs=k.setEnvironment,gs=k.setDeviceId,ms=k.setUserId,ps=k.setRequestDomain,hs=k.setPageView,ds=k.setChannel,fs=k.getRequestDomain,xs=k.getConsent,ys=k.getPageVisit,bs=k.getEnvironment,ws=k.getDeviceId,Rs=k.getUserId,vs=k.getPageView,Is=k.getChannel;var ks=s.$global,L=s.global("$hxClasses").FroomleSdk=class B{static register(){B.registered||B._env_set&&(!B._page_visit_set&&!B._page_view_set||(B.registered=!0))}static buildScriptTag(){let e='<script src="https://cdn.froomle.com/reco-backend-v2/0.0.9/reco-backend-v2.min.js" data-froomle-env="'+i.getEnvironment()+'" ';return i.getPageVisit()!=null&&(e+='data-froomle-page-visit="'+i.getPageVisit()+'" '),i.getPageView()!=null&&(e+='data-froomle-page-view="'+i.getPageView()+'" '),i.getDeviceId()!=null&&(e+='data-froomle-device-id="'+i.getDeviceId()+'" '),i.getUserId()!=null&&(e+='data-froomle-user-id="'+i.getUserId()+'" '),i.getConsent()>0&&(e+='data-froomle-consent="'+i.getConsent()+'" '),i.getRequestDomain()!=null&&(e+='data-froomle-request-domain="'+i.getRequestDomain()+'" '),e+="><\/script>",e}static setEnvironment(e){i.setEnvironment(e),B._env_set=!0,B.register()}static setDeviceId(e){i.setDeviceId(e)}static setUserId(e){i.setUserId(e)}static setConsent(e){i.setConsent(e)}static setPageView(e){i.setPageView(e),B._page_view_set=!0,B.register()}static setPageVisit(e){i.setPageVisit(e),B._page_visit_set=!0,B.register()}static setRequestDomain(e){i.setRequestDomain(e)}static getRawRecommendations(e){return i.getRawRecommendations(e)}static getVersion(){return"0.0.9"}static get __name__(){return"FroomleSdk"}get __class__(){return B}};L._env_set=!1;L._page_visit_set=!1;L._page_view_set=!1;L.registered=!1;var Ps=s.$global,ie=s.global("$hxClasses")["internal.domHandler.FroomleDomTree"]=class ge extends s.inherits(){[s.new](){}createElement(e){return window.document.createElement(e)}querySelectorAll(e){let t=this.root,r=[],n=t.querySelectorAll(e),l=0,a=n.length;for(;l<a;){let o=l++;r.push(n.item(o))}return r}getRoot(){return this.root}toString(){return this.root.outerHTML}static run(){}static fromHtml(e){return new ge}static fromDocument(){let e=new ge;return e.root=window.document,e}static get __name__(){return"internal.domHandler.FroomleDomTree"}get __class__(){return ge}};ie.prototype.root=null;var Vs=s.$global,O=s.global("$hxClasses")["internal._ADomNode.ADomNode"]=class Ie{static _new(e){return e}static fromElement(e){return e}static create(e,t){return window.document.createElement(t)}static replaceChild(e,t,r){e.replaceChild(t,r)}static get attributes(){return this.get_attributes()}static get_attributes(e){let t=e,r=[],n=0,l=t.attributes.length;for(;n<l;){let a=n++,o=t.attributes.item(a);r.push({name:o.name,value:o.value})}return r}static addChild(e,t){e.appendChild(t)}static removeChild(e,t){e.removeChild(t)}static getAttribute(e,t){return e.getAttribute(t)}static setAttribute(e,t,r){e.setAttribute(t,r)}static getText(e){return e.textContent}static setText(e,t){e.textContent=t}static get children(){return this.get_children()}static get_children(e){let t=[],n=e.children,l=0,a=n.length;for(;l<a;){let o=l++;t.push(n[o])}return t}static querySelectorAll(e,t){let r=e,n=[],l=r.querySelectorAll(t),a=0,o=l.length;for(;a<o;){let x=a++;n.push(l.item(x))}return n}static getFilterKeyValue(e){let t=0,r=Ie.get_attributes(e);for(;t<r.length;){let n=r[t];if(++t,n.name.startsWith("data-froomle-reco-filter-"))return{key:n.name.substring(25),value:n.value}}return{key:null,value:null}}static get __name__(){return"internal._ADomNode.ADomNode_Impl_"}get __class__(){return Ie}};var zs=s.$global,je=s.global("$hxClasses")["internal.domHandler.DomDomDom"]=class X extends s.inherits(){[s.new](){}static _fillRecoTargets(e){let t=new U;if(e==null)return t.trigger(!1),t;let r=[],n=e,l=[],a=n.querySelectorAll("*"),o=0,x=a.length;for(;o<x;){let h=o++;l.push(a.item(h))}let p=l,u=0;for(;u<p.length;){let h=p[u];++u;let C=0,v=O.get_attributes(h);for(;C<v.length;){let j=v[C];++C,j.name=="data-froomle-reco"&&r.push(h)}}let _=[],g=0;for(;g<r.length;){let h=r[g];++g,h.getAttribute("data-froomle-request-id")==null&&(h.getAttribute("data-froomle-id")==null||h.getAttribute("data-froomle-id")=="")&&_.push(h)}if(_.length<1)return new U;let E=[],c=[],m="",R="",y="",b=[],P=function(){let h={list_name:m,list_size:b.length,limit:b.length};R!=null&&I.setProperty(h,R,y),E.push(h),c.push(b)},V=function(h,C,v,j){m=h,R=C,y=v,b=[j]},w=0;for(;w<_.length;){let h=_[w];++w;let C=h.getAttribute("data-froomle-reco"),v=O.getFilterKeyValue(h);if(m==""){V(C,v.key,v.value,h);continue}else if(C==m&&v.key==R&&v.value==y){b.push(h);continue}else{P(),V(C,v.key,v.value,h);continue}}return m!=""&&P(),k.getRawRecommendations(E).then(function(h){let C=0,v=h.lists();for(;C<v.length;){let j=v[C],N=C++,T=j,z=T.items.length!=c[N].length,Q=0,me=T.items;for(;Q<me.length;){let pe=me[Q],Xe=Q++,ze=pe;X._fillParameters(c[N][Xe],ze,h.request_id)}}t.trigger(!0)}),t}static _fillParameters(e,t,r){let n=function(g,E,c,m){m==null&&(m="");let R=function(y,b,P){P==null&&(P="fgh");try{b=new ne("\\\\[(\\\\w+)\\\\]","g").map(b,function(v){return"."+v.matched(1)}),b=M.replace(b,"[","."),b=M.replace(b,"]",""),q.cca(b,0)==46&&(b=q.substr(b,1,null));let w=b.split("."),D=y.get(w[0]),h=1,C=w.length;for(;h<C;){let v=h++;if(D==null)return null;D instanceof Array&&S.parseInt(w[v])!=null?D=D[S.parseInt(w[v])]:D=I.field(D,w[v])}return D}catch{return P}};try{let y=R(t,c,m);E=="inner"?g.textContent=y:g.setAttribute(E,y)}catch{}};e.setAttribute("data-froomle-id",t.Id),e.setAttribute("data-froomle-request-id",r);let l=e,a=[],o=l.querySelectorAll("*"),x=0,p=o.length;for(;x<p;){let g=x++;a.push(o.item(g))}let u=a,_=0;for(;_<u.length;){let g=u[_];++_;let E=0,c=O.get_attributes(g);for(;E<c.length;){let m=c[E];if(++E,m.name.startsWith("data-froomle-param-")){let R=M.replace(m.name,"data-froomle-param-",""),y=m.value;n(g,R,y)}}}}static _orderElements(e){let t=function(c,m,R){let y=[],b=O.get_children(c),P=0;for(;P<b.length;){let D=b[P];if(++P,D.getAttribute("data-froomle-ordervalue")!=null){y.push(D);let C=O.create(e,"span");C.setAttribute("data-froomle-tmp-node",""),O.replaceChild(c,C,D)}}let V=[],w=0;for(;w<y.length;){let D=y[w];++w,V.push(D.getAttribute("data-froomle-ordervalue"))}return{el:c,key:m,values:V,orderChildren:y,list_name:R}},r=new U,n=e.getRoot(),l=[],a=n.querySelectorAll("*"),o=0,x=a.length;for(;o<x;){let c=o++;l.push(a.item(c))}let p=l,u=[],_=0;for(;_<p.length;){let c=p[_];++_;let m=0,R=O.get_attributes(c);for(;m<R.length;){let y=R[m];++m,y.name.startsWith("data-froomle-order-")&&u.push(t(c,y.name.substring(19),y.value))}}if(u.length<1)return r.trigger(!1),r;let g=[],E=0;for(;E<u.length;){let c=u[E];++E;let m={list_name:c.list_name,limit:c.values.length,list_size:c.values.length},R={};I.setProperty(R,c.key,c.values),I.setProperty(m,"order",R),g.push(m)}return k.getRawRecommendations(g).then(function(c){let m=0,R=c.lists();for(;m<R.length;){let y=R[m],P=m++,V=y,w=u[P];w.el.setAttribute("data-froomle-request-id",c.request_id);let D=[],h=0,C=V.items;for(;h<C.length;){let oe=C[h];++h;let N=oe.get(w.key),T=0,z=w.values;for(;T<z.length;){let Q=z[T],pe=T++;if(N==Q){D.push(w.orderChildren[pe]);break}}}let v=0,j=D.length;for(;v<j;){let oe=v++,N=0,T=O.get_children(w.el);for(;N<T.length;){let z=T[N];if(++N,z.getAttribute("data-froomle-tmp-node")==""){O.replaceChild(w.el,D[oe],z);break}}}}r.trigger(!0)}),r}static domInit(e){X._orderElements(e).then(function(t){X._fillRecoTargets(e.getRoot())})}static fillElementRecos(e){X._fillRecoTargets(e)}static runFromHtml(e){if(e=="")return"";let t=ie.fromHtml(e);return X.domInit(t),t.toString()}static get __name__(){return"internal.domHandler.DomDomDom"}get __class__(){return X}};var Gs=s.$global;var tt=L.setUserId,rt=i.getUserId,st=L.setEnvironment,nt=i.getEnvironment,lt=async()=>{throw new Error("Not implemented in V2")},it=async()=>{console.warn("preloadRecommendations not implemented")},ot=async()=>[],at=()=>[],ut=()=>[],_t=()=>[],ct=()=>[],gt=async()=>{},mt=()=>{};
|
|
6
|
-
//# sourceMappingURL=testing.cjs.map
|