@embedpdf/plugin-annotation 2.12.1 → 2.14.0

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 (41) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +1912 -1456
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/handlers/callout-free-text.handler.d.ts +3 -0
  6. package/dist/lib/handlers/index.d.ts +1 -0
  7. package/dist/lib/handlers/types.d.ts +7 -1
  8. package/dist/lib/patching/index.d.ts +1 -0
  9. package/dist/lib/patching/patch-utils.d.ts +38 -1
  10. package/dist/lib/patching/patches/callout-freetext.patch.d.ts +3 -0
  11. package/dist/lib/patching/patches/index.d.ts +1 -0
  12. package/dist/lib/tools/default-tools.d.ts +35 -0
  13. package/dist/preact/index.cjs +1 -1
  14. package/dist/preact/index.cjs.map +1 -1
  15. package/dist/preact/index.js +395 -14
  16. package/dist/preact/index.js.map +1 -1
  17. package/dist/react/index.cjs +1 -1
  18. package/dist/react/index.cjs.map +1 -1
  19. package/dist/react/index.js +395 -14
  20. package/dist/react/index.js.map +1 -1
  21. package/dist/shared/components/annotations/callout-free-text-preview.d.ts +15 -0
  22. package/dist/shared/components/annotations/callout-free-text.d.ts +15 -0
  23. package/dist/shared-preact/components/annotations/callout-free-text-preview.d.ts +15 -0
  24. package/dist/shared-preact/components/annotations/callout-free-text.d.ts +15 -0
  25. package/dist/shared-react/components/annotations/callout-free-text-preview.d.ts +15 -0
  26. package/dist/shared-react/components/annotations/callout-free-text.d.ts +15 -0
  27. package/dist/svelte/components/annotations/CalloutFreeText.svelte.d.ts +15 -0
  28. package/dist/svelte/components/annotations/CalloutFreeTextPreview.svelte.d.ts +10 -0
  29. package/dist/svelte/components/renderers/CalloutFreeTextRenderer.svelte.d.ts +5 -0
  30. package/dist/svelte/index.cjs +1 -1
  31. package/dist/svelte/index.cjs.map +1 -1
  32. package/dist/svelte/index.js +497 -86
  33. package/dist/svelte/index.js.map +1 -1
  34. package/dist/vue/components/annotations/callout-free-text-preview.vue.d.ts +10 -0
  35. package/dist/vue/components/annotations/callout-free-text.vue.d.ts +25 -0
  36. package/dist/vue/components/renderers/callout-free-text-renderer.vue.d.ts +6 -0
  37. package/dist/vue/index.cjs +1 -1
  38. package/dist/vue/index.cjs.map +1 -1
  39. package/dist/vue/index.js +544 -170
  40. package/dist/vue/index.js.map +1 -1
  41. package/package.json +12 -12
@@ -161,7 +161,7 @@ function AnnotationNavigationHandler($$anchor, $$props) {
161
161
  });
162
162
  $.pop();
163
163
  }
164
- var root_1$f = $.from_html(`<img alt="" draggable="false"/>`);
164
+ var root_1$h = $.from_html(`<img alt="" draggable="false"/>`);
165
165
  function AppearanceImage($$anchor, $$props) {
166
166
  $.push($$props, true);
167
167
  let imageUrl = $.state(null);
@@ -187,7 +187,7 @@ function AppearanceImage($$anchor, $$props) {
187
187
  var node = $.first_child(fragment);
188
188
  {
189
189
  var consequent = ($$anchor2) => {
190
- var img = root_1$f();
190
+ var img = root_1$h();
191
191
  $.template_effect(() => {
192
192
  $.set_attribute(img, "src", $.get(imageUrl));
193
193
  $.set_style(img, `position: absolute; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; ${$$props.style ?? "" ?? ""}`);
@@ -203,14 +203,14 @@ function AppearanceImage($$anchor, $$props) {
203
203
  $.append($$anchor, fragment);
204
204
  $.pop();
205
205
  }
206
- var root_4$7 = $.from_html(`<div></div> <div></div> <div></div>`, 1);
206
+ var root_4$8 = $.from_html(`<div></div> <div></div> <div></div>`, 1);
207
207
  var root_6$2 = $.from_html(`<div style="display: contents;"><!></div>`);
208
208
  var root_8$1 = $.from_html(`<div></div>`);
209
209
  var root_7 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
210
210
  var root_12 = $.from_html(`<div></div>`);
211
211
  var root_16 = $.from_html(`<div></div>`);
212
212
  var root_23 = $.from_html(`<div><div> </div></div>`);
213
- var root$i = $.from_html(`<div data-no-interaction=""><div><div><!> <!></div></div> <div><!> <!> <div><!> <!></div></div> <!> <!></div>`);
213
+ var root$j = $.from_html(`<div data-no-interaction=""><div><div><!> <!></div></div> <div><!> <!> <div><!> <!></div></div> <!> <!></div>`);
214
214
  function AnnotationContainer($$anchor, $$props) {
215
215
  $.push($$props, true);
216
216
  let isEditing = $.prop($$props, "isEditing", 3, false), isMultiSelected = $.prop($$props, "isMultiSelected", 3, false), isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), propsClass = $.prop($$props, "class", 3, ""), outlineOffset = $.prop($$props, "outlineOffset", 3, 1), zIndex = $.prop($$props, "zIndex", 3, 1), restProps = $.rest_props($$props, [
@@ -569,7 +569,7 @@ function AnnotationContainer($$anchor, $$props) {
569
569
  }
570
570
  };
571
571
  }
572
- var div = root$i();
572
+ var div = root$j();
573
573
  var div_1 = $.child(div);
574
574
  let styles;
575
575
  var div_2 = $.child(div_1);
@@ -644,7 +644,7 @@ function AnnotationContainer($$anchor, $$props) {
644
644
  var node_5 = $.child(div_3);
645
645
  {
646
646
  var consequent_2 = ($$anchor2) => {
647
- var fragment_3 = root_4$7();
647
+ var fragment_3 = root_4$8();
648
648
  var div_4 = $.first_child(fragment_3);
649
649
  let styles_2;
650
650
  var div_5 = $.sibling(div_4, 2);
@@ -1101,13 +1101,13 @@ function getAnnotationScreenBounds(annotation, scale, rotation) {
1101
1101
  bottom: top + maxY
1102
1102
  };
1103
1103
  }
1104
- var root_2$a = $.from_html(`<div></div> <div></div> <div></div>`, 1);
1105
- var root_4$6 = $.from_html(`<div style="display: contents;"><!></div>`);
1104
+ var root_2$c = $.from_html(`<div></div> <div></div> <div></div>`, 1);
1105
+ var root_4$7 = $.from_html(`<div style="display: contents;"><!></div>`);
1106
1106
  var root_6$1 = $.from_html(`<div></div>`);
1107
- var root_5$5 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
1107
+ var root_5$6 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
1108
1108
  var root_10 = $.from_html(`<div></div>`);
1109
1109
  var root_11 = $.from_html(`<div><div> </div></div>`);
1110
- var root_1$e = $.from_html(`<div data-group-selection-box="" data-no-interaction=""><div><!> <!> <div><!></div></div> <!> <!></div>`);
1110
+ var root_1$g = $.from_html(`<div data-group-selection-box="" data-no-interaction=""><div><!> <!> <div><!></div></div> <!> <!></div>`);
1111
1111
  function GroupSelectionBox($$anchor, $$props) {
1112
1112
  $.push($$props, true);
1113
1113
  let isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), zIndex = $.prop($$props, "zIndex", 3, 2);
@@ -1390,13 +1390,13 @@ function GroupSelectionBox($$anchor, $$props) {
1390
1390
  var node_1 = $.first_child(fragment);
1391
1391
  {
1392
1392
  var consequent_11 = ($$anchor2) => {
1393
- var div = root_1$e();
1393
+ var div = root_1$g();
1394
1394
  var div_1 = $.child(div);
1395
1395
  let styles;
1396
1396
  var node_2 = $.child(div_1);
1397
1397
  {
1398
1398
  var consequent = ($$anchor3) => {
1399
- var fragment_1 = root_2$a();
1399
+ var fragment_1 = root_2$c();
1400
1400
  var div_2 = $.first_child(fragment_1);
1401
1401
  let styles_1;
1402
1402
  var div_3 = $.sibling(div_2, 2);
@@ -1450,7 +1450,7 @@ function GroupSelectionBox($$anchor, $$props) {
1450
1450
  var node_4 = $.first_child(fragment_2);
1451
1451
  {
1452
1452
  var consequent_1 = ($$anchor4) => {
1453
- var div_5 = root_4$6();
1453
+ var div_5 = root_4$7();
1454
1454
  div_5.__pointermove = (e) => {
1455
1455
  if (!$.get(rotationActive)) $.set(cursorScreen, { x: e.clientX, y: e.clientY }, true);
1456
1456
  };
@@ -1480,7 +1480,7 @@ function GroupSelectionBox($$anchor, $$props) {
1480
1480
  $.append($$anchor4, div_5);
1481
1481
  };
1482
1482
  var alternate = ($$anchor4) => {
1483
- var div_6 = root_5$5();
1483
+ var div_6 = root_5$6();
1484
1484
  div_6.__pointermove = (e) => {
1485
1485
  if (!$.get(rotationActive)) $.set(cursorScreen, { x: e.clientX, y: e.clientY }, true);
1486
1486
  };
@@ -1735,7 +1735,7 @@ function GroupSelectionBox($$anchor, $$props) {
1735
1735
  $.pop();
1736
1736
  }
1737
1737
  $.delegate(["pointermove"]);
1738
- var root$h = $.from_html(`<div role="link" tabindex="-1"></div>`);
1738
+ var root$i = $.from_html(`<div role="link" tabindex="-1"></div>`);
1739
1739
  function LinkLockedMode($$anchor, $$props) {
1740
1740
  $.push($$props, true);
1741
1741
  const { provides } = useAnnotationCapability();
@@ -1744,7 +1744,7 @@ function LinkLockedMode($$anchor, $$props) {
1744
1744
  if (!target || !provides) return;
1745
1745
  provides.forDocument($$props.documentId).navigateTarget(target);
1746
1746
  }
1747
- var div = root$h();
1747
+ var div = root$i();
1748
1748
  div.__click = handleClick;
1749
1749
  div.__keydown = (e) => {
1750
1750
  if (e.key === "Enter") handleClick();
@@ -1759,10 +1759,10 @@ function LinkLockedMode($$anchor, $$props) {
1759
1759
  $.pop();
1760
1760
  }
1761
1761
  $.delegate(["click", "keydown"]);
1762
- var root$g = $.from_html(`<div></div>`);
1762
+ var root$h = $.from_html(`<div></div>`);
1763
1763
  function LinkPreview($$anchor, $$props) {
1764
1764
  $.push($$props, true);
1765
- var div = root$g();
1765
+ var div = root$h();
1766
1766
  let styles;
1767
1767
  $.template_effect(() => styles = $.set_style(div, "", styles, {
1768
1768
  position: "absolute",
@@ -1777,9 +1777,9 @@ function LinkPreview($$anchor, $$props) {
1777
1777
  $.append($$anchor, div);
1778
1778
  $.pop();
1779
1779
  }
1780
- var root_1$d = $.from_svg(`<path fill="none" stroke="transparent"></path>`);
1781
- var root_3$3 = $.from_svg(`<path fill="none"></path>`);
1782
- var root$f = $.from_svg(`<svg><!><!></svg>`);
1780
+ var root_1$f = $.from_svg(`<path fill="none" stroke="transparent"></path>`);
1781
+ var root_3$5 = $.from_svg(`<path fill="none"></path>`);
1782
+ var root$g = $.from_svg(`<svg><!><!></svg>`);
1783
1783
  function Ink($$anchor, $$props) {
1784
1784
  $.push($$props, true);
1785
1785
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -1798,11 +1798,11 @@ function Ink($$anchor, $$props) {
1798
1798
  const width = $.derived(() => $$props.rect.size.width * $$props.scale);
1799
1799
  const height = $.derived(() => $$props.rect.size.height * $$props.scale);
1800
1800
  const hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
1801
- var svg = root$f();
1801
+ var svg = root$g();
1802
1802
  let styles;
1803
1803
  var node = $.child(svg);
1804
1804
  $.each(node, 19, () => $.get(paths), (d, i) => `hit-${i}`, ($$anchor2, d) => {
1805
- var path = root_1$d();
1805
+ var path = root_1$f();
1806
1806
  path.__pointerdown = function(...$$args) {
1807
1807
  var _a;
1808
1808
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -1826,7 +1826,7 @@ function Ink($$anchor, $$props) {
1826
1826
  var fragment = $.comment();
1827
1827
  var node_2 = $.first_child(fragment);
1828
1828
  $.each(node_2, 19, () => $.get(paths), (d, i) => `vis-${i}`, ($$anchor3, d) => {
1829
- var path_1 = root_3$3();
1829
+ var path_1 = root_3$5();
1830
1830
  let styles_2;
1831
1831
  $.template_effect(() => {
1832
1832
  $.set_attribute(path_1, "d", $.get(d));
@@ -1869,11 +1869,11 @@ function InkPreview($$anchor, $$props) {
1869
1869
  () => $$props.data
1870
1870
  ));
1871
1871
  }
1872
- var root_1$c = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
1873
- var root_2$9 = $.from_svg(`<rect fill="transparent" stroke="transparent"></rect>`);
1874
- var root_4$5 = $.from_svg(`<path stroke-linejoin="round"></path>`);
1875
- var root_5$4 = $.from_svg(`<rect></rect>`);
1876
- var root$e = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
1872
+ var root_1$e = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
1873
+ var root_2$b = $.from_svg(`<rect fill="transparent" stroke="transparent"></rect>`);
1874
+ var root_4$6 = $.from_svg(`<path stroke-linejoin="round"></path>`);
1875
+ var root_5$5 = $.from_svg(`<rect></rect>`);
1876
+ var root$f = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
1877
1877
  function Square($$anchor, $$props) {
1878
1878
  $.push($$props, true);
1879
1879
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -1912,12 +1912,12 @@ function Square($$anchor, $$props) {
1912
1912
  var _a;
1913
1913
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
1914
1914
  });
1915
- var svg = root$e();
1915
+ var svg = root$f();
1916
1916
  let styles;
1917
1917
  var node = $.child(svg);
1918
1918
  {
1919
1919
  var consequent = ($$anchor2) => {
1920
- var path = root_1$c();
1920
+ var path = root_1$e();
1921
1921
  path.__pointerdown = function(...$$args) {
1922
1922
  var _a;
1923
1923
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -1934,7 +1934,7 @@ function Square($$anchor, $$props) {
1934
1934
  $.append($$anchor2, path);
1935
1935
  };
1936
1936
  var alternate = ($$anchor2) => {
1937
- var rect_1 = root_2$9();
1937
+ var rect_1 = root_2$b();
1938
1938
  rect_1.__pointerdown = function(...$$args) {
1939
1939
  var _a;
1940
1940
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -1965,7 +1965,7 @@ function Square($$anchor, $$props) {
1965
1965
  var node_2 = $.first_child(fragment);
1966
1966
  {
1967
1967
  var consequent_1 = ($$anchor3) => {
1968
- var path_1 = root_4$5();
1968
+ var path_1 = root_4$6();
1969
1969
  let styles_3;
1970
1970
  $.template_effect(() => {
1971
1971
  $.set_attribute(path_1, "d", $.get(cloudyPath).path);
@@ -1980,7 +1980,7 @@ function Square($$anchor, $$props) {
1980
1980
  $.append($$anchor3, path_1);
1981
1981
  };
1982
1982
  var alternate_1 = ($$anchor3) => {
1983
- var rect_2 = root_5$4();
1983
+ var rect_2 = root_5$5();
1984
1984
  let styles_4;
1985
1985
  $.template_effect(() => {
1986
1986
  $.set_attribute(rect_2, "x", $.get(x));
@@ -2034,11 +2034,11 @@ function SquarePreview($$anchor, $$props) {
2034
2034
  () => $$props.data
2035
2035
  ));
2036
2036
  }
2037
- var root_1$b = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2038
- var root_2$8 = $.from_svg(`<ellipse fill="transparent" stroke="transparent"></ellipse>`);
2039
- var root_4$4 = $.from_svg(`<path stroke-linejoin="round"></path>`);
2040
- var root_5$3 = $.from_svg(`<ellipse></ellipse>`);
2041
- var root$d = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
2037
+ var root_1$d = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2038
+ var root_2$a = $.from_svg(`<ellipse fill="transparent" stroke="transparent"></ellipse>`);
2039
+ var root_4$5 = $.from_svg(`<path stroke-linejoin="round"></path>`);
2040
+ var root_5$4 = $.from_svg(`<ellipse></ellipse>`);
2041
+ var root$e = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
2042
2042
  function Circle($$anchor, $$props) {
2043
2043
  $.push($$props, true);
2044
2044
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -2076,12 +2076,12 @@ function Circle($$anchor, $$props) {
2076
2076
  let svgHeight = $.derived(() => $.get(height) * $$props.scale);
2077
2077
  let hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
2078
2078
  let peValue = $.derived(() => !$$props.onClick ? "none" : $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible");
2079
- var svg = root$d();
2079
+ var svg = root$e();
2080
2080
  let styles;
2081
2081
  var node = $.child(svg);
2082
2082
  {
2083
2083
  var consequent = ($$anchor2) => {
2084
- var path = root_1$b();
2084
+ var path = root_1$d();
2085
2085
  path.__pointerdown = (e) => {
2086
2086
  var _a;
2087
2087
  return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
@@ -2098,7 +2098,7 @@ function Circle($$anchor, $$props) {
2098
2098
  $.append($$anchor2, path);
2099
2099
  };
2100
2100
  var alternate = ($$anchor2) => {
2101
- var ellipse = root_2$8();
2101
+ var ellipse = root_2$a();
2102
2102
  ellipse.__pointerdown = (e) => {
2103
2103
  var _a;
2104
2104
  return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
@@ -2129,7 +2129,7 @@ function Circle($$anchor, $$props) {
2129
2129
  var node_2 = $.first_child(fragment);
2130
2130
  {
2131
2131
  var consequent_1 = ($$anchor3) => {
2132
- var path_1 = root_4$4();
2132
+ var path_1 = root_4$5();
2133
2133
  $.set_style(path_1, "", {}, { "pointer-events": "none" });
2134
2134
  $.template_effect(() => {
2135
2135
  $.set_attribute(path_1, "d", $.get(cloudyPath).path);
@@ -2141,7 +2141,7 @@ function Circle($$anchor, $$props) {
2141
2141
  $.append($$anchor3, path_1);
2142
2142
  };
2143
2143
  var alternate_1 = ($$anchor3) => {
2144
- var ellipse_1 = root_5$3();
2144
+ var ellipse_1 = root_5$4();
2145
2145
  $.set_style(ellipse_1, "", {}, { "pointer-events": "none" });
2146
2146
  $.template_effect(
2147
2147
  ($0) => {
@@ -2203,12 +2203,12 @@ function CirclePreview($$anchor, $$props) {
2203
2203
  () => $$props.data
2204
2204
  ));
2205
2205
  }
2206
- var root_1$a = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2207
- var root_2$7 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2208
- var root_4$3 = $.from_svg(`<path></path>`);
2209
- var root_5$2 = $.from_svg(`<path></path>`);
2210
- var root_3$2 = $.from_svg(`<line></line><!><!>`, 1);
2211
- var root$c = $.from_svg(`<svg><line stroke="transparent"></line><!><!><!></svg>`);
2206
+ var root_1$c = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2207
+ var root_2$9 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2208
+ var root_4$4 = $.from_svg(`<path></path>`);
2209
+ var root_5$3 = $.from_svg(`<path></path>`);
2210
+ var root_3$4 = $.from_svg(`<line></line><!><!>`, 1);
2211
+ var root$d = $.from_svg(`<svg><line stroke="transparent"></line><!><!><!></svg>`);
2212
2212
  function Line($$anchor, $$props) {
2213
2213
  $.push($$props, true);
2214
2214
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -2232,7 +2232,7 @@ function Line($$anchor, $$props) {
2232
2232
  var _a;
2233
2233
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
2234
2234
  });
2235
- var svg = root$c();
2235
+ var svg = root$d();
2236
2236
  let styles;
2237
2237
  var line = $.child(svg);
2238
2238
  line.__pointerdown = function(...$$args) {
@@ -2243,7 +2243,7 @@ function Line($$anchor, $$props) {
2243
2243
  var node = $.sibling(line);
2244
2244
  {
2245
2245
  var consequent = ($$anchor2) => {
2246
- var path = root_1$a();
2246
+ var path = root_1$c();
2247
2247
  path.__pointerdown = function(...$$args) {
2248
2248
  var _a;
2249
2249
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -2268,7 +2268,7 @@ function Line($$anchor, $$props) {
2268
2268
  var node_1 = $.sibling(node);
2269
2269
  {
2270
2270
  var consequent_1 = ($$anchor2) => {
2271
- var path_1 = root_2$7();
2271
+ var path_1 = root_2$9();
2272
2272
  path_1.__pointerdown = function(...$$args) {
2273
2273
  var _a;
2274
2274
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -2293,13 +2293,13 @@ function Line($$anchor, $$props) {
2293
2293
  var node_2 = $.sibling(node_1);
2294
2294
  {
2295
2295
  var consequent_4 = ($$anchor2) => {
2296
- var fragment = root_3$2();
2296
+ var fragment = root_3$4();
2297
2297
  var line_1 = $.first_child(fragment);
2298
2298
  let styles_4;
2299
2299
  var node_3 = $.sibling(line_1);
2300
2300
  {
2301
2301
  var consequent_2 = ($$anchor3) => {
2302
- var path_2 = root_4$3();
2302
+ var path_2 = root_4$4();
2303
2303
  let styles_5;
2304
2304
  $.template_effect(() => {
2305
2305
  $.set_attribute(path_2, "d", $.get(endings).start.d);
@@ -2322,7 +2322,7 @@ function Line($$anchor, $$props) {
2322
2322
  var node_4 = $.sibling(node_3);
2323
2323
  {
2324
2324
  var consequent_3 = ($$anchor3) => {
2325
- var path_3 = root_5$2();
2325
+ var path_3 = root_5$3();
2326
2326
  let styles_6;
2327
2327
  $.template_effect(() => {
2328
2328
  $.set_attribute(path_3, "d", $.get(endings).end.d);
@@ -2394,12 +2394,12 @@ function LinePreview($$anchor, $$props) {
2394
2394
  () => $$props.data
2395
2395
  ));
2396
2396
  }
2397
- var root_1$9 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2398
- var root_2$6 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2399
- var root_4$2 = $.from_svg(`<path></path>`);
2400
- var root_5$1 = $.from_svg(`<path></path>`);
2401
- var root_3$1 = $.from_svg(`<path></path><!><!>`, 1);
2402
- var root$b = $.from_svg(`<svg><path fill="none" stroke="transparent"></path><!><!><!></svg>`);
2397
+ var root_1$b = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2398
+ var root_2$8 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2399
+ var root_4$3 = $.from_svg(`<path></path>`);
2400
+ var root_5$2 = $.from_svg(`<path></path>`);
2401
+ var root_3$3 = $.from_svg(`<path></path><!><!>`, 1);
2402
+ var root$c = $.from_svg(`<svg><path fill="none" stroke="transparent"></path><!><!><!></svg>`);
2403
2403
  function Polyline($$anchor, $$props) {
2404
2404
  $.push($$props, true);
2405
2405
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -2427,7 +2427,7 @@ function Polyline($$anchor, $$props) {
2427
2427
  var _a;
2428
2428
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
2429
2429
  });
2430
- var svg = root$b();
2430
+ var svg = root$c();
2431
2431
  let styles;
2432
2432
  var path = $.child(svg);
2433
2433
  path.__pointerdown = function(...$$args) {
@@ -2438,7 +2438,7 @@ function Polyline($$anchor, $$props) {
2438
2438
  var node = $.sibling(path);
2439
2439
  {
2440
2440
  var consequent = ($$anchor2) => {
2441
- var path_1 = root_1$9();
2441
+ var path_1 = root_1$b();
2442
2442
  path_1.__pointerdown = function(...$$args) {
2443
2443
  var _a;
2444
2444
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -2463,7 +2463,7 @@ function Polyline($$anchor, $$props) {
2463
2463
  var node_1 = $.sibling(node);
2464
2464
  {
2465
2465
  var consequent_1 = ($$anchor2) => {
2466
- var path_2 = root_2$6();
2466
+ var path_2 = root_2$8();
2467
2467
  path_2.__pointerdown = function(...$$args) {
2468
2468
  var _a;
2469
2469
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -2488,13 +2488,13 @@ function Polyline($$anchor, $$props) {
2488
2488
  var node_2 = $.sibling(node_1);
2489
2489
  {
2490
2490
  var consequent_4 = ($$anchor2) => {
2491
- var fragment = root_3$1();
2491
+ var fragment = root_3$3();
2492
2492
  var path_3 = $.first_child(fragment);
2493
2493
  let styles_4;
2494
2494
  var node_3 = $.sibling(path_3);
2495
2495
  {
2496
2496
  var consequent_2 = ($$anchor3) => {
2497
- var path_4 = root_4$2();
2497
+ var path_4 = root_4$3();
2498
2498
  let styles_5;
2499
2499
  $.template_effect(() => {
2500
2500
  $.set_attribute(path_4, "d", $.get(endings).start.d);
@@ -2517,7 +2517,7 @@ function Polyline($$anchor, $$props) {
2517
2517
  var node_4 = $.sibling(node_3);
2518
2518
  {
2519
2519
  var consequent_3 = ($$anchor3) => {
2520
- var path_5 = root_5$1();
2520
+ var path_5 = root_5$2();
2521
2521
  let styles_6;
2522
2522
  $.template_effect(() => {
2523
2523
  $.set_attribute(path_5, "d", $.get(endings).end.d);
@@ -2586,11 +2586,11 @@ function PolylinePreview($$anchor, $$props) {
2586
2586
  () => $$props.data
2587
2587
  ));
2588
2588
  }
2589
- var root_2$5 = $.from_svg(`<path></path>`);
2590
- var root_4$1 = $.from_svg(`<path fill="none"></path>`);
2591
- var root_5 = $.from_svg(`<rect></rect>`);
2592
- var root_3 = $.from_svg(`<path></path><!><!>`, 1);
2593
- var root$a = $.from_svg(`<svg><path fill="transparent" stroke="transparent"></path><!></svg>`);
2589
+ var root_2$7 = $.from_svg(`<path></path>`);
2590
+ var root_4$2 = $.from_svg(`<path fill="none"></path>`);
2591
+ var root_5$1 = $.from_svg(`<rect></rect>`);
2592
+ var root_3$2 = $.from_svg(`<path></path><!><!>`, 1);
2593
+ var root$b = $.from_svg(`<svg><path fill="transparent" stroke="transparent"></path><!></svg>`);
2594
2594
  function Polygon($$anchor, $$props) {
2595
2595
  $.push($$props, true);
2596
2596
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -2616,7 +2616,7 @@ function Polygon($$anchor, $$props) {
2616
2616
  var _a;
2617
2617
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
2618
2618
  });
2619
- var svg = root$a();
2619
+ var svg = root$b();
2620
2620
  let styles;
2621
2621
  var path = $.child(svg);
2622
2622
  path.__pointerdown = function(...$$args) {
@@ -2631,7 +2631,7 @@ function Polygon($$anchor, $$props) {
2631
2631
  var node_1 = $.first_child(fragment);
2632
2632
  {
2633
2633
  var consequent = ($$anchor3) => {
2634
- var path_1 = root_2$5();
2634
+ var path_1 = root_2$7();
2635
2635
  let styles_2;
2636
2636
  $.template_effect(() => {
2637
2637
  $.set_attribute(path_1, "d", $.get(cloudyPath).path);
@@ -2647,13 +2647,13 @@ function Polygon($$anchor, $$props) {
2647
2647
  $.append($$anchor3, path_1);
2648
2648
  };
2649
2649
  var alternate = ($$anchor3) => {
2650
- var fragment_1 = root_3();
2650
+ var fragment_1 = root_3$2();
2651
2651
  var path_2 = $.first_child(fragment_1);
2652
2652
  let styles_3;
2653
2653
  var node_2 = $.sibling(path_2);
2654
2654
  {
2655
2655
  var consequent_1 = ($$anchor4) => {
2656
- var path_3 = root_4$1();
2656
+ var path_3 = root_4$2();
2657
2657
  let styles_4;
2658
2658
  $.template_effect(() => {
2659
2659
  $.set_attribute(path_3, "d", `M ${$.get(localPts)[$.get(localPts).length - 1].x} ${$.get(localPts)[$.get(localPts).length - 1].y} L ${$.get(localPts)[0].x} ${$.get(localPts)[0].y}`);
@@ -2674,7 +2674,7 @@ function Polygon($$anchor, $$props) {
2674
2674
  var node_3 = $.sibling(node_2);
2675
2675
  {
2676
2676
  var consequent_2 = ($$anchor4) => {
2677
- var rect_1 = root_5();
2677
+ var rect_1 = root_5$1();
2678
2678
  $.set_attribute(rect_1, "opacity", 0.4);
2679
2679
  $.set_style(rect_1, "", {}, { "pointer-events": "none" });
2680
2680
  $.template_effect(() => {
@@ -2748,10 +2748,10 @@ function PolygonPreview($$anchor, $$props) {
2748
2748
  () => $$props.data
2749
2749
  ));
2750
2750
  }
2751
- var root$9 = $.from_html(`<div></div>`);
2751
+ var root$a = $.from_html(`<div></div>`);
2752
2752
  function FreeTextPreview($$anchor, $$props) {
2753
2753
  $.push($$props, true);
2754
- var div = root$9();
2754
+ var div = root$a();
2755
2755
  let styles;
2756
2756
  $.template_effect(() => styles = $.set_style(div, "", styles, {
2757
2757
  width: "100%",
@@ -2762,11 +2762,108 @@ function FreeTextPreview($$anchor, $$props) {
2762
2762
  $.append($$anchor, div);
2763
2763
  $.pop();
2764
2764
  }
2765
- var root$8 = $.from_html(`<img alt=""/>`);
2765
+ var root_2$6 = $.from_svg(`<path></path>`);
2766
+ var root_3$1 = $.from_svg(`<rect></rect>`);
2767
+ var root_1$a = $.from_svg(`<svg><polyline fill="none"></polyline><!><!></svg>`);
2768
+ function CalloutFreeTextPreview($$anchor, $$props) {
2769
+ $.push($$props, true);
2770
+ const cl = $.derived(() => $$props.data.calloutLine);
2771
+ const sw = $.derived(() => $$props.data.strokeWidth ?? 1);
2772
+ const sc = $.derived(() => $$props.data.strokeColor ?? "#000000");
2773
+ const op = $.derived(() => $$props.data.opacity ?? 1);
2774
+ const w = $.derived(() => $$props.bounds.size.width);
2775
+ const h = $.derived(() => $$props.bounds.size.height);
2776
+ const ox = $.derived(() => $$props.bounds.origin.x);
2777
+ const oy = $.derived(() => $$props.bounds.origin.y);
2778
+ const lineCoords = $.derived(() => {
2779
+ if (!$.get(cl) || $.get(cl).length < 2) return null;
2780
+ return $.get(cl).map((p) => ({ x: p.x - $.get(ox), y: p.y - $.get(oy) }));
2781
+ });
2782
+ const ending = $.derived(() => {
2783
+ if (!$.get(lineCoords) || $.get(lineCoords).length < 2) return null;
2784
+ const angle = Math.atan2($.get(lineCoords)[1].y - $.get(lineCoords)[0].y, $.get(lineCoords)[1].x - $.get(lineCoords)[0].x);
2785
+ return patching.createEnding($$props.data.lineEnding, $.get(sw), angle + Math.PI, $.get(lineCoords)[0].x, $.get(lineCoords)[0].y);
2786
+ });
2787
+ const halfSw = $.derived(() => $.get(sw) / 2);
2788
+ const tb = $.derived(() => $$props.data.textBox);
2789
+ var fragment = $.comment();
2790
+ var node = $.first_child(fragment);
2791
+ {
2792
+ var consequent_2 = ($$anchor2) => {
2793
+ var svg = root_1$a();
2794
+ let styles;
2795
+ var polyline = $.child(svg);
2796
+ var node_1 = $.sibling(polyline);
2797
+ {
2798
+ var consequent = ($$anchor3) => {
2799
+ var path = root_2$6();
2800
+ $.template_effect(() => {
2801
+ $.set_attribute(path, "d", $.get(ending).d);
2802
+ $.set_attribute(path, "transform", $.get(ending).transform);
2803
+ $.set_attribute(path, "stroke", $.get(sc));
2804
+ $.set_attribute(path, "fill", $.get(ending).filled ? $$props.data.color ?? "transparent" : "none");
2805
+ $.set_attribute(path, "stroke-width", $.get(sw));
2806
+ $.set_attribute(path, "opacity", $.get(op));
2807
+ });
2808
+ $.append($$anchor3, path);
2809
+ };
2810
+ $.if(node_1, ($$render) => {
2811
+ if ($.get(ending)) $$render(consequent);
2812
+ });
2813
+ }
2814
+ var node_2 = $.sibling(node_1);
2815
+ {
2816
+ var consequent_1 = ($$anchor3) => {
2817
+ var rect = root_3$1();
2818
+ $.template_effect(() => {
2819
+ $.set_attribute(rect, "x", $.get(tb).origin.x - $.get(ox) + $.get(halfSw));
2820
+ $.set_attribute(rect, "y", $.get(tb).origin.y - $.get(oy) + $.get(halfSw));
2821
+ $.set_attribute(rect, "width", $.get(tb).size.width - $.get(sw));
2822
+ $.set_attribute(rect, "height", $.get(tb).size.height - $.get(sw));
2823
+ $.set_attribute(rect, "fill", $$props.data.color ?? $$props.data.backgroundColor ?? "transparent");
2824
+ $.set_attribute(rect, "stroke", $.get(sc));
2825
+ $.set_attribute(rect, "stroke-width", $.get(sw));
2826
+ $.set_attribute(rect, "opacity", $.get(op));
2827
+ });
2828
+ $.append($$anchor3, rect);
2829
+ };
2830
+ $.if(node_2, ($$render) => {
2831
+ if ($.get(tb)) $$render(consequent_1);
2832
+ });
2833
+ }
2834
+ $.reset(svg);
2835
+ $.template_effect(
2836
+ ($0) => {
2837
+ styles = $.set_style(svg, "position: absolute; pointer-events: none; overflow: visible;", styles, {
2838
+ width: `${$.get(w) * $$props.scale}px`,
2839
+ height: `${$.get(h) * $$props.scale}px`
2840
+ });
2841
+ $.set_attribute(svg, "width", $.get(w) * $$props.scale);
2842
+ $.set_attribute(svg, "height", $.get(h) * $$props.scale);
2843
+ $.set_attribute(svg, "viewBox", `0 0 ${$.get(w)} ${$.get(h)}`);
2844
+ $.set_attribute(polyline, "points", $0);
2845
+ $.set_attribute(polyline, "stroke", $.get(sc));
2846
+ $.set_attribute(polyline, "stroke-width", $.get(sw));
2847
+ $.set_attribute(polyline, "opacity", $.get(op));
2848
+ },
2849
+ [
2850
+ () => $.get(lineCoords).map((p) => `${p.x},${p.y}`).join(" ")
2851
+ ]
2852
+ );
2853
+ $.append($$anchor2, svg);
2854
+ };
2855
+ $.if(node, ($$render) => {
2856
+ if ($.get(lineCoords)) $$render(consequent_2);
2857
+ });
2858
+ }
2859
+ $.append($$anchor, fragment);
2860
+ $.pop();
2861
+ }
2862
+ var root$9 = $.from_html(`<img alt=""/>`);
2766
2863
  function StampPreview($$anchor, $$props) {
2767
2864
  $.push($$props, true);
2768
2865
  const rotationDeg = $.derived(() => (4 - $$props.data.pageRotation) % 4 * 90);
2769
- var img = root$8();
2866
+ var img = root$9();
2770
2867
  let styles;
2771
2868
  $.template_effect(() => {
2772
2869
  $.set_attribute(img, "src", $$props.data.ghostUrl);
@@ -2878,7 +2975,7 @@ function PolygonRenderer($$anchor, $$props) {
2878
2975
  }
2879
2976
  }));
2880
2977
  }
2881
- var root$7 = $.from_html(`<div role="button"><span role="textbox" tabindex="0"> </span></div>`);
2978
+ var root$8 = $.from_html(`<div role="button"><span role="textbox" tabindex="0"> </span></div>`);
2882
2979
  function FreeText($$anchor, $$props) {
2883
2980
  $.push($$props, true);
2884
2981
  let appearanceActive = $.prop($$props, "appearanceActive", 3, false);
@@ -2915,7 +3012,7 @@ function FreeText($$anchor, $$props) {
2915
3012
  const outerH = $.derived(() => $$props.annotation.object.rect.size.height * $$props.scale);
2916
3013
  const justify = $.derived(() => $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end");
2917
3014
  const fontCss = $.derived(() => standardFontCssProperties($$props.annotation.object.fontFamily));
2918
- var div = root$7();
3015
+ var div = root$8();
2919
3016
  $.set_attribute(div, "tabindex", -1);
2920
3017
  div.__pointerdown = function(...$$args) {
2921
3018
  var _a;
@@ -3003,6 +3100,309 @@ function FreeTextRenderer($$anchor, $$props) {
3003
3100
  });
3004
3101
  }
3005
3102
  }
3103
+ var root_2$5 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
3104
+ var root_1$9 = $.from_svg(`<polyline fill="none" stroke="transparent"></polyline><!>`, 1);
3105
+ var root_5 = $.from_svg(`<path></path>`);
3106
+ var root_4$1 = $.from_svg(`<polyline fill="none"></polyline><!>`, 1);
3107
+ var root_3 = $.from_svg(`<!><rect></rect>`, 1);
3108
+ var root$7 = $.from_html(`<div><svg><!><!></svg> <div></div> <span role="textbox" tabindex="0"> </span></div>`);
3109
+ function CalloutFreeText($$anchor, $$props) {
3110
+ $.push($$props, true);
3111
+ const MIN_HIT_AREA_SCREEN_PX = 20;
3112
+ let appearanceActive = $.prop($$props, "appearanceActive", 3, false);
3113
+ const annotationCapability = useAnnotationCapability();
3114
+ const annotationProvides = $.derived(() => annotationCapability.provides ? annotationCapability.provides.forDocument($$props.documentId) : null);
3115
+ let editorRef = null;
3116
+ let editingRef = false;
3117
+ const obj = $.derived(() => $$props.annotation.object);
3118
+ const rect = $.derived(() => $.get(obj).rect);
3119
+ const strokeWidth = $.derived(() => $.get(obj).strokeWidth ?? 1);
3120
+ const strokeColor = $.derived(() => $.get(obj).strokeColor ?? "#000000");
3121
+ const textBox = $.derived(() => patching.computeTextBoxFromRD($.get(rect), $.get(obj).rectangleDifferences));
3122
+ const textBoxRelative = $.derived(() => ({
3123
+ left: ($.get(textBox).origin.x - $.get(rect).origin.x + $.get(strokeWidth) / 2) * $$props.scale,
3124
+ top: ($.get(textBox).origin.y - $.get(rect).origin.y + $.get(strokeWidth) / 2) * $$props.scale,
3125
+ width: ($.get(textBox).size.width - $.get(strokeWidth)) * $$props.scale,
3126
+ height: ($.get(textBox).size.height - $.get(strokeWidth)) * $$props.scale
3127
+ }));
3128
+ const lineCoords = $.derived(() => {
3129
+ const cl = $.get(obj).calloutLine;
3130
+ if (!cl || cl.length < 3) return null;
3131
+ return cl.map((p) => ({ x: p.x - $.get(rect).origin.x, y: p.y - $.get(rect).origin.y }));
3132
+ });
3133
+ const ending = $.derived(() => {
3134
+ if (!$.get(lineCoords) || $.get(lineCoords).length < 2) return null;
3135
+ const angle = Math.atan2($.get(lineCoords)[1].y - $.get(lineCoords)[0].y, $.get(lineCoords)[1].x - $.get(lineCoords)[0].x);
3136
+ return patching.createEnding($.get(obj).lineEnding, $.get(strokeWidth), angle + Math.PI, $.get(lineCoords)[0].x, $.get(lineCoords)[0].y);
3137
+ });
3138
+ const visualLineCoords = $.derived(() => {
3139
+ if (!$.get(lineCoords) || $.get(lineCoords).length < 2) return $.get(lineCoords);
3140
+ const pts = $.get(lineCoords).map((p) => ({ ...p }));
3141
+ const last = pts.length - 1;
3142
+ const prev = last - 1;
3143
+ const dx = pts[last].x - pts[prev].x;
3144
+ const dy = pts[last].y - pts[prev].y;
3145
+ const len = Math.sqrt(dx * dx + dy * dy);
3146
+ if (len > 0) {
3147
+ const halfBw = $.get(strokeWidth) / 2;
3148
+ pts[last].x += dx / len * halfBw;
3149
+ pts[last].y += dy / len * halfBw;
3150
+ }
3151
+ return pts;
3152
+ });
3153
+ const ios = useIOSZoomPrevention(() => $.get(obj).fontSize * $$props.scale, () => $$props.isEditing);
3154
+ const width = $.derived(() => $.get(rect).size.width * $$props.scale);
3155
+ const height = $.derived(() => $.get(rect).size.height * $$props.scale);
3156
+ const hitStrokeWidth = $.derived(() => Math.max($.get(strokeWidth), MIN_HIT_AREA_SCREEN_PX / $$props.scale));
3157
+ const fontCss = $.derived(() => standardFontCssProperties($.get(obj).fontFamily));
3158
+ const justify = $.derived(() => $.get(obj).verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : $.get(obj).verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end");
3159
+ $.user_effect(() => {
3160
+ var _a, _b, _c;
3161
+ if (!$$props.isEditing || !editorRef) return;
3162
+ editingRef = true;
3163
+ editorRef.focus();
3164
+ const tool = (_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation($.get(obj));
3165
+ const isDefaultContent = ((_b = tool == null ? void 0 : tool.defaults) == null ? void 0 : _b.contents) != null && $.get(obj).contents === tool.defaults.contents;
3166
+ const selection = (_c = window.getSelection) == null ? void 0 : _c.call(window);
3167
+ if (!selection) return;
3168
+ const range = document.createRange();
3169
+ range.selectNodeContents(editorRef);
3170
+ if (!isDefaultContent) {
3171
+ range.collapse(false);
3172
+ }
3173
+ selection.removeAllRanges();
3174
+ selection.addRange(range);
3175
+ });
3176
+ function handleBlur() {
3177
+ if (!editingRef) return;
3178
+ editingRef = false;
3179
+ if (!$.get(annotationProvides) || !editorRef) return;
3180
+ $.get(annotationProvides).updateAnnotation($$props.pageIndex, $.get(obj).id, { contents: editorRef.innerText.replace(/\u00A0/g, " ") });
3181
+ }
3182
+ var div = root$7();
3183
+ let styles;
3184
+ var svg = $.child(div);
3185
+ let styles_1;
3186
+ var node = $.child(svg);
3187
+ {
3188
+ var consequent_1 = ($$anchor2) => {
3189
+ var fragment = root_1$9();
3190
+ var polyline = $.first_child(fragment);
3191
+ polyline.__pointerdown = function(...$$args) {
3192
+ var _a;
3193
+ (_a = $$props.onClick ? (e) => $$props.onClick(e) : void 0) == null ? void 0 : _a.apply(this, $$args);
3194
+ };
3195
+ let styles_2;
3196
+ var node_1 = $.sibling(polyline);
3197
+ {
3198
+ var consequent = ($$anchor3) => {
3199
+ var path = root_2$5();
3200
+ path.__pointerdown = function(...$$args) {
3201
+ var _a;
3202
+ (_a = $$props.onClick ? (e) => $$props.onClick(e) : void 0) == null ? void 0 : _a.apply(this, $$args);
3203
+ };
3204
+ let styles_3;
3205
+ $.template_effect(() => {
3206
+ $.set_attribute(path, "d", $.get(ending).d);
3207
+ $.set_attribute(path, "transform", $.get(ending).transform);
3208
+ $.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
3209
+ styles_3 = $.set_style(path, "", styles_3, {
3210
+ cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
3211
+ "pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : $.get(ending).filled ? "visible" : "visibleStroke"
3212
+ });
3213
+ });
3214
+ $.append($$anchor3, path);
3215
+ };
3216
+ $.if(node_1, ($$render) => {
3217
+ if ($.get(ending)) $$render(consequent);
3218
+ });
3219
+ }
3220
+ $.template_effect(
3221
+ ($0) => {
3222
+ $.set_attribute(polyline, "points", $0);
3223
+ $.set_attribute(polyline, "stroke-width", $.get(hitStrokeWidth));
3224
+ styles_2 = $.set_style(polyline, "", styles_2, {
3225
+ cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
3226
+ "pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : "visibleStroke"
3227
+ });
3228
+ },
3229
+ [
3230
+ () => $.get(lineCoords).map((p) => `${p.x},${p.y}`).join(" ")
3231
+ ]
3232
+ );
3233
+ $.append($$anchor2, fragment);
3234
+ };
3235
+ $.if(node, ($$render) => {
3236
+ if ($.get(lineCoords)) $$render(consequent_1);
3237
+ });
3238
+ }
3239
+ var node_2 = $.sibling(node);
3240
+ {
3241
+ var consequent_4 = ($$anchor2) => {
3242
+ var fragment_1 = root_3();
3243
+ var node_3 = $.first_child(fragment_1);
3244
+ {
3245
+ var consequent_3 = ($$anchor3) => {
3246
+ var fragment_2 = root_4$1();
3247
+ var polyline_1 = $.first_child(fragment_2);
3248
+ $.set_style(polyline_1, "", {}, { "pointer-events": "none" });
3249
+ var node_4 = $.sibling(polyline_1);
3250
+ {
3251
+ var consequent_2 = ($$anchor4) => {
3252
+ var path_1 = root_5();
3253
+ $.set_style(path_1, "", {}, { "pointer-events": "none" });
3254
+ $.template_effect(() => {
3255
+ $.set_attribute(path_1, "d", $.get(ending).d);
3256
+ $.set_attribute(path_1, "transform", $.get(ending).transform);
3257
+ $.set_attribute(path_1, "stroke", $.get(strokeColor));
3258
+ $.set_attribute(path_1, "fill", $.get(ending).filled ? $.get(obj).color ?? "transparent" : "none");
3259
+ $.set_attribute(path_1, "stroke-width", $.get(strokeWidth));
3260
+ $.set_attribute(path_1, "opacity", $.get(obj).opacity);
3261
+ });
3262
+ $.append($$anchor4, path_1);
3263
+ };
3264
+ $.if(node_4, ($$render) => {
3265
+ if ($.get(ending)) $$render(consequent_2);
3266
+ });
3267
+ }
3268
+ $.template_effect(
3269
+ ($0) => {
3270
+ $.set_attribute(polyline_1, "points", $0);
3271
+ $.set_attribute(polyline_1, "stroke", $.get(strokeColor));
3272
+ $.set_attribute(polyline_1, "stroke-width", $.get(strokeWidth));
3273
+ $.set_attribute(polyline_1, "opacity", $.get(obj).opacity);
3274
+ },
3275
+ [
3276
+ () => $.get(visualLineCoords).map((p) => `${p.x},${p.y}`).join(" ")
3277
+ ]
3278
+ );
3279
+ $.append($$anchor3, fragment_2);
3280
+ };
3281
+ $.if(node_3, ($$render) => {
3282
+ if ($.get(visualLineCoords)) $$render(consequent_3);
3283
+ });
3284
+ }
3285
+ var rect_1 = $.sibling(node_3);
3286
+ $.set_style(rect_1, "", {}, { "pointer-events": "none" });
3287
+ $.template_effect(() => {
3288
+ $.set_attribute(rect_1, "x", $.get(textBox).origin.x - $.get(rect).origin.x + $.get(strokeWidth) / 2);
3289
+ $.set_attribute(rect_1, "y", $.get(textBox).origin.y - $.get(rect).origin.y + $.get(strokeWidth) / 2);
3290
+ $.set_attribute(rect_1, "width", $.get(textBox).size.width - $.get(strokeWidth));
3291
+ $.set_attribute(rect_1, "height", $.get(textBox).size.height - $.get(strokeWidth));
3292
+ $.set_attribute(rect_1, "fill", $.get(obj).color ?? $.get(obj).backgroundColor ?? "transparent");
3293
+ $.set_attribute(rect_1, "stroke", $.get(strokeColor));
3294
+ $.set_attribute(rect_1, "stroke-width", $.get(strokeWidth));
3295
+ $.set_attribute(rect_1, "opacity", $.get(obj).opacity);
3296
+ });
3297
+ $.append($$anchor2, fragment_1);
3298
+ };
3299
+ $.if(node_2, ($$render) => {
3300
+ if (!appearanceActive()) $$render(consequent_4);
3301
+ });
3302
+ }
3303
+ $.reset(svg);
3304
+ var div_1 = $.sibling(svg, 2);
3305
+ div_1.__pointerdown = function(...$$args) {
3306
+ var _a;
3307
+ (_a = $$props.onClick ? (e) => $$props.onClick(e) : void 0) == null ? void 0 : _a.apply(this, $$args);
3308
+ };
3309
+ let styles_4;
3310
+ var span = $.sibling(div_1, 2);
3311
+ let styles_5;
3312
+ var text = $.child(span, true);
3313
+ $.reset(span);
3314
+ $.bind_this(span, ($$value) => editorRef = $$value, () => editorRef);
3315
+ $.reset(div);
3316
+ $.template_effect(
3317
+ ($0) => {
3318
+ styles = $.set_style(div, "", styles, {
3319
+ position: "absolute",
3320
+ width: `${$.get(width)}px`,
3321
+ height: `${$.get(height)}px`,
3322
+ cursor: $$props.isSelected && !$$props.isEditing ? "move" : "default",
3323
+ "pointer-events": "none",
3324
+ "z-index": 2,
3325
+ opacity: appearanceActive() ? 0 : 1
3326
+ });
3327
+ styles_1 = $.set_style(svg, "position: absolute; pointer-events: none; overflow: visible;", styles_1, { width: `${$.get(width)}px`, height: `${$.get(height)}px` });
3328
+ $.set_attribute(svg, "width", $.get(width));
3329
+ $.set_attribute(svg, "height", $.get(height));
3330
+ $.set_attribute(svg, "viewBox", `0 0 ${$.get(rect).size.width} ${$.get(rect).size.height}`);
3331
+ styles_4 = $.set_style(div_1, "", styles_4, {
3332
+ position: "absolute",
3333
+ left: `${($.get(textBox).origin.x - $.get(rect).origin.x) * $$props.scale}px`,
3334
+ top: `${($.get(textBox).origin.y - $.get(rect).origin.y) * $$props.scale}px`,
3335
+ width: `${$.get(textBox).size.width * $$props.scale}px`,
3336
+ height: `${$.get(textBox).size.height * $$props.scale}px`,
3337
+ cursor: $$props.isSelected && !$$props.isEditing ? "move" : $$props.onClick ? "pointer" : "default",
3338
+ "pointer-events": !$$props.onClick ? "none" : $$props.isSelected && !$$props.isEditing ? "none" : "auto"
3339
+ });
3340
+ $.set_attribute(span, "contenteditable", $$props.isEditing);
3341
+ styles_5 = $.set_style(span, "", styles_5, $0);
3342
+ $.set_text(text, $.get(obj).contents);
3343
+ },
3344
+ [
3345
+ () => ({
3346
+ position: "absolute",
3347
+ left: `${$.get(textBoxRelative).left}px`,
3348
+ top: `${$.get(textBoxRelative).top}px`,
3349
+ width: `${$.get(textBoxRelative).width}px`,
3350
+ height: `${$.get(textBoxRelative).height}px`,
3351
+ color: $.get(obj).fontColor,
3352
+ "font-size": `${ios.adjustedFontPx}px`,
3353
+ "font-family": $.get(fontCss).fontFamily,
3354
+ "font-weight": $.get(fontCss).fontWeight,
3355
+ "font-style": $.get(fontCss).fontStyle,
3356
+ "text-align": textAlignmentToCss($.get(obj).textAlign),
3357
+ "flex-direction": "column",
3358
+ "justify-content": $.get(justify),
3359
+ display: "flex",
3360
+ padding: `${$.get(strokeWidth) * $$props.scale / 2 + 2 * $$props.scale}px`,
3361
+ opacity: $.get(obj).opacity,
3362
+ "line-height": "1.18",
3363
+ overflow: "hidden",
3364
+ cursor: $$props.isEditing ? "text" : "default",
3365
+ outline: "none",
3366
+ "pointer-events": $$props.isEditing ? "auto" : "none"
3367
+ })
3368
+ ]
3369
+ );
3370
+ $.event("blur", span, handleBlur);
3371
+ $.append($$anchor, div);
3372
+ $.pop();
3373
+ }
3374
+ $.delegate(["pointerdown"]);
3375
+ function CalloutFreeTextRenderer($$anchor, $$props) {
3376
+ {
3377
+ let $0 = $.derived(() => ({ ...$$props.annotation, object: $$props.currentObject }));
3378
+ CalloutFreeText($$anchor, {
3379
+ get documentId() {
3380
+ return $$props.documentId;
3381
+ },
3382
+ get isSelected() {
3383
+ return $$props.isSelected;
3384
+ },
3385
+ get isEditing() {
3386
+ return $$props.isEditing;
3387
+ },
3388
+ get annotation() {
3389
+ return $.get($0);
3390
+ },
3391
+ get pageIndex() {
3392
+ return $$props.pageIndex;
3393
+ },
3394
+ get scale() {
3395
+ return $$props.scale;
3396
+ },
3397
+ get onClick() {
3398
+ return $$props.onClick;
3399
+ },
3400
+ get appearanceActive() {
3401
+ return $$props.appearanceActive;
3402
+ }
3403
+ });
3404
+ }
3405
+ }
3006
3406
  var root_1$8 = $.from_html(`<img/>`);
3007
3407
  function RenderAnnotation($$anchor, $$props) {
3008
3408
  $.push($$props, true);
@@ -3805,10 +4205,21 @@ const builtInRenderers = [
3805
4205
  component: CaretRenderer,
3806
4206
  interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false }
3807
4207
  }),
4208
+ createRenderer({
4209
+ id: "freeTextCallout",
4210
+ matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT && a.intent === "FreeTextCallout",
4211
+ matchesPreview: (p) => p.type === PdfAnnotationSubtype.FREETEXT && !!p.data.calloutLine,
4212
+ component: CalloutFreeTextRenderer,
4213
+ renderPreview: CalloutFreeTextPreview,
4214
+ vertexConfig: patching.calloutVertexConfig,
4215
+ interactionDefaults: { isDraggable: true, isResizable: false, isRotatable: false },
4216
+ isDraggable: (toolDraggable, { isEditing }) => toolDraggable && !isEditing,
4217
+ onDoubleClick: (id, setEditingId) => setEditingId(id)
4218
+ }),
3808
4219
  createRenderer({
3809
4220
  id: "freeText",
3810
- matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT,
3811
- matchesPreview: (p) => p.type === PdfAnnotationSubtype.FREETEXT,
4221
+ matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT && a.intent !== "FreeTextCallout",
4222
+ matchesPreview: (p) => p.type === PdfAnnotationSubtype.FREETEXT && !p.data.calloutLine,
3812
4223
  component: FreeTextRenderer,
3813
4224
  renderPreview: FreeTextPreview,
3814
4225
  interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true },