sanity-plugin-seofields 1.2.5 → 1.2.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.
Files changed (50) hide show
  1. package/README.md +465 -0
  2. package/dist/index.cjs +2604 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +422 -0
  5. package/dist/index.d.ts +339 -492
  6. package/dist/index.js +1284 -2013
  7. package/dist/index.js.map +1 -1
  8. package/dist/next.cjs +182 -0
  9. package/dist/next.cjs.map +1 -0
  10. package/dist/next.d.cts +241 -0
  11. package/dist/next.d.ts +202 -295
  12. package/dist/next.js +110 -70
  13. package/dist/next.js.map +1 -1
  14. package/dist/types-B91ena4g.d.cts +89 -0
  15. package/dist/types-B91ena4g.d.ts +89 -0
  16. package/package.json +46 -20
  17. package/dist/index.d.mts +0 -575
  18. package/dist/index.mjs +0 -3292
  19. package/dist/index.mjs.map +0 -1
  20. package/dist/next.d.mts +0 -334
  21. package/dist/next.mjs +0 -102
  22. package/dist/next.mjs.map +0 -1
  23. package/sanity.json +0 -8
  24. package/src/components/SeoHealthDashboard.tsx +0 -1568
  25. package/src/components/SeoHealthPane.tsx +0 -81
  26. package/src/components/SeoHealthTool.tsx +0 -11
  27. package/src/components/SeoPreview.tsx +0 -178
  28. package/src/components/meta/MetaDescription.tsx +0 -39
  29. package/src/components/meta/MetaTitle.tsx +0 -44
  30. package/src/components/openGraph/OgDescription.tsx +0 -46
  31. package/src/components/openGraph/OgTitle.tsx +0 -45
  32. package/src/components/twitter/twitterDescription.tsx +0 -45
  33. package/src/components/twitter/twitterTitle.tsx +0 -45
  34. package/src/helpers/SeoMetaTags.tsx +0 -154
  35. package/src/helpers/seoMeta.ts +0 -283
  36. package/src/index.ts +0 -26
  37. package/src/next.ts +0 -12
  38. package/src/plugin.ts +0 -344
  39. package/src/schemas/index.ts +0 -121
  40. package/src/schemas/types/index.ts +0 -20
  41. package/src/schemas/types/metaAttribute/index.ts +0 -60
  42. package/src/schemas/types/metaTag/index.ts +0 -17
  43. package/src/schemas/types/openGraph/index.ts +0 -114
  44. package/src/schemas/types/robots/index.ts +0 -26
  45. package/src/schemas/types/twitter/index.ts +0 -108
  46. package/src/types.ts +0 -108
  47. package/src/utils/fieldsUtils.ts +0 -160
  48. package/src/utils/seoUtils.ts +0 -423
  49. package/src/utils/utils.ts +0 -9
  50. package/v2-incompatible.js +0 -11
package/dist/index.js CHANGED
@@ -1,1294 +1,58 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: !0 });
3
- var r = require("react"), sanity = require("sanity"), jsxRuntime = require("react/jsx-runtime"), router = require("sanity/router"), structure = require("sanity/structure"), ui = require("@sanity/ui");
4
- function _interopDefaultCompat(e) {
5
- return e && typeof e == "object" && "default" in e ? e : { default: e };
6
- }
7
- var r__default = /* @__PURE__ */ _interopDefaultCompat(r), __assign = function() {
8
- return __assign = Object.assign || function(t) {
9
- for (var s, i = 1, n = arguments.length; i < n; i++) {
10
- s = arguments[i];
11
- for (var p2 in s) Object.prototype.hasOwnProperty.call(s, p2) && (t[p2] = s[p2]);
12
- }
13
- return t;
14
- }, __assign.apply(this, arguments);
15
- };
16
- function __spreadArray(to, from2, pack) {
17
- if (pack || arguments.length === 2) for (var i = 0, l2 = from2.length, ar; i < l2; i++)
18
- (ar || !(i in from2)) && (ar || (ar = Array.prototype.slice.call(from2, 0, i)), ar[i] = from2[i]);
19
- return to.concat(ar || Array.prototype.slice.call(from2));
20
- }
21
- function memoize(fn) {
22
- var cache = /* @__PURE__ */ Object.create(null);
23
- return function(arg) {
24
- return cache[arg] === void 0 && (cache[arg] = fn(arg)), cache[arg];
25
- };
26
- }
27
- var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, isPropValid = /* @__PURE__ */ memoize(
28
- function(prop) {
29
- return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
30
- }
31
- /* Z+1 */
32
- ), MS = "-ms-", MOZ = "-moz-", WEBKIT = "-webkit-", COMMENT = "comm", RULESET = "rule", DECLARATION = "decl", IMPORT = "@import", NAMESPACE = "@namespace", KEYFRAMES = "@keyframes", LAYER = "@layer", abs = Math.abs, from = String.fromCharCode, assign = Object.assign;
33
- function hash(value, length2) {
34
- return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
35
- }
36
- function trim(value) {
37
- return value.trim();
38
- }
39
- function match(value, pattern) {
40
- return (value = pattern.exec(value)) ? value[0] : value;
41
- }
42
- function replace(value, pattern, replacement) {
43
- return value.replace(pattern, replacement);
44
- }
45
- function indexof(value, search, position2) {
46
- return value.indexOf(search, position2);
47
- }
48
- function charat(value, index) {
49
- return value.charCodeAt(index) | 0;
50
- }
51
- function substr(value, begin, end) {
52
- return value.slice(begin, end);
53
- }
54
- function strlen(value) {
55
- return value.length;
56
- }
57
- function sizeof(value) {
58
- return value.length;
59
- }
60
- function append(value, array) {
61
- return array.push(value), value;
62
- }
63
- function combine(array, callback) {
64
- return array.map(callback).join("");
65
- }
66
- function filter(array, pattern) {
67
- return array.filter(function(value) {
68
- return !match(value, pattern);
69
- });
70
- }
71
- var line = 1, column = 1, length = 0, position = 0, character = 0, characters = "";
72
- function node(value, root, parent, type, props, children, length2, siblings) {
73
- return { value, root, parent, type, props, children, line, column, length: length2, return: "", siblings };
74
- }
75
- function copy(root, props) {
76
- return assign(node("", null, null, "", null, null, 0, root.siblings), root, { length: -root.length }, props);
77
- }
78
- function lift(root) {
79
- for (; root.root; )
80
- root = copy(root.root, { children: [root] });
81
- append(root, root.siblings);
82
- }
83
- function char() {
84
- return character;
85
- }
86
- function prev() {
87
- return character = position > 0 ? charat(characters, --position) : 0, column--, character === 10 && (column = 1, line--), character;
88
- }
89
- function next() {
90
- return character = position < length ? charat(characters, position++) : 0, column++, character === 10 && (column = 1, line++), character;
91
- }
92
- function peek() {
93
- return charat(characters, position);
94
- }
95
- function caret() {
96
- return position;
97
- }
98
- function slice(begin, end) {
99
- return substr(characters, begin, end);
100
- }
101
- function token(type) {
102
- switch (type) {
103
- // \0 \t \n \r \s whitespace token
104
- case 0:
105
- case 9:
106
- case 10:
107
- case 13:
108
- case 32:
109
- return 5;
110
- // ! + , / > @ ~ isolate token
111
- case 33:
112
- case 43:
113
- case 44:
114
- case 47:
115
- case 62:
116
- case 64:
117
- case 126:
118
- // ; { } breakpoint token
119
- case 59:
120
- case 123:
121
- case 125:
122
- return 4;
123
- // : accompanied token
124
- case 58:
125
- return 3;
126
- // " ' ( [ opening delimit token
127
- case 34:
128
- case 39:
129
- case 40:
130
- case 91:
131
- return 2;
132
- // ) ] closing delimit token
133
- case 41:
134
- case 93:
135
- return 1;
136
- }
137
- return 0;
138
- }
139
- function alloc(value) {
140
- return line = column = 1, length = strlen(characters = value), position = 0, [];
141
- }
142
- function dealloc(value) {
143
- return characters = "", value;
144
- }
145
- function delimit(type) {
146
- return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
147
- }
148
- function whitespace(type) {
149
- for (; (character = peek()) && character < 33; )
150
- next();
151
- return token(type) > 2 || token(character) > 3 ? "" : " ";
152
- }
153
- function escaping(index, count) {
154
- for (; --count && next() && !(character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97); )
155
- ;
156
- return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
157
- }
158
- function delimiter(type) {
159
- for (; next(); )
160
- switch (character) {
161
- // ] ) " '
162
- case type:
163
- return position;
164
- // " '
165
- case 34:
166
- case 39:
167
- type !== 34 && type !== 39 && delimiter(character);
168
- break;
169
- // (
170
- case 40:
171
- type === 41 && delimiter(type);
172
- break;
173
- // \
174
- case 92:
175
- next();
176
- break;
177
- }
178
- return position;
179
- }
180
- function commenter(type, index) {
181
- for (; next() && type + character !== 57; )
182
- if (type + character === 84 && peek() === 47)
183
- break;
184
- return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
185
- }
186
- function identifier(index) {
187
- for (; !token(peek()); )
188
- next();
189
- return slice(index, position);
190
- }
191
- function compile(value) {
192
- return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
193
- }
194
- function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
195
- for (var index = 0, offset = 0, length2 = pseudo, atrule = 0, property = 0, previous = 0, variable = 1, scanning = 1, ampersand = 1, character2 = 0, type = "", props = rules, children = rulesets, reference = rule, characters2 = type; scanning; )
196
- switch (previous = character2, character2 = next()) {
197
- // (
198
- case 40:
199
- if (previous != 108 && charat(characters2, length2 - 1) == 58) {
200
- indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index ? points[index - 1] : 0)) != -1 && (ampersand = -1);
201
- break;
202
- }
203
- // " ' [
204
- case 34:
205
- case 39:
206
- case 91:
207
- characters2 += delimit(character2);
208
- break;
209
- // \t \n \r \s
210
- case 9:
211
- case 10:
212
- case 13:
213
- case 32:
214
- characters2 += whitespace(previous);
215
- break;
216
- // \
217
- case 92:
218
- characters2 += escaping(caret() - 1, 7);
219
- continue;
220
- // /
221
- case 47:
222
- switch (peek()) {
223
- case 42:
224
- case 47:
225
- append(comment(commenter(next(), caret()), root, parent, declarations), declarations), (token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters2) && substr(characters2, -1, void 0) !== " " && (characters2 += " ");
226
- break;
227
- default:
228
- characters2 += "/";
229
- }
230
- break;
231
- // {
232
- case 123 * variable:
233
- points[index++] = strlen(characters2) * ampersand;
234
- // } ; \0
235
- case 125 * variable:
236
- case 59:
237
- case 0:
238
- switch (character2) {
239
- // \0 }
240
- case 0:
241
- case 125:
242
- scanning = 0;
243
- // ;
244
- case 59 + offset:
245
- ampersand == -1 && (characters2 = replace(characters2, /\f/g, "")), property > 0 && (strlen(characters2) - length2 || variable === 0 && previous === 47) && append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2, declarations), declarations);
246
- break;
247
- // @ ;
248
- case 59:
249
- characters2 += ";";
250
- // { rule/at-rule
251
- default:
252
- if (append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2, rulesets), rulesets), character2 === 123)
253
- if (offset === 0)
254
- parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
255
- else {
256
- switch (atrule) {
257
- // c(ontainer)
258
- case 99:
259
- if (charat(characters2, 3) === 110) break;
260
- // l(ayer)
261
- case 108:
262
- if (charat(characters2, 2) === 97) break;
263
- default:
264
- offset = 0;
265
- // d(ocument) m(edia) s(upports)
266
- case 100:
267
- case 109:
268
- case 115:
269
- }
270
- offset ? parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2, children), children), rules, children, length2, points, rule ? props : children) : parse(characters2, reference, reference, reference, [""], children, 0, points, children);
271
- }
272
- }
273
- index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
274
- break;
275
- // :
276
- case 58:
277
- length2 = 1 + strlen(characters2), property = previous;
278
- default:
279
- if (variable < 1) {
280
- if (character2 == 123)
281
- --variable;
282
- else if (character2 == 125 && variable++ == 0 && prev() == 125)
283
- continue;
284
- }
285
- switch (characters2 += from(character2), character2 * variable) {
286
- // &
287
- case 38:
288
- ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
289
- break;
290
- // ,
291
- case 44:
292
- points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
293
- break;
294
- // @
295
- case 64:
296
- peek() === 45 && (characters2 += delimit(next())), atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
297
- break;
298
- // -
299
- case 45:
300
- previous === 45 && strlen(characters2) == 2 && (variable = 0);
301
- }
302
- }
303
- return rulesets;
304
- }
305
- function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length2, siblings) {
306
- for (var post = offset - 1, rule = offset === 0 ? rules : [""], size = sizeof(rule), i = 0, j2 = 0, k2 = 0; i < index; ++i)
307
- for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j2 = points[i])), z2 = value; x2 < size; ++x2)
308
- (z2 = trim(j2 > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2]))) && (props[k2++] = z2);
309
- return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length2, siblings);
310
- }
311
- function comment(value, root, parent, siblings) {
312
- return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings);
313
- }
314
- function declaration(value, root, parent, length2, siblings) {
315
- return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2, siblings);
316
- }
317
- function prefix(value, length2, children) {
318
- switch (hash(value, length2)) {
319
- // color-adjust
320
- case 5103:
321
- return WEBKIT + "print-" + value + value;
322
- // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
323
- case 5737:
324
- case 4201:
325
- case 3177:
326
- case 3433:
327
- case 1641:
328
- case 4457:
329
- case 2921:
330
- // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
331
- case 5572:
332
- case 6356:
333
- case 5844:
334
- case 3191:
335
- case 6645:
336
- case 3005:
337
- // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
338
- case 4215:
339
- case 6389:
340
- case 5109:
341
- case 5365:
342
- case 5621:
343
- case 3829:
344
- // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position
345
- case 6391:
346
- case 5879:
347
- case 5623:
348
- case 6135:
349
- case 4599:
350
- return WEBKIT + value + value;
351
- // mask-composite
352
- case 4855:
353
- return WEBKIT + value.replace("add", "source-over").replace("substract", "source-out").replace("intersect", "source-in").replace("exclude", "xor") + value;
354
- // tab-size
355
- case 4789:
356
- return MOZ + value + value;
357
- // appearance, user-select, transform, hyphens, text-size-adjust
358
- case 5349:
359
- case 4246:
360
- case 4810:
361
- case 6968:
362
- case 2756:
363
- return WEBKIT + value + MOZ + value + MS + value + value;
364
- // writing-mode
365
- case 5936:
366
- switch (charat(value, length2 + 11)) {
367
- // vertical-l(r)
368
- case 114:
369
- return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
370
- // vertical-r(l)
371
- case 108:
372
- return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
373
- // horizontal(-)tb
374
- case 45:
375
- return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
376
- }
377
- // flex, flex-direction, scroll-snap-type, writing-mode
378
- case 6828:
379
- case 4268:
380
- case 2903:
381
- return WEBKIT + value + MS + value + value;
382
- // order
383
- case 6165:
384
- return WEBKIT + value + MS + "flex-" + value + value;
385
- // align-items
386
- case 5187:
387
- return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
388
- // align-self
389
- case 5443:
390
- return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/g, "") + (match(value, /flex-|baseline/) ? "" : MS + "grid-row-" + replace(value, /flex-|-self/g, "")) + value;
391
- // align-content
392
- case 4675:
393
- return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/g, "") + value;
394
- // flex-shrink
395
- case 5548:
396
- return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
397
- // flex-basis
398
- case 5292:
399
- return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
400
- // flex-grow
401
- case 6060:
402
- return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
403
- // transition
404
- case 4554:
405
- return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
406
- // cursor
407
- case 6187:
408
- return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
409
- // background, background-image
410
- case 5495:
411
- case 3959:
412
- return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
413
- // justify-content
414
- case 4968:
415
- return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /space-between/, "justify") + WEBKIT + value + value;
416
- // justify-self
417
- case 4200:
418
- if (!match(value, /flex-|baseline/)) return MS + "grid-column-align" + substr(value, length2) + value;
419
- break;
420
- // grid-template-(columns|rows)
421
- case 2592:
422
- case 3360:
423
- return MS + replace(value, "template-", "") + value;
424
- // grid-(row|column)-start
425
- case 4384:
426
- case 3616:
427
- return children && children.some(function(element, index) {
428
- return length2 = index, match(element.props, /grid-\w+-end/);
429
- }) ? ~indexof(value + (children = children[length2].value), "span", 0) ? value : MS + replace(value, "-start", "") + value + MS + "grid-row-span:" + (~indexof(children, "span", 0) ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ";" : MS + replace(value, "-start", "") + value;
430
- // grid-(row|column)-end
431
- case 4896:
432
- case 4128:
433
- return children && children.some(function(element) {
434
- return match(element.props, /grid-\w+-start/);
435
- }) ? value : MS + replace(replace(value, "-end", "-span"), "span ", "") + value;
436
- // (margin|padding)-inline-(start|end)
437
- case 4095:
438
- case 3583:
439
- case 4068:
440
- case 2532:
441
- return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
442
- // (min|max)?(width|height|inline-size|block-size)
443
- case 8116:
444
- case 7059:
445
- case 5753:
446
- case 5535:
447
- case 5445:
448
- case 5701:
449
- case 4933:
450
- case 4677:
451
- case 5533:
452
- case 5789:
453
- case 5021:
454
- case 4765:
455
- if (strlen(value) - 1 - length2 > 6)
456
- switch (charat(value, length2 + 1)) {
457
- // (m)ax-content, (m)in-content
458
- case 109:
459
- if (charat(value, length2 + 4) !== 45)
460
- break;
461
- // (f)ill-available, (f)it-content
462
- case 102:
463
- return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
464
- // (s)tretch
465
- case 115:
466
- return ~indexof(value, "stretch", 0) ? prefix(replace(value, "stretch", "fill-available"), length2, children) + value : value;
467
- }
468
- break;
469
- // grid-(column|row)
470
- case 5152:
471
- case 5920:
472
- return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_2, a2, b2, c2, d2, e, f2) {
473
- return MS + a2 + ":" + b2 + f2 + (c2 ? MS + a2 + "-span:" + (d2 ? e : +e - +b2) + f2 : "") + value;
474
- });
475
- // position: sticky
476
- case 4949:
477
- if (charat(value, length2 + 6) === 121)
478
- return replace(value, ":", ":" + WEBKIT) + value;
479
- break;
480
- // display: (flex|inline-flex|grid|inline-grid)
481
- case 6444:
482
- switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) {
483
- // (inline-)?fle(x)
484
- case 120:
485
- return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
486
- // (inline-)?gri(d)
487
- case 100:
488
- return replace(value, ":", ":" + MS) + value;
489
- }
490
- break;
491
- // scroll-margin, scroll-margin-(top|right|bottom|left)
492
- case 5719:
493
- case 2647:
494
- case 2135:
495
- case 3927:
496
- case 2391:
497
- return replace(value, "scroll-", "scroll-snap-") + value;
498
- }
499
- return value;
500
- }
501
- function serialize(children, callback) {
502
- for (var output = "", i = 0; i < children.length; i++)
503
- output += callback(children[i], i, children, callback) || "";
504
- return output;
505
- }
506
- function stringify(element, index, children, callback) {
507
- switch (element.type) {
508
- case LAYER:
509
- if (element.children.length) break;
510
- case IMPORT:
511
- case NAMESPACE:
512
- case DECLARATION:
513
- return element.return = element.return || element.value;
514
- case COMMENT:
515
- return "";
516
- case KEYFRAMES:
517
- return element.return = element.value + "{" + serialize(element.children, callback) + "}";
518
- case RULESET:
519
- if (!strlen(element.value = element.props.join(","))) return "";
520
- }
521
- return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
522
- }
523
- function middleware(collection) {
524
- var length2 = sizeof(collection);
525
- return function(element, index, children, callback) {
526
- for (var output = "", i = 0; i < length2; i++)
527
- output += collection[i](element, index, children, callback) || "";
528
- return output;
529
- };
530
- }
531
- function rulesheet(callback) {
532
- return function(element) {
533
- element.root || (element = element.return) && callback(element);
534
- };
535
- }
536
- function prefixer(element, index, children, callback) {
537
- if (element.length > -1 && !element.return)
538
- switch (element.type) {
539
- case DECLARATION:
540
- element.return = prefix(element.value, element.length, children);
541
- return;
542
- case KEYFRAMES:
543
- return serialize([copy(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback);
544
- case RULESET:
545
- if (element.length)
546
- return combine(children = element.props, function(value) {
547
- switch (match(value, callback = /(::plac\w+|:read-\w+)/)) {
548
- // :read-(only|write)
549
- case ":read-only":
550
- case ":read-write":
551
- lift(copy(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] })), lift(copy(element, { props: [value] })), assign(element, { props: filter(children, callback) });
552
- break;
553
- // :placeholder
554
- case "::placeholder":
555
- lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] })), lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] })), lift(copy(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] })), lift(copy(element, { props: [value] })), assign(element, { props: filter(children, callback) });
556
- break;
557
- }
558
- return "";
559
- });
560
- }
561
- }
562
- var unitlessKeys = {
563
- animationIterationCount: 1,
564
- aspectRatio: 1,
565
- borderImageOutset: 1,
566
- borderImageSlice: 1,
567
- borderImageWidth: 1,
568
- boxFlex: 1,
569
- boxFlexGroup: 1,
570
- boxOrdinalGroup: 1,
571
- columnCount: 1,
572
- columns: 1,
573
- flex: 1,
574
- flexGrow: 1,
575
- flexPositive: 1,
576
- flexShrink: 1,
577
- flexNegative: 1,
578
- flexOrder: 1,
579
- gridRow: 1,
580
- gridRowEnd: 1,
581
- gridRowSpan: 1,
582
- gridRowStart: 1,
583
- gridColumn: 1,
584
- gridColumnEnd: 1,
585
- gridColumnSpan: 1,
586
- gridColumnStart: 1,
587
- msGridRow: 1,
588
- msGridRowSpan: 1,
589
- msGridColumn: 1,
590
- msGridColumnSpan: 1,
591
- fontWeight: 1,
592
- lineHeight: 1,
593
- opacity: 1,
594
- order: 1,
595
- orphans: 1,
596
- scale: 1,
597
- tabSize: 1,
598
- widows: 1,
599
- zIndex: 1,
600
- zoom: 1,
601
- WebkitLineClamp: 1,
602
- // SVG-related properties
603
- fillOpacity: 1,
604
- floodOpacity: 1,
605
- stopOpacity: 1,
606
- strokeDasharray: 1,
607
- strokeDashoffset: 1,
608
- strokeMiterlimit: 1,
609
- strokeOpacity: 1,
610
- strokeWidth: 1
611
- }, a = typeof process < "u" && process.env !== void 0 && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", c = "active", u = "data-styled-version", l = "6.3.11", p = `/*!sc*/
612
- `, d = typeof window < "u" && typeof document < "u", h = r__default.default.createContext === void 0, f = !!(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== "" ? process.env.REACT_APP_SC_DISABLE_SPEEDY !== "false" && process.env.REACT_APP_SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.SC_DISABLE_SPEEDY !== void 0 && process.env.SC_DISABLE_SPEEDY !== "" ? process.env.SC_DISABLE_SPEEDY !== "false" && process.env.SC_DISABLE_SPEEDY : process.env.NODE_ENV !== "production"), y = process.env.NODE_ENV !== "production" ? { 1: `Cannot create styled-component for component: %s.
613
-
614
- `, 2: `Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
615
-
616
- - Are you trying to reuse it across renders?
617
- - Are you accidentally calling collectStyles twice?
618
-
619
- `, 3: `Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
620
-
621
- `, 4: `The \`StyleSheetManager\` expects a valid target or sheet prop!
622
-
623
- - Does this error occur on the client and is your target falsy?
624
- - Does this error occur on the server and is the sheet falsy?
625
-
626
- `, 5: `The clone method cannot be used on the client!
627
-
628
- - Are you running in a client-like environment on the server?
629
- - Are you trying to run SSR on the client?
630
-
631
- `, 6: `Trying to insert a new style tag, but the given Node is unmounted!
632
-
633
- - Are you using a custom target that isn't mounted?
634
- - Does your document not have a valid head element?
635
- - Have you accidentally removed a style tag manually?
636
-
637
- `, 7: 'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n', 8: `ThemeProvider: Please make your "theme" prop an object.
638
-
639
- `, 9: "Missing document `<head>`\n\n", 10: `Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
640
-
641
- `, 11: `_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
642
-
643
- `, 12: "It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n", 13: `%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.
644
-
645
- `, 14: `ThemeProvider: "theme" prop is required.
646
-
647
- `, 15: "A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n", 16: `Reached the limit of how many styled components may be created at group %s.
648
- You may only create up to 1,073,741,824 components. If you're creating components dynamically,
649
- as for instance in your render method then you may be running into this limitation.
650
-
651
- `, 17: `CSSStyleSheet could not be found on HTMLStyleElement.
652
- Has styled-components' style tag been unmounted or altered by another script?
653
- `, 18: "ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`" } : {};
654
- function v() {
655
- for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
656
- for (var n = e[0], r2 = [], o = 1, s = e.length; o < s; o += 1) r2.push(e[o]);
657
- return r2.forEach(function(e2) {
658
- n = n.replace(/%[a-z]/, e2);
659
- }), n;
660
- }
661
- function g(t) {
662
- for (var n = [], r2 = 1; r2 < arguments.length; r2++) n[r2 - 1] = arguments[r2];
663
- return process.env.NODE_ENV === "production" ? new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t, " for more information.").concat(n.length > 0 ? " Args: ".concat(n.join(", ")) : "")) : new Error(v.apply(void 0, __spreadArray([y[t]], n, !1)).trim());
664
- }
665
- var S = 1 << 30, w = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), N = 1, C = function(e) {
666
- if (w.has(e)) return w.get(e);
667
- for (; b.has(N); ) N++;
668
- var t = N++;
669
- if (process.env.NODE_ENV !== "production" && ((0 | t) < 0 || t > S)) throw g(16, "".concat(t));
670
- return w.set(e, t), b.set(t, e), t;
671
- }, E = function(e, t) {
672
- N = t + 1, w.set(e, t), b.set(t, e);
673
- }, _ = /invalid hook call/i, A = /* @__PURE__ */ new Set(), I = function(t, n) {
674
- if (process.env.NODE_ENV !== "production") {
675
- if (h) return;
676
- var o = n ? ' with the id of "'.concat(n, '"') : "", s = "The component ".concat(t).concat(o, ` has been created dynamically.
677
- `) + `You may see this warning because you've called styled inside another component.
678
- To resolve this only create new StyledComponents outside of any render method and function component.
679
- See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
680
- `, i = console.error;
681
- try {
682
- var a2 = !0;
683
- console.error = function(t2) {
684
- for (var n2 = [], r2 = 1; r2 < arguments.length; r2++) n2[r2 - 1] = arguments[r2];
685
- _.test(t2) ? (a2 = !1, A.delete(s)) : i.apply(void 0, __spreadArray([t2], n2, !1));
686
- }, typeof r__default.default.useState == "function" && r__default.default.useState(null), a2 && !A.has(s) && (console.warn(s), A.add(s));
687
- } catch (e) {
688
- _.test(e.message) && A.delete(s);
689
- } finally {
690
- console.error = i;
691
- }
692
- }
693
- }, P = Object.freeze([]), O = Object.freeze({});
694
- function D(e, t, n) {
695
- return n === void 0 && (n = O), e.theme !== n.theme && e.theme || t || n.theme;
696
- }
697
- var T = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "blockquote", "body", "button", "br", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "menu", "meter", "nav", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "slot", "small", "span", "strong", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "switch", "symbol", "text", "textPath", "tspan", "use"]), R = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, x = /(^-|-$)/g;
698
- function j(e) {
699
- return e.replace(R, "-").replace(x, "");
700
- }
701
- var k = /(a)(d)/gi, M = function(e) {
702
- return String.fromCharCode(e + (e > 25 ? 39 : 97));
703
- };
704
- function V(e) {
705
- var t, n = "";
706
- for (t = Math.abs(e); t > 52; t = t / 52 | 0) n = M(t % 52) + n;
707
- return (M(t % 52) + n).replace(k, "$1-$2");
708
- }
709
- var F, G = function(e, t) {
710
- for (var n = t.length; n; ) e = 33 * e ^ t.charCodeAt(--n);
711
- return e;
712
- }, z = function(e) {
713
- return G(5381, e);
714
- };
715
- function B(e) {
716
- return V(z(e) >>> 0);
717
- }
718
- function L(e) {
719
- return process.env.NODE_ENV !== "production" && typeof e == "string" && e || e.displayName || e.name || "Component";
720
- }
721
- function $(e) {
722
- return typeof e == "string" && (process.env.NODE_ENV === "production" || e.charAt(0) === e.charAt(0).toLowerCase());
723
- }
724
- var Y = typeof Symbol == "function" && Symbol.for, W = Y ? Symbol.for("react.memo") : 60115, q = Y ? Symbol.for("react.forward_ref") : 60112, H = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, U = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, J = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, X = ((F = {})[q] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, F[W] = J, F);
725
- function Z(e) {
726
- return ("type" in (t = e) && t.type.$$typeof) === W ? J : "$$typeof" in e ? X[e.$$typeof] : H;
727
- var t;
728
- }
729
- var K = Object.defineProperty, Q = Object.getOwnPropertyNames, ee = Object.getOwnPropertySymbols, te = Object.getOwnPropertyDescriptor, ne = Object.getPrototypeOf, re = Object.prototype;
730
- function oe(e, t, n) {
731
- if (typeof t != "string") {
732
- if (re) {
733
- var r2 = ne(t);
734
- r2 && r2 !== re && oe(e, r2, n);
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
735
16
  }
736
- var o = Q(t);
737
- ee && (o = o.concat(ee(t)));
738
- for (var s = Z(e), i = Z(t), a2 = 0; a2 < o.length; ++a2) {
739
- var c2 = o[a2];
740
- if (!(c2 in U || n && n[c2] || i && c2 in i || s && c2 in s)) {
741
- var u2 = te(t, c2);
742
- try {
743
- K(e, c2, u2);
744
- } catch {
745
- }
746
- }
747
- }
748
- }
749
- return e;
750
- }
751
- function se(e) {
752
- return typeof e == "function";
753
- }
754
- function ie(e) {
755
- return typeof e == "object" && "styledComponentId" in e;
756
- }
757
- function ae(e, t) {
758
- return e && t ? "".concat(e, " ").concat(t) : e || t || "";
759
- }
760
- function ce(e, t) {
761
- return e.join("");
762
- }
763
- function ue(e) {
764
- return e !== null && typeof e == "object" && e.constructor.name === Object.name && !("props" in e && e.$$typeof);
765
- }
766
- function le(e, t, n) {
767
- if (n === void 0 && (n = !1), !n && !ue(e) && !Array.isArray(e)) return t;
768
- if (Array.isArray(t)) for (var r2 = 0; r2 < t.length; r2++) e[r2] = le(e[r2], t[r2]);
769
- else if (ue(t)) for (var r2 in t) e[r2] = le(e[r2], t[r2]);
770
- return e;
771
- }
772
- function pe(e, t) {
773
- Object.defineProperty(e, "toString", { value: t });
774
- }
775
- var de = (function() {
776
- function e(e2) {
777
- this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e2, this._cGroup = 0, this._cIndex = 0;
778
- }
779
- return e.prototype.indexOfGroup = function(e2) {
780
- if (e2 === this._cGroup) return this._cIndex;
781
- var t = this._cIndex;
782
- if (e2 > this._cGroup) for (var n = this._cGroup; n < e2; n++) t += this.groupSizes[n];
783
- else for (n = this._cGroup - 1; n >= e2; n--) t -= this.groupSizes[n];
784
- return this._cGroup = e2, this._cIndex = t, t;
785
- }, e.prototype.insertRules = function(e2, t) {
786
- if (e2 >= this.groupSizes.length) {
787
- for (var n = this.groupSizes, r2 = n.length, o = r2; e2 >= o; ) if ((o <<= 1) < 0) throw g(16, "".concat(e2));
788
- this.groupSizes = new Uint32Array(o), this.groupSizes.set(n), this.length = o;
789
- for (var s = r2; s < o; s++) this.groupSizes[s] = 0;
790
- }
791
- for (var i = this.indexOfGroup(e2 + 1), a2 = 0, c2 = (s = 0, t.length); s < c2; s++) this.tag.insertRule(i, t[s]) && (this.groupSizes[e2]++, i++, a2++);
792
- a2 > 0 && this._cGroup > e2 && (this._cIndex += a2);
793
- }, e.prototype.clearGroup = function(e2) {
794
- if (e2 < this.length) {
795
- var t = this.groupSizes[e2], n = this.indexOfGroup(e2), r2 = n + t;
796
- this.groupSizes[e2] = 0;
797
- for (var o = n; o < r2; o++) this.tag.deleteRule(n);
798
- t > 0 && this._cGroup > e2 && (this._cIndex -= t);
799
- }
800
- }, e.prototype.getGroup = function(e2) {
801
- var t = "";
802
- if (e2 >= this.length || this.groupSizes[e2] === 0) return t;
803
- for (var n = this.groupSizes[e2], r2 = this.indexOfGroup(e2), o = r2 + n, s = r2; s < o; s++) t += this.tag.getRule(s) + p;
804
- return t;
805
- }, e;
806
- })(), he = "style[".concat(a, "][").concat(u, '="').concat(l, '"]'), fe = new RegExp("^".concat(a, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), me = function(e) {
807
- return typeof ShadowRoot < "u" && e instanceof ShadowRoot || "host" in e && e.nodeType === 11;
808
- }, ye = function(e) {
809
- if (!e) return document;
810
- if (me(e)) return e;
811
- if ("getRootNode" in e) {
812
- var t = e.getRootNode();
813
- if (me(t)) return t;
814
- }
815
- return document;
816
- }, ve = function(e, t, n) {
817
- for (var r2, o = n.split(","), s = 0, i = o.length; s < i; s++) (r2 = o[s]) && e.registerName(t, r2);
818
- }, ge = function(e, t) {
819
- for (var n, r2 = ((n = t.textContent) !== null && n !== void 0 ? n : "").split(p), o = [], s = 0, i = r2.length; s < i; s++) {
820
- var a2 = r2[s].trim();
821
- if (a2) {
822
- var c2 = a2.match(fe);
823
- if (c2) {
824
- var u2 = 0 | parseInt(c2[1], 10), l2 = c2[2];
825
- u2 !== 0 && (E(l2, u2), ve(e, l2, c2[3]), e.getTag().insertRules(u2, o)), o.length = 0;
826
- } else o.push(a2);
827
- }
828
- }
829
- }, Se = function(e) {
830
- for (var t = ye(e.options.target).querySelectorAll(he), n = 0, r2 = t.length; n < r2; n++) {
831
- var o = t[n];
832
- o && o.getAttribute(a) !== c && (ge(e, o), o.parentNode && o.parentNode.removeChild(o));
833
- }
17
+ return a;
834
18
  };
835
- function we() {
836
- return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : null;
837
- }
838
- var be = function(e) {
839
- var t = document.head, n = e || t, r2 = document.createElement("style"), o = (function(e2) {
840
- var t2 = Array.from(e2.querySelectorAll("style[".concat(a, "]")));
841
- return t2[t2.length - 1];
842
- })(n), s = o !== void 0 ? o.nextSibling : null;
843
- r2.setAttribute(a, c), r2.setAttribute(u, l);
844
- var i = we();
845
- return i && r2.setAttribute("nonce", i), n.insertBefore(r2, s), r2;
846
- }, Ne = (function() {
847
- function e(e2) {
848
- this.element = be(e2), this.element.appendChild(document.createTextNode("")), this.sheet = (function(e3) {
849
- var t;
850
- if (e3.sheet) return e3.sheet;
851
- for (var n = (t = e3.getRootNode().styleSheets) !== null && t !== void 0 ? t : document.styleSheets, r2 = 0, o = n.length; r2 < o; r2++) {
852
- var s = n[r2];
853
- if (s.ownerNode === e3) return s;
854
- }
855
- throw g(17);
856
- })(this.element), this.length = 0;
857
- }
858
- return e.prototype.insertRule = function(e2, t) {
859
- try {
860
- return this.sheet.insertRule(t, e2), this.length++, !0;
861
- } catch {
862
- return !1;
863
- }
864
- }, e.prototype.deleteRule = function(e2) {
865
- this.sheet.deleteRule(e2), this.length--;
866
- }, e.prototype.getRule = function(e2) {
867
- var t = this.sheet.cssRules[e2];
868
- return t && t.cssText ? t.cssText : "";
869
- }, e;
870
- })(), Ce = (function() {
871
- function e(e2) {
872
- this.element = be(e2), this.nodes = this.element.childNodes, this.length = 0;
873
- }
874
- return e.prototype.insertRule = function(e2, t) {
875
- if (e2 <= this.length && e2 >= 0) {
876
- var n = document.createTextNode(t);
877
- return this.element.insertBefore(n, this.nodes[e2] || null), this.length++, !0;
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
878
29
  }
879
- return !1;
880
- }, e.prototype.deleteRule = function(e2) {
881
- this.element.removeChild(this.nodes[e2]), this.length--;
882
- }, e.prototype.getRule = function(e2) {
883
- return e2 < this.length ? this.nodes[e2].textContent : "";
884
- }, e;
885
- })(), Ee = (function() {
886
- function e(e2) {
887
- this.rules = [], this.length = 0;
888
- }
889
- return e.prototype.insertRule = function(e2, t) {
890
- return e2 <= this.length && (e2 === this.length ? this.rules.push(t) : this.rules.splice(e2, 0, t), this.length++, !0);
891
- }, e.prototype.deleteRule = function(e2) {
892
- this.rules.splice(e2, 1), this.length--;
893
- }, e.prototype.getRule = function(e2) {
894
- return e2 < this.length ? this.rules[e2] : "";
895
- }, e;
896
- })(), _e = d, Ae = { isServer: !d, useCSSOMInjection: !f }, Ie = (function() {
897
- function e(e2, n, r2) {
898
- e2 === void 0 && (e2 = O), n === void 0 && (n = {});
899
- var o = this;
900
- this.options = __assign(__assign({}, Ae), e2), this.gs = n, this.names = new Map(r2), this.server = !!e2.isServer, !this.server && d && _e && (_e = !1, Se(this)), pe(this, function() {
901
- return (function(e3) {
902
- for (var t = e3.getTag(), n2 = t.length, r3 = "", o2 = function(n3) {
903
- var o3 = (function(e4) {
904
- return b.get(e4);
905
- })(n3);
906
- if (o3 === void 0) return "continue";
907
- var s2 = e3.names.get(o3);
908
- if (s2 === void 0 || !s2.size) return "continue";
909
- var i = t.getGroup(n3);
910
- if (i.length === 0) return "continue";
911
- var c2 = a + ".g" + n3 + '[id="' + o3 + '"]', u2 = "";
912
- s2.forEach(function(e4) {
913
- e4.length > 0 && (u2 += e4 + ",");
914
- }), r3 += i + c2 + '{content:"' + u2 + '"}' + p;
915
- }, s = 0; s < n2; s++) o2(s);
916
- return r3;
917
- })(o);
918
- });
919
- }
920
- return e.registerId = function(e2) {
921
- return C(e2);
922
- }, e.prototype.rehydrate = function() {
923
- !this.server && d && Se(this);
924
- }, e.prototype.reconstructWithOptions = function(n, r2) {
925
- r2 === void 0 && (r2 = !0);
926
- var o = new e(__assign(__assign({}, this.options), n), this.gs, r2 && this.names || void 0);
927
- return !this.server && d && n.target !== this.options.target && ye(this.options.target) !== ye(n.target) && Se(o), o;
928
- }, e.prototype.allocateGSInstance = function(e2) {
929
- return this.gs[e2] = (this.gs[e2] || 0) + 1;
930
- }, e.prototype.getTag = function() {
931
- return this.tag || (this.tag = (e2 = (function(e3) {
932
- var t = e3.useCSSOMInjection, n = e3.target;
933
- return e3.isServer ? new Ee(n) : t ? new Ne(n) : new Ce(n);
934
- })(this.options), new de(e2)));
935
- var e2;
936
- }, e.prototype.hasNameForId = function(e2, t) {
937
- var n, r2;
938
- return (r2 = (n = this.names.get(e2)) === null || n === void 0 ? void 0 : n.has(t)) !== null && r2 !== void 0 && r2;
939
- }, e.prototype.registerName = function(e2, t) {
940
- C(e2);
941
- var n = this.names.get(e2);
942
- n ? n.add(t) : this.names.set(e2, /* @__PURE__ */ new Set([t]));
943
- }, e.prototype.insertRules = function(e2, t, n) {
944
- this.registerName(e2, t), this.getTag().insertRules(C(e2), n);
945
- }, e.prototype.clearNames = function(e2) {
946
- this.names.has(e2) && this.names.get(e2).clear();
947
- }, e.prototype.clearRules = function(e2) {
948
- this.getTag().clearGroup(C(e2)), this.clearNames(e2);
949
- }, e.prototype.clearTag = function() {
950
- this.tag = void 0;
951
- }, e;
952
- })(), Pe = /&/g, Oe = 47, De = 42;
953
- function Te(e) {
954
- if (e.indexOf("}") === -1) return !1;
955
- for (var t = e.length, n = 0, r2 = 0, o = !1, s = 0; s < t; s++) {
956
- var i = e.charCodeAt(s);
957
- if (r2 !== 0 || o || i !== Oe || e.charCodeAt(s + 1) !== De) if (o) i === De && e.charCodeAt(s + 1) === Oe && (o = !1, s++);
958
- else if (i !== 34 && i !== 39 || s !== 0 && e.charCodeAt(s - 1) === 92) {
959
- if (r2 === 0) {
960
- if (i === 123) n++;
961
- else if (i === 125 && --n < 0) return !0;
962
- }
963
- } else r2 === 0 ? r2 = i : r2 === i && (r2 = 0);
964
- else o = !0, s++;
965
- }
966
- return n !== 0 || r2 !== 0;
967
- }
968
- function Re(e, t) {
969
- return e.map(function(e2) {
970
- return e2.type === "rule" && (e2.value = "".concat(t, " ").concat(e2.value), e2.value = e2.value.replaceAll(",", ",".concat(t, " ")), e2.props = e2.props.map(function(e3) {
971
- return "".concat(t, " ").concat(e3);
972
- })), Array.isArray(e2.children) && e2.type !== "@keyframes" && (e2.children = Re(e2.children, t)), e2;
973
- });
974
- }
975
- function xe(e) {
976
- var t, n, r2, o = O, i = o.options, a2 = i === void 0 ? O : i, c2 = o.plugins, u2 = c2 === void 0 ? P : c2, l2 = function(e2, r3, o2) {
977
- return o2.startsWith(n) && o2.endsWith(n) && o2.replaceAll(n, "").length > 0 ? ".".concat(t) : e2;
978
- }, p2 = u2.slice();
979
- p2.push(function(e2) {
980
- e2.type === RULESET && e2.value.includes("&") && (r2 || (r2 = new RegExp("\\".concat(n, "\\b"), "g")), e2.props[0] = e2.props[0].replace(Pe, n).replace(r2, l2));
981
- }), a2.prefix && p2.push(prefixer), p2.push(stringify);
982
- var d2 = [], h2 = middleware(p2.concat(rulesheet(function(e2) {
983
- return d2.push(e2);
984
- }))), f2 = function(e2, o2, i2, c3) {
985
- o2 === void 0 && (o2 = ""), i2 === void 0 && (i2 = ""), c3 === void 0 && (c3 = "&"), t = c3, n = o2, r2 = void 0;
986
- var u3 = (function(e3) {
987
- if (!Te(e3)) return e3;
988
- for (var t2 = e3.length, n2 = "", r3 = 0, o3 = 0, s = 0, i3 = !1, a3 = 0; a3 < t2; a3++) {
989
- var c4 = e3.charCodeAt(a3);
990
- if (s !== 0 || i3 || c4 !== Oe || e3.charCodeAt(a3 + 1) !== De) if (i3) c4 === De && e3.charCodeAt(a3 + 1) === Oe && (i3 = !1, a3++);
991
- else if (c4 !== 34 && c4 !== 39 || a3 !== 0 && e3.charCodeAt(a3 - 1) === 92) {
992
- if (s === 0) if (c4 === 123) o3++;
993
- else if (c4 === 125) {
994
- if (--o3 < 0) {
995
- for (var u4 = a3 + 1; u4 < t2; ) {
996
- var l4 = e3.charCodeAt(u4);
997
- if (l4 === 59 || l4 === 10) break;
998
- u4++;
999
- }
1000
- u4 < t2 && e3.charCodeAt(u4) === 59 && u4++, o3 = 0, a3 = u4 - 1, r3 = u4;
1001
- continue;
1002
- }
1003
- o3 === 0 && (n2 += e3.substring(r3, a3 + 1), r3 = a3 + 1);
1004
- } else c4 === 59 && o3 === 0 && (n2 += e3.substring(r3, a3 + 1), r3 = a3 + 1);
1005
- } else s === 0 ? s = c4 : s === c4 && (s = 0);
1006
- else i3 = !0, a3++;
1007
- }
1008
- if (r3 < t2) {
1009
- var p3 = e3.substring(r3);
1010
- Te(p3) || (n2 += p3);
1011
- }
1012
- return n2;
1013
- })((function(e3) {
1014
- if (e3.indexOf("//") === -1) return e3;
1015
- for (var t2 = e3.length, n2 = [], r3 = 0, o3 = 0, s = 0, i3 = 0; o3 < t2; ) {
1016
- var a3 = e3.charCodeAt(o3);
1017
- if (a3 !== 34 && a3 !== 39 || o3 !== 0 && e3.charCodeAt(o3 - 1) === 92) if (s === 0) if (a3 === Oe && o3 + 1 < t2 && e3.charCodeAt(o3 + 1) === De) {
1018
- for (o3 += 2; o3 + 1 < t2 && (e3.charCodeAt(o3) !== De || e3.charCodeAt(o3 + 1) !== Oe); ) o3++;
1019
- o3 += 2;
1020
- } else if (a3 === 40 && o3 >= 3 && (32 | e3.charCodeAt(o3 - 1)) == 108 && (32 | e3.charCodeAt(o3 - 2)) == 114 && (32 | e3.charCodeAt(o3 - 3)) == 117) i3 = 1, o3++;
1021
- else if (i3 > 0) a3 === 41 ? i3-- : a3 === 40 && i3++, o3++;
1022
- else if (a3 === De && o3 + 1 < t2 && e3.charCodeAt(o3 + 1) === Oe) o3 > r3 && n2.push(e3.substring(r3, o3)), r3 = o3 += 2;
1023
- else if (a3 === Oe && o3 + 1 < t2 && e3.charCodeAt(o3 + 1) === Oe) {
1024
- for (o3 > r3 && n2.push(e3.substring(r3, o3)); o3 < t2 && e3.charCodeAt(o3) !== 10; ) o3++;
1025
- r3 = o3;
1026
- } else o3++;
1027
- else o3++;
1028
- else s === 0 ? s = a3 : s === a3 && (s = 0), o3++;
1029
- }
1030
- return r3 === 0 ? e3 : (r3 < t2 && n2.push(e3.substring(r3)), n2.join(""));
1031
- })(e2)), l3 = compile(i2 || o2 ? "".concat(i2, " ").concat(o2, " { ").concat(u3, " }") : u3);
1032
- return a2.namespace && (l3 = Re(l3, a2.namespace)), d2 = [], serialize(l3, h2), d2;
1033
- };
1034
- return f2.hash = u2.length ? u2.reduce(function(e2, t2) {
1035
- return t2.name || g(15), G(e2, t2.name);
1036
- }, 5381).toString() : "", f2;
1037
- }
1038
- var je = new Ie(), ke = xe(), Me = { shouldForwardProp: void 0, styleSheet: je, stylis: ke }, Ve = h ? { Provider: function(e) {
1039
- return e.children;
1040
- }, Consumer: function(e) {
1041
- return (0, e.children)(Me);
1042
- } } : r__default.default.createContext(Me);
1043
- h || r__default.default.createContext(void 0);
1044
- function ze() {
1045
- return h ? Me : r__default.default.useContext(Ve);
1046
- }
1047
- var Le = (function() {
1048
- function e(e2, t) {
1049
- var n = this;
1050
- this.inject = function(e3, t2) {
1051
- t2 === void 0 && (t2 = ke);
1052
- var r2 = n.name + t2.hash;
1053
- e3.hasNameForId(n.id, r2) || e3.insertRules(n.id, r2, t2(n.rules, r2, "@keyframes"));
1054
- }, this.name = e2, this.id = "sc-keyframes-".concat(e2), this.rules = t, pe(this, function() {
1055
- throw g(12, String(n.name));
1056
- });
1057
- }
1058
- return e.prototype.getName = function(e2) {
1059
- return e2 === void 0 && (e2 = ke), this.name + e2.hash;
1060
- }, e;
1061
- })();
1062
- function $e(e, t) {
1063
- return t == null || typeof t == "boolean" || t === "" ? "" : typeof t != "number" || t === 0 || e in unitlessKeys || e.startsWith("--") ? String(t).trim() : "".concat(t, "px");
1064
- }
1065
- var Ye = function(e) {
1066
- return e >= "A" && e <= "Z";
30
+ return target;
1067
31
  };
1068
- function We(e) {
1069
- for (var t = "", n = 0; n < e.length; n++) {
1070
- var r2 = e[n];
1071
- if (n === 1 && r2 === "-" && e[0] === "-") return e;
1072
- Ye(r2) ? t += "-" + r2.toLowerCase() : t += r2;
1073
- }
1074
- return t.startsWith("ms-") ? "-" + t : t;
1075
- }
1076
- var qe = function(e) {
1077
- return e == null || e === !1 || e === "";
1078
- }, He = function(t) {
1079
- var n = [];
1080
- for (var r2 in t) {
1081
- var o = t[r2];
1082
- t.hasOwnProperty(r2) && !qe(o) && (Array.isArray(o) && o.isCss || se(o) ? n.push("".concat(We(r2), ":"), o, ";") : ue(o) ? n.push.apply(n, __spreadArray(__spreadArray(["".concat(r2, " {")], He(o), !1), ["}"], !1)) : n.push("".concat(We(r2), ": ").concat($e(r2, o), ";")));
1083
- }
1084
- return n;
1085
- };
1086
- function Ue(e, t, n, r2, o) {
1087
- if (o === void 0 && (o = []), typeof e == "string") return e && o.push(e), o;
1088
- if (qe(e)) return o;
1089
- if (ie(e)) return o.push(".".concat(e.styledComponentId)), o;
1090
- if (se(e)) {
1091
- if (!se(i = e) || i.prototype && i.prototype.isReactComponent || !t) return o.push(e), o;
1092
- var s = e(t);
1093
- return process.env.NODE_ENV === "production" || typeof s != "object" || Array.isArray(s) || s instanceof Le || ue(s) || s === null || console.error("".concat(L(e), " is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")), Ue(s, t, n, r2, o);
1094
- }
1095
- var i;
1096
- if (e instanceof Le) return n ? (e.inject(n, r2), o.push(e.getName(r2))) : o.push(e), o;
1097
- if (ue(e)) {
1098
- for (var a2 = He(e), c2 = 0; c2 < a2.length; c2++) o.push(a2[c2]);
1099
- return o;
1100
- }
1101
- if (!Array.isArray(e)) return o.push(e.toString()), o;
1102
- for (c2 = 0; c2 < e.length; c2++) Ue(e[c2], t, n, r2, o);
1103
- return o;
1104
- }
1105
- function Je(e) {
1106
- for (var t = 0; t < e.length; t += 1) {
1107
- var n = e[t];
1108
- if (se(n) && !ie(n)) return !1;
1109
- }
1110
- return !0;
1111
- }
1112
- var Xe = z(l), Ze = (function() {
1113
- function e(e2, t, n) {
1114
- this.rules = e2, this.staticRulesId = "", this.isStatic = process.env.NODE_ENV === "production" && (n === void 0 || n.isStatic) && Je(e2), this.componentId = t, this.baseHash = G(Xe, t), this.baseStyle = n, Ie.registerId(t);
1115
- }
1116
- return e.prototype.generateAndInjectStyles = function(e2, t, n) {
1117
- var r2 = this.baseStyle ? this.baseStyle.generateAndInjectStyles(e2, t, n).className : "";
1118
- if (this.isStatic && !n.hash) if (this.staticRulesId && t.hasNameForId(this.componentId, this.staticRulesId)) r2 = ae(r2, this.staticRulesId);
1119
- else {
1120
- var o = ce(Ue(this.rules, e2, t, n)), s = V(G(this.baseHash, o) >>> 0);
1121
- if (!t.hasNameForId(this.componentId, s)) {
1122
- var i = n(o, ".".concat(s), void 0, this.componentId);
1123
- t.insertRules(this.componentId, s, i);
1124
- }
1125
- r2 = ae(r2, s), this.staticRulesId = s;
1126
- }
1127
- else {
1128
- for (var a2 = G(this.baseHash, n.hash), c2 = "", u2 = 0; u2 < this.rules.length; u2++) {
1129
- var l2 = this.rules[u2];
1130
- if (typeof l2 == "string") c2 += l2, process.env.NODE_ENV !== "production" && (a2 = G(a2, l2));
1131
- else if (l2) {
1132
- var p2 = ce(Ue(l2, e2, t, n));
1133
- a2 = G(G(a2, String(u2)), p2), c2 += p2;
1134
- }
1135
- }
1136
- if (c2) {
1137
- var d2 = V(a2 >>> 0);
1138
- if (!t.hasNameForId(this.componentId, d2)) {
1139
- var h2 = n(c2, ".".concat(d2), void 0, this.componentId);
1140
- t.insertRules(this.componentId, d2, h2);
1141
- }
1142
- r2 = ae(r2, d2);
1143
- }
1144
- }
1145
- return { className: r2, css: typeof window > "u" ? t.getTag().getGroup(C(this.componentId)) : "" };
1146
- }, e;
1147
- })(), Ke = h ? { Provider: function(e) {
1148
- return e.children;
1149
- }, Consumer: function(e) {
1150
- return (0, e.children)(void 0);
1151
- } } : r__default.default.createContext(void 0), nt = {}, rt = /* @__PURE__ */ new Set();
1152
- function ot(s, i, a2) {
1153
- var c2 = ie(s), u2 = s, p2 = !$(s), d2 = i.attrs, f2 = d2 === void 0 ? P : d2, m = i.componentId, y2 = m === void 0 ? (function(e, t) {
1154
- var n = typeof e != "string" ? "sc" : j(e);
1155
- nt[n] = (nt[n] || 0) + 1;
1156
- var r2 = "".concat(n, "-").concat(B(l + n + nt[n]));
1157
- return t ? "".concat(t, "-").concat(r2) : r2;
1158
- })(i.displayName, i.parentComponentId) : m, v2 = i.displayName, g2 = v2 === void 0 ? (function(e) {
1159
- return $(e) ? "styled.".concat(e) : "Styled(".concat(L(e), ")");
1160
- })(s) : v2, S2 = i.displayName && i.componentId ? "".concat(j(i.displayName), "-").concat(i.componentId) : i.componentId || y2, w2 = c2 && u2.attrs ? u2.attrs.concat(f2).filter(Boolean) : f2, b2 = i.shouldForwardProp;
1161
- if (c2 && u2.shouldForwardProp) {
1162
- var N2 = u2.shouldForwardProp;
1163
- if (i.shouldForwardProp) {
1164
- var E2 = i.shouldForwardProp;
1165
- b2 = function(e, t) {
1166
- return N2(e, t) && E2(e, t);
1167
- };
1168
- } else b2 = N2;
1169
- }
1170
- var _2 = new Ze(a2, S2, c2 ? u2.componentStyle : void 0);
1171
- function A2(s2, i2) {
1172
- return (function(s3, i3, a3) {
1173
- var c3 = s3.attrs, u3 = s3.componentStyle, l2 = s3.defaultProps, p3 = s3.foldedComponentIds, d3 = s3.styledComponentId, f3 = s3.target, m2 = h ? void 0 : r__default.default.useContext(Ke), y3 = ze(), v3 = s3.shouldForwardProp || y3.shouldForwardProp;
1174
- process.env.NODE_ENV !== "production" && r__default.default.useDebugValue && r__default.default.useDebugValue(d3);
1175
- var g3 = D(i3, m2, l2) || (h ? void 0 : O), S3 = (function(e, n, r2) {
1176
- for (var o, s4 = __assign(__assign({}, n), { className: void 0, theme: r2 }), i4 = 0; i4 < e.length; i4 += 1) {
1177
- var a4 = se(o = e[i4]) ? o(s4) : o;
1178
- for (var c4 in a4) c4 === "className" ? s4.className = ae(s4.className, a4[c4]) : c4 === "style" ? s4.style = __assign(__assign({}, s4.style), a4[c4]) : s4[c4] = a4[c4];
1179
- }
1180
- return "className" in n && typeof n.className == "string" && (s4.className = ae(s4.className, n.className)), s4;
1181
- })(c3, i3, g3), w3 = S3.as || f3, b3 = {};
1182
- for (var N3 in S3) S3[N3] === void 0 || N3[0] === "$" || N3 === "as" || N3 === "theme" && S3.theme === g3 || (N3 === "forwardedAs" ? b3.as = S3.forwardedAs : v3 && !v3(N3, w3) || (b3[N3] = S3[N3], v3 || process.env.NODE_ENV !== "development" || isPropValid(N3) || rt.has(N3) || !T.has(w3) || (rt.add(N3), console.warn('styled-components: it looks like an unknown prop "'.concat(N3, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
1183
- var E3 = (function(e, t) {
1184
- var n = ze(), o = e.generateAndInjectStyles(t, n.styleSheet, n.stylis);
1185
- return process.env.NODE_ENV !== "production" && r__default.default.useDebugValue && r__default.default.useDebugValue(o.className), o;
1186
- })(u3, S3), _3 = E3.className;
1187
- process.env.NODE_ENV !== "production" && s3.warnTooManyClasses && s3.warnTooManyClasses(_3);
1188
- var A3 = ae(p3, d3);
1189
- _3 && (A3 += " " + _3), S3.className && (A3 += " " + S3.className), b3[$(w3) && !T.has(w3) ? "class" : "className"] = A3, a3 && (b3.ref = a3);
1190
- var I2 = r.createElement(w3, b3);
1191
- if (h) {
1192
- for (var P2 = [], R3 = u3, x2 = function() {
1193
- var e = y3.styleSheet.getTag().getGroup(C(R3.componentId));
1194
- if (e) {
1195
- var t = "", n = y3.styleSheet.names.get(R3.componentId);
1196
- n && n.forEach(function(e2) {
1197
- t && (t += "_"), t += e2;
1198
- }), P2.push(r__default.default.createElement("style", { key: "sc-".concat(R3.componentId), precedence: "styled-components", href: "sc-".concat(R3.componentId, "-").concat(t), children: e }));
1199
- }
1200
- R3 = R3.baseStyle;
1201
- }; R3; ) x2();
1202
- if (P2.length) return P2.reverse(), r__default.default.createElement.apply(r__default.default, __spreadArray(__spreadArray([r__default.default.Fragment, null], P2, !1), [I2], !1));
1203
- }
1204
- return I2;
1205
- })(R2, s2, i2);
1206
- }
1207
- A2.displayName = g2;
1208
- var R2 = r__default.default.forwardRef(A2);
1209
- return R2.attrs = w2, R2.componentStyle = _2, R2.displayName = g2, R2.shouldForwardProp = b2, R2.foldedComponentIds = c2 ? ae(u2.foldedComponentIds, u2.styledComponentId) : "", R2.styledComponentId = S2, R2.target = c2 ? u2.target : s, Object.defineProperty(R2, "defaultProps", { get: function() {
1210
- return this._foldedDefaultProps;
1211
- }, set: function(e) {
1212
- this._foldedDefaultProps = c2 ? (function(e2) {
1213
- for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
1214
- for (var r2 = 0, o = t; r2 < o.length; r2++) le(e2, o[r2], !0);
1215
- return e2;
1216
- })({}, u2.defaultProps, e) : e;
1217
- } }), process.env.NODE_ENV !== "production" && (I(g2, S2), R2.warnTooManyClasses = /* @__PURE__ */ (function(e, t) {
1218
- var n = {}, r2 = !1;
1219
- return function(o) {
1220
- if (!r2 && (n[o] = !0, Object.keys(n).length >= 200)) {
1221
- var s2 = t ? ' with the id of "'.concat(t, '"') : "";
1222
- console.warn("Over ".concat(200, " classes were generated for component ").concat(e).concat(s2, `.
1223
- `) + `Consider using the attrs method, together with a style object for frequently changed styles.
1224
- Example:
1225
- const Component = styled.div.attrs(props => ({
1226
- style: {
1227
- background: props.background,
1228
- },
1229
- }))\`width: 100%;\`
1230
32
 
1231
- <Component />`), r2 = !0, n = {};
1232
- }
1233
- };
1234
- })(g2, S2)), pe(R2, function() {
1235
- return ".".concat(R2.styledComponentId);
1236
- }), p2 && oe(R2, s, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), R2;
1237
- }
1238
- function st(e, t) {
1239
- for (var n = [e[0]], r2 = 0, o = t.length; r2 < o; r2 += 1) n.push(t[r2], e[r2 + 1]);
1240
- return n;
1241
- }
1242
- var it = function(e) {
1243
- return Object.assign(e, { isCss: !0 });
1244
- };
1245
- function at(t) {
1246
- for (var n = [], r2 = 1; r2 < arguments.length; r2++) n[r2 - 1] = arguments[r2];
1247
- if (se(t) || ue(t)) return it(Ue(st(P, __spreadArray([t], n, !0))));
1248
- var o = t;
1249
- return n.length === 0 && o.length === 1 && typeof o[0] == "string" ? Ue(o) : it(Ue(st(o, n)));
1250
- }
1251
- function ct(n, r2, o) {
1252
- if (o === void 0 && (o = O), !r2) throw g(1, r2);
1253
- var s = function(t) {
1254
- for (var s2 = [], i = 1; i < arguments.length; i++) s2[i - 1] = arguments[i];
1255
- return n(r2, o, at.apply(void 0, __spreadArray([t], s2, !1)));
1256
- };
1257
- return s.attrs = function(e) {
1258
- return ct(n, r2, __assign(__assign({}, o), { attrs: Array.prototype.concat(o.attrs, e).filter(Boolean) }));
1259
- }, s.withConfig = function(e) {
1260
- return ct(n, r2, __assign(__assign({}, o), e));
1261
- }, s;
1262
- }
1263
- var ut = function(e) {
1264
- return ct(ot, e);
1265
- }, lt = ut;
1266
- T.forEach(function(e) {
1267
- lt[e] = ut(e);
1268
- });
1269
- function ht(t) {
1270
- for (var n = [], r2 = 1; r2 < arguments.length; r2++) n[r2 - 1] = arguments[r2];
1271
- process.env.NODE_ENV !== "production" && typeof navigator < "u" && navigator.product === "ReactNative" && console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");
1272
- var o = ce(at.apply(void 0, __spreadArray([t], n, !1))), s = B(o);
1273
- return new Le(s, o);
1274
- }
1275
- process.env.NODE_ENV !== "production" && typeof navigator < "u" && navigator.product === "ReactNative" && console.warn(`It looks like you've imported 'styled-components' on React Native.
1276
- Perhaps you're looking to import 'styled-components/native'?
1277
- Read more about this at https://www.styled-components.com/docs/basics#react-native`);
1278
- var gt = "__sc-".concat(a, "__");
1279
- process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && typeof window < "u" && (window[gt] || (window[gt] = 0), window[gt] === 1 && console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
33
+ // src/plugin.ts
34
+ import React8 from "react";
35
+ import { definePlugin } from "sanity";
1280
36
 
1281
- See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info.`), window[gt] += 1);
1282
- const DashboardContainer = lt.div`
37
+ // src/components/SeoHealthDashboard.tsx
38
+ import { useCallback, useEffect, useMemo, useState } from "react";
39
+ import { useClient, useWorkspace } from "sanity";
40
+ import { useIntentLink } from "sanity/router";
41
+ import { usePaneRouter } from "sanity/structure";
42
+ import styled, { keyframes } from "styled-components";
43
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
44
+ var DashboardContainer = styled.div`
1283
45
  width: 100%;
1284
46
  min-height: 100%;
1285
47
  background: #f0f2f5;
1286
48
  padding: 28px 32px;
1287
49
  box-sizing: border-box;
1288
50
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1289
- `, PageHeader = lt.div`
51
+ `;
52
+ var PageHeader = styled.div`
1290
53
  margin-bottom: 28px;
1291
- `, PageTitle = lt.h1`
54
+ `;
55
+ var PageTitle = styled.h1`
1292
56
  margin: 0 0 6px 0;
1293
57
  font-size: 22px;
1294
58
  font-weight: 700;
@@ -1297,7 +61,8 @@ const DashboardContainer = lt.div`
1297
61
  display: flex;
1298
62
  align-items: center;
1299
63
  gap: 10px;
1300
- `, PreviewBadge = lt.span`
64
+ `;
65
+ var PreviewBadge = styled.span`
1301
66
  display: inline-block;
1302
67
  background: #fef3c7;
1303
68
  color: #92400e;
@@ -1308,41 +73,47 @@ const DashboardContainer = lt.div`
1308
73
  text-transform: uppercase;
1309
74
  letter-spacing: 0.5px;
1310
75
  margin-left: 8px;
1311
- `, PageSubtitle = lt.p`
76
+ `;
77
+ var PageSubtitle = styled.p`
1312
78
  margin: 0;
1313
79
  font-size: 13px;
1314
80
  color: #6b7280;
1315
- `, StatsGrid = lt.div`
81
+ `;
82
+ var StatsGrid = styled.div`
1316
83
  display: grid;
1317
84
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
1318
85
  gap: 14px;
1319
86
  margin-bottom: 20px;
1320
- `, StatCard = lt.div`
87
+ `;
88
+ var StatCard = styled.div`
1321
89
  background: #ffffff;
1322
90
  border-radius: 10px;
1323
91
  padding: 16px 18px;
1324
92
  box-shadow:
1325
93
  0 1px 3px rgba(0, 0, 0, 0.07),
1326
94
  0 1px 2px rgba(0, 0, 0, 0.05);
1327
- border-left: ${(p2) => p2.$accent ? `4px solid ${p2.$accent}` : "4px solid transparent"};
95
+ border-left: ${(p) => p.$accent ? `4px solid ${p.$accent}` : "4px solid transparent"};
1328
96
  transition: box-shadow 0.15s ease;
1329
97
 
1330
98
  &:hover {
1331
99
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
1332
100
  }
1333
- `, StatLabel = lt.div`
101
+ `;
102
+ var StatLabel = styled.div`
1334
103
  font-size: 11px;
1335
104
  font-weight: 500;
1336
105
  color: #9ca3af;
1337
106
  text-transform: uppercase;
1338
107
  letter-spacing: 0.5px;
1339
108
  margin-bottom: 8px;
1340
- `, StatValue = lt.div`
109
+ `;
110
+ var StatValue = styled.div`
1341
111
  font-size: 26px;
1342
112
  font-weight: 700;
1343
113
  color: #111827;
1344
114
  line-height: 1;
1345
- `, ControlsBar = lt.div`
115
+ `;
116
+ var ControlsBar = styled.div`
1346
117
  background: #ffffff;
1347
118
  border-radius: 10px;
1348
119
  padding: 14px 18px;
@@ -1352,11 +123,13 @@ const DashboardContainer = lt.div`
1352
123
  flex-wrap: wrap;
1353
124
  margin-bottom: 20px;
1354
125
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
1355
- `, SearchWrapper = lt.div`
126
+ `;
127
+ var SearchWrapper = styled.div`
1356
128
  position: relative;
1357
129
  flex: 1;
1358
130
  min-width: 220px;
1359
- `, SearchIconSvg = lt.span`
131
+ `;
132
+ var SearchIconSvg = styled.span`
1360
133
  position: absolute;
1361
134
  left: 11px;
1362
135
  top: 50%;
@@ -1365,7 +138,8 @@ const DashboardContainer = lt.div`
1365
138
  display: flex;
1366
139
  align-items: center;
1367
140
  pointer-events: none;
1368
- `, SearchInput = lt.input`
141
+ `;
142
+ var SearchInput = styled.input`
1369
143
  width: 100%;
1370
144
  height: 36px;
1371
145
  padding: 0 12px 0 34px;
@@ -1389,7 +163,8 @@ const DashboardContainer = lt.div`
1389
163
  background: #fff;
1390
164
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
1391
165
  }
1392
- `, StyledSelect = lt.select`
166
+ `;
167
+ var StyledSelect = styled.select`
1393
168
  height: 36px;
1394
169
  padding: 0 32px 0 12px;
1395
170
  border: 1px solid #e5e7eb;
@@ -1409,12 +184,14 @@ const DashboardContainer = lt.div`
1409
184
  background-color: #fff;
1410
185
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
1411
186
  }
1412
- `, TableCard = lt.div`
187
+ `;
188
+ var TableCard = styled.div`
1413
189
  background: #ffffff;
1414
190
  border-radius: 10px;
1415
191
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
1416
192
  overflow: hidden;
1417
- `, TableHeader = lt.div`
193
+ `;
194
+ var TableHeader = styled.div`
1418
195
  display: flex;
1419
196
  align-items: center;
1420
197
  padding: 11px 20px;
@@ -1426,7 +203,8 @@ const DashboardContainer = lt.div`
1426
203
  text-transform: uppercase;
1427
204
  letter-spacing: 0.5px;
1428
205
  gap: 12px;
1429
- `, TableRow = lt.div`
206
+ `;
207
+ var TableRow = styled.div`
1430
208
  display: flex;
1431
209
  align-items: center;
1432
210
  padding: 13px 20px;
@@ -1441,29 +219,36 @@ const DashboardContainer = lt.div`
1441
219
  &:hover {
1442
220
  background: #fafafa;
1443
221
  }
1444
- `, ColTitle = lt.div`
222
+ `;
223
+ var ColTitle = styled.div`
1445
224
  flex: 2;
1446
225
  min-width: 0;
1447
- `, TitleWrapper = lt.div`
226
+ `;
227
+ var TitleWrapper = styled.div`
1448
228
  display: flex;
1449
229
  align-items: center;
1450
230
  gap: 4px;
1451
231
  flex-wrap: wrap;
1452
232
  min-width: 0;
1453
- `, TitleCell = lt.div`
233
+ `;
234
+ var TitleCell = styled.div`
1454
235
  min-width: 0;
1455
236
  overflow: hidden;
1456
237
  flex: 1;
1457
- `, ColType = lt.div`
238
+ `;
239
+ var ColType = styled.div`
1458
240
  flex: 0.8;
1459
241
  min-width: 80px;
1460
- `, ColScore = lt.div`
242
+ `;
243
+ var ColScore = styled.div`
1461
244
  flex: 0.6;
1462
245
  min-width: 70px;
1463
- `, ColIssues = lt.div`
246
+ `;
247
+ var ColIssues = styled.div`
1464
248
  flex: 2;
1465
249
  min-width: 0;
1466
- `, DocTitleLink = lt.a`
250
+ `;
251
+ var DocTitleLink = styled.a`
1467
252
  font-size: 13px;
1468
253
  font-weight: 600;
1469
254
  color: #4f46e5;
@@ -1478,51 +263,68 @@ const DashboardContainer = lt.div`
1478
263
  color: #4338ca;
1479
264
  text-decoration: underline;
1480
265
  }
1481
- `, DocId = lt.div`
266
+ `;
267
+ var DocId = styled.div`
1482
268
  font-size: 11px;
1483
269
  color: #9ca3af;
1484
270
  margin-top: 2px;
1485
271
  white-space: nowrap;
1486
272
  overflow: hidden;
1487
273
  text-overflow: ellipsis;
1488
- `, TypeBadge = lt.span`
274
+ `;
275
+ var TypeBadge = styled.span`
1489
276
  display: inline-block;
1490
277
  padding: 3px 8px;
1491
278
  border-radius: 5px;
1492
279
  font-size: 11px;
1493
280
  font-weight: 500;
1494
- background: ${(p2) => p2.$bgColor || "#ede9fe"};
1495
- color: ${(p2) => p2.$textColor || "#5b21b6"};
1496
- `, TypeText = lt.span`
281
+ background: ${(p) => p.$bgColor || "#ede9fe"};
282
+ color: ${(p) => p.$textColor || "#5b21b6"};
283
+ `;
284
+ var TypeText = styled.span`
1497
285
  font-size: 12px;
1498
286
  font-weight: 500;
1499
287
  color: #374151;
1500
- `, CustomBadge = lt.span`
288
+ `;
289
+ var CustomBadge = styled.span`
1501
290
  display: inline-block;
1502
291
  padding: 2px 6px;
1503
292
  border-radius: 4px;
1504
- font-size: ${(p2) => p2.$fontSize || "10px"};
293
+ font-size: ${(p) => p.$fontSize || "10px"};
1505
294
  font-weight: 600;
1506
295
  margin-left: 6px;
1507
- background: ${(p2) => p2.$bgColor || "#e0e7ff"};
1508
- color: ${(p2) => p2.$textColor || "#3730a3"};
296
+ background: ${(p) => p.$bgColor || "#e0e7ff"};
297
+ color: ${(p) => p.$textColor || "#3730a3"};
1509
298
  white-space: nowrap;
1510
- `, ScoreBadge = lt.span`
299
+ `;
300
+ var ScoreBadge = styled.span`
1511
301
  display: inline-block;
1512
302
  padding: 4px 10px;
1513
303
  border-radius: 6px;
1514
304
  font-size: 12px;
1515
305
  font-weight: 700;
1516
- background: ${(p2) => p2.$score >= 80 ? "#d1fae5" : p2.$score >= 60 ? "#fef3c7" : p2.$score >= 40 ? "#ffedd5" : "#fee2e2"};
1517
- color: ${(p2) => p2.$score >= 80 ? "#065f46" : p2.$score >= 60 ? "#92400e" : p2.$score >= 40 ? "#9a3412" : "#991b1b"};
1518
- `, IssueTag = lt.div`
306
+ background: ${(p) => {
307
+ if (p.$score >= 80) return "#d1fae5";
308
+ if (p.$score >= 60) return "#fef3c7";
309
+ if (p.$score >= 40) return "#ffedd5";
310
+ return "#fee2e2";
311
+ }};
312
+ color: ${(p) => {
313
+ if (p.$score >= 80) return "#065f46";
314
+ if (p.$score >= 60) return "#92400e";
315
+ if (p.$score >= 40) return "#9a3412";
316
+ return "#991b1b";
317
+ }};
318
+ `;
319
+ var IssueTag = styled.div`
1519
320
  font-size: 11px;
1520
321
  color: #ef4444;
1521
322
  line-height: 1.5;
1522
323
  white-space: nowrap;
1523
324
  overflow: hidden;
1524
325
  text-overflow: ellipsis;
1525
- `, MoreIssues = lt.div`
326
+ `;
327
+ var MoreIssues = styled.div`
1526
328
  font-size: 11px;
1527
329
  color: #6b7280;
1528
330
  cursor: pointer;
@@ -1531,10 +333,12 @@ const DashboardContainer = lt.div`
1531
333
  &:hover {
1532
334
  color: #374151;
1533
335
  }
1534
- `, MoreIssuesWrapper = lt.div`
336
+ `;
337
+ var MoreIssuesWrapper = styled.div`
1535
338
  position: relative;
1536
339
  display: inline-block;
1537
- `, IssuesPopover = lt.div`
340
+ `;
341
+ var IssuesPopover = styled.div`
1538
342
  position: absolute;
1539
343
  bottom: auto;
1540
344
  left: 0;
@@ -1561,7 +365,8 @@ const DashboardContainer = lt.div`
1561
365
  border-right: 6px solid transparent;
1562
366
  border-top: 6px solid #1f2937;
1563
367
  }
1564
- `, PopoverIssueItem = lt.div`
368
+ `;
369
+ var PopoverIssueItem = styled.div`
1565
370
  display: flex;
1566
371
  gap: 6px;
1567
372
  margin-bottom: 6px;
@@ -1569,13 +374,15 @@ const DashboardContainer = lt.div`
1569
374
  &:last-child {
1570
375
  margin-bottom: 0;
1571
376
  }
1572
- `, UpgradeContainer = lt.div`
377
+ `;
378
+ var UpgradeContainer = styled.div`
1573
379
  display: flex;
1574
380
  align-items: center;
1575
381
  justify-content: center;
1576
382
  min-height: 100%;
1577
383
  padding: 60px 24px;
1578
- `, UpgradeBox = lt.div`
384
+ `;
385
+ var UpgradeBox = styled.div`
1579
386
  background: #ffffff;
1580
387
  border-radius: 16px;
1581
388
  padding: 48px 40px;
@@ -1586,20 +393,24 @@ const DashboardContainer = lt.div`
1586
393
  0 4px 24px rgba(0, 0, 0, 0.08),
1587
394
  0 1px 4px rgba(0, 0, 0, 0.05);
1588
395
  border: 1px solid #e5e7eb;
1589
- `, UpgradeLock = lt.div`
396
+ `;
397
+ var UpgradeLock = styled.div`
1590
398
  font-size: 40px;
1591
399
  margin-bottom: 16px;
1592
- `, UpgradeTitle = lt.h2`
400
+ `;
401
+ var UpgradeTitle = styled.h2`
1593
402
  margin: 0 0 10px;
1594
403
  font-size: 20px;
1595
404
  font-weight: 700;
1596
405
  color: #111827;
1597
- `, UpgradeText = lt.p`
406
+ `;
407
+ var UpgradeText = styled.p`
1598
408
  margin: 0 0 20px;
1599
409
  font-size: 14px;
1600
410
  color: #6b7280;
1601
411
  line-height: 1.6;
1602
- `, UpgradeCode = lt.pre`
412
+ `;
413
+ var UpgradeCode = styled.pre`
1603
414
  background: #f3f4f6;
1604
415
  border-radius: 8px;
1605
416
  padding: 14px 16px;
@@ -1610,7 +421,8 @@ const DashboardContainer = lt.div`
1610
421
  overflow-x: auto;
1611
422
  line-height: 1.6;
1612
423
  border: 1px solid #e5e7eb;
1613
- `, UpgradeButton = lt.a`
424
+ `;
425
+ var UpgradeButton = styled.a`
1614
426
  display: inline-block;
1615
427
  background: #4f46e5;
1616
428
  color: #ffffff;
@@ -1624,7 +436,8 @@ const DashboardContainer = lt.div`
1624
436
  &:hover {
1625
437
  background: #4338ca;
1626
438
  }
1627
- `, ReloadButton = lt.button`
439
+ `;
440
+ var ReloadButton = styled.button`
1628
441
  display: inline-block;
1629
442
  background: transparent;
1630
443
  color: #6b7280;
@@ -1645,10 +458,15 @@ const DashboardContainer = lt.div`
1645
458
  color: #374151;
1646
459
  border-color: #9ca3af;
1647
460
  }
1648
- `, DocTitleAnchor = ({ id, type, structureTool, children }) => {
1649
- const { basePath } = sanity.useWorkspace(), { onClick: intentOnClick, href: intentHref } = router.useIntentLink({ intent: "edit", params: { id, type } }), href = structureTool ? `${basePath}/${structureTool}/intent/edit/id=${id};type=${type}/` : intentHref;
1650
- return /* @__PURE__ */ jsxRuntime.jsx(DocTitleLink, { href, onClick: structureTool ? void 0 : intentOnClick, title: "Open document", children });
1651
- }, PaneLinkWrapper = lt.span`
461
+ `;
462
+ var DocTitleAnchor = ({ id, type, structureTool, children }) => {
463
+ const { basePath } = useWorkspace();
464
+ const { onClick: intentOnClick, href: intentHref } = useIntentLink({ intent: "edit", params: { id, type } });
465
+ const href = structureTool ? `${basePath}/${structureTool}/intent/edit/id=${id};type=${type}/` : intentHref;
466
+ const onClick = structureTool ? void 0 : intentOnClick;
467
+ return /* @__PURE__ */ jsx(DocTitleLink, { href, onClick, title: "Open document", children });
468
+ };
469
+ var PaneLinkWrapper = styled.span`
1652
470
  display: block;
1653
471
  min-width: 0;
1654
472
  overflow: hidden;
@@ -1669,19 +487,24 @@ const DashboardContainer = lt.div`
1669
487
  text-decoration: underline;
1670
488
  }
1671
489
  }
1672
- `, DocTitleAnchorPane = ({
490
+ `;
491
+ var DocTitleAnchorPane = ({
1673
492
  id,
1674
493
  type,
1675
494
  children
1676
495
  }) => {
1677
- const { ChildLink } = structure.usePaneRouter();
1678
- return /* @__PURE__ */ jsxRuntime.jsx(PaneLinkWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(ChildLink, { childId: id, childParameters: { type }, children }) });
1679
- }, DocBadgeRenderer = ({ doc, docBadge }) => {
496
+ const { ChildLink } = usePaneRouter();
497
+ return /* @__PURE__ */ jsx(PaneLinkWrapper, { children: /* @__PURE__ */ jsx(ChildLink, { childId: id, childParameters: { type }, children }) });
498
+ };
499
+ var DocBadgeRenderer = ({ doc, docBadge }) => {
1680
500
  const badge = docBadge(doc);
1681
- return badge ? /* @__PURE__ */ jsxRuntime.jsx(CustomBadge, { $bgColor: badge.bgColor, $textColor: badge.textColor, $fontSize: badge.fontSize, children: badge.label }) : null;
1682
- }, spin = ht`
501
+ if (!badge) return null;
502
+ return /* @__PURE__ */ jsx(CustomBadge, { $bgColor: badge.bgColor, $textColor: badge.textColor, $fontSize: badge.fontSize, children: badge.label });
503
+ };
504
+ var spin = keyframes`
1683
505
  to { transform: rotate(360deg); }
1684
- `, Spinner = lt.div`
506
+ `;
507
+ var Spinner = styled.div`
1685
508
  width: 28px;
1686
509
  height: 28px;
1687
510
  border: 3px solid #e5e7eb;
@@ -1689,17 +512,20 @@ const DashboardContainer = lt.div`
1689
512
  border-radius: 50%;
1690
513
  animation: ${spin} 0.7s linear infinite;
1691
514
  margin: 0 auto 12px;
1692
- `, LoadingState = lt.div`
515
+ `;
516
+ var LoadingState = styled.div`
1693
517
  padding: 48px 24px;
1694
518
  text-align: center;
1695
519
  color: #6b7280;
1696
520
  font-size: 13px;
1697
- `, EmptyState = lt.div`
521
+ `;
522
+ var EmptyState = styled.div`
1698
523
  padding: 48px 24px;
1699
524
  text-align: center;
1700
525
  color: #9ca3af;
1701
526
  font-size: 13px;
1702
- `, TYPE_COLOR_PALETTE = [
527
+ `;
528
+ var TYPE_COLOR_PALETTE = [
1703
529
  { bg: "#dbeafe", text: "#0c4a6e" },
1704
530
  // Blue
1705
531
  { bg: "#dcfce7", text: "#14532d" },
@@ -1732,181 +558,267 @@ const DashboardContainer = lt.div`
1732
558
  // Light Purple
1733
559
  { bg: "#fffbeb", text: "#92400e" }
1734
560
  // Light Amber
1735
- ], getTypeColor = (type) => {
1736
- let hash2 = 0;
561
+ ];
562
+ var getTypeColor = (type) => {
563
+ let hash = 0;
1737
564
  for (let i = 0; i < type.length; i += 1) {
1738
- const char2 = type.charCodeAt(i);
1739
- hash2 = Math.abs(hash2 * 31 + char2);
565
+ const char = type.charCodeAt(i);
566
+ hash = Math.abs(hash * 31 + char);
1740
567
  }
1741
- const colorIndex = hash2 % TYPE_COLOR_PALETTE.length;
568
+ const colorIndex = hash % TYPE_COLOR_PALETTE.length;
1742
569
  return TYPE_COLOR_PALETTE[colorIndex];
1743
- }, getStatusCategory = (score) => score >= 80 ? "excellent" : score >= 60 ? "good" : score >= 40 ? "fair" : score > 0 ? "poor" : "missing", scoreMetaTitle = (title) => {
570
+ };
571
+ var getStatusCategory = (score) => {
572
+ if (score >= 80) return "excellent";
573
+ if (score >= 60) return "good";
574
+ if (score >= 40) return "fair";
575
+ if (score > 0) return "poor";
576
+ return "missing";
577
+ };
578
+ var scoreMetaTitle = (title) => {
1744
579
  const issues = [];
1745
580
  let score = 0;
1746
- return title && title.length >= 50 && title.length <= 60 ? score = 15 : title && title.length > 0 ? (score = 10, title.length < 50 && issues.push("Meta title too short (< 50 chars)"), title.length > 60 && issues.push("Meta title too long (> 60 chars)")) : issues.push("Missing meta title"), { score, issues };
1747
- }, scoreMetaDescription = (description) => {
581
+ if (title && title.length >= 50 && title.length <= 60) {
582
+ score = 15;
583
+ } else if (title && title.length > 0) {
584
+ score = 10;
585
+ if (title.length < 50) issues.push("Meta title too short (< 50 chars)");
586
+ if (title.length > 60) issues.push("Meta title too long (> 60 chars)");
587
+ } else {
588
+ issues.push("Missing meta title");
589
+ }
590
+ return { score, issues };
591
+ };
592
+ var scoreMetaDescription = (description) => {
1748
593
  const issues = [];
1749
594
  let score = 0;
1750
- return description && description.length >= 120 && description.length <= 160 ? score = 15 : description && description.length > 0 ? (score = 10, description.length < 120 && issues.push("Meta description too short (< 120 chars)"), description.length > 160 && issues.push("Meta description too long (> 160 chars)")) : issues.push("Missing meta description"), { score, issues };
1751
- }, scoreOpenGraph = (openGraph2) => {
595
+ if (description && description.length >= 120 && description.length <= 160) {
596
+ score = 15;
597
+ } else if (description && description.length > 0) {
598
+ score = 10;
599
+ if (description.length < 120) issues.push("Meta description too short (< 120 chars)");
600
+ if (description.length > 160) issues.push("Meta description too long (> 160 chars)");
601
+ } else {
602
+ issues.push("Missing meta description");
603
+ }
604
+ return { score, issues };
605
+ };
606
+ var scoreOpenGraph = (openGraph2) => {
1752
607
  const issues = [];
1753
608
  let score = 0;
1754
- return openGraph2 ? (openGraph2.title ? score += 6 : issues.push("Missing OG title"), openGraph2.description ? score += 6 : issues.push("Missing OG description"), openGraph2.image ? score += 6 : issues.push("Missing OG image"), openGraph2.type ? score += 7 : issues.push("Missing OG type")) : issues.push("Open Graph not configured"), { score, issues };
1755
- }, scoreTwitterCard = (twitter2) => {
609
+ if (openGraph2) {
610
+ if (openGraph2.title) score += 6;
611
+ else issues.push("Missing OG title");
612
+ if (openGraph2.description) score += 6;
613
+ else issues.push("Missing OG description");
614
+ if (openGraph2.image) score += 6;
615
+ else issues.push("Missing OG image");
616
+ if (openGraph2.type) score += 7;
617
+ else issues.push("Missing OG type");
618
+ } else {
619
+ issues.push("Open Graph not configured");
620
+ }
621
+ return { score, issues };
622
+ };
623
+ var scoreTwitterCard = (twitter2) => {
1756
624
  const issues = [];
1757
625
  let score = 0;
1758
- return twitter2 ? (twitter2.title ? score += 5 : issues.push("Missing Twitter title"), twitter2.description ? score += 5 : issues.push("Missing Twitter description"), twitter2.image ? score += 5 : issues.push("Missing Twitter image")) : issues.push("Twitter Card not configured"), { score, issues };
1759
- }, calculateHealthScore = (doc) => {
626
+ if (twitter2) {
627
+ if (twitter2.title) score += 5;
628
+ else issues.push("Missing Twitter title");
629
+ if (twitter2.description) score += 5;
630
+ else issues.push("Missing Twitter description");
631
+ if (twitter2.image) score += 5;
632
+ else issues.push("Missing Twitter image");
633
+ } else {
634
+ issues.push("Twitter Card not configured");
635
+ }
636
+ return { score, issues };
637
+ };
638
+ var calculateHealthScore = (doc) => {
1760
639
  let totalScore = 0;
1761
640
  const allIssues = [];
1762
- if (!doc.seo)
641
+ if (!doc.seo) {
1763
642
  return { score: 0, status: "missing", issues: ["SEO fields not configured"] };
1764
- const { title, description, metaImage, keywords, robots: robots2, openGraph: openGraph2, twitter: twitter2 } = doc.seo, titleScore = scoreMetaTitle(title);
1765
- totalScore += titleScore.score, allIssues.push(...titleScore.issues);
643
+ }
644
+ const { title, description, metaImage, keywords, robots, openGraph: openGraph2, twitter: twitter2 } = doc.seo;
645
+ const titleScore = scoreMetaTitle(title);
646
+ totalScore += titleScore.score;
647
+ allIssues.push(...titleScore.issues);
1766
648
  const descriptionScore = scoreMetaDescription(description);
1767
- totalScore += descriptionScore.score, allIssues.push(...descriptionScore.issues), metaImage ? totalScore += 10 : allIssues.push("Missing meta image"), keywords && keywords.length > 0 ? totalScore += 10 : allIssues.push("No keywords defined");
649
+ totalScore += descriptionScore.score;
650
+ allIssues.push(...descriptionScore.issues);
651
+ if (metaImage) {
652
+ totalScore += 10;
653
+ } else {
654
+ allIssues.push("Missing meta image");
655
+ }
656
+ if (keywords && keywords.length > 0) {
657
+ totalScore += 10;
658
+ } else {
659
+ allIssues.push("No keywords defined");
660
+ }
1768
661
  const ogScore = scoreOpenGraph(openGraph2);
1769
- totalScore += ogScore.score, allIssues.push(...ogScore.issues);
662
+ totalScore += ogScore.score;
663
+ allIssues.push(...ogScore.issues);
1770
664
  const twitterScore = scoreTwitterCard(twitter2);
1771
- totalScore += twitterScore.score, allIssues.push(...twitterScore.issues), robots2 && !robots2.noIndex && (totalScore += 5);
665
+ totalScore += twitterScore.score;
666
+ allIssues.push(...twitterScore.issues);
667
+ if (robots && !robots.noIndex) {
668
+ totalScore += 5;
669
+ }
1772
670
  const status = getStatusCategory(totalScore);
1773
671
  return { score: totalScore, status, issues: allIssues };
1774
- }, resolveTypeLabel = (type, typeLabels) => typeLabels?.[type] ?? type, buildTitleProjection = (titleField) => !titleField || titleField === "title" ? "title" : typeof titleField == "string" ? `"title": ${titleField}` : `"title": select(${Object.entries(titleField).map(([type, field]) => `_type == "${type}" => ${field}`).join(", ")}, title)`, generateDummyData = () => [
1775
- {
1776
- _id: "preview-post-1",
1777
- _type: "post",
1778
- title: "Getting Started with SEO Best Practices",
1779
- slug: { current: "getting-started-seo" },
1780
- _updatedAt: new Date(Date.now() - 1728e5).toISOString(),
1781
- seo: {
1782
- title: "Getting Started with SEO Best Practices | My Blog",
1783
- description: "Learn the fundamentals of SEO optimization to improve your website visibility and search rankings.",
1784
- keywords: ["seo", "best practices", "optimization"],
1785
- metaImage: { _type: "image", asset: { _ref: "image-123", _type: "reference" } },
1786
- openGraph: {
1787
- title: "SEO Best Practices Guide",
1788
- description: "Master SEO optimization",
1789
- image: { _type: "image", asset: { _ref: "image-123", _type: "reference" }, alt: "SEO Guide" },
1790
- type: "article"
1791
- },
1792
- twitter: {
1793
- title: "SEO Best Practices",
1794
- description: "Learn SEO optimization",
1795
- image: { _type: "image", asset: { _ref: "image-123", _type: "reference" }, alt: "Guide" },
1796
- card: "summary_large_image"
672
+ };
673
+ var resolveTypeLabel = (type, typeLabels) => {
674
+ var _a;
675
+ return (_a = typeLabels == null ? void 0 : typeLabels[type]) != null ? _a : type;
676
+ };
677
+ var buildTitleProjection = (titleField) => {
678
+ if (!titleField || titleField === "title") return "title";
679
+ if (typeof titleField === "string") return `"title": ${titleField}`;
680
+ const cases = Object.entries(titleField).map(([type, field]) => `_type == "${type}" => ${field}`).join(", ");
681
+ return `"title": select(${cases}, title)`;
682
+ };
683
+ var generateDummyData = () => {
684
+ const dummyDocs = [
685
+ {
686
+ _id: "preview-post-1",
687
+ _type: "post",
688
+ title: "Getting Started with SEO Best Practices",
689
+ slug: { current: "getting-started-seo" },
690
+ _updatedAt: new Date(Date.now() - 2 * 24 * 60 * 60 * 1e3).toISOString(),
691
+ seo: {
692
+ title: "Getting Started with SEO Best Practices | My Blog",
693
+ description: "Learn the fundamentals of SEO optimization to improve your website visibility and search rankings.",
694
+ keywords: ["seo", "best practices", "optimization"],
695
+ metaImage: { _type: "image", asset: { _ref: "image-123", _type: "reference" } },
696
+ openGraph: {
697
+ title: "SEO Best Practices Guide",
698
+ description: "Master SEO optimization",
699
+ image: { _type: "image", asset: { _ref: "image-123", _type: "reference" }, alt: "SEO Guide" },
700
+ type: "article"
701
+ },
702
+ twitter: {
703
+ title: "SEO Best Practices",
704
+ description: "Learn SEO optimization",
705
+ image: { _type: "image", asset: { _ref: "image-123", _type: "reference" }, alt: "Guide" },
706
+ card: "summary_large_image"
707
+ }
1797
708
  }
1798
- }
1799
- },
1800
- {
1801
- _id: "preview-post-2",
1802
- _type: "post",
1803
- title: "Advanced Analytics Strategy",
1804
- slug: { current: "advanced-analytics" },
1805
- _updatedAt: new Date(Date.now() - 432e6).toISOString(),
1806
- seo: {
1807
- title: "Advanced Analytics",
1808
- description: "Strategy tips",
1809
- keywords: ["analytics", "data"],
1810
- openGraph: {
1811
- title: "Analytics Guide"
709
+ },
710
+ {
711
+ _id: "preview-post-2",
712
+ _type: "post",
713
+ title: "Advanced Analytics Strategy",
714
+ slug: { current: "advanced-analytics" },
715
+ _updatedAt: new Date(Date.now() - 5 * 24 * 60 * 60 * 1e3).toISOString(),
716
+ seo: {
717
+ title: "Advanced Analytics",
718
+ description: "Strategy tips",
719
+ keywords: ["analytics", "data"],
720
+ openGraph: {
721
+ title: "Analytics Guide"
722
+ }
1812
723
  }
1813
- }
1814
- },
1815
- {
1816
- _id: "preview-page-1",
1817
- _type: "page",
1818
- title: "About Us",
1819
- slug: { current: "about" },
1820
- _updatedAt: new Date(Date.now() - 864e6).toISOString(),
1821
- seo: {
1822
- title: "About",
1823
- keywords: ["company", "team"],
1824
- metaImage: { _type: "image", asset: { _ref: "image-456", _type: "reference" } }
1825
- }
1826
- },
1827
- {
1828
- _id: "preview-post-3",
1829
- _type: "post",
1830
- title: "Content Marketing Trends for 2024",
1831
- slug: { current: "content-marketing-trends" },
1832
- _updatedAt: new Date(Date.now() - 864e5).toISOString(),
1833
- seo: {
1834
- title: "Content Marketing Trends 2024",
1835
- description: "Discover the latest content marketing trends and strategies to engage your audience effectively.",
1836
- keywords: ["content marketing", "trends", "strategy", "engagement"],
1837
- metaImage: { _type: "image", asset: { _ref: "image-789", _type: "reference" } },
1838
- openGraph: {
724
+ },
725
+ {
726
+ _id: "preview-page-1",
727
+ _type: "page",
728
+ title: "About Us",
729
+ slug: { current: "about" },
730
+ _updatedAt: new Date(Date.now() - 10 * 24 * 60 * 60 * 1e3).toISOString(),
731
+ seo: {
732
+ title: "About",
733
+ keywords: ["company", "team"],
734
+ metaImage: { _type: "image", asset: { _ref: "image-456", _type: "reference" } }
735
+ }
736
+ },
737
+ {
738
+ _id: "preview-post-3",
739
+ _type: "post",
740
+ title: "Content Marketing Trends for 2024",
741
+ slug: { current: "content-marketing-trends" },
742
+ _updatedAt: new Date(Date.now() - 1 * 24 * 60 * 60 * 1e3).toISOString(),
743
+ seo: {
1839
744
  title: "Content Marketing Trends 2024",
1840
- description: "Latest trends in content marketing",
1841
- image: { _type: "image", asset: { _ref: "image-789", _type: "reference" }, alt: "Trends" },
1842
- type: "article"
1843
- },
1844
- twitter: {
1845
- title: "Content Marketing Trends",
1846
- description: "Discover the latest trends",
1847
- card: "summary"
745
+ description: "Discover the latest content marketing trends and strategies to engage your audience effectively.",
746
+ keywords: ["content marketing", "trends", "strategy", "engagement"],
747
+ metaImage: { _type: "image", asset: { _ref: "image-789", _type: "reference" } },
748
+ openGraph: {
749
+ title: "Content Marketing Trends 2024",
750
+ description: "Latest trends in content marketing",
751
+ image: { _type: "image", asset: { _ref: "image-789", _type: "reference" }, alt: "Trends" },
752
+ type: "article"
753
+ },
754
+ twitter: {
755
+ title: "Content Marketing Trends",
756
+ description: "Discover the latest trends",
757
+ card: "summary"
758
+ }
1848
759
  }
1849
- }
1850
- },
1851
- {
1852
- _id: "preview-post-4",
1853
- _type: "product",
1854
- title: "Pro Plan",
1855
- slug: { current: "pro-plan" },
1856
- _updatedAt: new Date(Date.now() - 1296e6).toISOString(),
1857
- seo: {
1858
- title: "Pro",
1859
- keywords: ["pricing"]
1860
- }
1861
- },
1862
- {
1863
- _id: "preview-page-2",
1864
- _type: "page",
1865
- title: "Contact",
1866
- slug: { current: "contact" },
1867
- _updatedAt: new Date(Date.now() - 6912e5).toISOString(),
1868
- seo: {
1869
- openGraph: {
1870
- title: "Get in Touch"
760
+ },
761
+ {
762
+ _id: "preview-post-4",
763
+ _type: "product",
764
+ title: "Pro Plan",
765
+ slug: { current: "pro-plan" },
766
+ _updatedAt: new Date(Date.now() - 15 * 24 * 60 * 60 * 1e3).toISOString(),
767
+ seo: {
768
+ title: "Pro",
769
+ keywords: ["pricing"]
1871
770
  }
1872
- }
1873
- },
1874
- {
1875
- _id: "preview-post-5",
1876
- _type: "post",
1877
- title: "Mobile Optimization Guide",
1878
- slug: { current: "mobile-optimization" },
1879
- _updatedAt: new Date(Date.now() - 2592e5).toISOString(),
1880
- seo: {
1881
- title: "Mobile Optimization Guide: Best Practices for Responsive Design",
1882
- description: "Complete guide to mobile optimization including responsive design, performance tips, and user experience best practices for modern web development.",
1883
- keywords: ["mobile", "optimization", "responsive", "performance"],
1884
- metaImage: { _type: "image", asset: { _ref: "image-mobile", _type: "reference" } },
1885
- openGraph: {
1886
- title: "Mobile Optimization Best Practices",
1887
- description: "Master mobile web optimization",
1888
- image: { _type: "image", asset: { _ref: "image-mobile", _type: "reference" }, alt: "Mobile" },
1889
- type: "article"
1890
- },
1891
- twitter: {
1892
- title: "Mobile Optimization Tips",
1893
- description: "Responsive design best practices",
1894
- image: { _type: "image", asset: { _ref: "image-mobile", _type: "reference" }, alt: "Mobile" },
1895
- card: "summary_large_image"
771
+ },
772
+ {
773
+ _id: "preview-page-2",
774
+ _type: "page",
775
+ title: "Contact",
776
+ slug: { current: "contact" },
777
+ _updatedAt: new Date(Date.now() - 8 * 24 * 60 * 60 * 1e3).toISOString(),
778
+ seo: {
779
+ openGraph: {
780
+ title: "Get in Touch"
781
+ }
782
+ }
783
+ },
784
+ {
785
+ _id: "preview-post-5",
786
+ _type: "post",
787
+ title: "Mobile Optimization Guide",
788
+ slug: { current: "mobile-optimization" },
789
+ _updatedAt: new Date(Date.now() - 3 * 24 * 60 * 60 * 1e3).toISOString(),
790
+ seo: {
791
+ title: "Mobile Optimization Guide: Best Practices for Responsive Design",
792
+ description: "Complete guide to mobile optimization including responsive design, performance tips, and user experience best practices for modern web development.",
793
+ keywords: ["mobile", "optimization", "responsive", "performance"],
794
+ metaImage: { _type: "image", asset: { _ref: "image-mobile", _type: "reference" } },
795
+ openGraph: {
796
+ title: "Mobile Optimization Best Practices",
797
+ description: "Master mobile web optimization",
798
+ image: { _type: "image", asset: { _ref: "image-mobile", _type: "reference" }, alt: "Mobile" },
799
+ type: "article"
800
+ },
801
+ twitter: {
802
+ title: "Mobile Optimization Tips",
803
+ description: "Responsive design best practices",
804
+ image: { _type: "image", asset: { _ref: "image-mobile", _type: "reference" }, alt: "Mobile" },
805
+ card: "summary_large_image"
806
+ }
1896
807
  }
1897
808
  }
1898
- }
1899
- ].map((doc) => ({
1900
- ...doc,
1901
- health: calculateHealthScore(doc)
1902
- })), SeoHealthDashboard = ({
809
+ ];
810
+ return dummyDocs.map((doc) => __spreadProps(__spreadValues({}, doc), {
811
+ health: calculateHealthScore(doc)
812
+ }));
813
+ };
814
+ var SeoHealthDashboard = ({
1903
815
  icon = "\u{1F4CA}",
1904
816
  title = "SEO Health Dashboard",
1905
817
  description = "Monitor and optimize SEO fields across all your documents",
1906
- showTypeColumn = !0,
1907
- showDocumentId = !0,
818
+ showTypeColumn = true,
819
+ showDocumentId = true,
1908
820
  queryTypes,
1909
- queryRequireSeo = !0,
821
+ queryRequireSeo = true,
1910
822
  customQuery,
1911
823
  apiVersion = "2023-01-01",
1912
824
  licenseKey,
@@ -1917,12 +829,24 @@ const DashboardContainer = lt.div`
1917
829
  loadingLicense,
1918
830
  loadingDocuments,
1919
831
  noDocuments,
1920
- previewMode = !1,
1921
- openInPane = !1,
832
+ previewMode = false,
833
+ openInPane = false,
1922
834
  structureTool
1923
835
  }) => {
1924
- const client = sanity.useClient({ apiVersion }), [licenseStatus, setLicenseStatus] = r.useState("loading"), [documents, setDocuments] = r.useState([]), [loading, setLoading] = r.useState(!0), [searchQuery, setSearchQuery] = r.useState(""), [filterStatus, setFilterStatus] = r.useState("all"), [filterType, setFilterType] = r.useState("all"), [sortBy, setSortBy] = r.useState("score"), [activePopover, setActivePopover] = r.useState(null), VALIDATION_ENDPOINT = "https://sanity-plugin-seofields.thehardik.in/api/validate-license", CACHE_TTL_MS = 3600 * 1e3, validateLicense = r.useCallback(
1925
- async (forceRefresh = !1) => {
836
+ const client = useClient({ apiVersion });
837
+ const [licenseStatus, setLicenseStatus] = useState("loading");
838
+ const [documents, setDocuments] = useState([]);
839
+ const [loading, setLoading] = useState(true);
840
+ const [searchQuery, setSearchQuery] = useState("");
841
+ const [filterStatus, setFilterStatus] = useState("all");
842
+ const [filterType, setFilterType] = useState("all");
843
+ const [sortBy, setSortBy] = useState("score");
844
+ const [activePopover, setActivePopover] = useState(null);
845
+ const VALIDATION_ENDPOINT = "https://sanity-plugin-seofields.thehardik.in/api/validate-license";
846
+ const CACHE_TTL_MS = 60 * 60 * 1e3;
847
+ const validateLicense = useCallback(
848
+ async (forceRefresh = false) => {
849
+ var _a;
1926
850
  if (previewMode) {
1927
851
  setLicenseStatus("valid");
1928
852
  return;
@@ -1931,13 +855,15 @@ const DashboardContainer = lt.div`
1931
855
  setLicenseStatus("invalid");
1932
856
  return;
1933
857
  }
1934
- const projectId = client.config().projectId ?? "", cacheKey = `seofields_license_${projectId}`;
1935
- if (forceRefresh)
858
+ const projectId = (_a = client.config().projectId) != null ? _a : "";
859
+ const cacheKey = `seofields_license_${projectId}`;
860
+ if (forceRefresh) {
1936
861
  try {
1937
862
  sessionStorage.removeItem(cacheKey);
1938
- } catch {
863
+ } catch (e) {
1939
864
  }
1940
- if (!forceRefresh)
865
+ }
866
+ if (!forceRefresh) {
1941
867
  try {
1942
868
  const cached = sessionStorage.getItem(cacheKey);
1943
869
  if (cached) {
@@ -1947,48 +873,57 @@ const DashboardContainer = lt.div`
1947
873
  return;
1948
874
  }
1949
875
  }
1950
- } catch {
876
+ } catch (e) {
1951
877
  }
878
+ }
1952
879
  setLicenseStatus("loading");
1953
880
  try {
1954
- const valid = (await fetch(VALIDATION_ENDPOINT, {
881
+ const res = await fetch(VALIDATION_ENDPOINT, {
1955
882
  method: "POST",
1956
883
  headers: { "Content-Type": "application/json" },
1957
884
  body: JSON.stringify({ licenseKey, projectId })
1958
- })).ok;
885
+ });
886
+ const valid = res.ok;
1959
887
  setLicenseStatus(valid ? "valid" : "invalid");
1960
888
  try {
1961
889
  sessionStorage.setItem(cacheKey, JSON.stringify({ valid, ts: Date.now() }));
1962
- } catch {
890
+ } catch (e) {
1963
891
  }
1964
- } catch {
892
+ } catch (e) {
1965
893
  setLicenseStatus("valid");
1966
894
  }
1967
895
  },
1968
896
  // eslint-disable-next-line react-hooks/exhaustive-deps
1969
897
  [licenseKey, previewMode]
1970
898
  );
1971
- r.useEffect(() => {
899
+ useEffect(() => {
1972
900
  validateLicense();
1973
901
  }, [licenseKey, previewMode]);
1974
902
  const handleMouseEnterIssues = (el, issues) => {
1975
903
  if (!el) return;
1976
- const rect = el.getBoundingClientRect(), popoverWidth = 280, viewportWidth = window.innerWidth;
904
+ const rect = el.getBoundingClientRect();
905
+ const popoverWidth = 280;
906
+ const viewportWidth = window.innerWidth;
1977
907
  let left = rect.left;
1978
- left + popoverWidth > viewportWidth - 10 && (left = viewportWidth - popoverWidth - 10), left < 10 && (left = 10), setActivePopover({ top: rect.top, left, issues });
908
+ if (left + popoverWidth > viewportWidth - 10) left = viewportWidth - popoverWidth - 10;
909
+ if (left < 10) left = 10;
910
+ setActivePopover({ top: rect.top, left, issues });
1979
911
  };
1980
- r.useEffect(() => {
1981
- (async () => {
912
+ useEffect(() => {
913
+ const fetchDocuments = async () => {
1982
914
  try {
1983
- if (setLoading(!0), previewMode) {
915
+ setLoading(true);
916
+ if (previewMode) {
1984
917
  setDocuments(generateDummyData());
1985
918
  return;
1986
919
  }
1987
- let groqQuery, params = {};
1988
- if (customQuery)
920
+ let groqQuery;
921
+ let params = {};
922
+ if (customQuery) {
1989
923
  groqQuery = customQuery;
1990
- else if (queryTypes && queryTypes.length > 0) {
1991
- const seoFilter = queryRequireSeo ? " && seo != null" : "", titleProj = buildTitleProjection(titleField);
924
+ } else if (queryTypes && queryTypes.length > 0) {
925
+ const seoFilter = queryRequireSeo ? " && seo != null" : "";
926
+ const titleProj = buildTitleProjection(titleField);
1992
927
  groqQuery = `*[_type in $types${seoFilter} && !(_id in path("drafts.**"))]{
1993
928
  _id,
1994
929
  _type,
@@ -1996,27 +931,31 @@ const DashboardContainer = lt.div`
1996
931
  slug,
1997
932
  seo,
1998
933
  _updatedAt
1999
- }`, params = { types: queryTypes };
2000
- } else
934
+ }`;
935
+ params = { types: queryTypes };
936
+ } else {
937
+ const titleProj = buildTitleProjection(titleField);
2001
938
  groqQuery = `*[seo != null && !(_id in path("drafts.**"))]{
2002
939
  _id,
2003
940
  _type,
2004
- ${buildTitleProjection(titleField)},
941
+ ${titleProj},
2005
942
  slug,
2006
943
  seo,
2007
944
  _updatedAt
2008
945
  }`;
2009
- const docsWithHealth = (await client.fetch(groqQuery, params, { perspective: "published" })).map((doc) => ({
2010
- ...doc,
946
+ }
947
+ const result = await client.fetch(groqQuery, params, { perspective: "published" });
948
+ const docsWithHealth = result.map((doc) => __spreadProps(__spreadValues({}, doc), {
2011
949
  health: calculateHealthScore(doc)
2012
950
  }));
2013
951
  setDocuments(docsWithHealth);
2014
952
  } catch (error) {
2015
953
  console.error("Error fetching documents:", error);
2016
954
  } finally {
2017
- setLoading(!1);
955
+ setLoading(false);
2018
956
  }
2019
- })();
957
+ };
958
+ fetchDocuments();
2020
959
  }, [
2021
960
  client,
2022
961
  customQuery,
@@ -2027,35 +966,62 @@ const DashboardContainer = lt.div`
2027
966
  JSON.stringify(titleField),
2028
967
  previewMode
2029
968
  ]);
2030
- const uniqueDocumentTypes = r.useMemo(() => {
969
+ const uniqueDocumentTypes = useMemo(() => {
2031
970
  const types2 = new Set(documents.map((doc) => doc._type));
2032
971
  return Array.from(types2).sort();
2033
- }, [documents]), filteredAndSortedDocs = r.useMemo(() => {
972
+ }, [documents]);
973
+ const filteredAndSortedDocs = useMemo(() => {
2034
974
  let filtered = documents;
2035
- return searchQuery && (filtered = filtered.filter(
2036
- (doc) => doc.title?.toLowerCase().includes(searchQuery.toLowerCase()) || doc._id?.toLowerCase().includes(searchQuery.toLowerCase())
2037
- )), filterStatus !== "all" && (filtered = filtered.filter((doc) => doc.health.status === filterStatus)), filterType !== "all" && (filtered = filtered.filter((doc) => doc._type === filterType)), [...filtered].sort((a2, b2) => sortBy === "score" ? b2.health.score - a2.health.score : (a2.title || "").localeCompare(b2.title || ""));
2038
- }, [documents, searchQuery, filterStatus, filterType, sortBy]), stats = r.useMemo(() => {
2039
- const total = documents.length, excellent = documents.filter((d2) => d2.health.score >= 80).length, good = documents.filter((d2) => d2.health.score >= 60 && d2.health.score < 80).length, fair = documents.filter((d2) => d2.health.score >= 40 && d2.health.score < 60).length, poor = documents.filter((d2) => d2.health.score > 0 && d2.health.score < 40).length, missing = documents.filter((d2) => d2.health.score === 0).length, avgScore = total > 0 ? Math.round(documents.reduce((sum, d2) => sum + d2.health.score, 0) / total) : 0;
975
+ if (searchQuery) {
976
+ filtered = filtered.filter(
977
+ (doc) => {
978
+ var _a, _b;
979
+ return ((_a = doc.title) == null ? void 0 : _a.toLowerCase().includes(searchQuery.toLowerCase())) || ((_b = doc._id) == null ? void 0 : _b.toLowerCase().includes(searchQuery.toLowerCase()));
980
+ }
981
+ );
982
+ }
983
+ if (filterStatus !== "all") {
984
+ filtered = filtered.filter((doc) => doc.health.status === filterStatus);
985
+ }
986
+ if (filterType !== "all") {
987
+ filtered = filtered.filter((doc) => doc._type === filterType);
988
+ }
989
+ const sorted = [...filtered].sort((a, b) => {
990
+ if (sortBy === "score") {
991
+ return b.health.score - a.health.score;
992
+ }
993
+ return (a.title || "").localeCompare(b.title || "");
994
+ });
995
+ return sorted;
996
+ }, [documents, searchQuery, filterStatus, filterType, sortBy]);
997
+ const stats = useMemo(() => {
998
+ const total = documents.length;
999
+ const excellent = documents.filter((d) => d.health.score >= 80).length;
1000
+ const good = documents.filter((d) => d.health.score >= 60 && d.health.score < 80).length;
1001
+ const fair = documents.filter((d) => d.health.score >= 40 && d.health.score < 60).length;
1002
+ const poor = documents.filter((d) => d.health.score > 0 && d.health.score < 40).length;
1003
+ const missing = documents.filter((d) => d.health.score === 0).length;
1004
+ const avgScore = total > 0 ? Math.round(documents.reduce((sum, d) => sum + d.health.score, 0) / total) : 0;
2040
1005
  return { total, excellent, good, fair, poor, missing, avgScore };
2041
- }, [documents]), handleMouseLeave = r.useCallback(() => {
1006
+ }, [documents]);
1007
+ const handleMouseLeave = useCallback(() => {
2042
1008
  setActivePopover(null);
2043
1009
  }, []);
2044
- return /* @__PURE__ */ jsxRuntime.jsxs(DashboardContainer, { children: [
2045
- licenseStatus === "loading" && /* @__PURE__ */ jsxRuntime.jsxs(LoadingState, { style: { padding: "80px 24px" }, children: [
2046
- /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}),
2047
- loadingLicense ?? "Verifying license\u2026"
1010
+ return /* @__PURE__ */ jsxs(DashboardContainer, { children: [
1011
+ licenseStatus === "loading" && /* @__PURE__ */ jsxs(LoadingState, { style: { padding: "80px 24px" }, children: [
1012
+ /* @__PURE__ */ jsx(Spinner, {}),
1013
+ loadingLicense != null ? loadingLicense : "Verifying license\u2026"
2048
1014
  ] }),
2049
- licenseStatus === "invalid" && /* @__PURE__ */ jsxRuntime.jsx(UpgradeContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(UpgradeBox, { children: licenseKey ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2050
- /* @__PURE__ */ jsxRuntime.jsx(UpgradeLock, { children: "\u274C" }),
2051
- /* @__PURE__ */ jsxRuntime.jsx(UpgradeTitle, { children: "Invalid License Key" }),
2052
- /* @__PURE__ */ jsxRuntime.jsx(UpgradeText, { children: "The license key you provided is invalid or has been revoked. Please check your key and update it in the plugin config." }),
2053
- /* @__PURE__ */ jsxRuntime.jsx(UpgradeCode, { children: `seofields({
1015
+ licenseStatus === "invalid" && /* @__PURE__ */ jsx(UpgradeContainer, { children: /* @__PURE__ */ jsx(UpgradeBox, { children: licenseKey ? /* @__PURE__ */ jsxs(Fragment, { children: [
1016
+ /* @__PURE__ */ jsx(UpgradeLock, { children: "\u274C" }),
1017
+ /* @__PURE__ */ jsx(UpgradeTitle, { children: "Invalid License Key" }),
1018
+ /* @__PURE__ */ jsx(UpgradeText, { children: "The license key you provided is invalid or has been revoked. Please check your key and update it in the plugin config." }),
1019
+ /* @__PURE__ */ jsx(UpgradeCode, { children: `seofields({
2054
1020
  healthDashboard: {
2055
1021
  licenseKey: 'YOUR_LICENSE_KEY', // \u2190 replace with a valid key
2056
1022
  },
2057
1023
  })` }),
2058
- /* @__PURE__ */ jsxRuntime.jsx(
1024
+ /* @__PURE__ */ jsx(
2059
1025
  UpgradeButton,
2060
1026
  {
2061
1027
  href: "https://sanity-plugin-seofields.thehardik.in",
@@ -2064,13 +1030,13 @@ const DashboardContainer = lt.div`
2064
1030
  children: "Get a New License Key \u2192"
2065
1031
  }
2066
1032
  ),
2067
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2068
- /* @__PURE__ */ jsxRuntime.jsx(ReloadButton, { onClick: () => validateLicense(!0), children: "Click here If You Just Updated Your Key" })
2069
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2070
- /* @__PURE__ */ jsxRuntime.jsx(UpgradeLock, { children: "\u{1F512}" }),
2071
- /* @__PURE__ */ jsxRuntime.jsx(UpgradeTitle, { children: "SEO Health Dashboard" }),
2072
- /* @__PURE__ */ jsxRuntime.jsx(UpgradeText, { children: "This feature requires a license key. Add your key to the plugin config to unlock the full dashboard." }),
2073
- /* @__PURE__ */ jsxRuntime.jsx(UpgradeCode, { children: `// sanity.config.ts
1033
+ /* @__PURE__ */ jsx("br", {}),
1034
+ /* @__PURE__ */ jsx(ReloadButton, { onClick: () => validateLicense(true), children: "Click here If You Just Updated Your Key" })
1035
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1036
+ /* @__PURE__ */ jsx(UpgradeLock, { children: "\u{1F512}" }),
1037
+ /* @__PURE__ */ jsx(UpgradeTitle, { children: "SEO Health Dashboard" }),
1038
+ /* @__PURE__ */ jsx(UpgradeText, { children: "This feature requires a license key. Add your key to the plugin config to unlock the full dashboard." }),
1039
+ /* @__PURE__ */ jsx(UpgradeCode, { children: `// sanity.config.ts
2074
1040
  import { seofields } from 'sanity-plugin-seofields'
2075
1041
 
2076
1042
  export default defineConfig({
@@ -2082,7 +1048,7 @@ export default defineConfig({
2082
1048
  }),
2083
1049
  ],
2084
1050
  })` }),
2085
- /* @__PURE__ */ jsxRuntime.jsx(
1051
+ /* @__PURE__ */ jsx(
2086
1052
  UpgradeButton,
2087
1053
  {
2088
1054
  href: "https://sanity-plugin-seofields.thehardik.in",
@@ -2092,50 +1058,50 @@ export default defineConfig({
2092
1058
  }
2093
1059
  )
2094
1060
  ] }) }) }),
2095
- licenseStatus === "valid" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2096
- /* @__PURE__ */ jsxRuntime.jsxs(PageHeader, { children: [
2097
- /* @__PURE__ */ jsxRuntime.jsxs(PageTitle, { children: [
2098
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
1061
+ licenseStatus === "valid" && /* @__PURE__ */ jsxs(Fragment, { children: [
1062
+ /* @__PURE__ */ jsxs(PageHeader, { children: [
1063
+ /* @__PURE__ */ jsxs(PageTitle, { children: [
1064
+ /* @__PURE__ */ jsxs("span", { children: [
2099
1065
  icon,
2100
1066
  " ",
2101
1067
  title
2102
1068
  ] }),
2103
- previewMode && /* @__PURE__ */ jsxRuntime.jsx(PreviewBadge, { children: "Preview Mode" })
1069
+ previewMode && /* @__PURE__ */ jsx(PreviewBadge, { children: "Preview Mode" })
2104
1070
  ] }),
2105
- /* @__PURE__ */ jsxRuntime.jsx(PageSubtitle, { children: description })
1071
+ /* @__PURE__ */ jsx(PageSubtitle, { children: description })
2106
1072
  ] }),
2107
- !loading && /* @__PURE__ */ jsxRuntime.jsxs(StatsGrid, { children: [
2108
- /* @__PURE__ */ jsxRuntime.jsxs(StatCard, { children: [
2109
- /* @__PURE__ */ jsxRuntime.jsx(StatLabel, { children: "Total Docs" }),
2110
- /* @__PURE__ */ jsxRuntime.jsx(StatValue, { children: stats.total })
1073
+ !loading && /* @__PURE__ */ jsxs(StatsGrid, { children: [
1074
+ /* @__PURE__ */ jsxs(StatCard, { children: [
1075
+ /* @__PURE__ */ jsx(StatLabel, { children: "Total Docs" }),
1076
+ /* @__PURE__ */ jsx(StatValue, { children: stats.total })
2111
1077
  ] }),
2112
- /* @__PURE__ */ jsxRuntime.jsxs(StatCard, { children: [
2113
- /* @__PURE__ */ jsxRuntime.jsx(StatLabel, { children: "Avg Score" }),
2114
- /* @__PURE__ */ jsxRuntime.jsxs(StatValue, { children: [
1078
+ /* @__PURE__ */ jsxs(StatCard, { children: [
1079
+ /* @__PURE__ */ jsx(StatLabel, { children: "Avg Score" }),
1080
+ /* @__PURE__ */ jsxs(StatValue, { children: [
2115
1081
  stats.avgScore,
2116
1082
  "%"
2117
1083
  ] })
2118
1084
  ] }),
2119
- /* @__PURE__ */ jsxRuntime.jsxs(StatCard, { $accent: "#10b981", children: [
2120
- /* @__PURE__ */ jsxRuntime.jsx(StatLabel, { children: "Excellent (80+)" }),
2121
- /* @__PURE__ */ jsxRuntime.jsx(StatValue, { children: stats.excellent })
1085
+ /* @__PURE__ */ jsxs(StatCard, { $accent: "#10b981", children: [
1086
+ /* @__PURE__ */ jsx(StatLabel, { children: "Excellent (80+)" }),
1087
+ /* @__PURE__ */ jsx(StatValue, { children: stats.excellent })
2122
1088
  ] }),
2123
- /* @__PURE__ */ jsxRuntime.jsxs(StatCard, { $accent: "#f59e0b", children: [
2124
- /* @__PURE__ */ jsxRuntime.jsx(StatLabel, { children: "Good (60\u201379)" }),
2125
- /* @__PURE__ */ jsxRuntime.jsx(StatValue, { children: stats.good })
1089
+ /* @__PURE__ */ jsxs(StatCard, { $accent: "#f59e0b", children: [
1090
+ /* @__PURE__ */ jsx(StatLabel, { children: "Good (60\u201379)" }),
1091
+ /* @__PURE__ */ jsx(StatValue, { children: stats.good })
2126
1092
  ] }),
2127
- /* @__PURE__ */ jsxRuntime.jsxs(StatCard, { $accent: "#f97316", children: [
2128
- /* @__PURE__ */ jsxRuntime.jsx(StatLabel, { children: "Fair (40\u201359)" }),
2129
- /* @__PURE__ */ jsxRuntime.jsx(StatValue, { children: stats.fair })
1093
+ /* @__PURE__ */ jsxs(StatCard, { $accent: "#f97316", children: [
1094
+ /* @__PURE__ */ jsx(StatLabel, { children: "Fair (40\u201359)" }),
1095
+ /* @__PURE__ */ jsx(StatValue, { children: stats.fair })
2130
1096
  ] }),
2131
- /* @__PURE__ */ jsxRuntime.jsxs(StatCard, { $accent: "#ef4444", children: [
2132
- /* @__PURE__ */ jsxRuntime.jsx(StatLabel, { children: "Poor / Missing" }),
2133
- /* @__PURE__ */ jsxRuntime.jsx(StatValue, { children: stats.poor + stats.missing })
1097
+ /* @__PURE__ */ jsxs(StatCard, { $accent: "#ef4444", children: [
1098
+ /* @__PURE__ */ jsx(StatLabel, { children: "Poor / Missing" }),
1099
+ /* @__PURE__ */ jsx(StatValue, { children: stats.poor + stats.missing })
2134
1100
  ] })
2135
1101
  ] }),
2136
- /* @__PURE__ */ jsxRuntime.jsxs(ControlsBar, { children: [
2137
- /* @__PURE__ */ jsxRuntime.jsxs(SearchWrapper, { children: [
2138
- /* @__PURE__ */ jsxRuntime.jsx(SearchIconSvg, { children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx(
1102
+ /* @__PURE__ */ jsxs(ControlsBar, { children: [
1103
+ /* @__PURE__ */ jsxs(SearchWrapper, { children: [
1104
+ /* @__PURE__ */ jsx(SearchIconSvg, { children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx(
2139
1105
  "path",
2140
1106
  {
2141
1107
  fillRule: "evenodd",
@@ -2143,7 +1109,7 @@ export default defineConfig({
2143
1109
  clipRule: "evenodd"
2144
1110
  }
2145
1111
  ) }) }),
2146
- /* @__PURE__ */ jsxRuntime.jsx(
1112
+ /* @__PURE__ */ jsx(
2147
1113
  SearchInput,
2148
1114
  {
2149
1115
  placeholder: "Search documents...",
@@ -2152,105 +1118,107 @@ export default defineConfig({
2152
1118
  }
2153
1119
  )
2154
1120
  ] }),
2155
- /* @__PURE__ */ jsxRuntime.jsxs(
1121
+ /* @__PURE__ */ jsxs(
2156
1122
  StyledSelect,
2157
1123
  {
2158
1124
  value: filterStatus,
2159
1125
  onChange: (e) => setFilterStatus(e.currentTarget.value),
2160
1126
  children: [
2161
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "all", children: "All Status" }),
2162
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "excellent", children: "Excellent" }),
2163
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "good", children: "Good" }),
2164
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "fair", children: "Fair" }),
2165
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "poor", children: "Poor" }),
2166
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "missing", children: "Missing" })
1127
+ /* @__PURE__ */ jsx("option", { value: "all", children: "All Status" }),
1128
+ /* @__PURE__ */ jsx("option", { value: "excellent", children: "Excellent" }),
1129
+ /* @__PURE__ */ jsx("option", { value: "good", children: "Good" }),
1130
+ /* @__PURE__ */ jsx("option", { value: "fair", children: "Fair" }),
1131
+ /* @__PURE__ */ jsx("option", { value: "poor", children: "Poor" }),
1132
+ /* @__PURE__ */ jsx("option", { value: "missing", children: "Missing" })
2167
1133
  ]
2168
1134
  }
2169
1135
  ),
2170
- uniqueDocumentTypes.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs(
1136
+ uniqueDocumentTypes.length > 1 && /* @__PURE__ */ jsxs(
2171
1137
  StyledSelect,
2172
1138
  {
2173
1139
  value: filterType,
2174
1140
  onChange: (e) => setFilterType(e.currentTarget.value),
2175
1141
  children: [
2176
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "all", children: "All Types" }),
2177
- uniqueDocumentTypes.map((type) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: type, children: resolveTypeLabel(type, typeLabels) }, type))
1142
+ /* @__PURE__ */ jsx("option", { value: "all", children: "All Types" }),
1143
+ uniqueDocumentTypes.map((type) => /* @__PURE__ */ jsx("option", { value: type, children: resolveTypeLabel(type, typeLabels) }, type))
2178
1144
  ]
2179
1145
  }
2180
1146
  ),
2181
- /* @__PURE__ */ jsxRuntime.jsxs(
1147
+ /* @__PURE__ */ jsxs(
2182
1148
  StyledSelect,
2183
1149
  {
2184
1150
  value: sortBy,
2185
1151
  onChange: (e) => setSortBy(e.currentTarget.value),
2186
1152
  children: [
2187
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "score", children: "Sort by Score" }),
2188
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "title", children: "Sort by Title" })
1153
+ /* @__PURE__ */ jsx("option", { value: "score", children: "Sort by Score" }),
1154
+ /* @__PURE__ */ jsx("option", { value: "title", children: "Sort by Title" })
2189
1155
  ]
2190
1156
  }
2191
1157
  )
2192
1158
  ] }),
2193
- /* @__PURE__ */ jsxRuntime.jsxs(TableCard, { children: [
2194
- loading && /* @__PURE__ */ jsxRuntime.jsxs(LoadingState, { children: [
2195
- /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}),
2196
- loadingDocuments ?? "Loading documents\u2026"
1159
+ /* @__PURE__ */ jsxs(TableCard, { children: [
1160
+ loading && /* @__PURE__ */ jsxs(LoadingState, { children: [
1161
+ /* @__PURE__ */ jsx(Spinner, {}),
1162
+ loadingDocuments != null ? loadingDocuments : "Loading documents\u2026"
2197
1163
  ] }),
2198
- !loading && (filteredAndSortedDocs.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { children: noDocuments ?? "No documents found" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2199
- /* @__PURE__ */ jsxRuntime.jsxs(TableHeader, { children: [
2200
- /* @__PURE__ */ jsxRuntime.jsx(ColTitle, { children: "Title" }),
2201
- showTypeColumn && /* @__PURE__ */ jsxRuntime.jsx(ColType, { children: "Type" }),
2202
- /* @__PURE__ */ jsxRuntime.jsx(ColScore, { children: "Score" }),
2203
- /* @__PURE__ */ jsxRuntime.jsx(ColIssues, { children: "Top Issues" })
1164
+ !loading && (filteredAndSortedDocs.length === 0 ? /* @__PURE__ */ jsx(EmptyState, { children: noDocuments != null ? noDocuments : "No documents found" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1165
+ /* @__PURE__ */ jsxs(TableHeader, { children: [
1166
+ /* @__PURE__ */ jsx(ColTitle, { children: "Title" }),
1167
+ showTypeColumn && /* @__PURE__ */ jsx(ColType, { children: "Type" }),
1168
+ /* @__PURE__ */ jsx(ColScore, { children: "Score" }),
1169
+ /* @__PURE__ */ jsx(ColIssues, { children: "Top Issues" })
2204
1170
  ] }),
2205
- filteredAndSortedDocs.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { children: [
2206
- /* @__PURE__ */ jsxRuntime.jsx(ColTitle, { children: /* @__PURE__ */ jsxRuntime.jsxs(TitleWrapper, { children: [
2207
- /* @__PURE__ */ jsxRuntime.jsxs(TitleCell, { children: [
2208
- openInPane ? /* @__PURE__ */ jsxRuntime.jsx(DocTitleAnchorPane, { id: doc._id, type: doc._type, children: doc.title || "Untitled" }) : /* @__PURE__ */ jsxRuntime.jsx(DocTitleAnchor, { id: doc._id, type: doc._type, structureTool, children: doc.title || "Untitled" }),
2209
- showDocumentId && /* @__PURE__ */ jsxRuntime.jsx(DocId, { children: doc._id })
2210
- ] }),
2211
- docBadge && /* @__PURE__ */ jsxRuntime.jsx(
2212
- DocBadgeRenderer,
2213
- {
2214
- doc,
2215
- docBadge
2216
- }
2217
- )
2218
- ] }) }),
2219
- showTypeColumn && /* @__PURE__ */ jsxRuntime.jsx(ColType, { children: typeColumnMode === "text" ? /* @__PURE__ */ jsxRuntime.jsx(TypeText, { children: resolveTypeLabel(doc._type, typeLabels) }) : (() => {
2220
- const typeColor = getTypeColor(doc._type);
2221
- return /* @__PURE__ */ jsxRuntime.jsx(TypeBadge, { $bgColor: typeColor.bg, $textColor: typeColor.text, children: resolveTypeLabel(doc._type, typeLabels) });
2222
- })() }),
2223
- /* @__PURE__ */ jsxRuntime.jsx(ColScore, { children: /* @__PURE__ */ jsxRuntime.jsxs(ScoreBadge, { $score: doc.health.score, children: [
2224
- doc.health.score,
2225
- "%"
2226
- ] }) }),
2227
- /* @__PURE__ */ jsxRuntime.jsxs(ColIssues, { children: [
2228
- doc.health.issues.slice(0, 2).map((issue) => /* @__PURE__ */ jsxRuntime.jsxs(IssueTag, { children: [
2229
- "\u2022 ",
2230
- issue
2231
- ] }, `issue-${doc._id}-${issue}`)),
2232
- doc.health.issues.length > 2 && /* @__PURE__ */ jsxRuntime.jsx(
2233
- MoreIssuesWrapper,
2234
- {
2235
- onMouseEnter: function(e) {
2236
- handleMouseEnterIssues(
2237
- e.currentTarget,
2238
- doc.health.issues
2239
- );
2240
- },
2241
- onMouseLeave: handleMouseLeave,
2242
- children: /* @__PURE__ */ jsxRuntime.jsxs(MoreIssues, { children: [
2243
- "+",
2244
- doc.health.issues.length - 2,
2245
- " more issues"
2246
- ] })
2247
- }
2248
- )
2249
- ] })
2250
- ] }, doc._id))
1171
+ filteredAndSortedDocs.map((doc) => {
1172
+ return /* @__PURE__ */ jsxs(TableRow, { children: [
1173
+ /* @__PURE__ */ jsx(ColTitle, { children: /* @__PURE__ */ jsxs(TitleWrapper, { children: [
1174
+ /* @__PURE__ */ jsxs(TitleCell, { children: [
1175
+ openInPane ? /* @__PURE__ */ jsx(DocTitleAnchorPane, { id: doc._id, type: doc._type, children: doc.title || "Untitled" }) : /* @__PURE__ */ jsx(DocTitleAnchor, { id: doc._id, type: doc._type, structureTool, children: doc.title || "Untitled" }),
1176
+ showDocumentId && /* @__PURE__ */ jsx(DocId, { children: doc._id })
1177
+ ] }),
1178
+ docBadge && /* @__PURE__ */ jsx(
1179
+ DocBadgeRenderer,
1180
+ {
1181
+ doc,
1182
+ docBadge
1183
+ }
1184
+ )
1185
+ ] }) }),
1186
+ showTypeColumn && /* @__PURE__ */ jsx(ColType, { children: typeColumnMode === "text" ? /* @__PURE__ */ jsx(TypeText, { children: resolveTypeLabel(doc._type, typeLabels) }) : (() => {
1187
+ const typeColor = getTypeColor(doc._type);
1188
+ return /* @__PURE__ */ jsx(TypeBadge, { $bgColor: typeColor.bg, $textColor: typeColor.text, children: resolveTypeLabel(doc._type, typeLabels) });
1189
+ })() }),
1190
+ /* @__PURE__ */ jsx(ColScore, { children: /* @__PURE__ */ jsxs(ScoreBadge, { $score: doc.health.score, children: [
1191
+ doc.health.score,
1192
+ "%"
1193
+ ] }) }),
1194
+ /* @__PURE__ */ jsxs(ColIssues, { children: [
1195
+ doc.health.issues.slice(0, 2).map((issue) => /* @__PURE__ */ jsxs(IssueTag, { children: [
1196
+ "\u2022 ",
1197
+ issue
1198
+ ] }, `issue-${doc._id}-${issue}`)),
1199
+ doc.health.issues.length > 2 && /* @__PURE__ */ jsx(
1200
+ MoreIssuesWrapper,
1201
+ {
1202
+ onMouseEnter: function(e) {
1203
+ handleMouseEnterIssues(
1204
+ e.currentTarget,
1205
+ doc.health.issues
1206
+ );
1207
+ },
1208
+ onMouseLeave: handleMouseLeave,
1209
+ children: /* @__PURE__ */ jsxs(MoreIssues, { children: [
1210
+ "+",
1211
+ doc.health.issues.length - 2,
1212
+ " more issues"
1213
+ ] })
1214
+ }
1215
+ )
1216
+ ] })
1217
+ ] }, doc._id);
1218
+ })
2251
1219
  ] }))
2252
1220
  ] }),
2253
- activePopover && /* @__PURE__ */ jsxRuntime.jsx(
1221
+ activePopover && /* @__PURE__ */ jsx(
2254
1222
  IssuesPopover,
2255
1223
  {
2256
1224
  style: {
@@ -2258,7 +1226,7 @@ export default defineConfig({
2258
1226
  left: activePopover.left,
2259
1227
  transform: "translateY(calc(-100% - 10px))"
2260
1228
  },
2261
- children: activePopover.issues.map((issue) => /* @__PURE__ */ jsxRuntime.jsxs(PopoverIssueItem, { children: [
1229
+ children: activePopover.issues.map((issue) => /* @__PURE__ */ jsxs(PopoverIssueItem, { children: [
2262
1230
  "\u26A0\uFE0F ",
2263
1231
  issue
2264
1232
  ] }, issue))
@@ -2268,216 +1236,371 @@ export default defineConfig({
2268
1236
  ] }),
2269
1237
  " "
2270
1238
  ] });
2271
- }, SeoHealthTool = (props) => /* @__PURE__ */ jsxRuntime.jsx(SeoHealthDashboard, { ...props }), stopWords = ["the", "a", "an", "and", "or", "but"], hasMatchingKeyword = (title, keywordList) => {
2272
- if (!title || keywordList.length === 0) return !1;
1239
+ };
1240
+ var SeoHealthDashboard_default = SeoHealthDashboard;
1241
+
1242
+ // src/components/SeoHealthTool.tsx
1243
+ import { jsx as jsx2 } from "react/jsx-runtime";
1244
+ var SeoHealthTool = (props) => {
1245
+ return /* @__PURE__ */ jsx2(SeoHealthDashboard_default, __spreadValues({}, props));
1246
+ };
1247
+ var SeoHealthTool_default = SeoHealthTool;
1248
+
1249
+ // src/schemas/index.ts
1250
+ import { defineField as defineField3, defineType as defineType3 } from "sanity";
1251
+
1252
+ // src/components/meta/MetaDescription.tsx
1253
+ import { Stack, Text } from "@sanity/ui";
1254
+ import { useMemo as useMemo2 } from "react";
1255
+ import { useFormValue } from "sanity";
1256
+
1257
+ // src/utils/seoUtils.ts
1258
+ var stopWords = ["the", "a", "an", "and", "or", "but"];
1259
+ var hasMatchingKeyword = (title, keywordList) => {
1260
+ if (!title || keywordList.length === 0) return false;
2273
1261
  const lowerTitle = title.toLowerCase();
2274
1262
  return keywordList.some((keyword) => keyword && lowerTitle.includes(keyword.toLowerCase()));
2275
- }, hasKeywordOveruse = (title, keywordList, maxOccurrences = 3) => {
2276
- if (!title || keywordList.length === 0) return !1;
1263
+ };
1264
+ var hasKeywordOveruse = (title, keywordList, maxOccurrences = 3) => {
1265
+ if (!title || keywordList.length === 0) return false;
2277
1266
  const lowerTitle = title.toLowerCase();
2278
1267
  return keywordList.some((keyword) => {
2279
- if (!keyword) return !1;
1268
+ if (!keyword) return false;
2280
1269
  const matches = lowerTitle.match(new RegExp(keyword.toLowerCase(), "g"));
2281
- return matches ? matches.length > maxOccurrences : !1;
1270
+ return matches ? matches.length > maxOccurrences : false;
2282
1271
  });
2283
- }, startsWithStopWord = (title) => {
2284
- if (!title) return !1;
1272
+ };
1273
+ var startsWithStopWord = (title) => {
1274
+ if (!title) return false;
2285
1275
  const firstWord = title.trim().split(" ")[0].toLowerCase();
2286
1276
  return stopWords.includes(firstWord);
2287
- }, truncate = (text, maxLength) => text.length > maxLength ? `${text.slice(0, maxLength)}\u2026` : text, hasExcessivePunctuation = (title) => /[!@#$%^&*]{2,}/.test(title), getMetaTitleValidationMessages = (title, keywords, isParentseoField) => {
2288
- const feedback = [], charCount = title?.length || 0;
2289
- if (!title?.trim())
2290
- return feedback.push({ text: "Meta Title is empty. Add content to improve SEO.", color: "red" }), feedback;
2291
- if (charCount < 50 ? feedback.push({
2292
- text: `Title is ${charCount} characters \u2014 below recommended 50.`,
2293
- color: "orange"
2294
- }) : charCount > 60 ? feedback.push({
2295
- text: `Title is ${charCount} characters \u2014 exceeds recommended 60.`,
2296
- color: "red"
2297
- }) : feedback.push({ text: `Title length (${charCount}) looks good for SEO.`, color: "green" }), isParentseoField)
1277
+ };
1278
+ var truncate = (text, maxLength) => text.length > maxLength ? `${text.slice(0, maxLength)}\u2026` : text;
1279
+ var hasExcessivePunctuation = (title) => /[!@#$%^&*]{2,}/.test(title);
1280
+ var getMetaTitleValidationMessages = (title, keywords, isParentseoField) => {
1281
+ const feedback = [];
1282
+ const minChar = 50;
1283
+ const maxChar = 60;
1284
+ const charCount = (title == null ? void 0 : title.length) || 0;
1285
+ if (!(title == null ? void 0 : title.trim())) {
1286
+ feedback.push({ text: "Meta Title is empty. Add content to improve SEO.", color: "red" });
1287
+ return feedback;
1288
+ }
1289
+ if (charCount < minChar)
1290
+ feedback.push({
1291
+ text: `Title is ${charCount} characters \u2014 below recommended ${minChar}.`,
1292
+ color: "orange"
1293
+ });
1294
+ else if (charCount > maxChar)
1295
+ feedback.push({
1296
+ text: `Title is ${charCount} characters \u2014 exceeds recommended ${maxChar}.`,
1297
+ color: "red"
1298
+ });
1299
+ else feedback.push({ text: `Title length (${charCount}) looks good for SEO.`, color: "green" });
1300
+ if (isParentseoField) {
2298
1301
  if (keywords.length > 0) {
2299
1302
  const hasKeyword = hasMatchingKeyword(title, keywords);
2300
1303
  feedback.push({
2301
1304
  text: hasKeyword ? "Keyword found in title \u2014 good job!" : "Keywords defined but missing in title.",
2302
1305
  color: hasKeyword ? "green" : "red"
2303
- }), hasKeywordOveruse(title, keywords) && feedback.push({
2304
- text: "Keyword appears too many times \u2014 avoid keyword stuffing.",
2305
- color: "orange"
2306
1306
  });
2307
- } else
1307
+ if (hasKeywordOveruse(title, keywords)) {
1308
+ feedback.push({
1309
+ text: "Keyword appears too many times \u2014 avoid keyword stuffing.",
1310
+ color: "orange"
1311
+ });
1312
+ }
1313
+ } else {
2308
1314
  feedback.push({
2309
1315
  text: "No keywords defined. Consider adding relevant keywords.",
2310
1316
  color: "orange"
2311
1317
  });
2312
- return startsWithStopWord(title) && feedback.push({ text: "Title starts with a stop word \u2014 consider rephrasing.", color: "orange" }), hasExcessivePunctuation(title) && feedback.push({ text: "Title contains excessive punctuation \u2014 simplify it.", color: "orange" }), feedback;
2313
- }, getMetaDescriptionValidationMessages = (description, keywords, isParentseoField) => {
2314
- const feedback = [], charCount = description?.length || 0;
2315
- if (!description?.trim())
2316
- return feedback.push({ text: "Meta description is empty. Add content to improve SEO.", color: "red" }), feedback;
2317
- if (charCount < 120 ? feedback.push({
2318
- text: `Description is ${charCount} chars \u2014 below recommended 120.`,
2319
- color: "orange"
2320
- }) : charCount > 160 ? feedback.push({
2321
- text: `Description is ${charCount} chars \u2014 exceeds recommended 160.`,
2322
- color: "red"
2323
- }) : feedback.push({ text: `Description length (${charCount}) looks good for SEO.`, color: "green" }), isParentseoField)
1318
+ }
1319
+ }
1320
+ if (startsWithStopWord(title))
1321
+ feedback.push({ text: "Title starts with a stop word \u2014 consider rephrasing.", color: "orange" });
1322
+ if (hasExcessivePunctuation(title))
1323
+ feedback.push({ text: "Title contains excessive punctuation \u2014 simplify it.", color: "orange" });
1324
+ return feedback;
1325
+ };
1326
+ var getMetaDescriptionValidationMessages = (description, keywords, isParentseoField) => {
1327
+ const feedback = [];
1328
+ const minChar = 120;
1329
+ const maxChar = 160;
1330
+ const charCount = (description == null ? void 0 : description.length) || 0;
1331
+ if (!(description == null ? void 0 : description.trim())) {
1332
+ feedback.push({ text: "Meta description is empty. Add content to improve SEO.", color: "red" });
1333
+ return feedback;
1334
+ }
1335
+ if (charCount < minChar)
1336
+ feedback.push({
1337
+ text: `Description is ${charCount} chars \u2014 below recommended ${minChar}.`,
1338
+ color: "orange"
1339
+ });
1340
+ else if (charCount > maxChar)
1341
+ feedback.push({
1342
+ text: `Description is ${charCount} chars \u2014 exceeds recommended ${maxChar}.`,
1343
+ color: "red"
1344
+ });
1345
+ else
1346
+ feedback.push({ text: `Description length (${charCount}) looks good for SEO.`, color: "green" });
1347
+ if (isParentseoField) {
2324
1348
  if (keywords.length > 0) {
2325
1349
  const hasKeyword = hasMatchingKeyword(description, keywords);
2326
1350
  feedback.push({
2327
1351
  text: hasKeyword ? "Keyword found in description \u2014 good job!" : "Keywords defined but missing in description.",
2328
1352
  color: hasKeyword ? "green" : "red"
2329
- }), hasKeywordOveruse(description, keywords) && feedback.push({
2330
- text: "Keyword appears too many times \u2014 avoid keyword stuffing.",
2331
- color: "orange"
2332
1353
  });
2333
- } else
1354
+ if (hasKeywordOveruse(description, keywords)) {
1355
+ feedback.push({
1356
+ text: "Keyword appears too many times \u2014 avoid keyword stuffing.",
1357
+ color: "orange"
1358
+ });
1359
+ }
1360
+ } else {
2334
1361
  feedback.push({
2335
1362
  text: "No keywords defined. Consider adding relevant keywords.",
2336
1363
  color: "orange"
2337
1364
  });
2338
- return startsWithStopWord(description) && feedback.push({
2339
- text: "Description starts with a stop word \u2014 consider rephrasing.",
2340
- color: "orange"
2341
- }), hasExcessivePunctuation(description) && feedback.push({
2342
- text: "Description contains excessive punctuation \u2014 simplify it.",
2343
- color: "orange"
2344
- }), feedback;
2345
- }, getOgTitleValidation = (title, keywords = [], isParentseoField) => {
2346
- const feedback = [], count = title?.length || 0;
2347
- if (!title?.trim())
2348
- return feedback.push({ text: "OG Title is empty. Add content for better social preview.", color: "red" }), feedback;
2349
- if (count < 40 ? feedback.push({
2350
- text: `OG Title is ${count} chars \u2014 shorter than recommended 40.`,
2351
- color: "orange"
2352
- }) : count > 60 ? feedback.push({ text: `OG Title is ${count} chars \u2014 exceeds recommended 60.`, color: "red" }) : feedback.push({ text: `OG Title length (${count}) looks good.`, color: "green" }), isParentseoField)
1365
+ }
1366
+ }
1367
+ if (startsWithStopWord(description))
1368
+ feedback.push({
1369
+ text: "Description starts with a stop word \u2014 consider rephrasing.",
1370
+ color: "orange"
1371
+ });
1372
+ if (hasExcessivePunctuation(description))
1373
+ feedback.push({
1374
+ text: "Description contains excessive punctuation \u2014 simplify it.",
1375
+ color: "orange"
1376
+ });
1377
+ return feedback;
1378
+ };
1379
+ var getOgTitleValidation = (title, keywords = [], isParentseoField) => {
1380
+ const feedback = [];
1381
+ const min = 40;
1382
+ const max = 60;
1383
+ const count = (title == null ? void 0 : title.length) || 0;
1384
+ if (!(title == null ? void 0 : title.trim())) {
1385
+ feedback.push({ text: "OG Title is empty. Add content for better social preview.", color: "red" });
1386
+ return feedback;
1387
+ }
1388
+ if (count < min)
1389
+ feedback.push({
1390
+ text: `OG Title is ${count} chars \u2014 shorter than recommended ${min}.`,
1391
+ color: "orange"
1392
+ });
1393
+ else if (count > max)
1394
+ feedback.push({ text: `OG Title is ${count} chars \u2014 exceeds recommended ${max}.`, color: "red" });
1395
+ else feedback.push({ text: `OG Title length (${count}) looks good.`, color: "green" });
1396
+ if (isParentseoField) {
2353
1397
  if (keywords.length > 0) {
2354
1398
  const hasKeyword = hasMatchingKeyword(title, keywords);
2355
1399
  feedback.push({
2356
1400
  text: hasKeyword ? "Keyword found in OG title \u2014 good job!" : "Keywords defined but missing in OG title.",
2357
1401
  color: hasKeyword ? "green" : "red"
2358
- }), hasKeywordOveruse(title, keywords) && feedback.push({
2359
- text: "Keyword appears too many times in OG title \u2014 avoid keyword stuffing.",
2360
- color: "orange"
2361
1402
  });
2362
- } else
1403
+ if (hasKeywordOveruse(title, keywords)) {
1404
+ feedback.push({
1405
+ text: "Keyword appears too many times in OG title \u2014 avoid keyword stuffing.",
1406
+ color: "orange"
1407
+ });
1408
+ }
1409
+ } else {
2363
1410
  feedback.push({
2364
1411
  text: "No keywords defined. Consider adding relevant keywords.",
2365
1412
  color: "orange"
2366
1413
  });
2367
- return startsWithStopWord(title) && feedback.push({
2368
- text: "OG Title starts with a stop word \u2014 consider rephrasing.",
2369
- color: "orange"
2370
- }), hasExcessivePunctuation(title) && feedback.push({ text: "OG Title contains excessive punctuation \u2014 simplify it.", color: "orange" }), feedback;
2371
- }, getOgDescriptionValidation = (desc, keywords = [], isParentseoField) => {
2372
- const feedback = [], count = desc?.length || 0;
2373
- if (!desc?.trim())
2374
- return feedback.push({
1414
+ }
1415
+ }
1416
+ if (startsWithStopWord(title))
1417
+ feedback.push({
1418
+ text: "OG Title starts with a stop word \u2014 consider rephrasing.",
1419
+ color: "orange"
1420
+ });
1421
+ if (hasExcessivePunctuation(title))
1422
+ feedback.push({ text: "OG Title contains excessive punctuation \u2014 simplify it.", color: "orange" });
1423
+ return feedback;
1424
+ };
1425
+ var getOgDescriptionValidation = (desc, keywords = [], isParentseoField) => {
1426
+ const feedback = [];
1427
+ const min = 90;
1428
+ const max = 120;
1429
+ const count = (desc == null ? void 0 : desc.length) || 0;
1430
+ if (!(desc == null ? void 0 : desc.trim())) {
1431
+ feedback.push({
2375
1432
  text: "OG Description is empty. Add content for better social preview.",
2376
1433
  color: "red"
2377
- }), feedback;
2378
- if (count < 90 ? feedback.push({
2379
- text: `OG Description is ${count} chars \u2014 shorter than recommended 90.`,
2380
- color: "orange"
2381
- }) : count > 120 ? feedback.push({
2382
- text: `OG Description is ${count} chars \u2014 exceeds recommended 120.`,
2383
- color: "red"
2384
- }) : feedback.push({ text: `OG Description length (${count}) looks good.`, color: "green" }), isParentseoField)
1434
+ });
1435
+ return feedback;
1436
+ }
1437
+ if (count < min)
1438
+ feedback.push({
1439
+ text: `OG Description is ${count} chars \u2014 shorter than recommended ${min}.`,
1440
+ color: "orange"
1441
+ });
1442
+ else if (count > max)
1443
+ feedback.push({
1444
+ text: `OG Description is ${count} chars \u2014 exceeds recommended ${max}.`,
1445
+ color: "red"
1446
+ });
1447
+ else feedback.push({ text: `OG Description length (${count}) looks good.`, color: "green" });
1448
+ if (isParentseoField) {
2385
1449
  if (keywords.length > 0) {
2386
1450
  const hasKeyword = hasMatchingKeyword(desc, keywords);
2387
1451
  feedback.push({
2388
1452
  text: hasKeyword ? "Keyword found in OG description \u2014 good job!" : "Keywords defined but missing in OG description.",
2389
1453
  color: hasKeyword ? "green" : "red"
2390
- }), hasKeywordOveruse(desc, keywords) && feedback.push({
2391
- text: "Keyword appears too many times in OG description \u2014 avoid keyword stuffing.",
2392
- color: "orange"
2393
1454
  });
2394
- } else
1455
+ if (hasKeywordOveruse(desc, keywords)) {
1456
+ feedback.push({
1457
+ text: "Keyword appears too many times in OG description \u2014 avoid keyword stuffing.",
1458
+ color: "orange"
1459
+ });
1460
+ }
1461
+ } else {
2395
1462
  feedback.push({
2396
1463
  text: "No keywords defined. Consider adding relevant keywords.",
2397
1464
  color: "orange"
2398
1465
  });
2399
- return startsWithStopWord(desc) && feedback.push({
2400
- text: "OG Description starts with a stop word \u2014 consider rephrasing.",
2401
- color: "orange"
2402
- }), hasExcessivePunctuation(desc) && feedback.push({
2403
- text: "OG Description contains excessive punctuation \u2014 simplify it.",
2404
- color: "orange"
2405
- }), feedback;
2406
- }, getTwitterTitleValidation = (title, keywords = [], isParentseoField) => {
2407
- const feedback = [], count = title?.length || 0;
2408
- if (!title?.trim())
2409
- return feedback.push({ text: "X Title is empty. Add content for better SEO.", color: "red" }), feedback;
2410
- if (count < 30 ? feedback.push({
2411
- text: `X Title is ${count} chars \u2014 shorter than recommended 30.`,
2412
- color: "orange"
2413
- }) : count > 70 ? feedback.push({
2414
- text: `X Title is ${count} chars \u2014 exceeds recommended 70.`,
2415
- color: "red"
2416
- }) : feedback.push({ text: `X Title length (${count}) looks good.`, color: "green" }), isParentseoField)
1466
+ }
1467
+ }
1468
+ if (startsWithStopWord(desc))
1469
+ feedback.push({
1470
+ text: "OG Description starts with a stop word \u2014 consider rephrasing.",
1471
+ color: "orange"
1472
+ });
1473
+ if (hasExcessivePunctuation(desc))
1474
+ feedback.push({
1475
+ text: "OG Description contains excessive punctuation \u2014 simplify it.",
1476
+ color: "orange"
1477
+ });
1478
+ return feedback;
1479
+ };
1480
+ var getTwitterTitleValidation = (title, keywords = [], isParentseoField) => {
1481
+ const feedback = [];
1482
+ const min = 30;
1483
+ const max = 70;
1484
+ const count = (title == null ? void 0 : title.length) || 0;
1485
+ if (!(title == null ? void 0 : title.trim())) {
1486
+ feedback.push({ text: "X Title is empty. Add content for better SEO.", color: "red" });
1487
+ return feedback;
1488
+ }
1489
+ if (count < min)
1490
+ feedback.push({
1491
+ text: `X Title is ${count} chars \u2014 shorter than recommended ${min}.`,
1492
+ color: "orange"
1493
+ });
1494
+ else if (count > max)
1495
+ feedback.push({
1496
+ text: `X Title is ${count} chars \u2014 exceeds recommended ${max}.`,
1497
+ color: "red"
1498
+ });
1499
+ else feedback.push({ text: `X Title length (${count}) looks good.`, color: "green" });
1500
+ if (isParentseoField) {
2417
1501
  if (keywords.length > 0) {
2418
1502
  const hasKeyword = hasMatchingKeyword(title, keywords);
2419
1503
  feedback.push({
2420
1504
  text: hasKeyword ? "Keyword found in X title \u2014 good job!" : "Keywords defined but missing in X title.",
2421
1505
  color: hasKeyword ? "green" : "red"
2422
1506
  });
2423
- } else
1507
+ } else {
2424
1508
  feedback.push({
2425
1509
  text: "No keywords defined. Consider adding relevant keywords.",
2426
1510
  color: "orange"
2427
1511
  });
2428
- return /[!@#$%^&*]{2,}/.test(title) && feedback.push({ text: "X Title has excessive punctuation \u2014 simplify it.", color: "orange" }), feedback;
2429
- }, getTwitterDescriptionValidation = (desc, keywords = [], isParentseoField) => {
2430
- const feedback = [], count = desc?.length || 0;
2431
- if (!desc?.trim())
2432
- return feedback.push({ text: "X Description is empty. Add content for better SEO.", color: "red" }), feedback;
2433
- if (count < 50 ? feedback.push({
2434
- text: `X Description is ${count} chars \u2014 shorter than recommended 50.`,
2435
- color: "orange"
2436
- }) : count > 200 ? feedback.push({
2437
- text: `X Description is ${count} chars \u2014 exceeds recommended 200.`,
2438
- color: "red"
2439
- }) : feedback.push({ text: `X Description length (${count}) looks good.`, color: "green" }), isParentseoField)
1512
+ }
1513
+ }
1514
+ if (/[!@#$%^&*]{2,}/.test(title))
1515
+ feedback.push({ text: "X Title has excessive punctuation \u2014 simplify it.", color: "orange" });
1516
+ return feedback;
1517
+ };
1518
+ var getTwitterDescriptionValidation = (desc, keywords = [], isParentseoField) => {
1519
+ const feedback = [];
1520
+ const min = 50;
1521
+ const max = 200;
1522
+ const count = (desc == null ? void 0 : desc.length) || 0;
1523
+ if (!(desc == null ? void 0 : desc.trim())) {
1524
+ feedback.push({ text: "X Description is empty. Add content for better SEO.", color: "red" });
1525
+ return feedback;
1526
+ }
1527
+ if (count < min)
1528
+ feedback.push({
1529
+ text: `X Description is ${count} chars \u2014 shorter than recommended ${min}.`,
1530
+ color: "orange"
1531
+ });
1532
+ else if (count > max)
1533
+ feedback.push({
1534
+ text: `X Description is ${count} chars \u2014 exceeds recommended ${max}.`,
1535
+ color: "red"
1536
+ });
1537
+ else feedback.push({ text: `X Description length (${count}) looks good.`, color: "green" });
1538
+ if (isParentseoField) {
2440
1539
  if (keywords.length > 0) {
2441
1540
  const hasKeyword = hasMatchingKeyword(desc, keywords);
2442
1541
  feedback.push({
2443
1542
  text: hasKeyword ? "Keyword found in X description \u2014 good job!" : "Keywords defined but missing in X description.",
2444
1543
  color: hasKeyword ? "green" : "red"
2445
1544
  });
2446
- } else
1545
+ } else {
2447
1546
  feedback.push({
2448
1547
  text: "No keywords defined. Consider adding relevant keywords.",
2449
1548
  color: "orange"
2450
1549
  });
2451
- return /[!@#$%^&*]{2,}/.test(desc) && feedback.push({
2452
- text: "X Description has excessive punctuation \u2014 simplify it.",
2453
- color: "orange"
2454
- }), feedback;
2455
- }, MetaDescription = (props) => {
2456
- const { value, renderDefault, path } = props, parent = sanity.useFormValue([path[0]]), isParentseoField = parent && parent?._type === "seoFields", keywords = r.useMemo(() => parent?.keywords || [], [parent?.keywords]), feedbackItems = r.useMemo(
1550
+ }
1551
+ }
1552
+ if (/[!@#$%^&*]{2,}/.test(desc))
1553
+ feedback.push({
1554
+ text: "X Description has excessive punctuation \u2014 simplify it.",
1555
+ color: "orange"
1556
+ });
1557
+ return feedback;
1558
+ };
1559
+
1560
+ // src/components/meta/MetaDescription.tsx
1561
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1562
+ var MetaDescription = (props) => {
1563
+ const { value, renderDefault, path } = props;
1564
+ const parent = useFormValue([path[0]]);
1565
+ const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
1566
+ const keywords = useMemo2(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
1567
+ const feedbackItems = useMemo2(
2457
1568
  () => getMetaDescriptionValidationMessages(value || "", keywords, isParentseoField),
2458
1569
  [value, keywords, isParentseoField]
2459
1570
  );
2460
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
1571
+ return /* @__PURE__ */ jsxs2(Stack, { space: 3, children: [
2461
1572
  renderDefault(props),
2462
- /* @__PURE__ */ jsxRuntime.jsx(ui.Stack, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
2463
- /* @__PURE__ */ jsxRuntime.jsx(
1573
+ /* @__PURE__ */ jsx3(Stack, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
1574
+ /* @__PURE__ */ jsx3(
2464
1575
  "div",
2465
1576
  {
2466
1577
  style: { width: 10, height: 10, borderRadius: "50%", backgroundColor: item.color }
2467
1578
  }
2468
1579
  ),
2469
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { weight: "bold", muted: !0, size: 14, children: item.text })
1580
+ /* @__PURE__ */ jsx3(Text, { weight: "bold", muted: true, size: 14, children: item.text })
2470
1581
  ] }, item.text)) })
2471
1582
  ] });
2472
- }, MetaTitle = (props) => {
2473
- const { value, renderDefault, path } = props, parent = sanity.useFormValue([path[0]]), isParentseoField = parent && parent?._type === "seoFields", keywords = r.useMemo(() => parent?.keywords || [], [parent?.keywords]), feedbackItems = r.useMemo(
1583
+ };
1584
+ var MetaDescription_default = MetaDescription;
1585
+
1586
+ // src/components/meta/MetaTitle.tsx
1587
+ import { Stack as Stack2, Text as Text2 } from "@sanity/ui";
1588
+ import { useMemo as useMemo3 } from "react";
1589
+ import { useFormValue as useFormValue2 } from "sanity";
1590
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1591
+ var MetaTitle = (props) => {
1592
+ const { value, renderDefault, path } = props;
1593
+ const parent = useFormValue2([path[0]]);
1594
+ const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
1595
+ const keywords = useMemo3(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
1596
+ const feedbackItems = useMemo3(
2474
1597
  () => getMetaTitleValidationMessages(value || "", keywords, isParentseoField),
2475
1598
  [value, keywords, isParentseoField]
2476
1599
  );
2477
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
1600
+ return /* @__PURE__ */ jsxs3(Stack2, { space: 3, children: [
2478
1601
  renderDefault(props),
2479
- /* @__PURE__ */ jsxRuntime.jsx(ui.Stack, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
2480
- /* @__PURE__ */ jsxRuntime.jsx(
1602
+ /* @__PURE__ */ jsx4(Stack2, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs3("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
1603
+ /* @__PURE__ */ jsx4(
2481
1604
  "div",
2482
1605
  {
2483
1606
  style: {
@@ -2488,17 +1611,26 @@ export default defineConfig({
2488
1611
  }
2489
1612
  }
2490
1613
  ),
2491
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { weight: "bold", muted: !0, size: 14, children: item.text })
1614
+ /* @__PURE__ */ jsx4(Text2, { weight: "bold", muted: true, size: 14, children: item.text })
2492
1615
  ] }, item.text)) })
2493
1616
  ] });
2494
- }, PreviewContainer = lt.div`
1617
+ };
1618
+ var MetaTitle_default = MetaTitle;
1619
+
1620
+ // src/components/SeoPreview.tsx
1621
+ import { Box } from "@sanity/ui";
1622
+ import { useFormValue as useFormValue3 } from "sanity";
1623
+ import styled2 from "styled-components";
1624
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1625
+ var PreviewContainer = styled2.div`
2495
1626
  max-width: 600px;
2496
1627
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
2497
1628
  background: #ffffff;
2498
1629
  border: 1px solid #dadce0;
2499
1630
  border-radius: 8px;
2500
1631
  overflow: hidden;
2501
- `, PreviewHeader = lt.div`
1632
+ `;
1633
+ var PreviewHeader = styled2.div`
2502
1634
  background: #f8f9fa;
2503
1635
  padding: 12px 16px;
2504
1636
  border-bottom: 1px solid #dadce0;
@@ -2506,15 +1638,18 @@ export default defineConfig({
2506
1638
  align-items: center;
2507
1639
  justify-content: space-between;
2508
1640
  gap: 8px;
2509
- `, PreviewBody = lt.div`
1641
+ `;
1642
+ var PreviewBody = styled2.div`
2510
1643
  padding: 16px;
2511
- `, SerpUrl = lt.p`
1644
+ `;
1645
+ var SerpUrl = styled2.p`
2512
1646
  margin: 0 0 4px;
2513
1647
  color: #006621;
2514
1648
  font-size: 13px;
2515
1649
  line-height: 1.4;
2516
1650
  word-break: break-word;
2517
- `, SerpTitle = lt.h3`
1651
+ `;
1652
+ var SerpTitle = styled2.h3`
2518
1653
  margin: 0 0 8px;
2519
1654
  color: #1a0dab;
2520
1655
  font-size: 18px;
@@ -2525,7 +1660,8 @@ export default defineConfig({
2525
1660
  &:hover {
2526
1661
  text-decoration: underline;
2527
1662
  }
2528
- `, SerpDescription = lt.p`
1663
+ `;
1664
+ var SerpDescription = styled2.p`
2529
1665
  margin: 0;
2530
1666
  color: #545454;
2531
1667
  font-size: 14px;
@@ -2535,7 +1671,8 @@ export default defineConfig({
2535
1671
  -webkit-line-clamp: 2;
2536
1672
  -webkit-box-orient: vertical;
2537
1673
  overflow: hidden;
2538
- `, LiveIndicator = lt.span`
1674
+ `;
1675
+ var LiveIndicator = styled2.span`
2539
1676
  display: inline-flex;
2540
1677
  align-items: center;
2541
1678
  gap: 4px;
@@ -2547,29 +1684,46 @@ export default defineConfig({
2547
1684
  background: #f0f4ff;
2548
1685
  padding: 4px 8px;
2549
1686
  border-radius: 4px;
2550
- `, SeoPreview = (props) => {
2551
- const { path, schemaType } = props, { options } = schemaType, baseUrl = options?.baseUrl || "https://www.example.com", prefixFunction = options?.prefix, parent = sanity.useFormValue([path[0]]) || {
1687
+ `;
1688
+ var SeoPreview = (props) => {
1689
+ var _a, _b;
1690
+ const { path, schemaType } = props;
1691
+ const { options } = schemaType;
1692
+ const baseUrl = (options == null ? void 0 : options.baseUrl) || "https://www.example.com";
1693
+ const prefixFunction = options == null ? void 0 : options.prefix;
1694
+ const parent = useFormValue3([path[0]]) || {
2552
1695
  title: "",
2553
1696
  description: "",
2554
1697
  canonicalUrl: ""
2555
- }, rootDoc = sanity.useFormValue([]) || {
1698
+ };
1699
+ const rootDoc = useFormValue3([]) || {
2556
1700
  slug: { current: "" }
2557
- }, slug = rootDoc?.slug?.current || "", {
1701
+ };
1702
+ const slug = ((_a = rootDoc == null ? void 0 : rootDoc.slug) == null ? void 0 : _a.current) || "";
1703
+ const {
2558
1704
  title,
2559
1705
  description,
2560
1706
  canonicalUrl: url
2561
- } = parent, base = (url || baseUrl)?.replace(/\/+$/, ""), slugStr = String(slug || "").replace(/^\/+/, ""), urlPath = [String(
1707
+ } = parent;
1708
+ const base = (_b = url || baseUrl) == null ? void 0 : _b.replace(/\/+$/, "");
1709
+ const slugStr = String(slug || "").replace(/^\/+/, "");
1710
+ const pref = String(
2562
1711
  prefixFunction ? prefixFunction(rootDoc) : ""
2563
- ).replace(/^\/+|\/+$/g, ""), slugStr].filter(Boolean).join("/"), finalUrl = urlPath ? `${base}/${urlPath}` : base, urlDisplay = `${(() => {
1712
+ ).replace(/^\/+|\/+$/g, "");
1713
+ const urlPath = [pref, slugStr].filter(Boolean).join("/");
1714
+ const finalUrl = urlPath ? `${base}/${urlPath}` : base;
1715
+ const domain = (() => {
2564
1716
  try {
2565
- return new URL(finalUrl || base).hostname;
2566
- } catch {
1717
+ const u = new URL(finalUrl || base);
1718
+ return u.hostname;
1719
+ } catch (e) {
2567
1720
  return "example.com";
2568
1721
  }
2569
- })()}${urlPath ? ` \u203A ${urlPath.split("/").slice(-1)[0]}` : ""}`;
2570
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { padding: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(PreviewContainer, { children: [
2571
- /* @__PURE__ */ jsxRuntime.jsxs(PreviewHeader, { children: [
2572
- /* @__PURE__ */ jsxRuntime.jsx(
1722
+ })();
1723
+ const urlDisplay = `${domain}${urlPath ? ` \u203A ${urlPath.split("/").slice(-1)[0]}` : ""}`;
1724
+ return /* @__PURE__ */ jsx5(Box, { padding: 3, children: /* @__PURE__ */ jsxs4(PreviewContainer, { children: [
1725
+ /* @__PURE__ */ jsxs4(PreviewHeader, { children: [
1726
+ /* @__PURE__ */ jsx5(
2573
1727
  "span",
2574
1728
  {
2575
1729
  style: {
@@ -2581,8 +1735,8 @@ export default defineConfig({
2581
1735
  children: "Search Preview"
2582
1736
  }
2583
1737
  ),
2584
- /* @__PURE__ */ jsxRuntime.jsxs(LiveIndicator, { children: [
2585
- /* @__PURE__ */ jsxRuntime.jsx(
1738
+ /* @__PURE__ */ jsxs4(LiveIndicator, { children: [
1739
+ /* @__PURE__ */ jsx5(
2586
1740
  "span",
2587
1741
  {
2588
1742
  style: {
@@ -2597,13 +1751,17 @@ export default defineConfig({
2597
1751
  "Live"
2598
1752
  ] })
2599
1753
  ] }),
2600
- /* @__PURE__ */ jsxRuntime.jsxs(PreviewBody, { children: [
2601
- /* @__PURE__ */ jsxRuntime.jsx(SerpUrl, { children: finalUrl ? urlDisplay : "example.com \u203A page-url" }),
2602
- /* @__PURE__ */ jsxRuntime.jsx(SerpTitle, { children: title && title.length > 0 ? truncate(title, 60) : "Your SEO Title will appear here" }),
2603
- /* @__PURE__ */ jsxRuntime.jsx(SerpDescription, { children: description && description.length > 0 ? truncate(description, 160) : "Your meta description will show up here. Make it compelling!" })
1754
+ /* @__PURE__ */ jsxs4(PreviewBody, { children: [
1755
+ /* @__PURE__ */ jsx5(SerpUrl, { children: finalUrl ? urlDisplay : "example.com \u203A page-url" }),
1756
+ /* @__PURE__ */ jsx5(SerpTitle, { children: title && title.length > 0 ? truncate(title, 60) : "Your SEO Title will appear here" }),
1757
+ /* @__PURE__ */ jsx5(SerpDescription, { children: description && description.length > 0 ? truncate(description, 160) : "Your meta description will show up here. Make it compelling!" })
2604
1758
  ] })
2605
1759
  ] }) });
2606
- }, DEFAULT_FIELD_INFO = {
1760
+ };
1761
+ var SeoPreview_default = SeoPreview;
1762
+
1763
+ // src/utils/fieldsUtils.ts
1764
+ var DEFAULT_FIELD_INFO = {
2607
1765
  title: {
2608
1766
  title: "Meta Title",
2609
1767
  description: "The meta title is displayed in search engine results as the clickable headline for a given result. It should be concise and accurately reflect the content of the page."
@@ -2696,23 +1854,56 @@ export default defineConfig({
2696
1854
  title: "X Image URL",
2697
1855
  description: "Enter the full URL of the image for X (formerly Twitter). Ensure the image is accessible and meets the recommended size."
2698
1856
  }
2699
- }, getFieldInfo = (fieldName, fieldOverrides) => {
1857
+ };
1858
+ var getFieldInfo = (fieldName, fieldOverrides) => {
2700
1859
  const fieldInfo = fieldOverrides && fieldOverrides[fieldName] || DEFAULT_FIELD_INFO[fieldName];
2701
1860
  return fieldInfo ? { title: fieldInfo.title || "", description: fieldInfo.description || "" } : { title: "", description: "" };
2702
- }, isFieldHidden = (fieldName, config, documentType) => !!(config.defaultHiddenFields?.includes(fieldName) || documentType && config.fieldVisibility?.[documentType]?.hiddenFields?.includes(fieldName)), getFieldHiddenFunction = (fieldName, config) => ({
2703
- document: document2
2704
- }) => {
2705
- const documentType = document2?._type;
2706
- return isFieldHidden(fieldName, config, documentType);
2707
- }, isEmpty = (value) => value == null || typeof value == "string" && value.trim() === "" || Array.isArray(value) && value.length === 0 || typeof value == "object" && !Array.isArray(value) && Object.keys(value).length === 0, OgDescription = (props) => {
2708
- const { value, renderDefault, path } = props, parent = sanity.useFormValue([path[0]]), isParentseoField = parent && parent?._type === "seoFields", keywords = r.useMemo(() => parent?.keywords || [], [parent?.keywords]), feedbackItems = r.useMemo(
1861
+ };
1862
+ var isFieldHidden = (fieldName, config, documentType) => {
1863
+ var _a, _b, _c, _d;
1864
+ if ((_a = config.defaultHiddenFields) == null ? void 0 : _a.includes(fieldName)) {
1865
+ return true;
1866
+ }
1867
+ if (documentType && ((_d = (_c = (_b = config.fieldVisibility) == null ? void 0 : _b[documentType]) == null ? void 0 : _c.hiddenFields) == null ? void 0 : _d.includes(fieldName))) {
1868
+ return true;
1869
+ }
1870
+ return false;
1871
+ };
1872
+ var getFieldHiddenFunction = (fieldName, config) => {
1873
+ return ({
1874
+ document
1875
+ }) => {
1876
+ const documentType = document == null ? void 0 : document._type;
1877
+ return isFieldHidden(fieldName, config, documentType);
1878
+ };
1879
+ };
1880
+
1881
+ // src/utils/utils.ts
1882
+ var isEmpty = (value) => {
1883
+ return value === null || value === void 0 || typeof value === "string" && value.trim() === "" || Array.isArray(value) && value.length === 0 || typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0;
1884
+ };
1885
+
1886
+ // src/schemas/types/openGraph/index.ts
1887
+ import { defineField, defineType } from "sanity";
1888
+
1889
+ // src/components/openGraph/OgDescription.tsx
1890
+ import { Stack as Stack4, Text as Text4 } from "@sanity/ui";
1891
+ import { useMemo as useMemo4 } from "react";
1892
+ import { useFormValue as useFormValue4 } from "sanity";
1893
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
1894
+ var OgDescription = (props) => {
1895
+ const { value, renderDefault, path } = props;
1896
+ const parent = useFormValue4([path[0]]);
1897
+ const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
1898
+ const keywords = useMemo4(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
1899
+ const feedbackItems = useMemo4(
2709
1900
  () => getOgDescriptionValidation(value || "", keywords, isParentseoField),
2710
1901
  [value, keywords, isParentseoField]
2711
1902
  );
2712
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
1903
+ return /* @__PURE__ */ jsxs5(Stack4, { space: 3, children: [
2713
1904
  renderDefault(props),
2714
- /* @__PURE__ */ jsxRuntime.jsx(ui.Stack, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
2715
- /* @__PURE__ */ jsxRuntime.jsx(
1905
+ /* @__PURE__ */ jsx6(Stack4, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs5("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
1906
+ /* @__PURE__ */ jsx6(
2716
1907
  "div",
2717
1908
  {
2718
1909
  style: {
@@ -2723,18 +1914,30 @@ export default defineConfig({
2723
1914
  }
2724
1915
  }
2725
1916
  ),
2726
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { weight: "bold", muted: !0, size: 14, children: item.text })
1917
+ /* @__PURE__ */ jsx6(Text4, { weight: "bold", muted: true, size: 14, children: item.text })
2727
1918
  ] }, item.text)) })
2728
1919
  ] });
2729
- }, OgTitle = (props) => {
2730
- const { value, renderDefault, path } = props, parent = sanity.useFormValue([path[0]]), isParentseoField = parent && parent?._type === "seoFields", keywords = r.useMemo(() => parent?.keywords || [], [parent?.keywords]), feedbackItems = r.useMemo(
1920
+ };
1921
+ var OgDescription_default = OgDescription;
1922
+
1923
+ // src/components/openGraph/OgTitle.tsx
1924
+ import { Stack as Stack5, Text as Text5 } from "@sanity/ui";
1925
+ import { useMemo as useMemo5 } from "react";
1926
+ import { useFormValue as useFormValue5 } from "sanity";
1927
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1928
+ var OgTitle = (props) => {
1929
+ const { value, renderDefault, path } = props;
1930
+ const parent = useFormValue5([path[0]]);
1931
+ const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
1932
+ const keywords = useMemo5(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
1933
+ const feedbackItems = useMemo5(
2731
1934
  () => getOgTitleValidation(value || "", keywords, isParentseoField),
2732
1935
  [value, keywords, isParentseoField]
2733
1936
  );
2734
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
1937
+ return /* @__PURE__ */ jsxs6(Stack5, { space: 3, children: [
2735
1938
  renderDefault(props),
2736
- /* @__PURE__ */ jsxRuntime.jsx(ui.Stack, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
2737
- /* @__PURE__ */ jsxRuntime.jsx(
1939
+ /* @__PURE__ */ jsx7(Stack5, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
1940
+ /* @__PURE__ */ jsx7(
2738
1941
  "div",
2739
1942
  {
2740
1943
  style: {
@@ -2745,53 +1948,56 @@ export default defineConfig({
2745
1948
  }
2746
1949
  }
2747
1950
  ),
2748
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { weight: "bold", muted: !0, size: 14, children: item.text })
1951
+ /* @__PURE__ */ jsx7(Text5, { weight: "bold", muted: true, size: 14, children: item.text })
2749
1952
  ] }, item.text)) })
2750
1953
  ] });
2751
1954
  };
1955
+ var OgTitle_default = OgTitle;
1956
+
1957
+ // src/schemas/types/openGraph/index.ts
2752
1958
  function openGraph(config = {}) {
2753
- return sanity.defineType({
1959
+ return defineType({
2754
1960
  name: "openGraph",
2755
1961
  title: "Open Graph Settings",
2756
1962
  type: "object",
2757
1963
  fields: [
2758
- sanity.defineField({
1964
+ defineField(__spreadProps(__spreadValues({
2759
1965
  name: "url",
2760
- type: "url",
2761
- ...getFieldInfo("openGraphUrl", config.fieldOverrides),
1966
+ type: "url"
1967
+ }, getFieldInfo("openGraphUrl", config.fieldOverrides)), {
2762
1968
  hidden: getFieldHiddenFunction("openGraphUrl", config),
2763
1969
  description: "The canonical URL of the page. This should be the full URL including protocol (https://)."
2764
- }),
2765
- sanity.defineField({
2766
- name: "title",
2767
- ...getFieldInfo("openGraphTitle", config.fieldOverrides),
1970
+ })),
1971
+ defineField(__spreadProps(__spreadValues({
1972
+ name: "title"
1973
+ }, getFieldInfo("openGraphTitle", config.fieldOverrides)), {
2768
1974
  type: "string",
2769
1975
  hidden: getFieldHiddenFunction("openGraphTitle", config),
2770
1976
  components: {
2771
- input: OgTitle
1977
+ input: OgTitle_default
2772
1978
  // Can also wrap with a string input + preview
2773
1979
  }
2774
- }),
2775
- sanity.defineField({
2776
- name: "description",
2777
- ...getFieldInfo("openGraphDescription", config.fieldOverrides),
1980
+ })),
1981
+ defineField(__spreadProps(__spreadValues({
1982
+ name: "description"
1983
+ }, getFieldInfo("openGraphDescription", config.fieldOverrides)), {
2778
1984
  type: "text",
2779
1985
  rows: 3,
2780
1986
  hidden: getFieldHiddenFunction("openGraphDescription", config),
2781
1987
  components: {
2782
- input: OgDescription
1988
+ input: OgDescription_default
2783
1989
  // Can also wrap with a text area + preview
2784
1990
  }
2785
- }),
2786
- sanity.defineField({
2787
- name: "siteName",
2788
- ...getFieldInfo("openGraphSiteName", config.fieldOverrides),
1991
+ })),
1992
+ defineField(__spreadProps(__spreadValues({
1993
+ name: "siteName"
1994
+ }, getFieldInfo("openGraphSiteName", config.fieldOverrides)), {
2789
1995
  type: "string",
2790
1996
  hidden: getFieldHiddenFunction("openGraphSiteName", config)
2791
- }),
2792
- sanity.defineField({
2793
- name: "type",
2794
- ...getFieldInfo("openGraphType", config.fieldOverrides),
1997
+ })),
1998
+ defineField(__spreadProps(__spreadValues({
1999
+ name: "type"
2000
+ }, getFieldInfo("openGraphType", config.fieldOverrides)), {
2795
2001
  type: "string",
2796
2002
  options: {
2797
2003
  list: [
@@ -2807,10 +2013,10 @@ function openGraph(config = {}) {
2807
2013
  },
2808
2014
  hidden: getFieldHiddenFunction("openGraphType", config),
2809
2015
  initialValue: "website"
2810
- }),
2811
- sanity.defineField({
2812
- name: "imageType",
2813
- ...getFieldInfo("openGraphImageType", config.fieldOverrides),
2016
+ })),
2017
+ defineField(__spreadProps(__spreadValues({
2018
+ name: "imageType"
2019
+ }, getFieldInfo("openGraphImageType", config.fieldOverrides)), {
2814
2020
  type: "string",
2815
2021
  options: {
2816
2022
  list: [
@@ -2820,16 +2026,16 @@ function openGraph(config = {}) {
2820
2026
  },
2821
2027
  hidden: getFieldHiddenFunction("openGraphImage", config),
2822
2028
  initialValue: "upload"
2823
- }),
2824
- sanity.defineField({
2825
- name: "image",
2826
- ...getFieldInfo("openGraphImage", config.fieldOverrides),
2029
+ })),
2030
+ defineField(__spreadProps(__spreadValues({
2031
+ name: "image"
2032
+ }, getFieldInfo("openGraphImage", config.fieldOverrides)), {
2827
2033
  type: "image",
2828
2034
  options: {
2829
- hotspot: !0
2035
+ hotspot: true
2830
2036
  },
2831
2037
  fields: [
2832
- sanity.defineField({
2038
+ defineField({
2833
2039
  name: "alt",
2834
2040
  title: "Image Alt Text",
2835
2041
  type: "string",
@@ -2838,34 +2044,47 @@ function openGraph(config = {}) {
2838
2044
  ],
2839
2045
  hidden: (context) => {
2840
2046
  const { parent } = context;
2841
- if (parent?.imageType !== "upload") return !0;
2047
+ if ((parent == null ? void 0 : parent.imageType) !== "upload") return true;
2842
2048
  const hiddenFn = getFieldHiddenFunction("openGraphImage", config);
2843
- return typeof hiddenFn == "function" ? hiddenFn(context) : hiddenFn;
2049
+ return typeof hiddenFn === "function" ? hiddenFn(context) : hiddenFn;
2844
2050
  }
2845
- }),
2846
- sanity.defineField({
2847
- name: "imageUrl",
2848
- ...getFieldInfo("openGraphImageUrl", config.fieldOverrides),
2051
+ })),
2052
+ defineField(__spreadProps(__spreadValues({
2053
+ name: "imageUrl"
2054
+ }, getFieldInfo("openGraphImageUrl", config.fieldOverrides)), {
2849
2055
  type: "url",
2850
2056
  hidden: (context) => {
2851
2057
  const { parent } = context;
2852
- if (parent?.imageType !== "url") return !0;
2058
+ if ((parent == null ? void 0 : parent.imageType) !== "url") return true;
2853
2059
  const hiddenFn = getFieldHiddenFunction("openGraphImage", config);
2854
- return typeof hiddenFn == "function" ? hiddenFn(context) : hiddenFn;
2060
+ return typeof hiddenFn === "function" ? hiddenFn(context) : hiddenFn;
2855
2061
  }
2856
- })
2062
+ }))
2857
2063
  ]
2858
2064
  });
2859
2065
  }
2860
- const TwitterDescription = (props) => {
2861
- const { value, renderDefault, path } = props, parent = sanity.useFormValue([path[0]]), isParentseoField = parent && parent?._type === "seoFields", keywords = r.useMemo(() => parent?.keywords || [], [parent?.keywords]), feedbackItems = r.useMemo(
2066
+
2067
+ // src/schemas/types/twitter/index.ts
2068
+ import { defineField as defineField2, defineType as defineType2 } from "sanity";
2069
+
2070
+ // src/components/twitter/twitterDescription.tsx
2071
+ import { Stack as Stack6, Text as Text6 } from "@sanity/ui";
2072
+ import { useMemo as useMemo6 } from "react";
2073
+ import { useFormValue as useFormValue6 } from "sanity";
2074
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
2075
+ var TwitterDescription = (props) => {
2076
+ const { value, renderDefault, path } = props;
2077
+ const parent = useFormValue6([path[0]]);
2078
+ const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
2079
+ const keywords = useMemo6(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
2080
+ const feedbackItems = useMemo6(
2862
2081
  () => getTwitterDescriptionValidation(value || "", keywords, isParentseoField),
2863
2082
  [value, keywords, isParentseoField]
2864
2083
  );
2865
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
2084
+ return /* @__PURE__ */ jsxs7(Stack6, { space: 3, children: [
2866
2085
  renderDefault(props),
2867
- /* @__PURE__ */ jsxRuntime.jsx(ui.Stack, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
2868
- /* @__PURE__ */ jsxRuntime.jsx(
2086
+ /* @__PURE__ */ jsx8(Stack6, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs7("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
2087
+ /* @__PURE__ */ jsx8(
2869
2088
  "div",
2870
2089
  {
2871
2090
  style: {
@@ -2876,18 +2095,30 @@ const TwitterDescription = (props) => {
2876
2095
  }
2877
2096
  }
2878
2097
  ),
2879
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { weight: "bold", muted: !0, size: 14, children: item.text })
2098
+ /* @__PURE__ */ jsx8(Text6, { weight: "bold", muted: true, size: 14, children: item.text })
2880
2099
  ] }, item.text)) })
2881
2100
  ] });
2882
- }, TwitterTitle = (props) => {
2883
- const { value, renderDefault, path } = props, parent = sanity.useFormValue([path[0]]), isParentseoField = parent && parent?._type === "seoFields", keywords = r.useMemo(() => parent?.keywords || [], [parent?.keywords]), feedbackItems = r.useMemo(
2101
+ };
2102
+ var twitterDescription_default = TwitterDescription;
2103
+
2104
+ // src/components/twitter/twitterTitle.tsx
2105
+ import { Stack as Stack7, Text as Text7 } from "@sanity/ui";
2106
+ import { useMemo as useMemo7 } from "react";
2107
+ import { useFormValue as useFormValue7 } from "sanity";
2108
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
2109
+ var TwitterTitle = (props) => {
2110
+ const { value, renderDefault, path } = props;
2111
+ const parent = useFormValue7([path[0]]);
2112
+ const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
2113
+ const keywords = useMemo7(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
2114
+ const feedbackItems = useMemo7(
2884
2115
  () => getTwitterTitleValidation(value || "", keywords, isParentseoField),
2885
2116
  [value, keywords, isParentseoField]
2886
2117
  );
2887
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
2118
+ return /* @__PURE__ */ jsxs8(Stack7, { space: 3, children: [
2888
2119
  renderDefault(props),
2889
- /* @__PURE__ */ jsxRuntime.jsx(ui.Stack, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
2890
- /* @__PURE__ */ jsxRuntime.jsx(
2120
+ /* @__PURE__ */ jsx9(Stack7, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxs8("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
2121
+ /* @__PURE__ */ jsx9(
2891
2122
  "div",
2892
2123
  {
2893
2124
  style: {
@@ -2898,19 +2129,22 @@ const TwitterDescription = (props) => {
2898
2129
  }
2899
2130
  }
2900
2131
  ),
2901
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { weight: "bold", muted: !0, size: 14, children: item.text })
2132
+ /* @__PURE__ */ jsx9(Text7, { weight: "bold", muted: true, size: 14, children: item.text })
2902
2133
  ] }, item.text)) })
2903
2134
  ] });
2904
2135
  };
2136
+ var twitterTitle_default = TwitterTitle;
2137
+
2138
+ // src/schemas/types/twitter/index.ts
2905
2139
  function twitter(config = {}) {
2906
- return sanity.defineType({
2140
+ return defineType2({
2907
2141
  name: "twitter",
2908
2142
  title: "X (Formerly Twitter)",
2909
2143
  type: "object",
2910
2144
  fields: [
2911
- sanity.defineField({
2912
- name: "card",
2913
- ...getFieldInfo("twitterCard", config.fieldOverrides),
2145
+ defineField2(__spreadProps(__spreadValues({
2146
+ name: "card"
2147
+ }, getFieldInfo("twitterCard", config.fieldOverrides)), {
2914
2148
  type: "string",
2915
2149
  options: {
2916
2150
  list: [
@@ -2923,41 +2157,41 @@ function twitter(config = {}) {
2923
2157
  hidden: getFieldHiddenFunction("twitterCard", config),
2924
2158
  initialValue: "summary_large_image"
2925
2159
  // good default
2926
- }),
2927
- sanity.defineField({
2928
- name: "site",
2929
- ...getFieldInfo("twitterSite", config.fieldOverrides),
2160
+ })),
2161
+ defineField2(__spreadProps(__spreadValues({
2162
+ name: "site"
2163
+ }, getFieldInfo("twitterSite", config.fieldOverrides)), {
2930
2164
  type: "string",
2931
2165
  hidden: getFieldHiddenFunction("twitterSite", config)
2932
- }),
2933
- sanity.defineField({
2166
+ })),
2167
+ defineField2(__spreadProps(__spreadValues({
2934
2168
  name: "creator",
2935
- type: "string",
2936
- ...getFieldInfo("twitterCreator", config.fieldOverrides),
2169
+ type: "string"
2170
+ }, getFieldInfo("twitterCreator", config.fieldOverrides)), {
2937
2171
  hidden: getFieldHiddenFunction("twitterCreator", config)
2938
- }),
2939
- sanity.defineField({
2172
+ })),
2173
+ defineField2(__spreadProps(__spreadValues({
2940
2174
  name: "title",
2941
- type: "string",
2942
- ...getFieldInfo("twitterTitle", config.fieldOverrides),
2175
+ type: "string"
2176
+ }, getFieldInfo("twitterTitle", config.fieldOverrides)), {
2943
2177
  hidden: getFieldHiddenFunction("twitterTitle", config),
2944
2178
  components: {
2945
- input: TwitterTitle
2179
+ input: twitterTitle_default
2946
2180
  }
2947
- }),
2948
- sanity.defineField({
2181
+ })),
2182
+ defineField2(__spreadProps(__spreadValues({
2949
2183
  name: "description",
2950
2184
  type: "text",
2951
- rows: 3,
2952
- ...getFieldInfo("twitterDescription", config.fieldOverrides),
2185
+ rows: 3
2186
+ }, getFieldInfo("twitterDescription", config.fieldOverrides)), {
2953
2187
  hidden: getFieldHiddenFunction("twitterDescription", config),
2954
2188
  components: {
2955
- input: TwitterDescription
2189
+ input: twitterDescription_default
2956
2190
  }
2957
- }),
2958
- sanity.defineField({
2959
- name: "imageType",
2960
- ...getFieldInfo("twitterImageType", config.fieldOverrides),
2191
+ })),
2192
+ defineField2(__spreadProps(__spreadValues({
2193
+ name: "imageType"
2194
+ }, getFieldInfo("twitterImageType", config.fieldOverrides)), {
2961
2195
  type: "string",
2962
2196
  options: {
2963
2197
  list: [
@@ -2967,16 +2201,16 @@ function twitter(config = {}) {
2967
2201
  },
2968
2202
  hidden: getFieldHiddenFunction("twitterImage", config),
2969
2203
  initialValue: "upload"
2970
- }),
2971
- sanity.defineField({
2972
- name: "image",
2973
- ...getFieldInfo("twitterImage", config.fieldOverrides),
2204
+ })),
2205
+ defineField2(__spreadProps(__spreadValues({
2206
+ name: "image"
2207
+ }, getFieldInfo("twitterImage", config.fieldOverrides)), {
2974
2208
  type: "image",
2975
2209
  options: {
2976
- hotspot: !0
2210
+ hotspot: true
2977
2211
  },
2978
2212
  fields: [
2979
- sanity.defineField({
2213
+ defineField2({
2980
2214
  name: "alt",
2981
2215
  title: "Image Alt Text",
2982
2216
  type: "string",
@@ -2985,32 +2219,34 @@ function twitter(config = {}) {
2985
2219
  ],
2986
2220
  hidden: (context) => {
2987
2221
  const { parent } = context;
2988
- if (parent?.imageType !== "upload") return !0;
2222
+ if ((parent == null ? void 0 : parent.imageType) !== "upload") return true;
2989
2223
  const hiddenFn = getFieldHiddenFunction("twitterImage", config);
2990
- return typeof hiddenFn == "function" ? hiddenFn(context) : hiddenFn;
2224
+ return typeof hiddenFn === "function" ? hiddenFn(context) : hiddenFn;
2991
2225
  }
2992
- }),
2993
- sanity.defineField({
2994
- name: "imageUrl",
2995
- ...getFieldInfo("twitterImageUrl", config.fieldOverrides),
2226
+ })),
2227
+ defineField2(__spreadProps(__spreadValues({
2228
+ name: "imageUrl"
2229
+ }, getFieldInfo("twitterImageUrl", config.fieldOverrides)), {
2996
2230
  type: "url",
2997
2231
  hidden: (context) => {
2998
2232
  const { parent } = context;
2999
- if (parent?.imageType !== "url") return !0;
2233
+ if ((parent == null ? void 0 : parent.imageType) !== "url") return true;
3000
2234
  const hiddenFn = getFieldHiddenFunction("twitterImage", config);
3001
- return typeof hiddenFn == "function" ? hiddenFn(context) : hiddenFn;
2235
+ return typeof hiddenFn === "function" ? hiddenFn(context) : hiddenFn;
3002
2236
  }
3003
- })
2237
+ }))
3004
2238
  ]
3005
2239
  });
3006
2240
  }
2241
+
2242
+ // src/schemas/index.ts
3007
2243
  function seoFieldsSchema(config = {}) {
3008
- return sanity.defineType({
2244
+ return defineType3({
3009
2245
  name: "seoFields",
3010
2246
  title: "SEO Fields",
3011
2247
  type: "object",
3012
2248
  fields: [
3013
- sanity.defineField({
2249
+ defineField3({
3014
2250
  name: "robots",
3015
2251
  title: "Robots Settings",
3016
2252
  type: "robots",
@@ -3018,105 +2254,106 @@ function seoFieldsSchema(config = {}) {
3018
2254
  hidden: getFieldHiddenFunction("robots", config)
3019
2255
  }),
3020
2256
  // 👇 conditionally spread preview field
3021
- ...typeof config.seoPreview == "boolean" && config.seoPreview || typeof config.seoPreview == "object" && !isEmpty(config.seoPreview) ? [
3022
- sanity.defineField({
2257
+ ...typeof config.seoPreview === "boolean" && config.seoPreview || typeof config.seoPreview === "object" && !isEmpty(config.seoPreview) ? [
2258
+ defineField3({
3023
2259
  name: "preview",
3024
2260
  title: "SEO Preview",
3025
2261
  type: "string",
3026
- components: { input: SeoPreview },
3027
- options: {
3028
- baseUrl: config.baseUrl || "https://www.example.com",
3029
- ...typeof config.seoPreview == "object" && config.seoPreview && config.seoPreview.prefix ? { prefix: config.seoPreview.prefix } : {}
3030
- },
2262
+ components: { input: SeoPreview_default },
2263
+ options: __spreadValues({
2264
+ baseUrl: config.baseUrl || "https://www.example.com"
2265
+ }, typeof config.seoPreview === "object" && config.seoPreview && config.seoPreview.prefix ? { prefix: config.seoPreview.prefix } : {}),
3031
2266
  // Use a readOnly field to prevent editing
3032
2267
  // This field is just for preview purposes
3033
2268
  initialValue: "",
3034
2269
  // Set an initial value
3035
- readOnly: !0
2270
+ readOnly: true
3036
2271
  })
3037
2272
  ] : [],
3038
- sanity.defineField({
3039
- name: "title",
3040
- ...getFieldInfo("title", config.fieldOverrides),
2273
+ defineField3(__spreadProps(__spreadValues({
2274
+ name: "title"
2275
+ }, getFieldInfo("title", config.fieldOverrides)), {
3041
2276
  // title: 'Meta Title',
3042
2277
  type: "string",
3043
2278
  // description:
3044
2279
  // 'The meta title is displayed in search engine results as the clickable headline for a given result. It should be concise and accurately reflect the content of the page.',
3045
2280
  components: {
3046
- input: MetaTitle
2281
+ input: MetaTitle_default
3047
2282
  },
3048
2283
  // validation: (Rule) => Rule.max(60).warning('Meta title should be under 60 characters.'),
3049
2284
  hidden: getFieldHiddenFunction("title", config)
3050
- }),
3051
- sanity.defineField({
3052
- name: "description",
3053
- ...getFieldInfo("description", config.fieldOverrides),
2285
+ })),
2286
+ defineField3(__spreadProps(__spreadValues({
2287
+ name: "description"
2288
+ }, getFieldInfo("description", config.fieldOverrides)), {
3054
2289
  // title: 'Meta Description',
3055
2290
  // description:
3056
2291
  // 'Provide a concise summary of the page content. This description may be used by search engines in search results.',
3057
2292
  type: "text",
3058
2293
  rows: 3,
3059
2294
  components: {
3060
- input: MetaDescription
2295
+ input: MetaDescription_default
3061
2296
  },
3062
2297
  // validation: (Rule) => Rule.max(160).warning('Meta description should be under 160 characters.'),
3063
2298
  hidden: getFieldHiddenFunction("description", config)
3064
- }),
3065
- sanity.defineField({
3066
- name: "metaImage",
3067
- ...getFieldInfo("metaImage", config.fieldOverrides),
2299
+ })),
2300
+ defineField3(__spreadProps(__spreadValues({
2301
+ name: "metaImage"
2302
+ }, getFieldInfo("metaImage", config.fieldOverrides)), {
3068
2303
  // title: 'Meta Image',
3069
2304
  // description:
3070
2305
  // 'Upload an image that represents the content of the page. This image may be used in social media previews and search engine results.',
3071
2306
  type: "image",
3072
2307
  options: {
3073
- hotspot: !0
2308
+ hotspot: true
3074
2309
  },
3075
2310
  hidden: getFieldHiddenFunction("metaImage", config)
3076
- }),
3077
- sanity.defineField({
3078
- name: "metaAttributes",
3079
- // title: 'Additional Meta Attributes',
3080
- ...getFieldInfo("metaAttributes", config.fieldOverrides),
2311
+ })),
2312
+ defineField3(__spreadProps(__spreadValues({
2313
+ name: "metaAttributes"
2314
+ }, getFieldInfo("metaAttributes", config.fieldOverrides)), {
3081
2315
  type: "array",
3082
2316
  of: [{ type: "metaAttribute" }],
3083
2317
  // description:
3084
2318
  // 'Add custom meta attributes to the head of the document for additional SEO and social media integration.',
3085
2319
  hidden: getFieldHiddenFunction("metaAttributes", config)
3086
- }),
3087
- sanity.defineField({
3088
- name: "keywords",
3089
- ...getFieldInfo("keywords", config.fieldOverrides),
2320
+ })),
2321
+ defineField3(__spreadProps(__spreadValues({
2322
+ name: "keywords"
2323
+ }, getFieldInfo("keywords", config.fieldOverrides)), {
3090
2324
  title: "Keywords",
3091
2325
  type: "array",
3092
2326
  of: [{ type: "string" }],
3093
2327
  description: "Add relevant keywords for this page. These keywords will be used for SEO purposes.",
3094
2328
  hidden: getFieldHiddenFunction("keywords", config)
3095
- }),
3096
- sanity.defineField({
3097
- name: "canonicalUrl",
3098
- ...getFieldInfo("canonicalUrl", config.fieldOverrides),
2329
+ })),
2330
+ defineField3(__spreadProps(__spreadValues({
2331
+ name: "canonicalUrl"
2332
+ }, getFieldInfo("canonicalUrl", config.fieldOverrides)), {
3099
2333
  title: "Canonical URL",
3100
2334
  type: "url",
3101
2335
  description: "Specify the canonical URL for this page. This helps prevent duplicate content issues by indicating the preferred version of a page.",
3102
2336
  hidden: getFieldHiddenFunction("canonicalUrl", config)
3103
- }),
2337
+ })),
3104
2338
  openGraph(config),
3105
2339
  twitter(config)
3106
2340
  ]
3107
2341
  });
3108
2342
  }
3109
- var metaAttribute = sanity.defineType({
2343
+
2344
+ // src/schemas/types/metaAttribute/index.ts
2345
+ import { defineField as defineField4, defineType as defineType4 } from "sanity";
2346
+ var metaAttribute_default = defineType4({
3110
2347
  name: "metaAttribute",
3111
2348
  title: "Meta Attribute",
3112
2349
  type: "object",
3113
2350
  fields: [
3114
- sanity.defineField({
2351
+ defineField4({
3115
2352
  name: "key",
3116
2353
  title: "Attribute Name",
3117
2354
  type: "string"
3118
2355
  }),
3119
- sanity.defineField({
2356
+ defineField4({
3120
2357
  name: "type",
3121
2358
  title: "Attribute Value Type",
3122
2359
  type: "string",
@@ -3128,17 +2365,17 @@ var metaAttribute = sanity.defineType({
3128
2365
  },
3129
2366
  initialValue: "string"
3130
2367
  }),
3131
- sanity.defineField({
2368
+ defineField4({
3132
2369
  name: "value",
3133
2370
  title: "Attribute Value",
3134
2371
  type: "string",
3135
- hidden: ({ parent }) => parent?.type === "image"
2372
+ hidden: ({ parent }) => (parent == null ? void 0 : parent.type) === "image"
3136
2373
  }),
3137
- sanity.defineField({
2374
+ defineField4({
3138
2375
  name: "image",
3139
2376
  title: "Attribute Image Value",
3140
2377
  type: "image",
3141
- hidden: ({ parent }) => parent?.type === "string"
2378
+ hidden: ({ parent }) => (parent == null ? void 0 : parent.type) === "string"
3142
2379
  })
3143
2380
  ],
3144
2381
  preview: {
@@ -3149,14 +2386,25 @@ var metaAttribute = sanity.defineType({
3149
2386
  },
3150
2387
  prepare({ attributeName, attributeValueString, attributeValueImage }) {
3151
2388
  let subtitle = "";
3152
- return attributeValueString ? subtitle = `Value: ${attributeValueString}` : attributeValueImage ? subtitle = "Value: [Image]" : subtitle = "No Attribute Value", {
2389
+ if (attributeValueString) {
2390
+ subtitle = `Value: ${attributeValueString}`;
2391
+ } else if (attributeValueImage) {
2392
+ subtitle = "Value: [Image]";
2393
+ } else {
2394
+ subtitle = "No Attribute Value";
2395
+ }
2396
+ return {
3153
2397
  title: attributeName || "No Attribute Name",
3154
2398
  subtitle,
3155
2399
  media: attributeValueImage
3156
2400
  };
3157
2401
  }
3158
2402
  }
3159
- }), metaTag = sanity.defineType({
2403
+ });
2404
+
2405
+ // src/schemas/types/metaTag/index.ts
2406
+ import { defineType as defineType5 } from "sanity";
2407
+ var metaTag_default = defineType5({
3160
2408
  name: "metaTag",
3161
2409
  title: "Meta Tag",
3162
2410
  type: "object",
@@ -3169,28 +2417,34 @@ var metaAttribute = sanity.defineType({
3169
2417
  description: "Add custom meta attributes to the head of the document for additional SEO and social media integration."
3170
2418
  }
3171
2419
  ]
3172
- }), robots = sanity.defineType({
2420
+ });
2421
+
2422
+ // src/schemas/types/robots/index.ts
2423
+ import { defineField as defineField5, defineType as defineType6 } from "sanity";
2424
+ var robots_default = defineType6({
3173
2425
  name: "robots",
3174
2426
  title: "Robots Settings",
3175
2427
  type: "object",
3176
2428
  fields: [
3177
- sanity.defineField({
2429
+ defineField5({
3178
2430
  name: "noIndex",
3179
2431
  title: "No Index",
3180
2432
  type: "boolean",
3181
- initialValue: !1,
2433
+ initialValue: false,
3182
2434
  description: "Enable this to prevent search engines from indexing this page. The page will not appear in search results."
3183
2435
  }),
3184
- sanity.defineField({
2436
+ defineField5({
3185
2437
  name: "noFollow",
3186
2438
  title: "No Follow",
3187
2439
  type: "boolean",
3188
- initialValue: !1,
2440
+ initialValue: false,
3189
2441
  description: "Enable this to prevent search engines from following links on this page. Links will not pass SEO value."
3190
2442
  })
3191
2443
  ],
3192
2444
  description: "Select how search engines should index and follow links on this page."
3193
2445
  });
2446
+
2447
+ // src/schemas/types/index.ts
3194
2448
  function types(config = {}) {
3195
2449
  return [
3196
2450
  seoFieldsSchema(config),
@@ -3199,39 +2453,45 @@ function types(config = {}) {
3199
2453
  // pass config here
3200
2454
  twitter(config),
3201
2455
  // pass config here
3202
- metaAttribute,
3203
- metaTag,
3204
- robots
2456
+ metaAttribute_default,
2457
+ metaTag_default,
2458
+ robots_default
3205
2459
  ];
3206
2460
  }
3207
- const resolveDashboardConfig = (healthDashboard) => {
3208
- const cfg = typeof healthDashboard == "object" ? healthDashboard : void 0;
2461
+
2462
+ // src/plugin.ts
2463
+ var resolveDashboardConfig = (healthDashboard) => {
2464
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
2465
+ const cfg = typeof healthDashboard === "object" ? healthDashboard : void 0;
3209
2466
  return {
3210
- enabled: healthDashboard !== !1,
3211
- toolTitle: cfg?.tool?.title ?? "SEO Health",
3212
- toolName: cfg?.tool?.name ?? "seo-health-dashboard",
3213
- icon: cfg?.content?.icon,
3214
- title: cfg?.content?.title,
3215
- description: cfg?.content?.description,
3216
- showTypeColumn: cfg?.display?.typeColumn,
3217
- showDocumentId: cfg?.display?.documentId,
3218
- queryTypes: cfg?.query?.types,
3219
- queryRequireSeo: cfg?.query?.requireSeo,
3220
- queryGroq: cfg?.query?.groq,
3221
- apiVersion: cfg?.apiVersion,
3222
- licenseKey: cfg?.licenseKey,
3223
- typeLabels: cfg?.typeLabels,
3224
- typeColumnMode: cfg?.typeColumnMode,
3225
- titleField: cfg?.titleField,
3226
- docBadge: cfg?.docBadge,
3227
- loadingLicense: cfg?.content?.loadingLicense,
3228
- loadingDocuments: cfg?.content?.loadingDocuments,
3229
- noDocuments: cfg?.content?.noDocuments,
3230
- previewMode: cfg?.previewMode,
3231
- structureTool: cfg?.structureTool
2467
+ enabled: healthDashboard !== false,
2468
+ toolTitle: (_b = (_a = cfg == null ? void 0 : cfg.tool) == null ? void 0 : _a.title) != null ? _b : "SEO Health",
2469
+ toolName: (_d = (_c = cfg == null ? void 0 : cfg.tool) == null ? void 0 : _c.name) != null ? _d : "seo-health-dashboard",
2470
+ icon: (_e = cfg == null ? void 0 : cfg.content) == null ? void 0 : _e.icon,
2471
+ title: (_f = cfg == null ? void 0 : cfg.content) == null ? void 0 : _f.title,
2472
+ description: (_g = cfg == null ? void 0 : cfg.content) == null ? void 0 : _g.description,
2473
+ showTypeColumn: (_h = cfg == null ? void 0 : cfg.display) == null ? void 0 : _h.typeColumn,
2474
+ showDocumentId: (_i = cfg == null ? void 0 : cfg.display) == null ? void 0 : _i.documentId,
2475
+ queryTypes: (_j = cfg == null ? void 0 : cfg.query) == null ? void 0 : _j.types,
2476
+ queryRequireSeo: (_k = cfg == null ? void 0 : cfg.query) == null ? void 0 : _k.requireSeo,
2477
+ queryGroq: (_l = cfg == null ? void 0 : cfg.query) == null ? void 0 : _l.groq,
2478
+ apiVersion: cfg == null ? void 0 : cfg.apiVersion,
2479
+ licenseKey: cfg == null ? void 0 : cfg.licenseKey,
2480
+ typeLabels: cfg == null ? void 0 : cfg.typeLabels,
2481
+ typeColumnMode: cfg == null ? void 0 : cfg.typeColumnMode,
2482
+ titleField: cfg == null ? void 0 : cfg.titleField,
2483
+ docBadge: cfg == null ? void 0 : cfg.docBadge,
2484
+ loadingLicense: (_m = cfg == null ? void 0 : cfg.content) == null ? void 0 : _m.loadingLicense,
2485
+ loadingDocuments: (_n = cfg == null ? void 0 : cfg.content) == null ? void 0 : _n.loadingDocuments,
2486
+ noDocuments: (_o = cfg == null ? void 0 : cfg.content) == null ? void 0 : _o.noDocuments,
2487
+ previewMode: cfg == null ? void 0 : cfg.previewMode,
2488
+ structureTool: cfg == null ? void 0 : cfg.structureTool
3232
2489
  };
3233
- }, seofields = sanity.definePlugin((config = {}) => {
3234
- const { healthDashboard = !0 } = config, dash = resolveDashboardConfig(healthDashboard), BoundSeoHealthTool = () => r__default.default.createElement(SeoHealthTool, {
2490
+ };
2491
+ var seofields = definePlugin((config = {}) => {
2492
+ const { healthDashboard = true } = config;
2493
+ const dash = resolveDashboardConfig(healthDashboard);
2494
+ const BoundSeoHealthTool = () => React8.createElement(SeoHealthTool_default, {
3235
2495
  icon: dash.icon,
3236
2496
  title: dash.title,
3237
2497
  description: dash.description,
@@ -3252,39 +2512,50 @@ const resolveDashboardConfig = (healthDashboard) => {
3252
2512
  previewMode: dash.previewMode,
3253
2513
  structureTool: dash.structureTool
3254
2514
  });
3255
- return {
2515
+ return __spreadValues({
3256
2516
  name: "sanity-plugin-seofields",
3257
2517
  schema: {
3258
2518
  types: types(config)
3259
- },
3260
- ...dash.enabled && {
3261
- tools: [
3262
- {
3263
- name: dash.toolName,
3264
- title: dash.toolTitle,
3265
- component: BoundSeoHealthTool,
3266
- icon: () => "\u{1F4CA}"
3267
- }
3268
- ]
3269
2519
  }
3270
- };
2520
+ }, dash.enabled && {
2521
+ tools: [
2522
+ {
2523
+ name: dash.toolName,
2524
+ title: dash.toolTitle,
2525
+ component: BoundSeoHealthTool,
2526
+ icon: () => "\u{1F4CA}"
2527
+ }
2528
+ ]
2529
+ });
3271
2530
  });
2531
+ var plugin_default = seofields;
2532
+
2533
+ // src/components/SeoHealthPane.tsx
2534
+ import { jsx as jsx10 } from "react/jsx-runtime";
3272
2535
  function createSeoHealthPane(optionsOrS, optionsWhenS) {
3273
- const S2 = optionsOrS, { query, openInPane = !0, title: paneTitle, ...rest } = optionsWhenS ?? {}, SeoHealthPane = () => /* @__PURE__ */ jsxRuntime.jsx(SeoHealthDashboard, { customQuery: query, openInPane, title: paneTitle, ...rest });
3274
- return SeoHealthPane.displayName = "SeoHealthPane", S2.component(SeoHealthPane).title(paneTitle ?? "SEO Health").child((docId, { params }) => {
3275
- const builder = S2.document().documentId(docId);
3276
- return params?.type ? builder.schemaType(params.type) : builder;
2536
+ const S = optionsOrS;
2537
+ const _a = optionsWhenS != null ? optionsWhenS : {}, { query, openInPane = true, title: paneTitle } = _a, rest = __objRest(_a, ["query", "openInPane", "title"]);
2538
+ const SeoHealthPane = () => /* @__PURE__ */ jsx10(SeoHealthDashboard_default, __spreadValues({ customQuery: query, openInPane, title: paneTitle }, rest));
2539
+ SeoHealthPane.displayName = "SeoHealthPane";
2540
+ return S.component(SeoHealthPane).title(paneTitle != null ? paneTitle : "SEO Health").child((docId, { params }) => {
2541
+ const builder = S.document().documentId(docId);
2542
+ return (params == null ? void 0 : params.type) ? builder.schemaType(params.type) : builder;
3277
2543
  });
3278
2544
  }
3279
- exports.SeoHealthDashboard = SeoHealthDashboard;
3280
- exports.SeoHealthTool = SeoHealthTool;
3281
- exports.allSchemas = types;
3282
- exports.createSeoHealthPane = createSeoHealthPane;
3283
- exports.default = seofields;
3284
- exports.metaAttributeSchema = metaAttribute;
3285
- exports.metaTagSchema = metaTag;
3286
- exports.openGraphSchema = openGraph;
3287
- exports.robotsSchema = robots;
3288
- exports.seoFieldsSchema = seoFieldsSchema;
3289
- exports.twitterSchema = twitter;
3290
- //# sourceMappingURL=index.js.map
2545
+
2546
+ // src/index.ts
2547
+ var src_default = plugin_default;
2548
+ export {
2549
+ SeoHealthDashboard_default as SeoHealthDashboard,
2550
+ SeoHealthTool_default as SeoHealthTool,
2551
+ types as allSchemas,
2552
+ createSeoHealthPane,
2553
+ src_default as default,
2554
+ metaAttribute_default as metaAttributeSchema,
2555
+ metaTag_default as metaTagSchema,
2556
+ openGraph as openGraphSchema,
2557
+ robots_default as robotsSchema,
2558
+ seoFieldsSchema,
2559
+ twitter as twitterSchema
2560
+ };
2561
+ //# sourceMappingURL=index.js.map