@arkitektbedriftene/fe-lib 0.4.33 → 0.4.35

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.
@@ -1,34 +1,30 @@
1
- var Gt = Object.defineProperty;
2
- var Jt = (t, e, r) => e in t ? Gt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var st = (t, e, r) => (Jt(t, typeof e != "symbol" ? e + "" : e, r), r);
4
- import { createHeadlessEditor as Xt } from "@lexical/headless";
5
- import { $generateHtmlFromNodes as Qt } from "@lexical/html";
6
- import { $getRoot as K, ParagraphNode as Vt, $createParagraphNode as q, $createTextNode as B, $setSelection as bt, SELECTION_CHANGE_COMMAND as F, $getSelection as T, COMMAND_PRIORITY_CRITICAL as Q, $isRangeSelection as L, $isRootOrShadowRoot as Zt, FORMAT_TEXT_COMMAND as D, COMMAND_PRIORITY_LOW as E, KEY_ARROW_DOWN_COMMAND as te, KEY_ARROW_UP_COMMAND as ee, KEY_ESCAPE_COMMAND as vt, KEY_SPACE_COMMAND as re, $getNearestNodeFromDOMNode as V, KEY_ARROW_LEFT_COMMAND as ne, $isElementNode as oe, COMMAND_PRIORITY_NORMAL as ie, $isParagraphNode as ae, COMMAND_PRIORITY_HIGH as le } from "lexical";
7
- import { trimTextContentFromAnchor as se, $setBlocksType as J, $isAtNodeEnd as ct } from "@lexical/selection";
1
+ var Yt = Object.defineProperty;
2
+ var Gt = (t, e, r) => e in t ? Yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var st = (t, e, r) => (Gt(t, typeof e != "symbol" ? e + "" : e, r), r);
4
+ import { createHeadlessEditor as Jt } from "@lexical/headless";
5
+ import { $generateHtmlFromNodes as Xt } from "@lexical/html";
6
+ import { $getRoot as K, ParagraphNode as Qt, $createParagraphNode as q, $createTextNode as D, $setSelection as bt, SELECTION_CHANGE_COMMAND as F, $getSelection as T, COMMAND_PRIORITY_CRITICAL as Q, $isRangeSelection as L, $isRootOrShadowRoot as Vt, FORMAT_TEXT_COMMAND as B, COMMAND_PRIORITY_LOW as E, KEY_ARROW_DOWN_COMMAND as Zt, KEY_ARROW_UP_COMMAND as te, KEY_ESCAPE_COMMAND as vt, KEY_SPACE_COMMAND as ee, $getNearestNodeFromDOMNode as V, KEY_ARROW_LEFT_COMMAND as re, $isElementNode as ne, COMMAND_PRIORITY_NORMAL as oe, $isParagraphNode as ie, COMMAND_PRIORITY_HIGH as ae } from "lexical";
7
+ import { trimTextContentFromAnchor as le, $setBlocksType as J, $isAtNodeEnd as ct } from "@lexical/selection";
8
8
  import { LinkNode as z, AutoLinkNode as Mt, $isLinkNode as U, TOGGLE_LINK_COMMAND as Z } from "@lexical/link";
9
- import { ListNode as tt, ListItemNode as Ct, $isListNode as et, INSERT_UNORDERED_LIST_COMMAND as ce, INSERT_ORDERED_LIST_COMMAND as de, INSERT_CHECK_LIST_COMMAND as Tt, insertList as ue, $isListItemNode as O } from "@lexical/list";
10
- import { HeadingNode as Lt, QuoteNode as xt, $isHeadingNode as he, $createHeadingNode as pe, $createQuoteNode as ge } from "@lexical/rich-text";
11
- import { TableNode as yt, TableRowNode as Nt, TableCellNode as St, INSERT_TABLE_COMMAND as fe, $getTableCellNodeFromLexicalNode as me, $deleteTableColumn__EXPERIMENTAL as ke, $deleteTableRow__EXPERIMENTAL as be, $insertTableColumn__EXPERIMENTAL as dt, $insertTableRow__EXPERIMENTAL as ut } from "@lexical/table";
9
+ import { ListNode as tt, ListItemNode as Ct, $isListNode as et, INSERT_UNORDERED_LIST_COMMAND as se, INSERT_ORDERED_LIST_COMMAND as ce, INSERT_CHECK_LIST_COMMAND as Tt, insertList as de, $isListItemNode as O } from "@lexical/list";
10
+ import { HeadingNode as Lt, QuoteNode as xt, $isHeadingNode as ue, $createHeadingNode as he, $createQuoteNode as pe } from "@lexical/rich-text";
11
+ import { TableNode as yt, TableRowNode as Nt, TableCellNode as St, INSERT_TABLE_COMMAND as ge, $getTableCellNodeFromLexicalNode as fe, $deleteTableColumn__EXPERIMENTAL as me, $deleteTableRow__EXPERIMENTAL as ke, $insertTableColumn__EXPERIMENTAL as dt, $insertTableRow__EXPERIMENTAL as ut } from "@lexical/table";
12
12
  import { jsx as n, jsxs as g, Fragment as Y } from "react/jsx-runtime";
13
- import { createContext as ve, useState as b, useRef as rt, useCallback as v, useContext as Me, useEffect as x, useMemo as wt, useLayoutEffect as Ce } from "react";
14
- import { s as Et, D as nt, T as _t, a as C, B as P, b as Rt, c as I, u as ot, d as It, e as Te, f as Le, o as zt, g as xe, h as Ot, i as $t, F as At, O as Dt, j as ye, k as Ne, S as Se, l as we, m as $, n as R, p as ht, q as Ee, N as _e, r as pt, t as Re, v as Bt, C as Ie, w as ze, x as Oe } from "./Checkbox-0c1030b1.js";
15
- import "react-select";
16
- import { LexicalComposer as $e } from "@lexical/react/LexicalComposer.js";
17
- import { RichTextPlugin as Ae } from "@lexical/react/LexicalRichTextPlugin.js";
18
- import De from "@lexical/react/LexicalErrorBoundary.js";
13
+ import { createContext as be, useState as b, useRef as rt, useCallback as v, useContext as ve, useEffect as x, useMemo as wt, useLayoutEffect as Me } from "react";
14
+ import { DropdownMenu as nt, ToolbarButton as Et, DropdownMenuIconItem as C, Box as P, ToolbarToggleGroup as _t, ToolbarToggleItem as I, OverlayCard as Rt, Toolbar as Ce, ToolbarSeparator as Te, styled as Le, Spinner as xe, Button as $, DropdownMenuItem as R, DropdownMenuSeparator as ht, Dialog as ye, NavBar as Ne, NavBarItem as pt, TextInput as Se, DialogActions as It, Combobox as we } from "./ui.es.js";
15
+ import { LexicalComposer as Ee } from "@lexical/react/LexicalComposer.js";
16
+ import { RichTextPlugin as _e } from "@lexical/react/LexicalRichTextPlugin.js";
17
+ import Re from "@lexical/react/LexicalErrorBoundary.js";
18
+ import { s as Ie, u as ot, a as zt, b as ze, f as Oe, o as Ot, c as $e, d as $t, e as At, F as Bt, g as Ae, i as Be, h as De } from "./stitches.config-543644f4.js";
19
19
  import { useLexicalComposerContext as y } from "@lexical/react/LexicalComposerContext.js";
20
- import { $getNearestNodeOfType as Be, $findMatchingParent as Pt, mergeRegister as it, isHTMLElement as gt } from "@lexical/utils";
21
- import { G as h, f as Pe } from "./index.esm-3266b7f8.js";
22
- import { ListPlugin as Fe } from "@lexical/react/LexicalListPlugin.js";
23
- import { HistoryPlugin as He } from "@lexical/react/LexicalHistoryPlugin.js";
24
- import { TablePlugin as Ue } from "@lexical/react/LexicalTablePlugin.js";
25
- import { TabIndentationPlugin as We } from "@lexical/react/LexicalTabIndentationPlugin.js";
20
+ import { $getNearestNodeOfType as Pe, $findMatchingParent as Dt, mergeRegister as it, isHTMLElement as gt } from "@lexical/utils";
21
+ import { G as h, e as Fe } from "./index.esm-e4db0c1f.js";
22
+ import { ListPlugin as He } from "@lexical/react/LexicalListPlugin.js";
23
+ import { HistoryPlugin as Ue } from "@lexical/react/LexicalHistoryPlugin.js";
24
+ import { TablePlugin as We } from "@lexical/react/LexicalTablePlugin.js";
25
+ import { TabIndentationPlugin as je } from "@lexical/react/LexicalTabIndentationPlugin.js";
26
26
  import "react-dom";
27
- import "@radix-ui/react-toolbar";
28
- import "@radix-ui/react-dialog";
29
- import "@radix-ui/react-dropdown-menu";
30
- import "@radix-ui/react-checkbox";
31
- const je = ({
27
+ const Ke = ({
32
28
  text: t,
33
29
  maxChars: e,
34
30
  maxLines: r
@@ -43,16 +39,16 @@ const je = ({
43
39
  t[a] === `
44
40
  ` && l++, a++;
45
41
  return t.slice(0, a).length;
46
- }, Ke = ({
42
+ }, qe = ({
47
43
  editor: t,
48
44
  maxChars: e,
49
45
  maxLines: r
50
46
  }) => {
51
- const o = K(), i = o.getTextContent(), l = je({ text: i, maxChars: e, maxLines: r }), a = i.length - l, d = o.select().anchor;
52
- se(t, d, a);
47
+ const o = K(), i = o.getTextContent(), l = Ke({ text: i, maxChars: e, maxLines: r }), a = i.length - l, d = o.select().anchor;
48
+ le(t, d, a);
53
49
  const c = o.getLastChild();
54
- return c instanceof Vt && c.getChildrenSize() === 0 && c.remove(), a;
55
- }, Ft = {
50
+ return c instanceof Qt && c.getChildrenSize() === 0 && c.remove(), a;
51
+ }, Pt = {
56
52
  quote: "ain-rich-text-quote",
57
53
  text: {
58
54
  bold: "ain-rich-text-bold",
@@ -64,47 +60,47 @@ const je = ({
64
60
  listitem: "ain-rich-text-nested-list-item"
65
61
  }
66
62
  }
67
- }, Ht = (t) => t[0] === "{", qe = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ye = (t, e) => {
63
+ }, Ft = (t) => t[0] === "{", Ye = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ge = (t, e) => {
68
64
  t.update(
69
65
  () => {
70
66
  const r = K();
71
67
  r.clear();
72
68
  const o = q();
73
- o.append(B("")), r.append(o), bt(null);
69
+ o.append(D("")), r.append(o), bt(null);
74
70
  },
75
71
  {
76
72
  tag: e
77
73
  }
78
74
  );
79
- }, Ge = (t, e, r) => {
75
+ }, Je = (t, e, r) => {
80
76
  e.update(
81
77
  () => {
82
78
  const o = K();
83
79
  o.clear();
84
80
  const i = q();
85
- i.append(B(t.trim())), o.append(i), bt(null);
81
+ i.append(D(t.trim())), o.append(i), bt(null);
86
82
  },
87
83
  {
88
84
  tag: r
89
85
  }
90
86
  ), e.blur();
91
- }, cn = (t, e, r) => {
87
+ }, an = (t, e, r) => {
92
88
  let o = 0;
93
- const i = Xt({
89
+ const i = Jt({
94
90
  nodes: e,
95
91
  editable: !1,
96
- theme: Ft
92
+ theme: Pt
97
93
  });
98
94
  if (t)
99
95
  try {
100
- if (typeof t == "string" && !Ht(t))
96
+ if (typeof t == "string" && !Ft(t))
101
97
  i.update(() => {
102
98
  const a = K(), s = q();
103
- s.append(B(t.trim())), a.append(s);
99
+ s.append(D(t.trim())), a.append(s);
104
100
  });
105
101
  else {
106
102
  const a = i.parseEditorState(t, () => {
107
- (r == null ? void 0 : r.maxLines) !== void 0 && (o = Ke({
103
+ (r == null ? void 0 : r.maxLines) !== void 0 && (o = qe({
108
104
  editor: i,
109
105
  maxLines: r.maxLines
110
106
  }));
@@ -117,13 +113,23 @@ const je = ({
117
113
  let l = "";
118
114
  return i.update(() => {
119
115
  var a;
120
- r != null && r.updateFn && ((a = r.updateFn) == null || a.call(r)), l = Qt(i);
116
+ r != null && r.updateFn && ((a = r.updateFn) == null || a.call(r)), l = Xt(i);
121
117
  }), { html: l, trimCount: o };
122
118
  };
123
119
  class W extends z {
124
120
  static getType() {
125
121
  return "target-link";
126
122
  }
123
+ constructor(e, r, o) {
124
+ let i = !1;
125
+ const l = { ...r };
126
+ try {
127
+ const a = new URL(e);
128
+ window.location.hostname !== a.hostname && (i = !0);
129
+ } catch {
130
+ }
131
+ i && (l.target = "_blank", l.rel = "noopener noreferrer"), super(e, l, o);
132
+ }
127
133
  static clone(e) {
128
134
  return new W(
129
135
  e.__url,
@@ -131,10 +137,6 @@ class W extends z {
131
137
  e.__key
132
138
  );
133
139
  }
134
- createDOM(e) {
135
- const r = super.createDOM(e);
136
- return r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer"), r;
137
- }
138
140
  exportJSON() {
139
141
  return super.exportJSON();
140
142
  }
@@ -142,7 +144,7 @@ class W extends z {
142
144
  return z.importJSON(e);
143
145
  }
144
146
  }
145
- const dn = [
147
+ const ln = [
146
148
  Lt,
147
149
  xt,
148
150
  tt,
@@ -152,7 +154,7 @@ const dn = [
152
154
  yt,
153
155
  Nt,
154
156
  St
155
- ], un = [
157
+ ], sn = [
156
158
  Lt,
157
159
  xt,
158
160
  tt,
@@ -170,7 +172,7 @@ const dn = [
170
172
  { rel: t.__rel, target: t.__target, title: t.__title }
171
173
  )
172
174
  }
173
- ], Ut = ve({ hasFocus: !1, editorRef: { current: null } }), Je = ({ onBlur: t }) => {
175
+ ], Ht = be({ hasFocus: !1, editorRef: { current: null } }), Xe = ({ onBlur: t }) => {
174
176
  const [e, r] = b(!1), o = rt(null), i = v(() => {
175
177
  r(!0), o.current && window.clearTimeout(o.current);
176
178
  }, []), l = v(() => {
@@ -185,65 +187,65 @@ const dn = [
185
187
  onBlur: l
186
188
  }
187
189
  };
188
- }, at = () => Me(Ut);
189
- function Xe(t) {
190
+ }, at = () => ve(Ht);
191
+ function Qe(t) {
190
192
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" } }, { tag: "path", attr: { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" } }] })(t);
191
193
  }
192
- function Qe(t) {
194
+ function Ve(t) {
193
195
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
194
196
  }
195
- function Ve(t) {
197
+ function Ze(t) {
196
198
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 18v-8l-2 2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
197
199
  }
198
- function Ze(t) {
200
+ function tr(t) {
199
201
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
200
202
  }
201
- function tr(t) {
203
+ function er(t) {
202
204
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 -2 -2" } }, { tag: "path", attr: { d: "M17 16a2 2 0 1 0 2 -2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
203
205
  }
204
- function er(t) {
206
+ function rr(t) {
205
207
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M20 18v-8l-4 6h5" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
206
208
  }
207
- function rr(t) {
209
+ function nr(t) {
208
210
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 18h2a2 2 0 1 0 0 -4h-2v-4h4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
209
211
  }
210
- function nr(t) {
212
+ function or(t) {
211
213
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z" } }, { tag: "path", attr: { d: "M21 12a2 2 0 1 0 -4 0v4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
212
214
  }
213
- function or(t) {
215
+ function ir(t) {
214
216
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
215
217
  }
216
- function ir(t) {
218
+ function ar(t) {
217
219
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0" } }, { tag: "path", attr: { d: "M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5" } }, { tag: "path", attr: { d: "M3 13h7" } }, { tag: "path", attr: { d: "M21 12v7" } }] })(t);
218
220
  }
219
- function ar(t) {
221
+ function lr(t) {
220
222
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" } }, { tag: "path", attr: { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" } }] })(t);
221
223
  }
222
- function lr(t) {
224
+ function sr(t) {
223
225
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M3.5 5.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 11.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 17.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M11 6l9 0" } }, { tag: "path", attr: { d: "M11 12l9 0" } }, { tag: "path", attr: { d: "M11 18l9 0" } }] })(t);
224
226
  }
225
- function sr(t) {
227
+ function cr(t) {
226
228
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 6h9" } }, { tag: "path", attr: { d: "M11 12h9" } }, { tag: "path", attr: { d: "M12 18h8" } }, { tag: "path", attr: { d: "M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" } }, { tag: "path", attr: { d: "M6 10v-6l-2 2" } }] })(t);
227
229
  }
228
- function cr(t) {
230
+ function dr(t) {
229
231
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M9 6l11 0" } }, { tag: "path", attr: { d: "M9 12l11 0" } }, { tag: "path", attr: { d: "M9 18l11 0" } }, { tag: "path", attr: { d: "M5 6l0 .01" } }, { tag: "path", attr: { d: "M5 12l0 .01" } }, { tag: "path", attr: { d: "M5 18l0 .01" } }] })(t);
230
232
  }
231
- function dr(t) {
233
+ function ur(t) {
232
234
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }, { tag: "path", attr: { d: "M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }] })(t);
233
235
  }
234
- function ur(t) {
236
+ function hr(t) {
235
237
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M5 7l8 10m-8 0l8 -10" } }, { tag: "path", attr: { d: "M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2" } }] })(t);
236
238
  }
237
- function hr(t) {
239
+ function pr(t) {
238
240
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" } }, { tag: "path", attr: { d: "M4 10l16 0" } }, { tag: "path", attr: { d: "M10 4l0 16" } }] })(t);
239
241
  }
240
- function pr(t) {
242
+ function gr(t) {
241
243
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
242
244
  }
243
- const gr = Et("div", {
245
+ const fr = Ie("div", {
244
246
  width: "10rem",
245
247
  display: "flex"
246
- }), Wt = {
248
+ }), Ut = {
247
249
  bullet: "Punktliste",
248
250
  h1: "Overskrift 1",
249
251
  h2: "Overskrift 2",
@@ -255,22 +257,22 @@ const gr = Et("div", {
255
257
  paragraph: "Normal",
256
258
  quote: "Sitat",
257
259
  check: "Avkrysningsliste"
258
- }, fr = {
259
- bullet: /* @__PURE__ */ n(cr, { size: "1.25rem" }),
260
- h1: /* @__PURE__ */ n(Ve, { size: "1.25rem" }),
261
- h2: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
262
- h3: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
263
- h4: /* @__PURE__ */ n(er, { size: "1.25rem" }),
264
- h5: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
265
- h6: /* @__PURE__ */ n(nr, { size: "1.25rem" }),
266
- number: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
267
- check: /* @__PURE__ */ n(lr, { size: "1.25rem" }),
268
- paragraph: /* @__PURE__ */ n(ir, { size: "1.25rem" }),
269
- quote: /* @__PURE__ */ n(dr, { size: "1.25rem" })
260
+ }, mr = {
261
+ bullet: /* @__PURE__ */ n(dr, { size: "1.25rem" }),
262
+ h1: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
263
+ h2: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
264
+ h3: /* @__PURE__ */ n(er, { size: "1.25rem" }),
265
+ h4: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
266
+ h5: /* @__PURE__ */ n(nr, { size: "1.25rem" }),
267
+ h6: /* @__PURE__ */ n(or, { size: "1.25rem" }),
268
+ number: /* @__PURE__ */ n(cr, { size: "1.25rem" }),
269
+ check: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
270
+ paragraph: /* @__PURE__ */ n(ar, { size: "1.25rem" }),
271
+ quote: /* @__PURE__ */ n(ur, { size: "1.25rem" })
270
272
  }, M = ({
271
273
  blockType: t
272
274
  }) => /* @__PURE__ */ g(Y, { children: [
273
- /* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children: fr[t] }),
275
+ /* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children: mr[t] }),
274
276
  /* @__PURE__ */ n(
275
277
  P,
276
278
  {
@@ -280,40 +282,40 @@ const gr = Et("div", {
280
282
  textOverflow: "ellipsis",
281
283
  whiteSpace: "nowrap"
282
284
  },
283
- children: Wt[t]
285
+ children: Ut[t]
284
286
  }
285
287
  )
286
- ] }), mr = (t) => {
288
+ ] }), kr = (t) => {
287
289
  if (!L(t))
288
290
  return null;
289
291
  const e = t.anchor.getNode();
290
- let r = e.getKey() === "root" ? e : Pt(e, (o) => {
292
+ let r = e.getKey() === "root" ? e : Dt(e, (o) => {
291
293
  const i = o.getParent();
292
- return i !== null && Zt(i);
294
+ return i !== null && Vt(i);
293
295
  });
294
296
  return r === null && (r = e.getTopLevelElementOrThrow()), {
295
297
  anchorNode: e,
296
298
  element: r
297
299
  };
298
- }, kr = () => {
300
+ }, br = () => {
299
301
  const [t] = y(), [e, r] = b("paragraph");
300
302
  x(() => t.registerCommand(
301
303
  F,
302
304
  () => {
303
- const c = T(), f = mr(c);
305
+ const c = T(), f = kr(c);
304
306
  if (!f)
305
307
  return !1;
306
308
  const { element: u, anchorNode: m } = f, w = u.getKey();
307
309
  if (t.getElementByKey(w) !== null)
308
310
  if (et(u)) {
309
- const k = Be(
311
+ const k = Pe(
310
312
  m,
311
313
  tt
312
314
  ), S = k ? k.getListType() : u.getListType();
313
315
  r(S);
314
316
  } else {
315
- const k = he(u) ? u.getTag() : u.getType();
316
- k in Wt && r(k);
317
+ const k = ue(u) ? u.getTag() : u.getType();
318
+ k in Ut && r(k);
317
319
  }
318
320
  return !1;
319
321
  },
@@ -322,14 +324,14 @@ const gr = Et("div", {
322
324
  const o = (c) => {
323
325
  e !== c && t.update(() => {
324
326
  const f = T();
325
- L(f) && (J(f, () => pe(c)), r(c));
327
+ L(f) && (J(f, () => he(c)), r(c));
326
328
  });
327
329
  };
328
- return /* @__PURE__ */ n(gr, { children: /* @__PURE__ */ g(
330
+ return /* @__PURE__ */ n(fr, { children: /* @__PURE__ */ g(
329
331
  nt,
330
332
  {
331
333
  trigger: /* @__PURE__ */ n(
332
- _t,
334
+ Et,
333
335
  {
334
336
  dropdown: !0,
335
337
  css: { display: "flex", width: "100%", overflow: "hidden" },
@@ -352,10 +354,10 @@ const gr = Et("div", {
352
354
  /* @__PURE__ */ n(C, { onClick: () => o("h5"), children: /* @__PURE__ */ n(M, { blockType: "h5" }) }),
353
355
  /* @__PURE__ */ n(C, { onClick: () => o("h6"), children: /* @__PURE__ */ n(M, { blockType: "h6" }) }),
354
356
  /* @__PURE__ */ n(C, { onClick: () => {
355
- e !== "bullet" && (t.dispatchCommand(ce, void 0), r("bullet"));
357
+ e !== "bullet" && (t.dispatchCommand(se, void 0), r("bullet"));
356
358
  }, children: /* @__PURE__ */ n(M, { blockType: "bullet" }) }),
357
359
  /* @__PURE__ */ n(C, { onClick: () => {
358
- e !== "number" && (t.dispatchCommand(de, void 0), r("number"));
360
+ e !== "number" && (t.dispatchCommand(ce, void 0), r("number"));
359
361
  }, children: /* @__PURE__ */ n(M, { blockType: "number" }) }),
360
362
  /* @__PURE__ */ n(C, { onClick: () => {
361
363
  e !== "check" && (t.dispatchCommand(Tt, void 0), r("check"));
@@ -363,13 +365,13 @@ const gr = Et("div", {
363
365
  /* @__PURE__ */ n(C, { onClick: () => {
364
366
  e !== "quote" && t.update(() => {
365
367
  const c = T();
366
- L(c) && (J(c, () => ge()), r("quote"));
368
+ L(c) && (J(c, () => pe()), r("quote"));
367
369
  });
368
370
  }, children: /* @__PURE__ */ n(M, { blockType: "quote" }) })
369
371
  ]
370
372
  }
371
373
  ) });
372
- }, br = () => {
374
+ }, vr = () => {
373
375
  const [t] = y(), [e, r] = b(!1), [o, i] = b(!1), [l, a] = b(!1), [s, d] = b(!1), [c, f] = b(!1), u = v(() => {
374
376
  const p = T();
375
377
  L(p) && (r(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
@@ -387,47 +389,39 @@ const gr = Et("div", {
387
389
  })
388
390
  ), [t, u]);
389
391
  const m = v(
390
- () => t.dispatchCommand(D, "bold"),
392
+ () => t.dispatchCommand(B, "bold"),
391
393
  [t]
392
394
  ), w = v(
393
- () => t.dispatchCommand(D, "italic"),
395
+ () => t.dispatchCommand(B, "italic"),
394
396
  [t]
395
397
  ), N = v(
396
- () => t.dispatchCommand(D, "underline"),
398
+ () => t.dispatchCommand(B, "underline"),
397
399
  [t]
398
400
  ), k = v(
399
- () => t.dispatchCommand(D, "code"),
401
+ () => t.dispatchCommand(B, "code"),
400
402
  [t]
401
403
  ), S = v(
402
- () => t.dispatchCommand(D, "superscript"),
404
+ () => t.dispatchCommand(B, "superscript"),
403
405
  [t]
404
406
  ), A = wt(() => {
405
407
  const p = [];
406
408
  return e && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
407
409
  }, [e, o, l, s, c]);
408
410
  return /* @__PURE__ */ g(
409
- Rt,
411
+ _t,
410
412
  {
411
413
  type: "multiple",
412
414
  "aria-label": "Tekstformattering",
413
415
  value: A,
414
416
  children: [
415
- /* @__PURE__ */ n(
416
- I,
417
- {
418
- onClick: m,
419
- title: "Fet tekst",
420
- value: "bold",
421
- children: /* @__PURE__ */ n(Xe, { size: "1.25rem" })
422
- }
423
- ),
417
+ /* @__PURE__ */ n(I, { onClick: m, title: "Fet tekst", value: "bold", children: /* @__PURE__ */ n(Qe, { size: "1.25rem" }) }),
424
418
  /* @__PURE__ */ n(
425
419
  I,
426
420
  {
427
421
  onClick: w,
428
422
  title: "Kursiv tekst",
429
423
  value: "italic",
430
- children: /* @__PURE__ */ n(or, { size: "1.25rem" })
424
+ children: /* @__PURE__ */ n(ir, { size: "1.25rem" })
431
425
  }
432
426
  ),
433
427
  /* @__PURE__ */ n(
@@ -436,49 +430,41 @@ const gr = Et("div", {
436
430
  onClick: N,
437
431
  title: "Understreket tekst",
438
432
  value: "underline",
439
- children: /* @__PURE__ */ n(pr, { size: "1.25rem" })
440
- }
441
- ),
442
- /* @__PURE__ */ n(
443
- I,
444
- {
445
- onClick: k,
446
- title: "Kode",
447
- value: "code",
448
- children: /* @__PURE__ */ n(Qe, { size: "1.25rem" })
433
+ children: /* @__PURE__ */ n(gr, { size: "1.25rem" })
449
434
  }
450
435
  ),
436
+ /* @__PURE__ */ n(I, { onClick: k, title: "Kode", value: "code", children: /* @__PURE__ */ n(Ve, { size: "1.25rem" }) }),
451
437
  /* @__PURE__ */ n(
452
438
  I,
453
439
  {
454
440
  onClick: S,
455
441
  title: "Superscript",
456
442
  value: "superscript",
457
- children: /* @__PURE__ */ n(ur, { size: "1.25rem" })
443
+ children: /* @__PURE__ */ n(hr, { size: "1.25rem" })
458
444
  }
459
445
  )
460
446
  ]
461
447
  }
462
448
  );
463
- }, vr = ({ children: t }) => {
449
+ }, Mr = ({ children: t }) => {
464
450
  const { hasFocus: e, editorRef: r } = at(), o = e, [i, l] = b(o);
465
- Ce(() => {
451
+ Me(() => {
466
452
  l(o);
467
453
  }, [o]);
468
454
  const { context: a, refs: s, floatingStyles: d } = ot({
469
455
  placement: "top",
470
- whileElementsMounted: It,
456
+ whileElementsMounted: zt,
471
457
  middleware: [
472
- Te({
458
+ ze({
473
459
  apply: ({ rects: f, elements: u }) => {
474
460
  u.floating.style.minWidth = `${f.reference.width}px`;
475
461
  }
476
462
  }),
477
- Le(),
478
- zt({
463
+ Oe(),
464
+ Ot({
479
465
  mainAxis: 8
480
466
  }),
481
- xe({
467
+ $e({
482
468
  padding: 8
483
469
  })
484
470
  ],
@@ -487,13 +473,13 @@ const gr = Et("div", {
487
473
  elements: {
488
474
  reference: r.current
489
475
  }
490
- }), { getFloatingProps: c } = Ot([
491
- $t(a, {
476
+ }), { getFloatingProps: c } = $t([
477
+ At(a, {
492
478
  role: "dialog"
493
479
  })
494
480
  ]);
495
- return i ? /* @__PURE__ */ n(At, { children: /* @__PURE__ */ n(
496
- Dt,
481
+ return i ? /* @__PURE__ */ n(Bt, { children: /* @__PURE__ */ n(
482
+ Rt,
497
483
  {
498
484
  ref: s.setFloating,
499
485
  style: d,
@@ -504,33 +490,33 @@ const gr = Et("div", {
504
490
  overflow: "hidden",
505
491
  boxShadow: "$md"
506
492
  },
507
- children: /* @__PURE__ */ n(Mr, { children: t })
493
+ children: /* @__PURE__ */ n(Cr, { children: t })
508
494
  }
509
495
  ) }) : null;
510
- }, Mr = ({
496
+ }, Cr = ({
511
497
  children: t,
512
498
  ...e
513
- }) => /* @__PURE__ */ g(ye, { "aria-label": "Formattering", ...e, children: [
514
- /* @__PURE__ */ n(kr, {}),
515
- /* @__PURE__ */ n(Ne, {}),
499
+ }) => /* @__PURE__ */ g(Ce, { "aria-label": "Formattering", ...e, children: [
516
500
  /* @__PURE__ */ n(br, {}),
501
+ /* @__PURE__ */ n(Te, {}),
502
+ /* @__PURE__ */ n(vr, {}),
517
503
  t
518
504
  ] });
519
- function Cr() {
505
+ function Tr() {
520
506
  const [t] = y();
521
507
  return x(() => it(
522
508
  t.registerCommand(
523
509
  Tt,
524
- () => (ue(t, "check"), !0),
510
+ () => (de(t, "check"), !0),
525
511
  E
526
512
  ),
527
513
  t.registerCommand(
528
- te,
514
+ Zt,
529
515
  (e) => kt(e, t, !1),
530
516
  E
531
517
  ),
532
518
  t.registerCommand(
533
- ee,
519
+ te,
534
520
  (e) => kt(e, t, !0),
535
521
  E
536
522
  ),
@@ -546,7 +532,7 @@ function Cr() {
546
532
  E
547
533
  ),
548
534
  t.registerCommand(
549
- re,
535
+ ee,
550
536
  (e) => {
551
537
  const r = X();
552
538
  return r != null && t.isEditable() ? (t.update(() => {
@@ -557,15 +543,15 @@ function Cr() {
557
543
  E
558
544
  ),
559
545
  t.registerCommand(
560
- ne,
546
+ re,
561
547
  (e) => t.getEditorState().read(() => {
562
548
  const r = T();
563
549
  if (L(r) && r.isCollapsed()) {
564
550
  const { anchor: o } = r, i = o.type === "element";
565
551
  if (i || o.offset === 0) {
566
- const l = o.getNode(), a = Pt(
552
+ const l = o.getNode(), a = Dt(
567
553
  l,
568
- (s) => oe(s) && !s.isInline()
554
+ (s) => ne(s) && !s.isInline()
569
555
  );
570
556
  if (O(a)) {
571
557
  const s = a.getParent();
@@ -586,7 +572,7 @@ function Cr() {
586
572
  })
587
573
  ), [t]), null;
588
574
  }
589
- function jt(t, e) {
575
+ function Wt(t, e) {
590
576
  const r = t.target;
591
577
  if (r === null || !gt(r))
592
578
  return;
@@ -600,8 +586,8 @@ function jt(t, e) {
600
586
  (r.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && e();
601
587
  }
602
588
  function ft(t) {
603
- jt(t, () => {
604
- const e = t.target, r = Tr(e);
589
+ Wt(t, () => {
590
+ const e = t.target, r = Lr(e);
605
591
  r != null && r.isEditable() && r.update(() => {
606
592
  if (t.target) {
607
593
  const o = V(e);
@@ -611,11 +597,11 @@ function ft(t) {
611
597
  });
612
598
  }
613
599
  function mt(t) {
614
- jt(t, () => {
600
+ Wt(t, () => {
615
601
  t.preventDefault();
616
602
  });
617
603
  }
618
- function Tr(t) {
604
+ function Lr(t) {
619
605
  let e = t;
620
606
  for (; e; ) {
621
607
  if (e.__lexicalEditor)
@@ -629,7 +615,7 @@ function X() {
629
615
  return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
630
616
  t.parentNode.__lexicalListType === "check" ? t : null;
631
617
  }
632
- function Lr(t, e) {
618
+ function xr(t, e) {
633
619
  let r = e ? t.getPreviousSibling() : t.getNextSibling(), o = t;
634
620
  for (; r == null && O(o); )
635
621
  o = o.getParentOrThrow().getParent(), o != null && (r = e ? o.getPreviousSibling() : o.getNextSibling());
@@ -647,7 +633,7 @@ function kt(t, e, r) {
647
633
  const i = V(o);
648
634
  if (!O(i))
649
635
  return;
650
- const l = Lr(i, r);
636
+ const l = xr(i, r);
651
637
  if (l != null) {
652
638
  l.selectStart();
653
639
  const a = e.getElementByKey(l.__key);
@@ -657,25 +643,25 @@ function kt(t, e, r) {
657
643
  }
658
644
  }), !1;
659
645
  }
660
- const xr = () => /* @__PURE__ */ g(Y, { children: [
661
- /* @__PURE__ */ n(Fe, {}),
662
- /* @__PURE__ */ n(Ue, {}),
646
+ const yr = () => /* @__PURE__ */ g(Y, { children: [
663
647
  /* @__PURE__ */ n(He, {}),
664
- /* @__PURE__ */ n(Cr, {}),
665
- /* @__PURE__ */ n(We, {})
666
- ] }), yr = ({
648
+ /* @__PURE__ */ n(We, {}),
649
+ /* @__PURE__ */ n(Ue, {}),
650
+ /* @__PURE__ */ n(Tr, {}),
651
+ /* @__PURE__ */ n(je, {})
652
+ ] }), Nr = ({
667
653
  state: t
668
654
  }) => {
669
655
  const [e] = y();
670
656
  return x(() => {
671
657
  if (t)
672
658
  try {
673
- if (qe(t)) {
674
- t.isEmpty() ? Ye(e) : e.setEditorState(t);
659
+ if (Ye(t)) {
660
+ t.isEmpty() ? Ge(e) : e.setEditorState(t);
675
661
  return;
676
662
  }
677
- if (typeof t == "string" && !Ht(t)) {
678
- Ge(t, e);
663
+ if (typeof t == "string" && !Ft(t)) {
664
+ Je(t, e);
679
665
  return;
680
666
  }
681
667
  const r = e.parseEditorState(t);
@@ -684,7 +670,7 @@ const xr = () => /* @__PURE__ */ g(Y, { children: [
684
670
  console.error("Could not parse"), console.error(r);
685
671
  }
686
672
  }, []), null;
687
- }, Nr = Et("div", {
673
+ }, Sr = Le("div", {
688
674
  border: "1px solid $borderDarker",
689
675
  borderRadius: "$md",
690
676
  position: "relative",
@@ -721,7 +707,7 @@ const xr = () => /* @__PURE__ */ g(Y, { children: [
721
707
  }
722
708
  }
723
709
  ]
724
- }), Sr = ({
710
+ }), wr = ({
725
711
  isLoading: t
726
712
  }) => /* @__PURE__ */ n(
727
713
  P,
@@ -733,9 +719,9 @@ const xr = () => /* @__PURE__ */ g(Y, { children: [
733
719
  right: "1rem",
734
720
  display: "flex"
735
721
  },
736
- children: /* @__PURE__ */ n(Se, {})
722
+ children: /* @__PURE__ */ n(xe, {})
737
723
  }
738
- ), hn = ({
724
+ ), cn = ({
739
725
  isLoading: t,
740
726
  children: e,
741
727
  placeholderText: r,
@@ -749,22 +735,22 @@ const xr = () => /* @__PURE__ */ g(Y, { children: [
749
735
  defaultState: f,
750
736
  css: u
751
737
  }) => {
752
- const { hasFocus: m, attributes: w } = Je({ onBlur: c }), N = rt(null), k = wt(() => ({ hasFocus: m, editorRef: N }), [m]);
753
- return /* @__PURE__ */ n(Ut.Provider, { value: k, children: /* @__PURE__ */ g(
754
- $e,
738
+ const { hasFocus: m, attributes: w } = Xe({ onBlur: c }), N = rt(null), k = wt(() => ({ hasFocus: m, editorRef: N }), [m]);
739
+ return /* @__PURE__ */ n(Ht.Provider, { value: k, children: /* @__PURE__ */ g(
740
+ Ee,
755
741
  {
756
742
  initialConfig: {
757
743
  namespace: "ain-rich-text",
758
744
  onError: (S) => {
759
745
  console.error(S);
760
746
  },
761
- theme: Ft,
747
+ theme: Pt,
762
748
  nodes: o,
763
749
  editable: !0
764
750
  },
765
751
  children: [
766
752
  /* @__PURE__ */ g(
767
- Nr,
753
+ Sr,
768
754
  {
769
755
  ref: N,
770
756
  hasFocus: m,
@@ -774,7 +760,7 @@ const xr = () => /* @__PURE__ */ g(Y, { children: [
774
760
  children: [
775
761
  l,
776
762
  /* @__PURE__ */ n(
777
- Ae,
763
+ _e,
778
764
  {
779
765
  contentEditable: s,
780
766
  placeholder: r ? /* @__PURE__ */ n(
@@ -791,22 +777,22 @@ const xr = () => /* @__PURE__ */ g(Y, { children: [
791
777
  children: r
792
778
  }
793
779
  ) : null,
794
- ErrorBoundary: De
780
+ ErrorBoundary: Re
795
781
  }
796
782
  ),
797
- /* @__PURE__ */ n(xr, {}),
783
+ /* @__PURE__ */ n(yr, {}),
798
784
  i,
799
- /* @__PURE__ */ n(Sr, { isLoading: t }),
800
- !l && /* @__PURE__ */ n(vr, { children: a })
785
+ /* @__PURE__ */ n(wr, { isLoading: t }),
786
+ !l && /* @__PURE__ */ n(Mr, { children: a })
801
787
  ]
802
788
  }
803
789
  ),
804
- /* @__PURE__ */ n(yr, { state: f }),
790
+ /* @__PURE__ */ n(Nr, { state: f }),
805
791
  /* @__PURE__ */ n(Y, { children: e })
806
792
  ]
807
793
  }
808
794
  ) });
809
- }, wr = {
795
+ }, Er = {
810
796
  fontSize: "1rem",
811
797
  lineHeight: "1.5",
812
798
  "h1, h2, h3, h4, h5, h6": {
@@ -996,9 +982,9 @@ const xr = () => /* @__PURE__ */ g(Y, { children: [
996
982
  defaultVariants: {
997
983
  size: "md"
998
984
  }
999
- }, pn = we(wr), gn = () => {
985
+ }, dn = Ae(Er), un = () => {
1000
986
  const [t] = y(), e = v(() => {
1001
- t.dispatchCommand(fe, {
987
+ t.dispatchCommand(ge, {
1002
988
  rows: "3",
1003
989
  columns: "3",
1004
990
  includeHeaders: !1
@@ -1007,20 +993,20 @@ const xr = () => /* @__PURE__ */ g(Y, { children: [
1007
993
  return /* @__PURE__ */ n(
1008
994
  nt,
1009
995
  {
1010
- trigger: /* @__PURE__ */ n(_t, { dropdown: !0, children: "Sett inn" }),
996
+ trigger: /* @__PURE__ */ n(Et, { dropdown: !0, children: "Sett inn" }),
1011
997
  side: "bottom",
1012
998
  align: "end",
1013
999
  children: /* @__PURE__ */ g(C, { onClick: e, children: [
1014
- /* @__PURE__ */ n(hr, { size: "1.25rem" }),
1000
+ /* @__PURE__ */ n(pr, { size: "1.25rem" }),
1015
1001
  " Tabell"
1016
1002
  ] })
1017
1003
  }
1018
1004
  );
1019
1005
  };
1020
- function Er(t) {
1006
+ function _r(t) {
1021
1007
  return h({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "circle", attr: { cx: "256", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "416", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "96", cy: "256", r: "48" } }] })(t);
1022
1008
  }
1023
- const fn = () => {
1009
+ const hn = () => {
1024
1010
  const [t] = y(), [e, r] = b(null), { hasFocus: o } = at();
1025
1011
  x(() => {
1026
1012
  !o && e && r(null);
@@ -1031,19 +1017,19 @@ const fn = () => {
1031
1017
  elements: {
1032
1018
  reference: e
1033
1019
  },
1034
- middleware: [zt({ mainAxis: -20, crossAxis: -2 })]
1020
+ middleware: [Ot({ mainAxis: -20, crossAxis: -2 })]
1035
1021
  });
1036
1022
  x(() => t.registerCommand(
1037
1023
  F,
1038
1024
  () => {
1039
1025
  const s = T();
1040
1026
  if (L(s)) {
1041
- const d = s.anchor.getNode(), c = me(d);
1027
+ const d = s.anchor.getNode(), c = fe(d);
1042
1028
  r(c ? t.getElementByKey(c.getKey()) : null);
1043
1029
  }
1044
1030
  return !1;
1045
1031
  },
1046
- ie
1032
+ oe
1047
1033
  ), [t]);
1048
1034
  const a = (s) => () => {
1049
1035
  t.update(() => {
@@ -1061,10 +1047,10 @@ const fn = () => {
1061
1047
  dt(!0);
1062
1048
  break;
1063
1049
  case "delete-row":
1064
- be();
1050
+ ke();
1065
1051
  break;
1066
1052
  case "delete-column":
1067
- ke();
1053
+ me();
1068
1054
  break;
1069
1055
  }
1070
1056
  });
@@ -1081,7 +1067,7 @@ const fn = () => {
1081
1067
  ref: i.setFloating,
1082
1068
  style: l,
1083
1069
  css: { padding: "2px", width: "18px", height: "18px" },
1084
- children: /* @__PURE__ */ n(Er, {})
1070
+ children: /* @__PURE__ */ n(_r, {})
1085
1071
  }
1086
1072
  ),
1087
1073
  children: [
@@ -1097,16 +1083,16 @@ const fn = () => {
1097
1083
  }
1098
1084
  ) : null;
1099
1085
  };
1100
- function Kt(t) {
1086
+ function jt(t) {
1101
1087
  let e = t;
1102
1088
  const r = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, o = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
1103
1089
  return e = String(e).trim(), e.match(r) || e.match(o) ? e : "https://";
1104
1090
  }
1105
- function qt(t) {
1091
+ function Kt(t) {
1106
1092
  const e = t.anchor, r = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
1107
1093
  return o === i ? o : t.isBackward() ? ct(r) ? o : i : ct(e) ? o : i;
1108
1094
  }
1109
- const mn = (t) => (_.baseURL = t, _), j = class extends z {
1095
+ const pn = (t) => (_.baseURL = t, _), j = class extends z {
1110
1096
  static getType() {
1111
1097
  return "rutine_link";
1112
1098
  }
@@ -1118,7 +1104,7 @@ const mn = (t) => (_.baseURL = t, _), j = class extends z {
1118
1104
  return r.setAttribute("href", this.getURL()), r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer"), r.classList.add("rutine-link"), r;
1119
1105
  }
1120
1106
  static importJSON(e) {
1121
- return Yt(e.url);
1107
+ return qt(e.url);
1122
1108
  }
1123
1109
  exportJSON() {
1124
1110
  return {
@@ -1138,13 +1124,13 @@ const mn = (t) => (_.baseURL = t, _), j = class extends z {
1138
1124
  };
1139
1125
  let _ = j;
1140
1126
  st(_, "baseURL", "");
1141
- function Yt(t) {
1127
+ function qt(t) {
1142
1128
  return new _(t);
1143
1129
  }
1144
- function _r(t) {
1130
+ function Rr(t) {
1145
1131
  return t instanceof _;
1146
1132
  }
1147
- const Rr = ({ onClose: t }) => {
1133
+ const Ir = ({ onClose: t }) => {
1148
1134
  const [e] = y(), r = v(
1149
1135
  (i) => {
1150
1136
  e.update(() => {
@@ -1153,23 +1139,23 @@ const Rr = ({ onClose: t }) => {
1153
1139
  const a = l.getNodes();
1154
1140
  if (a.length === 1) {
1155
1141
  const s = a[0];
1156
- ae(s) && s.getChildren().length === 0 && l.insertText(i);
1142
+ ie(s) && s.getChildren().length === 0 && l.insertText(i);
1157
1143
  }
1158
1144
  }
1159
- }), e.dispatchCommand(Z, Kt(i));
1145
+ }), e.dispatchCommand(Z, jt(i));
1160
1146
  },
1161
1147
  [e]
1162
1148
  );
1163
1149
  return /* @__PURE__ */ g("form", { onSubmit: (i) => {
1164
1150
  r(i.target.url.value), t();
1165
1151
  }, children: [
1166
- /* @__PURE__ */ n(Re, { name: "url", label: "URL", type: "url", required: !0 }),
1167
- /* @__PURE__ */ g(Bt, { children: [
1152
+ /* @__PURE__ */ n(Se, { name: "url", label: "URL", type: "url", required: !0 }),
1153
+ /* @__PURE__ */ g(It, { children: [
1168
1154
  /* @__PURE__ */ n($, { onClick: t, children: "Avbryt" }),
1169
1155
  /* @__PURE__ */ n($, { type: "submit", variant: "primary", children: "Lagre" })
1170
1156
  ] })
1171
1157
  ] });
1172
- }, Ir = ({ onClose: t, getDocs: e }) => {
1158
+ }, zr = ({ onClose: t, getDocs: e }) => {
1173
1159
  const [r] = y(), [o, i] = b([]), l = e(), a = v(
1174
1160
  (s) => {
1175
1161
  r.update(() => {
@@ -1177,8 +1163,8 @@ const Rr = ({ onClose: t }) => {
1177
1163
  if (L(d)) {
1178
1164
  const c = [];
1179
1165
  for (const [f, u] of s.entries()) {
1180
- const m = Yt(u.value);
1181
- m.append(B(u.label)), c.push(m), f !== s.length - 1 && c.push(B(" "));
1166
+ const m = qt(u.value);
1167
+ m.append(D(u.label)), c.push(m), f !== s.length - 1 && c.push(D(" "));
1182
1168
  }
1183
1169
  d.insertNodes(c);
1184
1170
  }
@@ -1187,8 +1173,8 @@ const Rr = ({ onClose: t }) => {
1187
1173
  [r]
1188
1174
  );
1189
1175
  return /* @__PURE__ */ g(Y, { children: [
1190
- /* @__PURE__ */ n(Ie, { isMulti: !0, options: l, onChange: i }),
1191
- /* @__PURE__ */ g(Bt, { children: [
1176
+ /* @__PURE__ */ n(we, { isMulti: !0, options: l, onChange: i }),
1177
+ /* @__PURE__ */ g(It, { children: [
1192
1178
  /* @__PURE__ */ n($, { onClick: t, children: "Avbryt" }),
1193
1179
  /* @__PURE__ */ n(
1194
1180
  $,
@@ -1202,7 +1188,7 @@ const Rr = ({ onClose: t }) => {
1202
1188
  )
1203
1189
  ] })
1204
1190
  ] });
1205
- }, zr = ({
1191
+ }, Or = ({
1206
1192
  open: t,
1207
1193
  onOpenChange: e,
1208
1194
  getDocs: r
@@ -1210,19 +1196,19 @@ const Rr = ({ onClose: t }) => {
1210
1196
  const [o, i] = b("url"), l = () => {
1211
1197
  e(!1);
1212
1198
  };
1213
- return /* @__PURE__ */ g(Ee, { open: t, onOpenChange: e, css: { width: "600px" }, children: [
1214
- /* @__PURE__ */ g(_e, { css: { marginBottom: "$8" }, children: [
1199
+ return /* @__PURE__ */ g(ye, { open: t, onOpenChange: e, css: { width: "600px" }, children: [
1200
+ /* @__PURE__ */ g(Ne, { css: { marginBottom: "$8" }, children: [
1215
1201
  /* @__PURE__ */ n(pt, { active: o === "url", onClick: () => i("url"), children: "URL" }),
1216
1202
  /* @__PURE__ */ n(pt, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
1217
1203
  ] }),
1218
- o === "url" && /* @__PURE__ */ n(Rr, { onClose: l }),
1219
- o === "rutine" && /* @__PURE__ */ n(Ir, { onClose: l, getDocs: r })
1204
+ o === "url" && /* @__PURE__ */ n(Ir, { onClose: l }),
1205
+ o === "rutine" && /* @__PURE__ */ n(zr, { onClose: l, getDocs: r })
1220
1206
  ] });
1221
- }, kn = ({ getDocs: t }) => {
1207
+ }, gn = ({ getDocs: t }) => {
1222
1208
  const [e] = y(), [r, o] = b(!1), [i, l] = b(!1), a = v(() => {
1223
1209
  const s = T();
1224
1210
  if (L(s)) {
1225
- const d = qt(s), c = d.getParent();
1211
+ const d = Kt(s), c = d.getParent();
1226
1212
  o(U(c) || U(d));
1227
1213
  }
1228
1214
  }, []);
@@ -1230,7 +1216,7 @@ const Rr = ({ onClose: t }) => {
1230
1216
  F,
1231
1217
  () => (a(), !1),
1232
1218
  Q
1233
- ), [e, a]), /* @__PURE__ */ g(Rt, { type: "single", value: r ? "link" : "", children: [
1219
+ ), [e, a]), /* @__PURE__ */ g(_t, { type: "single", value: r ? "link" : "", children: [
1234
1220
  /* @__PURE__ */ n(
1235
1221
  I,
1236
1222
  {
@@ -1239,11 +1225,11 @@ const Rr = ({ onClose: t }) => {
1239
1225
  },
1240
1226
  title: "Lenke",
1241
1227
  value: "link",
1242
- children: /* @__PURE__ */ n(ar, { size: "1.25rem" })
1228
+ children: /* @__PURE__ */ n(lr, { size: "1.25rem" })
1243
1229
  }
1244
1230
  ),
1245
1231
  /* @__PURE__ */ n(
1246
- zr,
1232
+ Or,
1247
1233
  {
1248
1234
  open: i,
1249
1235
  onOpenChange: l,
@@ -1251,7 +1237,7 @@ const Rr = ({ onClose: t }) => {
1251
1237
  }
1252
1238
  )
1253
1239
  ] });
1254
- }, bn = () => {
1240
+ }, fn = () => {
1255
1241
  const [t] = y(), e = rt(null), [r, o] = b(null), [i, l] = b(""), { hasFocus: a } = at();
1256
1242
  x(() => {
1257
1243
  r ? t.update(() => {
@@ -1262,19 +1248,19 @@ const Rr = ({ onClose: t }) => {
1262
1248
  placement: "top",
1263
1249
  strategy: "fixed",
1264
1250
  open: s,
1265
- whileElementsMounted: It,
1251
+ whileElementsMounted: zt,
1266
1252
  elements: {
1267
1253
  reference: e.current
1268
1254
  },
1269
- middleware: [ze()]
1270
- }), { getFloatingProps: u } = Ot([
1271
- $t(f),
1272
- Oe(f)
1255
+ middleware: [Be()]
1256
+ }), { getFloatingProps: u } = $t([
1257
+ At(f),
1258
+ De(f)
1273
1259
  ]), m = v(() => {
1274
1260
  var S;
1275
1261
  const k = T();
1276
1262
  if (L(k)) {
1277
- const A = qt(k), p = A.getParent();
1263
+ const A = Kt(k), p = A.getParent();
1278
1264
  let H = null;
1279
1265
  if (U(p) ? H = p : U(A) && (H = A), H) {
1280
1266
  const G = window.getSelection(), lt = t.getRootElement();
@@ -1283,7 +1269,7 @@ const Rr = ({ onClose: t }) => {
1283
1269
  o(H);
1284
1270
  }
1285
1271
  }, [t]), w = v(() => {
1286
- r && _r(r) && t.update(() => {
1272
+ r && Rr(r) && t.update(() => {
1287
1273
  r.remove();
1288
1274
  }), t.dispatchCommand(Z, null);
1289
1275
  }, [t, r]);
@@ -1305,13 +1291,13 @@ const Rr = ({ onClose: t }) => {
1305
1291
  t.registerCommand(
1306
1292
  vt,
1307
1293
  () => r ? (o(null), !0) : !1,
1308
- le
1294
+ ae
1309
1295
  )
1310
1296
  ), [t, m, r]), !s)
1311
1297
  return null;
1312
- const N = Kt(i);
1313
- return /* @__PURE__ */ n(At, { children: /* @__PURE__ */ g(
1314
- Dt,
1298
+ const N = jt(i);
1299
+ return /* @__PURE__ */ n(Bt, { children: /* @__PURE__ */ g(
1300
+ Rt,
1315
1301
  {
1316
1302
  ref: d.setFloating,
1317
1303
  css: {
@@ -1342,34 +1328,34 @@ const Rr = ({ onClose: t }) => {
1342
1328
  children: i
1343
1329
  }
1344
1330
  ),
1345
- /* @__PURE__ */ n($, { color: "danger", icon: !0, size: "sm", onClick: w, children: /* @__PURE__ */ n(Pe, { size: 24 }) })
1331
+ /* @__PURE__ */ n($, { color: "danger", icon: !0, size: "sm", onClick: w, children: /* @__PURE__ */ n(Fe, { size: 24 }) })
1346
1332
  ]
1347
1333
  }
1348
1334
  ) });
1349
1335
  };
1350
1336
  export {
1351
- Yt as $createRutineLinkNode,
1352
- _r as $isRutineLinkNode,
1353
- vr as FloatingToolbar,
1354
- gn as InsertSelector,
1355
- bn as LinkEditPlugin,
1337
+ qt as $createRutineLinkNode,
1338
+ Rr as $isRutineLinkNode,
1339
+ Mr as FloatingToolbar,
1340
+ un as InsertSelector,
1341
+ fn as LinkEditPlugin,
1356
1342
  W as LinkTargetNode,
1357
- kn as LinkToolbarButton,
1358
- hn as RichTextEditor,
1359
- Mr as RichTextToolbar,
1343
+ gn as LinkToolbarButton,
1344
+ cn as RichTextEditor,
1345
+ Cr as RichTextToolbar,
1360
1346
  _ as RutineLinkNode,
1361
- mn as RutineLinkNodeInit,
1362
- fn as TableEditPlugin,
1363
- Ye as clearEditorState,
1364
- dn as defaultNodes,
1365
- un as defaultViewNodes,
1366
- qe as isEditorState,
1367
- Ht as isJSON,
1368
- Ut as richTextContext,
1369
- pn as richTextCss,
1370
- wr as richTextStyleObj,
1371
- Ge as setStateFromPlainText,
1372
- cn as stateToHTML,
1373
- Je as useHasFocusWithin,
1347
+ pn as RutineLinkNodeInit,
1348
+ hn as TableEditPlugin,
1349
+ Ge as clearEditorState,
1350
+ ln as defaultNodes,
1351
+ sn as defaultViewNodes,
1352
+ Ye as isEditorState,
1353
+ Ft as isJSON,
1354
+ Ht as richTextContext,
1355
+ dn as richTextCss,
1356
+ Er as richTextStyleObj,
1357
+ Je as setStateFromPlainText,
1358
+ an as stateToHTML,
1359
+ Xe as useHasFocusWithin,
1374
1360
  at as useRichTextContext
1375
1361
  };