lineas-romero-cookies-consent 1.1.5 → 1.1.7
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.
|
@@ -16,19 +16,20 @@ function y(o) {
|
|
|
16
16
|
description: i.description ? String(i.description) : "",
|
|
17
17
|
enabled: !!i.enabled,
|
|
18
18
|
readonly: !!i.readonly,
|
|
19
|
-
cookiePatterns: Array.isArray(i.cookiePatterns) ? i.cookiePatterns.map(String) : []
|
|
19
|
+
cookiePatterns: Array.isArray(i.cookiePatterns) ? i.cookiePatterns.map(String) : [],
|
|
20
|
+
cookiesDetails: Array.isArray(i.cookiesDetails) ? i.cookiesDetails : []
|
|
20
21
|
};
|
|
21
|
-
}),
|
|
22
|
+
}), a = o.cookieName ? String(o.cookieName) : C, n = Number.isFinite(o.cookieExpiresDays) ? Number(o.cookieExpiresDays) : 180;
|
|
22
23
|
return {
|
|
23
24
|
siteName: o.siteName ? String(o.siteName) : "",
|
|
24
25
|
autoClear: !!o.autoClear,
|
|
25
|
-
cookieName:
|
|
26
|
-
cookieExpiresDays:
|
|
26
|
+
cookieName: a,
|
|
27
|
+
cookieExpiresDays: n,
|
|
27
28
|
categories: t,
|
|
28
29
|
onAccept: typeof o.onAccept == "function" ? o.onAccept : null
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function A(o) {
|
|
32
33
|
const e = {};
|
|
33
34
|
for (const t of o)
|
|
34
35
|
e[t.id] = t.readonly ? !0 : !!t.enabled;
|
|
@@ -41,27 +42,27 @@ function N(o) {
|
|
|
41
42
|
return null;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function _() {
|
|
45
46
|
return "LR-" + Math.random().toString(36).substr(2, 9).toUpperCase() + "-" + Date.now().toString(36).toUpperCase();
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function S(o) {
|
|
48
49
|
if (typeof document > "u") return null;
|
|
49
50
|
const e = document.cookie ? document.cookie.split("; ") : [];
|
|
50
51
|
for (const t of e) {
|
|
51
|
-
const
|
|
52
|
-
if ((
|
|
53
|
-
return
|
|
52
|
+
const a = t.indexOf("=");
|
|
53
|
+
if ((a >= 0 ? t.slice(0, a) : t) === o)
|
|
54
|
+
return a >= 0 ? t.slice(a + 1) : "";
|
|
54
55
|
}
|
|
55
56
|
return null;
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
+
function E(o, e, { expiresDays: t }) {
|
|
58
59
|
if (typeof document > "u") return;
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
document.cookie = `${o}=${
|
|
60
|
+
const a = /* @__PURE__ */ new Date();
|
|
61
|
+
a.setTime(a.getTime() + t * 24 * 60 * 60 * 1e3);
|
|
62
|
+
const n = encodeURIComponent(JSON.stringify(e));
|
|
63
|
+
document.cookie = `${o}=${n}; Expires=${a.toUTCString()}; Path=/; SameSite=Lax`;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function f(o, e) {
|
|
65
66
|
return e ? o === e ? !0 : o.startsWith(e) : !1;
|
|
66
67
|
}
|
|
67
68
|
function m() {
|
|
@@ -70,69 +71,67 @@ function m() {
|
|
|
70
71
|
return t >= 0 ? e.slice(0, t) : e;
|
|
71
72
|
}).filter(Boolean);
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function P(o) {
|
|
74
75
|
const e = /* @__PURE__ */ new Set();
|
|
75
76
|
if (!o) return Array.from(e);
|
|
76
77
|
e.add(o), o.includes(".") && e.add(`.${o}`);
|
|
77
78
|
const t = o.split(".").filter(Boolean);
|
|
78
|
-
for (let
|
|
79
|
-
const
|
|
80
|
-
e.add(
|
|
79
|
+
for (let a = 1; a < t.length - 1; a += 1) {
|
|
80
|
+
const n = t.slice(a).join(".");
|
|
81
|
+
e.add(n), e.add(`.${n}`);
|
|
81
82
|
}
|
|
82
83
|
return Array.from(e);
|
|
83
84
|
}
|
|
84
85
|
function g(o) {
|
|
85
86
|
if (typeof document > "u") return;
|
|
86
|
-
const e = "Thu, 01 Jan 1970 00:00:00 GMT", t = typeof location < "u" ? location.hostname : "",
|
|
87
|
+
const e = "Thu, 01 Jan 1970 00:00:00 GMT", t = typeof location < "u" ? location.hostname : "", a = P(t);
|
|
87
88
|
document.cookie = `${o}=; Expires=${e}; Path=/; SameSite=Lax`;
|
|
88
|
-
for (const
|
|
89
|
-
document.cookie = `${o}=; Expires=${e}; Path=/; Domain=${
|
|
89
|
+
for (const n of a)
|
|
90
|
+
document.cookie = `${o}=; Expires=${e}; Path=/; Domain=${n}; SameSite=Lax`;
|
|
90
91
|
}
|
|
91
92
|
function w(o, e) {
|
|
92
93
|
return o.find((t) => t.id === e) || null;
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
+
function h(o, e) {
|
|
95
96
|
const t = w(o, e);
|
|
96
97
|
return t ? t.cookiePatterns : [];
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
+
function D({ categories: o, allowedPreferences: e }) {
|
|
99
100
|
const t = m();
|
|
100
|
-
for (const
|
|
101
|
-
if (!e[
|
|
101
|
+
for (const a of o)
|
|
102
|
+
if (!e[a.id])
|
|
102
103
|
for (const i of t)
|
|
103
|
-
|
|
104
|
+
a.cookiePatterns.some((c) => f(i, c)) && g(i);
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
+
function p(o, e) {
|
|
106
107
|
const t = {};
|
|
107
|
-
for (const
|
|
108
|
-
const
|
|
109
|
-
t[
|
|
108
|
+
for (const a of o) {
|
|
109
|
+
const n = e && Object.prototype.hasOwnProperty.call(e, a.id) ? !!e[a.id] : !!a.enabled;
|
|
110
|
+
t[a.id] = a.readonly ? !0 : n;
|
|
110
111
|
}
|
|
111
112
|
return t;
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
-
const e = y(o), t =
|
|
115
|
-
let i =
|
|
116
|
-
|
|
114
|
+
function q(o) {
|
|
115
|
+
const e = y(o), t = A(e.categories), a = S(e.cookieName), n = a ? N(a) : null;
|
|
116
|
+
let i = n && n.preferences ? p(e.categories, n.preferences) : t, s = n ? n.consentId : null, c = n ? n.updatedAt : null;
|
|
117
|
+
n && n.preferences && e.onAccept && e.onAccept({ ...i });
|
|
117
118
|
function d(r) {
|
|
118
|
-
return i =
|
|
119
|
+
return i = p(e.categories, r), s || (s = _()), c = (/* @__PURE__ */ new Date()).toISOString(), E(
|
|
119
120
|
e.cookieName,
|
|
120
121
|
{
|
|
121
122
|
preferences: i,
|
|
122
|
-
consentId:
|
|
123
|
-
|
|
124
|
-
updatedAt: l,
|
|
125
|
-
// Guardamos la fecha
|
|
123
|
+
consentId: s,
|
|
124
|
+
updatedAt: c,
|
|
126
125
|
siteName: e.siteName
|
|
127
126
|
},
|
|
128
127
|
{ expiresDays: e.cookieExpiresDays }
|
|
129
|
-
), e.autoClear &&
|
|
128
|
+
), e.autoClear && D({ categories: e.categories, allowedPreferences: i }), e.onAccept && e.onAccept({ ...i }), { ...i };
|
|
130
129
|
}
|
|
131
130
|
return {
|
|
132
131
|
getConsentDetails() {
|
|
133
132
|
return {
|
|
134
|
-
consentId:
|
|
135
|
-
consentDate:
|
|
133
|
+
consentId: s || "No registrado",
|
|
134
|
+
consentDate: c || "No registrado",
|
|
136
135
|
preferences: { ...i }
|
|
137
136
|
};
|
|
138
137
|
},
|
|
@@ -146,79 +145,160 @@ function L(o) {
|
|
|
146
145
|
};
|
|
147
146
|
},
|
|
148
147
|
hasStoredConsent() {
|
|
149
|
-
return !!(
|
|
148
|
+
return !!(n && n.preferences);
|
|
150
149
|
},
|
|
151
150
|
getPreferences() {
|
|
152
151
|
return { ...i };
|
|
153
152
|
},
|
|
154
153
|
acceptAll() {
|
|
155
154
|
const r = {};
|
|
156
|
-
for (const
|
|
157
|
-
r[
|
|
155
|
+
for (const l of e.categories)
|
|
156
|
+
r[l.id] = !0;
|
|
158
157
|
return d(r);
|
|
159
158
|
},
|
|
160
159
|
rejectAll() {
|
|
161
160
|
const r = {};
|
|
162
|
-
for (const
|
|
163
|
-
r[
|
|
161
|
+
for (const l of e.categories)
|
|
162
|
+
r[l.id] = !!l.readonly;
|
|
164
163
|
return d(r);
|
|
165
164
|
},
|
|
166
165
|
setPreferences(r) {
|
|
167
166
|
return d({ ...i, ...r || {} });
|
|
168
167
|
},
|
|
169
168
|
clearCategoryCookies(r) {
|
|
170
|
-
const
|
|
169
|
+
const l = h(e.categories, r), k = m();
|
|
171
170
|
for (const u of k)
|
|
172
|
-
|
|
171
|
+
l.some((b) => f(u, b)) && g(u);
|
|
173
172
|
}
|
|
174
173
|
};
|
|
175
174
|
}
|
|
176
|
-
const
|
|
175
|
+
const v = (o) => {
|
|
176
|
+
if (typeof document > "u" || document.querySelector(`script[src="${o}"]`)) return;
|
|
177
|
+
const e = document.createElement("script");
|
|
178
|
+
e.src = o, e.async = !0, document.head.appendChild(e);
|
|
179
|
+
}, x = {
|
|
177
180
|
siteName: "Lineas Romero NextJS",
|
|
178
181
|
autoClear: !0,
|
|
179
182
|
categories: [
|
|
180
183
|
{
|
|
181
184
|
id: "necessary",
|
|
182
185
|
label: "Necesario",
|
|
183
|
-
description: "Las cookies necesarias ayudan a hacer una página web utilizable activando funciones básicas
|
|
186
|
+
description: "Las cookies necesarias ayudan a hacer una página web utilizable activando funciones básicas.",
|
|
184
187
|
enabled: !0,
|
|
185
188
|
readonly: !0,
|
|
186
|
-
cookiePatterns: ["fh_", "fareharbor", "next-", "__Host-", "connect.sid", "CookieConsent", "NEXT_LOCALE"]
|
|
189
|
+
cookiePatterns: ["fh_", "fareharbor", "next-", "__Host-", "connect.sid", "CookieConsent", "NEXT_LOCALE"],
|
|
190
|
+
cookiesDetails: [
|
|
191
|
+
{
|
|
192
|
+
provider: "Lineas Romero",
|
|
193
|
+
name: "CookieConsent",
|
|
194
|
+
duration: "6 meses",
|
|
195
|
+
purpose: "Almacena el estado de consentimiento de cookies del usuario."
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
provider: "Lineas Romero",
|
|
199
|
+
name: "NEXT_LOCALE",
|
|
200
|
+
duration: "Sesión",
|
|
201
|
+
purpose: "Guarda la preferencia de idioma del usuario."
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
provider: "FareHarbor",
|
|
205
|
+
name: "fh_session",
|
|
206
|
+
duration: "Sesión",
|
|
207
|
+
purpose: "Necesaria para el proceso de reserva."
|
|
208
|
+
}
|
|
209
|
+
]
|
|
187
210
|
},
|
|
188
211
|
{
|
|
189
212
|
id: "preferences",
|
|
190
213
|
label: "Preferencias",
|
|
191
214
|
description: "Las cookies de preferencias permiten a la página web recordar información que cambia la forma en que la página se comporta o el aspecto que tiene.",
|
|
192
215
|
enabled: !1,
|
|
193
|
-
cookiePatterns: []
|
|
216
|
+
cookiePatterns: [],
|
|
217
|
+
cookiesDetails: []
|
|
194
218
|
},
|
|
195
219
|
{
|
|
196
220
|
id: "statistics",
|
|
197
|
-
// Renombrado de 'analytics' a 'statistics'
|
|
198
221
|
label: "Estadística",
|
|
199
|
-
description: "Las cookies
|
|
222
|
+
description: "Las cookies de estadística ayudan a los propietarios de sitios web a comprender cómo interactúan los visitantes con los sitios web mediante la recopilación y presentación de información de forma anónima.",
|
|
200
223
|
enabled: !1,
|
|
201
|
-
cookiePatterns: ["_ga", "_gid", "_gat", "mc_", "metricool"]
|
|
224
|
+
cookiePatterns: ["_ga", "_gid", "_gat", "mc_", "metricool"],
|
|
225
|
+
cookiesDetails: [
|
|
226
|
+
{
|
|
227
|
+
provider: "Google Analytics",
|
|
228
|
+
name: "_ga",
|
|
229
|
+
duration: "2 años",
|
|
230
|
+
purpose: "Registra una identificación única que se utiliza para generar datos estadísticos."
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
provider: "Google Analytics",
|
|
234
|
+
name: "_gid",
|
|
235
|
+
duration: "24 horas",
|
|
236
|
+
purpose: "Registra una identificación única que se utiliza para generar datos estadísticos."
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
provider: "Metricool",
|
|
240
|
+
name: "mc_session",
|
|
241
|
+
duration: "Sesión",
|
|
242
|
+
purpose: "Analítica interna de visitas."
|
|
243
|
+
}
|
|
244
|
+
]
|
|
202
245
|
},
|
|
203
246
|
{
|
|
204
247
|
id: "marketing",
|
|
205
248
|
label: "Marketing",
|
|
206
|
-
description:
|
|
249
|
+
description: 'Las cookies de marketing se utilizan para rastrear a los visitantes en las páginas web. La intención es mostrar anuncios relevantes y atractivos para el usuario individual, y por lo tanto, más valiosos para los editores y terceros anunciantes."',
|
|
207
250
|
enabled: !1,
|
|
208
|
-
cookiePatterns: ["_fbp", "fr", "tr", "_gcl",
|
|
251
|
+
cookiePatterns: ["_fbp", "fr", "tr", "_gcl"],
|
|
252
|
+
cookiesDetails: [
|
|
253
|
+
{
|
|
254
|
+
provider: "Facebook",
|
|
255
|
+
name: "_fbp",
|
|
256
|
+
duration: "3 meses",
|
|
257
|
+
purpose: "Utilizada por Facebook para ofrecer una serie de productos publicitarios."
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
provider: "Google Ads",
|
|
261
|
+
name: "_gcl_au",
|
|
262
|
+
duration: "3 meses",
|
|
263
|
+
purpose: "Utilizada por Google AdSense para experimentar con la eficiencia publicitaria."
|
|
264
|
+
}
|
|
265
|
+
]
|
|
209
266
|
},
|
|
210
267
|
{
|
|
211
268
|
id: "unclassified",
|
|
212
269
|
label: "No clasificadas",
|
|
213
|
-
description: "
|
|
270
|
+
description: "Las cookies no clasificadas son cookies para las que todavía estamos en proceso de clasificar, junto con los proveedores de cookies individuales.",
|
|
214
271
|
enabled: !1,
|
|
215
|
-
cookiePatterns: []
|
|
272
|
+
cookiePatterns: [],
|
|
273
|
+
cookiesDetails: []
|
|
216
274
|
}
|
|
217
275
|
],
|
|
218
276
|
onAccept: (o) => {
|
|
219
|
-
o.statistics
|
|
277
|
+
if (o.statistics) {
|
|
278
|
+
(function(t, a, n, i, s) {
|
|
279
|
+
t[i] = t[i] || [], t[i].push({
|
|
280
|
+
"gtm.start": (/* @__PURE__ */ new Date()).getTime(),
|
|
281
|
+
event: "gtm.js"
|
|
282
|
+
});
|
|
283
|
+
var c = a.getElementsByTagName(n)[0], d = a.createElement(n), r = "";
|
|
284
|
+
d.async = !0, d.src = "https://www.googletagmanager.com/gtm.js?id=" + s + r, c.parentNode.insertBefore(d, c);
|
|
285
|
+
})(window, document, "script", "dataLayer", "GTM-T22MXTS"), v("https://tracker.metricool.com/resources/be.js");
|
|
286
|
+
const e = setInterval(() => {
|
|
287
|
+
window.beTracker && (clearInterval(e), window.beTracker.t({ hash: "dfa94193071c025264595ebeb4647ae3" }));
|
|
288
|
+
}, 100);
|
|
289
|
+
}
|
|
290
|
+
o.marketing && ((function(e, t, a, n, i, s, c) {
|
|
291
|
+
e.fbq || (i = e.fbq = function() {
|
|
292
|
+
i.callMethod ? i.callMethod.apply(i, arguments) : i.queue.push(arguments);
|
|
293
|
+
}, e._fbq || (e._fbq = i), i.push = i, i.loaded = !0, i.version = "2.0", i.queue = [], s = t.createElement(a), s.async = !0, s.src = n, c = t.getElementsByTagName(a)[0], c.parentNode.insertBefore(s, c));
|
|
294
|
+
})(
|
|
295
|
+
window,
|
|
296
|
+
document,
|
|
297
|
+
"script",
|
|
298
|
+
"https://connect.facebook.net/en_US/fbevents.js"
|
|
299
|
+
), fbq("init", "1048470300095520"), fbq("track", "PageView"));
|
|
220
300
|
}
|
|
221
|
-
},
|
|
301
|
+
}, T = {
|
|
222
302
|
siteName: "Apartamentos Lineas Romero",
|
|
223
303
|
autoClear: !0,
|
|
224
304
|
categories: [
|
|
@@ -269,7 +349,7 @@ const I = {
|
|
|
269
349
|
onAccept: (o) => {
|
|
270
350
|
o.marketing;
|
|
271
351
|
}
|
|
272
|
-
},
|
|
352
|
+
}, I = {
|
|
273
353
|
siteName: "Visit La Graciosa",
|
|
274
354
|
autoClear: !0,
|
|
275
355
|
categories: [
|
|
@@ -315,8 +395,8 @@ const I = {
|
|
|
315
395
|
}
|
|
316
396
|
};
|
|
317
397
|
export {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
398
|
+
q as initCookieConsent,
|
|
399
|
+
x as nextJsConfig,
|
|
400
|
+
I as visitLaGraciosaConfig,
|
|
401
|
+
T as wpApartamentosConfig
|
|
322
402
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(r,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(r=typeof globalThis<"u"?globalThis:r||self,l(r.LineasRomeroCookies={}))})(this,(function(r){"use strict";const l="CookieConsent";function b(o){if(!o||typeof o!="object")throw new Error("initCookieConsent(config): config is required");const e=Array.isArray(o.categories)?o.categories:[];if(e.length===0)throw new Error("initCookieConsent(config): config.categories is required");const i=e.map(t=>{if(!t||typeof t!="object")throw new Error("initCookieConsent(config): invalid category");if(!t.id)throw new Error("initCookieConsent(config): category.id is required");return{id:String(t.id),label:t.label?String(t.label):String(t.id),description:t.description?String(t.description):"",enabled:!!t.enabled,readonly:!!t.readonly,cookiePatterns:Array.isArray(t.cookiePatterns)?t.cookiePatterns.map(String):[]}}),n=o.cookieName?String(o.cookieName):l,a=Number.isFinite(o.cookieExpiresDays)?Number(o.cookieExpiresDays):180;return{siteName:o.siteName?String(o.siteName):"",autoClear:!!o.autoClear,cookieName:n,cookieExpiresDays:a,categories:i,onAccept:typeof o.onAccept=="function"?o.onAccept:null}}function y(o){const e={};for(const i of o)e[i.id]=i.readonly?!0:!!i.enabled;return e}function P(o){try{return JSON.parse(decodeURIComponent(o))}catch{return null}}function N(){return"LR-"+Math.random().toString(36).substr(2,9).toUpperCase()+"-"+Date.now().toString(36).toUpperCase()}function A(o){if(typeof document>"u")return null;const e=document.cookie?document.cookie.split("; "):[];for(const i of e){const n=i.indexOf("=");if((n>=0?i.slice(0,n):i)===o)return n>=0?i.slice(n+1):""}return null}function S(o,e,{expiresDays:i}){if(typeof document>"u")return;const n=new Date;n.setTime(n.getTime()+i*24*60*60*1e3);const a=encodeURIComponent(JSON.stringify(e));document.cookie=`${o}=${a}; Expires=${n.toUTCString()}; Path=/; SameSite=Lax`}function p(o,e){return e?o===e?!0:o.startsWith(e):!1}function m(){return typeof document>"u"?[]:(document.cookie?document.cookie.split("; "):[]).map(e=>{const i=e.indexOf("=");return i>=0?e.slice(0,i):e}).filter(Boolean)}function E(o){const e=new Set;if(!o)return Array.from(e);e.add(o),o.includes(".")&&e.add(`.${o}`);const i=o.split(".").filter(Boolean);for(let n=1;n<i.length-1;n+=1){const a=i.slice(n).join(".");e.add(a),e.add(`.${a}`)}return Array.from(e)}function g(o){if(typeof document>"u")return;const e="Thu, 01 Jan 1970 00:00:00 GMT",i=typeof location<"u"?location.hostname:"",n=E(i);document.cookie=`${o}=; Expires=${e}; Path=/; SameSite=Lax`;for(const a of n)document.cookie=`${o}=; Expires=${e}; Path=/; Domain=${a}; SameSite=Lax`}function _(o,e){return o.find(i=>i.id===e)||null}function w(o,e){const i=_(o,e);return i?i.cookiePatterns:[]}function h({categories:o,allowedPreferences:e}){const i=m();for(const n of o)if(!e[n.id])for(const t of i)n.cookiePatterns.some(f=>p(t,f))&&g(t)}function k(o,e){const i={};for(const n of o){const a=e&&Object.prototype.hasOwnProperty.call(e,n.id)?!!e[n.id]:!!n.enabled;i[n.id]=n.readonly?!0:a}return i}function D(o){const e=b(o),i=y(e.categories),n=A(e.cookieName),a=n?P(n):null;let t=a&&a.preferences?k(e.categories,a.preferences):i,d=a?a.consentId:null,f=a?a.updatedAt:null;a&&a.preferences&&e.onAccept&&e.onAccept({...t});function u(s){return t=k(e.categories,s),d||(d=N()),f=new Date().toISOString(),S(e.cookieName,{preferences:t,consentId:d,updatedAt:f,siteName:e.siteName},{expiresDays:e.cookieExpiresDays}),e.autoClear&&h({categories:e.categories,allowedPreferences:t}),e.onAccept&&e.onAccept({...t}),{...t}}return{getConsentDetails(){return{consentId:d||"No registrado",consentDate:f||"No registrado",preferences:{...t}}},getConfig(){return{siteName:e.siteName,autoClear:e.autoClear,cookieName:e.cookieName,cookieExpiresDays:e.cookieExpiresDays,categories:e.categories.map(s=>({...s}))}},hasStoredConsent(){return!!(a&&a.preferences)},getPreferences(){return{...t}},acceptAll(){const s={};for(const c of e.categories)s[c.id]=!0;return u(s)},rejectAll(){const s={};for(const c of e.categories)s[c.id]=!!c.readonly;return u(s)},setPreferences(s){return u({...t,...s||{}})},clearCategoryCookies(s){const c=w(e.categories,s),I=m();for(const C of I)c.some(O=>p(C,O))&&g(C)}}}const L={siteName:"Lineas Romero NextJS",autoClear:!0,categories:[{id:"necessary",label:"Necesario",description:"Las cookies necesarias ayudan a hacer una página web utilizable activando funciones básicas como la navegación en la página y el acceso a áreas seguras de la página web.",enabled:!0,readonly:!0,cookiePatterns:["fh_","fareharbor","next-","__Host-","connect.sid","CookieConsent","NEXT_LOCALE"]},{id:"preferences",label:"Preferencias",description:"Las cookies de preferencias permiten a la página web recordar información que cambia la forma en que la página se comporta o el aspecto que tiene.",enabled:!1,cookiePatterns:[]},{id:"statistics",label:"Estadística",description:"Las cookies estadísticas ayudan a los propietarios de páginas web a comprender cómo interactúan los visitantes con las páginas web reuniendo información de forma anónima.",enabled:!1,cookiePatterns:["_ga","_gid","_gat","mc_","metricool"]},{id:"marketing",label:"Marketing",description:"Las cookies de marketing se utilizan para rastrear a los visitantes en las páginas web. La intención es mostrar anuncios relevantes.",enabled:!1,cookiePatterns:["_fbp","fr","tr","_gcl","_gac"]},{id:"unclassified",label:"No clasificadas",description:"Cookies que estamos en proceso de clasificar.",enabled:!1,cookiePatterns:[]}],onAccept:o=>{o.statistics,o.marketing}},x={siteName:"Apartamentos Lineas Romero",autoClear:!0,categories:[{id:"necessary",label:"Necesario",description:"Las cookies necesarias ayudan a hacer una página web utilizable activando funciones básicas.",enabled:!0,readonly:!0,cookiePatterns:["wp-settings","wordpress_","pll_","CookieConsent","AEC","__Secure-BUCKET"]},{id:"preferences",label:"Preferencias",description:"Permiten recordar información que cambia el aspecto o comportamiento del sitio.",enabled:!1,cookiePatterns:[]},{id:"statistics",label:"Estadística",description:"Ayudan a comprender cómo interactúan los visitantes con la web.",enabled:!1,cookiePatterns:["_ga","_gid"]},{id:"marketing",label:"Marketing",description:"Se utilizan para rastrear a los visitantes y mostrar anuncios relevantes.",enabled:!1,cookiePatterns:["IDE","_gcl","ar_debug","SOCS","__Secure-ENID","NID","1P_JAR"]},{id:"unclassified",label:"No clasificadas",description:"Cookies en proceso de clasificación.",enabled:!1,cookiePatterns:[]}],onAccept:o=>{o.marketing}},v={siteName:"Visit La Graciosa",autoClear:!0,categories:[{id:"necessary",label:"Necesario",description:"Esenciales para preferencias de idioma y funcionamiento del sitio.",enabled:!0,readonly:!0,cookiePatterns:["pll_","session_id","PHPSESSID"]},{id:"preferences",label:"Preferencias",description:"Configuración regional e idioma.",enabled:!1,cookiePatterns:[]},{id:"statistics",label:"Estadística",description:"Estadísticas de uso anónimo.",enabled:!1,cookiePatterns:["_ga","_gid"]},{id:"marketing",label:"Marketing",description:"Publicidad y seguimiento de conversiones.",enabled:!1,cookiePatterns:["_gcl","_gac"]},{id:"unclassified",label:"No clasificadas",description:"Pendientes de clasificar.",enabled:!1,cookiePatterns:[]}],onAccept:o=>{o.marketing}};r.initCookieConsent=D,r.nextJsConfig=L,r.visitLaGraciosaConfig=v,r.wpApartamentosConfig=x,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(d,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(d=typeof globalThis<"u"?globalThis:d||self,p(d.LineasRomeroCookies={}))})(this,(function(d){"use strict";const p="CookieConsent";function C(o){if(!o||typeof o!="object")throw new Error("initCookieConsent(config): config is required");const e=Array.isArray(o.categories)?o.categories:[];if(e.length===0)throw new Error("initCookieConsent(config): config.categories is required");const t=e.map(i=>{if(!i||typeof i!="object")throw new Error("initCookieConsent(config): invalid category");if(!i.id)throw new Error("initCookieConsent(config): category.id is required");return{id:String(i.id),label:i.label?String(i.label):String(i.id),description:i.description?String(i.description):"",enabled:!!i.enabled,readonly:!!i.readonly,cookiePatterns:Array.isArray(i.cookiePatterns)?i.cookiePatterns.map(String):[],cookiesDetails:Array.isArray(i.cookiesDetails)?i.cookiesDetails:[]}}),a=o.cookieName?String(o.cookieName):p,n=Number.isFinite(o.cookieExpiresDays)?Number(o.cookieExpiresDays):180;return{siteName:o.siteName?String(o.siteName):"",autoClear:!!o.autoClear,cookieName:a,cookieExpiresDays:n,categories:t,onAccept:typeof o.onAccept=="function"?o.onAccept:null}}function y(o){const e={};for(const t of o)e[t.id]=t.readonly?!0:!!t.enabled;return e}function A(o){try{return JSON.parse(decodeURIComponent(o))}catch{return null}}function S(){return"LR-"+Math.random().toString(36).substr(2,9).toUpperCase()+"-"+Date.now().toString(36).toUpperCase()}function N(o){if(typeof document>"u")return null;const e=document.cookie?document.cookie.split("; "):[];for(const t of e){const a=t.indexOf("=");if((a>=0?t.slice(0,a):t)===o)return a>=0?t.slice(a+1):""}return null}function _(o,e,{expiresDays:t}){if(typeof document>"u")return;const a=new Date;a.setTime(a.getTime()+t*24*60*60*1e3);const n=encodeURIComponent(JSON.stringify(e));document.cookie=`${o}=${n}; Expires=${a.toUTCString()}; Path=/; SameSite=Lax`}function f(o,e){return e?o===e?!0:o.startsWith(e):!1}function m(){return typeof document>"u"?[]:(document.cookie?document.cookie.split("; "):[]).map(e=>{const t=e.indexOf("=");return t>=0?e.slice(0,t):e}).filter(Boolean)}function P(o){const e=new Set;if(!o)return Array.from(e);e.add(o),o.includes(".")&&e.add(`.${o}`);const t=o.split(".").filter(Boolean);for(let a=1;a<t.length-1;a+=1){const n=t.slice(a).join(".");e.add(n),e.add(`.${n}`)}return Array.from(e)}function g(o){if(typeof document>"u")return;const e="Thu, 01 Jan 1970 00:00:00 GMT",t=typeof location<"u"?location.hostname:"",a=P(t);document.cookie=`${o}=; Expires=${e}; Path=/; SameSite=Lax`;for(const n of a)document.cookie=`${o}=; Expires=${e}; Path=/; Domain=${n}; SameSite=Lax`}function E(o,e){return o.find(t=>t.id===e)||null}function h(o,e){const t=E(o,e);return t?t.cookiePatterns:[]}function w({categories:o,allowedPreferences:e}){const t=m();for(const a of o)if(!e[a.id])for(const i of t)a.cookiePatterns.some(c=>f(i,c))&&g(i)}function k(o,e){const t={};for(const a of o){const n=e&&Object.prototype.hasOwnProperty.call(e,a.id)?!!e[a.id]:!!a.enabled;t[a.id]=a.readonly?!0:n}return t}function v(o){const e=C(o),t=y(e.categories),a=N(e.cookieName),n=a?A(a):null;let i=n&&n.preferences?k(e.categories,n.preferences):t,r=n?n.consentId:null,c=n?n.updatedAt:null;n&&n.preferences&&e.onAccept&&e.onAccept({...i});function l(s){return i=k(e.categories,s),r||(r=S()),c=new Date().toISOString(),_(e.cookieName,{preferences:i,consentId:r,updatedAt:c,siteName:e.siteName},{expiresDays:e.cookieExpiresDays}),e.autoClear&&w({categories:e.categories,allowedPreferences:i}),e.onAccept&&e.onAccept({...i}),{...i}}return{getConsentDetails(){return{consentId:r||"No registrado",consentDate:c||"No registrado",preferences:{...i}}},getConfig(){return{siteName:e.siteName,autoClear:e.autoClear,cookieName:e.cookieName,cookieExpiresDays:e.cookieExpiresDays,categories:e.categories.map(s=>({...s}))}},hasStoredConsent(){return!!(n&&n.preferences)},getPreferences(){return{...i}},acceptAll(){const s={};for(const u of e.categories)s[u.id]=!0;return l(s)},rejectAll(){const s={};for(const u of e.categories)s[u.id]=!!u.readonly;return l(s)},setPreferences(s){return l({...i,...s||{}})},clearCategoryCookies(s){const u=h(e.categories,s),x=m();for(const b of x)u.some(I=>f(b,I))&&g(b)}}}const D=o=>{if(typeof document>"u"||document.querySelector(`script[src="${o}"]`))return;const e=document.createElement("script");e.src=o,e.async=!0,document.head.appendChild(e)},L={siteName:"Lineas Romero NextJS",autoClear:!0,categories:[{id:"necessary",label:"Necesario",description:"Las cookies necesarias ayudan a hacer una página web utilizable activando funciones básicas.",enabled:!0,readonly:!0,cookiePatterns:["fh_","fareharbor","next-","__Host-","connect.sid","CookieConsent","NEXT_LOCALE"],cookiesDetails:[{provider:"Lineas Romero",name:"CookieConsent",duration:"6 meses",purpose:"Almacena el estado de consentimiento de cookies del usuario."},{provider:"Lineas Romero",name:"NEXT_LOCALE",duration:"Sesión",purpose:"Guarda la preferencia de idioma del usuario."},{provider:"FareHarbor",name:"fh_session",duration:"Sesión",purpose:"Necesaria para el proceso de reserva."}]},{id:"preferences",label:"Preferencias",description:"Las cookies de preferencias permiten a la página web recordar información que cambia la forma en que la página se comporta o el aspecto que tiene.",enabled:!1,cookiePatterns:[],cookiesDetails:[]},{id:"statistics",label:"Estadística",description:"Las cookies de estadística ayudan a los propietarios de sitios web a comprender cómo interactúan los visitantes con los sitios web mediante la recopilación y presentación de información de forma anónima.",enabled:!1,cookiePatterns:["_ga","_gid","_gat","mc_","metricool"],cookiesDetails:[{provider:"Google Analytics",name:"_ga",duration:"2 años",purpose:"Registra una identificación única que se utiliza para generar datos estadísticos."},{provider:"Google Analytics",name:"_gid",duration:"24 horas",purpose:"Registra una identificación única que se utiliza para generar datos estadísticos."},{provider:"Metricool",name:"mc_session",duration:"Sesión",purpose:"Analítica interna de visitas."}]},{id:"marketing",label:"Marketing",description:'Las cookies de marketing se utilizan para rastrear a los visitantes en las páginas web. La intención es mostrar anuncios relevantes y atractivos para el usuario individual, y por lo tanto, más valiosos para los editores y terceros anunciantes."',enabled:!1,cookiePatterns:["_fbp","fr","tr","_gcl"],cookiesDetails:[{provider:"Facebook",name:"_fbp",duration:"3 meses",purpose:"Utilizada por Facebook para ofrecer una serie de productos publicitarios."},{provider:"Google Ads",name:"_gcl_au",duration:"3 meses",purpose:"Utilizada por Google AdSense para experimentar con la eficiencia publicitaria."}]},{id:"unclassified",label:"No clasificadas",description:"Las cookies no clasificadas son cookies para las que todavía estamos en proceso de clasificar, junto con los proveedores de cookies individuales.",enabled:!1,cookiePatterns:[],cookiesDetails:[]}],onAccept:o=>{if(o.statistics){(function(t,a,n,i,r){t[i]=t[i]||[],t[i].push({"gtm.start":new Date().getTime(),event:"gtm.js"});var c=a.getElementsByTagName(n)[0],l=a.createElement(n),s="";l.async=!0,l.src="https://www.googletagmanager.com/gtm.js?id="+r+s,c.parentNode.insertBefore(l,c)})(window,document,"script","dataLayer","GTM-T22MXTS"),D("https://tracker.metricool.com/resources/be.js");const e=setInterval(()=>{window.beTracker&&(clearInterval(e),window.beTracker.t({hash:"dfa94193071c025264595ebeb4647ae3"}))},100)}o.marketing&&((function(e,t,a,n,i,r,c){e.fbq||(i=e.fbq=function(){i.callMethod?i.callMethod.apply(i,arguments):i.queue.push(arguments)},e._fbq||(e._fbq=i),i.push=i,i.loaded=!0,i.version="2.0",i.queue=[],r=t.createElement(a),r.async=!0,r.src=n,c=t.getElementsByTagName(a)[0],c.parentNode.insertBefore(r,c))})(window,document,"script","https://connect.facebook.net/en_US/fbevents.js"),fbq("init","1048470300095520"),fbq("track","PageView"))}},q={siteName:"Apartamentos Lineas Romero",autoClear:!0,categories:[{id:"necessary",label:"Necesario",description:"Las cookies necesarias ayudan a hacer una página web utilizable activando funciones básicas.",enabled:!0,readonly:!0,cookiePatterns:["wp-settings","wordpress_","pll_","CookieConsent","AEC","__Secure-BUCKET"]},{id:"preferences",label:"Preferencias",description:"Permiten recordar información que cambia el aspecto o comportamiento del sitio.",enabled:!1,cookiePatterns:[]},{id:"statistics",label:"Estadística",description:"Ayudan a comprender cómo interactúan los visitantes con la web.",enabled:!1,cookiePatterns:["_ga","_gid"]},{id:"marketing",label:"Marketing",description:"Se utilizan para rastrear a los visitantes y mostrar anuncios relevantes.",enabled:!1,cookiePatterns:["IDE","_gcl","ar_debug","SOCS","__Secure-ENID","NID","1P_JAR"]},{id:"unclassified",label:"No clasificadas",description:"Cookies en proceso de clasificación.",enabled:!1,cookiePatterns:[]}],onAccept:o=>{o.marketing}},T={siteName:"Visit La Graciosa",autoClear:!0,categories:[{id:"necessary",label:"Necesario",description:"Esenciales para preferencias de idioma y funcionamiento del sitio.",enabled:!0,readonly:!0,cookiePatterns:["pll_","session_id","PHPSESSID"]},{id:"preferences",label:"Preferencias",description:"Configuración regional e idioma.",enabled:!1,cookiePatterns:[]},{id:"statistics",label:"Estadística",description:"Estadísticas de uso anónimo.",enabled:!1,cookiePatterns:["_ga","_gid"]},{id:"marketing",label:"Marketing",description:"Publicidad y seguimiento de conversiones.",enabled:!1,cookiePatterns:["_gcl","_gac"]},{id:"unclassified",label:"No clasificadas",description:"Pendientes de clasificar.",enabled:!1,cookiePatterns:[]}],onAccept:o=>{o.marketing}};d.initCookieConsent=v,d.nextJsConfig=L,d.visitLaGraciosaConfig=T,d.wpApartamentosConfig=q,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
// 1. Definición de detalle de cookie individual
|
|
2
|
+
export interface CookieDetail {
|
|
3
|
+
provider: string; // Ej: "Google Analytics"
|
|
4
|
+
name: string; // Ej: "_ga"
|
|
5
|
+
duration: string; // Ej: "2 años"
|
|
6
|
+
purpose: string; // Ej: "Se usa para distinguir a los usuarios."
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// 2. Definición de Categoría
|
|
1
10
|
export interface CookieCategory {
|
|
2
11
|
id: string;
|
|
3
12
|
label?: string;
|
|
@@ -5,6 +14,7 @@ export interface CookieCategory {
|
|
|
5
14
|
enabled?: boolean;
|
|
6
15
|
readonly?: boolean;
|
|
7
16
|
cookiePatterns?: string[];
|
|
17
|
+
cookiesDetails?: CookieDetail[]; // Array opcional con los detalles
|
|
8
18
|
}
|
|
9
19
|
|
|
10
20
|
export interface UserPreferences {
|
package/package.json
CHANGED