@picked/client 0.0.1-dev.1773878362211 → 0.0.1-dev.1774231221701

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.
Files changed (74) hide show
  1. package/dist/api-BEXzPJHZ.cjs +1 -0
  2. package/dist/api-oudcFuUX.js +37 -0
  3. package/dist/cjs/form/index.js +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/plugins/create-experience/index.js +1 -1
  6. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  7. package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
  8. package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
  9. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  10. package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
  11. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  12. package/dist/cjs/plugins/web-components/index.js +1 -1
  13. package/dist/cjs/plugins/window-object/index.js +1 -1
  14. package/dist/cjs/server/index.js +1 -1
  15. package/dist/esm/form/index.js +416 -381
  16. package/dist/esm/index.js +1138 -1204
  17. package/dist/esm/plugins/create-experience/index.js +461 -434
  18. package/dist/esm/plugins/dynamic-experiences/index.js +106 -123
  19. package/dist/esm/plugins/experience-browser-storage/index.js +32 -37
  20. package/dist/esm/plugins/history-browser-storage/index.js +23 -25
  21. package/dist/esm/plugins/responses-browser-storage/index.js +36 -39
  22. package/dist/esm/plugins/responses-indexeddb/index.js +77 -85
  23. package/dist/esm/plugins/single-page-app/index.js +31 -35
  24. package/dist/esm/plugins/web-components/index.js +18 -20
  25. package/dist/esm/plugins/window-object/index.js +9 -9
  26. package/dist/esm/server/index.js +95 -89
  27. package/dist/experience-instance-DZiAwXph.js +481 -0
  28. package/dist/experience-instance-Ddk4Jktn.cjs +1 -0
  29. package/dist/id-Bv44ilEo.cjs +1 -0
  30. package/dist/id-CRqy981z.js +4 -0
  31. package/dist/logger-6z_gb4rA.js +4 -0
  32. package/dist/logger-fbvQC40v.cjs +1 -0
  33. package/dist/object-C82v79xc.js +25 -0
  34. package/dist/object-CUJOjanb.cjs +1 -0
  35. package/dist/rules-logic-B7vJrWyO.js +231 -0
  36. package/dist/rules-logic-CXr4wXcG.cjs +1 -0
  37. package/dist/storage-6Xk0uAxB.js +103 -0
  38. package/dist/storage-B6lQtc4-.cjs +1 -0
  39. package/dist/supports-0XIfd4-R.js +85 -0
  40. package/dist/supports-Dsjg-82e.cjs +1 -0
  41. package/dist/types/entities/field/field.d.ts +1 -1
  42. package/dist/types/entities/field/field.d.ts.map +1 -1
  43. package/dist/types/entities/response/response.d.ts.map +1 -1
  44. package/dist/types/form/create-form.d.ts +13 -3
  45. package/dist/types/form/create-form.d.ts.map +1 -1
  46. package/dist/types/form/create-submit-pipeline.d.ts +4 -4
  47. package/dist/types/form/create-submit-pipeline.d.ts.map +1 -1
  48. package/dist/types/index.d.ts +0 -1
  49. package/dist/types/index.d.ts.map +1 -1
  50. package/dist/types/picked.d.ts +0 -1
  51. package/dist/types/picked.d.ts.map +1 -1
  52. package/dist/types/plugins/create-experience/create-experience.d.ts +21 -26
  53. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  54. package/dist/types/plugins/history-browser-storage/plugin.d.ts +2 -2
  55. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  56. package/package.json +7 -21
  57. package/dist/api-4YC7Dkcf.js +0 -32
  58. package/dist/api-dQTozK5u.cjs +0 -1
  59. package/dist/experience-instance-Bd4kkjE6.js +0 -559
  60. package/dist/experience-instance-UAZPiG2b.cjs +0 -1
  61. package/dist/id-BKIWbSTy.cjs +0 -1
  62. package/dist/id-BW-g3y32.js +0 -6
  63. package/dist/logger-BsmHUUw1.cjs +0 -1
  64. package/dist/logger-C9a75KZn.js +0 -5
  65. package/dist/object-CJssU1Pm.js +0 -28
  66. package/dist/object-mwaxtjLG.cjs +0 -1
  67. package/dist/rules-logic-CZfip-Wl.js +0 -265
  68. package/dist/rules-logic-Cgia6n5p.cjs +0 -1
  69. package/dist/storage-58NoTSsc.cjs +0 -1
  70. package/dist/storage-B2d81EOI.js +0 -244
  71. package/dist/supports-8YT4QKI7.js +0 -95
  72. package/dist/supports-YvpQZxbh.cjs +0 -1
  73. package/dist/types/entities/project/project.d.ts +0 -9
  74. package/dist/types/entities/project/project.d.ts.map +0 -1
@@ -1,265 +0,0 @@
1
- import { i as S } from "./object-CJssU1Pm.js";
2
- function b(t) {
3
- return typeof t == "number" && !isNaN(t);
4
- }
5
- function w(t) {
6
- return typeof t == "string";
7
- }
8
- function l(t) {
9
- return Array.isArray(t);
10
- }
11
- function g(t) {
12
- return t instanceof Promise;
13
- }
14
- function y(t) {
15
- return typeof t == "object" && t !== null && !Array.isArray(t) && Object.keys(t).length === 1;
16
- }
17
- function a(t) {
18
- if (b(t)) return t;
19
- const r = parseFloat(`${t}`);
20
- return isNaN(r) ? 0 : r;
21
- }
22
- function h(t) {
23
- return `${t}`;
24
- }
25
- const d = {
26
- // eslint-disable-next-line eqeqeq
27
- "==": (t, r) => t == r,
28
- "===": (t, r) => t === r,
29
- // eslint-disable-next-line eqeqeq
30
- "!=": (t, r) => t != r,
31
- "!==": (t, r) => t !== r,
32
- ">": (t, r) => a(t) > a(r),
33
- ">=": (t, r) => a(t) >= a(r),
34
- "<": (t, r, s) => {
35
- const n = a(t), u = a(r);
36
- if (s === void 0) return n < u;
37
- const o = a(s);
38
- return n < u && u < o;
39
- },
40
- "<=": (t, r, s) => {
41
- const n = a(t), u = a(r);
42
- if (s === void 0) return n <= u;
43
- const o = a(s);
44
- return n <= u && u <= o;
45
- },
46
- "!!": async (t) => await m(t),
47
- "!": async (t) => !await m(t),
48
- "%": (t, r) => a(t) % a(r),
49
- // eslint-disable-next-line sonarjs/function-return-type
50
- log: (t) => (console.log(t), t),
51
- in: (t, r) => r ? w(r) ? r.indexOf(h(t)) !== -1 : l(r) ? r.includes(t) : !1 : !1,
52
- cat: (...t) => t.map(h).join(""),
53
- /* eslint-disable sonarjs/deprecation */
54
- substr: (t, r, s) => {
55
- const n = h(t), u = a(r);
56
- if (s === void 0) return n.substr(u);
57
- const o = a(s);
58
- if (o < 0) {
59
- const e = n.substr(u);
60
- return e.substr(0, e.length + o);
61
- }
62
- return n.substr(u, o);
63
- },
64
- /* eslint-enable sonarjs/deprecation */
65
- "+": (...t) => t.reduce((r, s) => a(r) + a(s), 0),
66
- "*": (...t) => t.reduce((r, s) => a(r) * a(s), 1),
67
- "-": (t, r) => {
68
- const s = a(t);
69
- return r === void 0 ? -s : s - a(r);
70
- },
71
- "/": (t, r) => a(t) / a(r),
72
- min: (...t) => Math.min(...t.map(a)),
73
- max: (...t) => Math.max(...t.map(a)),
74
- merge: (...t) => t.reduce((r, s) => l(s) ? r.concat(s) : r.concat([s]), []),
75
- // eslint-disable-next-line sonarjs/cognitive-complexity -- JSONLogic var operator requires complex path traversal logic
76
- var(t, r) {
77
- const s = arguments.length > 1 ? r : null;
78
- if (t === "" || t === "." || t === null || t === void 0)
79
- return this;
80
- if (typeof t == "number" && Array.isArray(this))
81
- return t >= 0 && t < this.length ? this[t] : s;
82
- const n = h(t);
83
- if (n === "" || n === ".")
84
- return this;
85
- const u = n.split(".");
86
- let o = this;
87
- for (const e of u) {
88
- if (o == null)
89
- return s;
90
- if (Array.isArray(o)) {
91
- const c = parseInt(e, 10);
92
- isNaN(c) ? o = o[e] : o = o[c];
93
- } else
94
- o = o[e];
95
- }
96
- return o !== void 0 ? o : s;
97
- },
98
- async missing(...t) {
99
- const r = l(t[0]) ? t[0] : t, s = [];
100
- for (const n of r) {
101
- const u = await i({ var: n }, this);
102
- (u === null || u === "") && s.push(`${n}`);
103
- }
104
- return s;
105
- },
106
- async missing_some(t, r) {
107
- const s = await i({ missing: r }, this);
108
- if (!l(s) || !l(r)) return [];
109
- const n = s.filter(w);
110
- return r.filter(w).length - n.length >= a(t) ? [] : n;
111
- },
112
- /**
113
- * Invoke operator - executes a function with optional arguments
114
- *
115
- * Object format (no arguments):
116
- * { "invoke": { "var": "functionName" } }
117
- *
118
- * Array format (with arguments):
119
- * { "invoke": [{ "var": "functionName" }, arg1, arg2, ...] }
120
- *
121
- * Arguments are evaluated as JSONLogic expressions before being passed to the function.
122
- */
123
- // eslint-disable-next-line sonarjs/function-return-type
124
- invoke(...t) {
125
- const [r, ...s] = t;
126
- return typeof r != "function" ? null : Reflect.apply(r, null, s);
127
- },
128
- regexp_matches(t, r) {
129
- let s = t, n = "";
130
- if (l(t)) {
131
- const [o, e] = t;
132
- s = o, n = e;
133
- }
134
- return !w(s) || !w(n) ? !1 : new RegExp(s, n).test(h(r));
135
- },
136
- throw(t) {
137
- throw new Error(h(t));
138
- }
139
- };
140
- async function i(t, r) {
141
- if (!t) return t;
142
- if (g(t))
143
- return i(await t, r);
144
- if (l(t))
145
- return Promise.all(t.map((e) => i(e, r)));
146
- if (!y(t)) return t;
147
- const s = k(t);
148
- let n = s ? t[s] ?? [] : [];
149
- switch (l(n) || (n = [n]), s) {
150
- case "if":
151
- case "?:":
152
- for (let e = 0; e < n.length - 1; e += 2)
153
- if (await m(await i(n[e], r)))
154
- return i(n[e + 1], r);
155
- return n.length % 2 === 1 ? i(n[n.length - 1], r) : null;
156
- case "and": {
157
- let e = null;
158
- for (const c of n)
159
- if (e = await i(c, r), !await m(e))
160
- return e;
161
- return e;
162
- }
163
- case "or": {
164
- let e = null;
165
- for (const c of n)
166
- if (e = await i(c, r), await m(e)) return e;
167
- return e;
168
- }
169
- case "map": {
170
- const e = await i(n[0], r);
171
- return l(e) ? await Promise.all(e.map((c) => i(n[1], c))) : [];
172
- }
173
- case "filter": {
174
- const e = await i(n[0], r);
175
- return l(e) ? (await Promise.all(
176
- e.map(async (f) => {
177
- const p = await m(await i(n[1], f));
178
- return { item: f, shouldInclude: p };
179
- })
180
- )).filter(({ shouldInclude: f }) => f).map(({ item: f }) => f) : [];
181
- }
182
- case "reduce": {
183
- const e = await i(n[0], r);
184
- if (!l(e))
185
- return n.length > 2 ? await i(n[2], r) : null;
186
- const c = n[1];
187
- let p = n.length > 2 ? await i(n[2], r) : null;
188
- for (const A of e)
189
- p = await i(c, { current: A, accumulator: p });
190
- return p;
191
- }
192
- case "all": {
193
- const e = await i(n[0], r);
194
- if (!l(e) || e.length === 0) return !1;
195
- for (const c of e)
196
- if (!await m(await i(n[1], c))) return !1;
197
- return !0;
198
- }
199
- case "some": {
200
- const e = await i(n[0], r);
201
- if (!l(e)) return !1;
202
- for (const c of e)
203
- if (await m(await i(n[1], c))) return !0;
204
- return !1;
205
- }
206
- case "none": {
207
- const e = await i(n[0], r);
208
- if (!l(e)) return !0;
209
- for (const c of e)
210
- if (await m(await i(n[1], c))) return !1;
211
- return !0;
212
- }
213
- case "catch":
214
- try {
215
- return await i(n[0], r);
216
- } catch (e) {
217
- return y(e) ? await i(e, r) : n[1] ? await i(n[1], e) : e instanceof Error ? e.message : e;
218
- }
219
- }
220
- const u = await Promise.all(n.map((e) => i(e, r))), o = s ? d[s] : void 0;
221
- if (!o) throw new Error(`Unrecognized operation ${s}`);
222
- return o.apply(r, u);
223
- }
224
- async function m(t) {
225
- return g(t) ? m(await t) : !(Array.isArray(t) && t.length === 0) && !!t;
226
- }
227
- function k(t) {
228
- return Object.keys(t)[0];
229
- }
230
- function x(t) {
231
- return !S(t);
232
- }
233
- async function N(t, r, s) {
234
- const n = t.getStateSnapshot(), u = t.predicates.listStore.getState().reduce((c, f) => ({
235
- ...c,
236
- [f.name]: (...p) => f.predicate({ ...n, args: p })
237
- }), {}), o = t.features.listStore.getState().reduce((c, f) => ({
238
- ...c,
239
- [f.id]: async () => {
240
- const { bucket: p } = await f.getBucket();
241
- return p;
242
- }
243
- }), {}), e = {
244
- ...s,
245
- responses: t.responses.getAllStore.getState(),
246
- location: typeof n.location == "object" ? {
247
- hash: n.location.hash,
248
- host: n.location.host,
249
- hostname: n.location.hostname,
250
- href: n.location.href,
251
- origin: n.location.origin,
252
- pathname: n.location.pathname,
253
- port: n.location.port,
254
- protocol: n.location.protocol,
255
- search: n.location.search
256
- } : void 0,
257
- predicates: u,
258
- features: o
259
- };
260
- return await i(r, e);
261
- }
262
- export {
263
- N as e,
264
- x as i
265
- };
@@ -1 +0,0 @@
1
- "use strict";const S=require("./object-mwaxtjLG.cjs");function b(t){return typeof t=="number"&&!isNaN(t)}function w(t){return typeof t=="string"}function l(t){return Array.isArray(t)}function y(t){return t instanceof Promise}function g(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.keys(t).length===1}function a(t){if(b(t))return t;const r=parseFloat(`${t}`);return isNaN(r)?0:r}function p(t){return`${t}`}const v={"==":(t,r)=>t==r,"===":(t,r)=>t===r,"!=":(t,r)=>t!=r,"!==":(t,r)=>t!==r,">":(t,r)=>a(t)>a(r),">=":(t,r)=>a(t)>=a(r),"<":(t,r,s)=>{const n=a(t),u=a(r);if(s===void 0)return n<u;const o=a(s);return n<u&&u<o},"<=":(t,r,s)=>{const n=a(t),u=a(r);if(s===void 0)return n<=u;const o=a(s);return n<=u&&u<=o},"!!":async t=>await m(t),"!":async t=>!await m(t),"%":(t,r)=>a(t)%a(r),log:t=>(console.log(t),t),in:(t,r)=>r?w(r)?r.indexOf(p(t))!==-1:l(r)?r.includes(t):!1:!1,cat:(...t)=>t.map(p).join(""),substr:(t,r,s)=>{const n=p(t),u=a(r);if(s===void 0)return n.substr(u);const o=a(s);if(o<0){const e=n.substr(u);return e.substr(0,e.length+o)}return n.substr(u,o)},"+":(...t)=>t.reduce((r,s)=>a(r)+a(s),0),"*":(...t)=>t.reduce((r,s)=>a(r)*a(s),1),"-":(t,r)=>{const s=a(t);return r===void 0?-s:s-a(r)},"/":(t,r)=>a(t)/a(r),min:(...t)=>Math.min(...t.map(a)),max:(...t)=>Math.max(...t.map(a)),merge:(...t)=>t.reduce((r,s)=>l(s)?r.concat(s):r.concat([s]),[]),var(t,r){const s=arguments.length>1?r:null;if(t===""||t==="."||t===null||t===void 0)return this;if(typeof t=="number"&&Array.isArray(this))return t>=0&&t<this.length?this[t]:s;const n=p(t);if(n===""||n===".")return this;const u=n.split(".");let o=this;for(const e of u){if(o==null)return s;if(Array.isArray(o)){const c=parseInt(e,10);isNaN(c)?o=o[e]:o=o[c]}else o=o[e]}return o!==void 0?o:s},async missing(...t){const r=l(t[0])?t[0]:t,s=[];for(const n of r){const u=await i({var:n},this);(u===null||u==="")&&s.push(`${n}`)}return s},async missing_some(t,r){const s=await i({missing:r},this);if(!l(s)||!l(r))return[];const n=s.filter(w);return r.filter(w).length-n.length>=a(t)?[]:n},invoke(...t){const[r,...s]=t;return typeof r!="function"?null:Reflect.apply(r,null,s)},regexp_matches(t,r){let s=t,n="";if(l(t)){const[o,e]=t;s=o,n=e}return!w(s)||!w(n)?!1:new RegExp(s,n).test(p(r))},throw(t){throw new Error(p(t))}};async function i(t,r){if(!t)return t;if(y(t))return i(await t,r);if(l(t))return Promise.all(t.map(e=>i(e,r)));if(!g(t))return t;const s=d(t);let n=s?t[s]??[]:[];switch(l(n)||(n=[n]),s){case"if":case"?:":for(let e=0;e<n.length-1;e+=2)if(await m(await i(n[e],r)))return i(n[e+1],r);return n.length%2===1?i(n[n.length-1],r):null;case"and":{let e=null;for(const c of n)if(e=await i(c,r),!await m(e))return e;return e}case"or":{let e=null;for(const c of n)if(e=await i(c,r),await m(e))return e;return e}case"map":{const e=await i(n[0],r);return l(e)?await Promise.all(e.map(c=>i(n[1],c))):[]}case"filter":{const e=await i(n[0],r);return l(e)?(await Promise.all(e.map(async f=>{const h=await m(await i(n[1],f));return{item:f,shouldInclude:h}}))).filter(({shouldInclude:f})=>f).map(({item:f})=>f):[]}case"reduce":{const e=await i(n[0],r);if(!l(e))return n.length>2?await i(n[2],r):null;const c=n[1];let h=n.length>2?await i(n[2],r):null;for(const A of e)h=await i(c,{current:A,accumulator:h});return h}case"all":{const e=await i(n[0],r);if(!l(e)||e.length===0)return!1;for(const c of e)if(!await m(await i(n[1],c)))return!1;return!0}case"some":{const e=await i(n[0],r);if(!l(e))return!1;for(const c of e)if(await m(await i(n[1],c)))return!0;return!1}case"none":{const e=await i(n[0],r);if(!l(e))return!0;for(const c of e)if(await m(await i(n[1],c)))return!1;return!0}case"catch":try{return await i(n[0],r)}catch(e){return g(e)?await i(e,r):n[1]?await i(n[1],e):e instanceof Error?e.message:e}}const u=await Promise.all(n.map(e=>i(e,r))),o=s?v[s]:void 0;if(!o)throw new Error(`Unrecognized operation ${s}`);return o.apply(r,u)}async function m(t){return y(t)?m(await t):!(Array.isArray(t)&&t.length===0)&&!!t}function d(t){return Object.keys(t)[0]}function k(t){return!S.isEmpty(t)}async function N(t,r,s){const n=t.getStateSnapshot(),u=t.predicates.listStore.getState().reduce((c,f)=>({...c,[f.name]:(...h)=>f.predicate({...n,args:h})}),{}),o=t.features.listStore.getState().reduce((c,f)=>({...c,[f.id]:async()=>{const{bucket:h}=await f.getBucket();return h}}),{}),e={...s,responses:t.responses.getAllStore.getState(),location:typeof n.location=="object"?{hash:n.location.hash,host:n.location.host,hostname:n.location.hostname,href:n.location.href,origin:n.location.origin,pathname:n.location.pathname,port:n.location.port,protocol:n.location.protocol,search:n.location.search}:void 0,predicates:u,features:o};return await i(r,e)}exports.evaluateRuleLogic=N;exports.isRulesLogic=k;
@@ -1 +0,0 @@
1
- "use strict";const p=e=>btoa([...e].map(t=>String.fromCharCode(t.charCodeAt(0)^7)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function w(e,t="global",o){let r="pckd";if(t==="experience"){if(!o)throw new Error("Experience instance is required to scope storage to an experience");r=`${r}:${o.experienceId}`}return{_:`${r}:${p(e)}`,scope:t}}const u=new Map;function m(e,t){const o=u.get(e._);o&&o.forEach(r=>r(e,t))}function S(e,t,o,r){const i=o==="local"?localStorage:sessionStorage,c=typeof t!="string"?JSON.stringify(t):t;if(i.setItem(e._,c),typeof r=="number"){const l=new Date(Date.now()+r).toISOString();i.setItem(`${e._}:expires-at`,l)}m(e,o)}function b(e,t){const o=t==="local"?localStorage:sessionStorage;o.removeItem(e._),o.removeItem(`${e._}:expires-at`),m(e,t)}function f(e,t,o,r){const i=t==="local"?localStorage:sessionStorage;function c(n){n.storageArea===i&&n.key===e._&&r(o(e))}function a(n,s){s===t&&r(o(n))}window.addEventListener("storage",c),u.has(e._)||u.set(e._,new Set);const l=u.get(e._);return l&&l.add(a),function(){window.removeEventListener("storage",c);const s=u.get(e._);s&&(s.delete(a),s.size===0&&u.delete(e._))}}function g(e,t){const o=t==="local"?localStorage:sessionStorage,r=o.getItem(e._),i=o.getItem(`${e._}:expires-at`),c=(n,s)=>S(e,n,t,s),a=()=>b(e,t),l=n=>f(e,t,s=>g(s,t),n);if(i){const n=new Date,s=new Date(i);if(n>s)return b(e,t),{isSet:()=>!1,text:()=>null,json:()=>null,boolean:()=>null,set:c,remove:a,subscribe:l}}return{isSet(){return r!==null},text(){return r},json(){return r?JSON.parse(r):null},boolean(){return r?r==="true":null},set:c,remove:a,subscribe:l}}const d={get(e){return g(e,"session")},set(e,t,o){S(e,t,"session",o)},remove(e){b(e,"session")},subscribe(e,t){return f(e,"session",this.get,t)}},_={get(e){return g(e,"local")},set(e,t,o){S(e,t,"local",o)},remove(e){b(e,"local")},subscribe(e,t){return f(e,"local",this.get,t)}};exports.createStorageKey=w;exports.localStore=_;exports.sessionStore=d;exports.subscribe=f;
@@ -1,244 +0,0 @@
1
- const m = (e) => (
2
- // eslint-disable-next-line no-bitwise -- XOR cipher for cookie consent banner detection avoidance
3
- btoa([...e].map((t) => String.fromCharCode(t.charCodeAt(0) ^ 7)).join("")).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "")
4
- );
5
- function w(e, t = "global", o) {
6
- let n = "pckd";
7
- if (t === "experience") {
8
- if (!o)
9
- throw new Error("Experience instance is required to scope storage to an experience");
10
- n = `${n}:${o.experienceId}`;
11
- }
12
- return { _: `${n}:${m(e)}`, scope: t };
13
- }
14
- const u = /* @__PURE__ */ new Map();
15
- function p(e, t) {
16
- const o = u.get(e._);
17
- o && o.forEach((n) => n(e, t));
18
- }
19
- function b(e, t, o, n) {
20
- const i = o === "local" ? localStorage : sessionStorage, c = typeof t != "string" ? JSON.stringify(t) : t;
21
- if (i.setItem(e._, c), typeof n == "number") {
22
- const a = new Date(Date.now() + n).toISOString();
23
- i.setItem(`${e._}:expires-at`, a);
24
- }
25
- p(e, o);
26
- }
27
- function f(e, t) {
28
- const o = t === "local" ? localStorage : sessionStorage;
29
- o.removeItem(e._), o.removeItem(`${e._}:expires-at`), p(e, t);
30
- }
31
- function S(e, t, o, n) {
32
- const i = t === "local" ? localStorage : sessionStorage;
33
- function c(r) {
34
- r.storageArea === i && r.key === e._ && n(o(e));
35
- }
36
- function l(r, s) {
37
- s === t && n(o(r));
38
- }
39
- window.addEventListener("storage", c), u.has(e._) || u.set(e._, /* @__PURE__ */ new Set());
40
- const a = u.get(e._);
41
- return a && a.add(l), function() {
42
- window.removeEventListener("storage", c);
43
- const s = u.get(e._);
44
- s && (s.delete(l), s.size === 0 && u.delete(e._));
45
- };
46
- }
47
- function g(e, t) {
48
- const o = t === "local" ? localStorage : sessionStorage, n = o.getItem(e._), i = o.getItem(`${e._}:expires-at`), c = (r, s) => b(e, r, t, s), l = () => f(e, t), a = (r) => S(e, t, (s) => g(s, t), r);
49
- if (i) {
50
- const r = /* @__PURE__ */ new Date(), s = new Date(i);
51
- if (r > s)
52
- return f(e, t), {
53
- isSet: () => !1,
54
- text: () => null,
55
- json: () => null,
56
- boolean: () => null,
57
- set: c,
58
- remove: l,
59
- subscribe: a
60
- };
61
- }
62
- return {
63
- isSet() {
64
- return n !== null;
65
- },
66
- text() {
67
- return n;
68
- },
69
- json() {
70
- return n ? JSON.parse(n) : null;
71
- },
72
- boolean() {
73
- return n ? n === "true" : null;
74
- },
75
- set: c,
76
- remove: l,
77
- subscribe: a
78
- };
79
- }
80
- const d = {
81
- /**
82
- * Retrieves a storage item from sessionStorage.
83
- *
84
- * @template T - The type of the stored value
85
- * @param key - The storage key
86
- * @returns A StorageItem with methods to interact with the value
87
- *
88
- * @example
89
- * ```typescript
90
- * const key = createStorageKey('user')
91
- * const item = sessionStore.get<User>(key)
92
- * const user = item.json() // User | null
93
- * ```
94
- */
95
- get(e) {
96
- return g(e, "session");
97
- },
98
- /**
99
- * Sets a value in sessionStorage with optional expiry.
100
- *
101
- * @param key - The storage key
102
- * @param value - The value to store
103
- * @param expiresIn - Optional expiry time in milliseconds from now
104
- *
105
- * @example
106
- * ```typescript
107
- * const key = createStorageKey('theme')
108
- * // Set without expiry
109
- * sessionStore.set(key, 'dark')
110
- * // Set with 1 hour expiry
111
- * sessionStore.set(key, 'dark', 60 * 60 * 1000)
112
- * ```
113
- */
114
- set(e, t, o) {
115
- b(e, t, "session", o);
116
- },
117
- /**
118
- * Removes a value from sessionStorage, including expiry metadata.
119
- *
120
- * @param key - The storage key
121
- *
122
- * @example
123
- * ```typescript
124
- * const key = createStorageKey('temp-data')
125
- * sessionStore.remove(key)
126
- * ```
127
- */
128
- remove(e) {
129
- f(e, "session");
130
- },
131
- /**
132
- * Subscribes to storage changes for a key, both in the same tab and across browser tabs/windows.
133
- * Callbacks are invoked when changes occur via sessionStore.set() or sessionStore.remove() in the same tab,
134
- * and also when changes are made in other tabs/windows.
135
- *
136
- * @template T - The type of the stored value
137
- * @param key - The storage key to watch
138
- * @param callback - Function called when storage changes
139
- * @returns Unsubscribe function to stop listening
140
- *
141
- * @example
142
- * ```typescript
143
- * const key = createStorageKey('notifications')
144
- * const unsubscribe = sessionStore.subscribe<Notification[]>(key, (item) => {
145
- * const notifications = item.json()
146
- * console.log('Notifications updated:', notifications)
147
- * })
148
- *
149
- * // Changes in same tab trigger callback
150
- * sessionStore.set(key, [{ id: 1, message: 'New notification' }])
151
- *
152
- * // Later, stop listening
153
- * unsubscribe()
154
- * ```
155
- */
156
- subscribe(e, t) {
157
- return S(e, "session", this.get, t);
158
- }
159
- }, _ = {
160
- /**
161
- * Retrieves a storage item from localStorage.
162
- *
163
- * @template T - The type of the stored value
164
- * @param key - The storage key
165
- * @returns A StorageItem with methods to interact with the value
166
- *
167
- * @example
168
- * ```typescript
169
- * const key = createStorageKey('settings')
170
- * const item = localStore.get<Settings>(key)
171
- * const settings = item.json() // Settings | null
172
- * ```
173
- */
174
- get(e) {
175
- return g(e, "local");
176
- },
177
- /**
178
- * Sets a value in localStorage with optional expiry.
179
- *
180
- * @param key - The storage key
181
- * @param value - The value to store
182
- * @param expiresIn - Optional expiry time in milliseconds from now
183
- *
184
- * @example
185
- * ```typescript
186
- * const key = createStorageKey('auth-token')
187
- * // Set without expiry
188
- * localStore.set(key, 'token123')
189
- * // Set with 24 hour expiry
190
- * localStore.set(key, 'token123', 24 * 60 * 60 * 1000)
191
- * ```
192
- */
193
- set(e, t, o) {
194
- b(e, t, "local", o);
195
- },
196
- /**
197
- * Removes a value from localStorage, including expiry metadata.
198
- *
199
- * @param key - The storage key
200
- *
201
- * @example
202
- * ```typescript
203
- * const key = createStorageKey('cached-data')
204
- * localStore.remove(key)
205
- * ```
206
- */
207
- remove(e) {
208
- f(e, "local");
209
- },
210
- /**
211
- * Subscribes to storage changes for a key, both in the same tab and across browser tabs/windows.
212
- * Callbacks are invoked when changes occur via localStore.set() or localStore.remove() in the same tab,
213
- * and also when changes are made in other tabs/windows.
214
- *
215
- * @template T - The type of the stored value
216
- * @param key - The storage key to watch
217
- * @param callback - Function called when storage changes
218
- * @returns Unsubscribe function to stop listening
219
- *
220
- * @example
221
- * ```typescript
222
- * const key = createStorageKey('user-status')
223
- * const unsubscribe = localStore.subscribe<UserStatus>(key, (item) => {
224
- * const status = item.json()
225
- * console.log('User status changed:', status)
226
- * })
227
- *
228
- * // Changes in same tab trigger callback
229
- * localStore.set(key, { online: true })
230
- *
231
- * // Later, stop listening
232
- * unsubscribe()
233
- * ```
234
- */
235
- subscribe(e, t) {
236
- return S(e, "local", this.get, t);
237
- }
238
- };
239
- export {
240
- S as a,
241
- w as c,
242
- _ as l,
243
- d as s
244
- };
@@ -1,95 +0,0 @@
1
- const o = /* @__PURE__ */ Symbol("Picked"), t = globalThis, r = (n) => {
2
- t[o] = n;
3
- };
4
- function e() {
5
- try {
6
- return "location" in t && !!t.location;
7
- } catch {
8
- return !1;
9
- }
10
- }
11
- function s() {
12
- try {
13
- return "history" in t && !!t.history;
14
- } catch {
15
- return !1;
16
- }
17
- }
18
- function a() {
19
- try {
20
- return "localStorage" in t && !!t.localStorage;
21
- } catch {
22
- return !1;
23
- }
24
- }
25
- function c() {
26
- try {
27
- return "sessionStorage" in t && !!t.sessionStorage;
28
- } catch {
29
- return !1;
30
- }
31
- }
32
- function u() {
33
- try {
34
- return "document" in t && "cookie" in t.document;
35
- } catch {
36
- return !1;
37
- }
38
- }
39
- function i() {
40
- try {
41
- return "document" in t && "createElement" in t.document && "attachShadow" in t.document.createElement("div");
42
- } catch {
43
- return !1;
44
- }
45
- }
46
- function l() {
47
- try {
48
- return "window" in t;
49
- } catch {
50
- return !1;
51
- }
52
- }
53
- function p() {
54
- try {
55
- return "document" in t;
56
- } catch {
57
- return !1;
58
- }
59
- }
60
- function f() {
61
- try {
62
- return "IntersectionObserver" in t;
63
- } catch {
64
- return !1;
65
- }
66
- }
67
- function y() {
68
- try {
69
- return "customElements" in t && !!t.customElements;
70
- } catch {
71
- return !1;
72
- }
73
- }
74
- function h() {
75
- try {
76
- return "crypto" in t && "randomUUID" in t.crypto;
77
- } catch {
78
- return !1;
79
- }
80
- }
81
- export {
82
- t as G,
83
- l as a,
84
- a as b,
85
- h as c,
86
- r as d,
87
- u as e,
88
- s as f,
89
- f as g,
90
- e as h,
91
- c as i,
92
- i as j,
93
- y as k,
94
- p as s
95
- };
@@ -1 +0,0 @@
1
- "use strict";const n=Symbol("Picked"),t=globalThis,r=o=>{t[n]=o};function e(){try{return"location"in t&&!!t.location}catch{return!1}}function s(){try{return"history"in t&&!!t.history}catch{return!1}}function u(){try{return"localStorage"in t&&!!t.localStorage}catch{return!1}}function c(){try{return"sessionStorage"in t&&!!t.sessionStorage}catch{return!1}}function a(){try{return"document"in t&&"cookie"in t.document}catch{return!1}}function i(){try{return"document"in t&&"createElement"in t.document&&"attachShadow"in t.document.createElement("div")}catch{return!1}}function p(){try{return"window"in t}catch{return!1}}function l(){try{return"document"in t}catch{return!1}}function f(){try{return"IntersectionObserver"in t}catch{return!1}}function y(){try{return"customElements"in t&&!!t.customElements}catch{return!1}}function m(){try{return"crypto"in t&&"randomUUID"in t.crypto}catch{return!1}}exports.GLOBAL_OBJ=t;exports.bindClient=r;exports.supportsCookies=a;exports.supportsCryptoRandomUUID=m;exports.supportsDocument=l;exports.supportsHistory=s;exports.supportsIntersectionObserver=f;exports.supportsLocalStorage=u;exports.supportsLocation=e;exports.supportsSessionStorage=c;exports.supportsShadowRoot=i;exports.supportsWebComponents=y;exports.supportsWindow=p;
@@ -1,9 +0,0 @@
1
- import { Experience } from '../experience/experience';
2
- export interface Project {
3
- id: string;
4
- name: string;
5
- organizationId: string;
6
- experiences: Array<Experience>;
7
- }
8
- export declare const MOCK_fetchProject: (organizationId: string, projectId: string) => Promise<Project>;
9
- //# sourceMappingURL=project.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../../src/entities/project/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;CAC/B;AAGD,eAAO,MAAM,iBAAiB,GAC5B,gBAAgB,MAAM,EACtB,WAAW,MAAM,KAChB,OAAO,CAAC,OAAO,CAOjB,CAAA"}