@lingshugroup/web-plus 1.0.37 → 1.0.38

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 (31) hide show
  1. package/README.md +1 -1
  2. package/lib/index.css +1 -1
  3. package/lib/index.css.br +0 -0
  4. package/lib/index.css.gz +0 -0
  5. package/lib/packages/ls-components/components/descriptions/Index.vue/index.cjs +1 -1
  6. package/lib/packages/ls-components/components/descriptions/Index.vue/index.js +1 -1
  7. package/lib/packages/ls-components/components/descriptions/Index.vue/index2.cjs +1 -1
  8. package/lib/packages/ls-components/components/descriptions/Index.vue/index2.js +62 -60
  9. package/lib/packages/ls-components/components/descriptions/Index.vue/index2.js.br +0 -0
  10. package/lib/packages/ls-components/components/descriptions/Index.vue/index2.js.gz +0 -0
  11. package/lib/packages/ls-components/components/preview_pdf/composable/index.cjs +1 -1
  12. package/lib/packages/ls-components/components/preview_pdf/composable/index.js +43 -43
  13. package/lib/packages/ls-components/components/preview_pdf/composable/index.js.br +0 -0
  14. package/lib/packages/ls-components/components/preview_pdf/composable/index.js.gz +0 -0
  15. package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.cjs +1 -1
  16. package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.js +20 -20
  17. package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.js.br +0 -0
  18. package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.js.gz +0 -0
  19. package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.cjs +1 -1
  20. package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.js +37 -37
  21. package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.js.br +0 -0
  22. package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.js.gz +0 -0
  23. package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.cjs +1 -1
  24. package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.js +12 -12
  25. package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.js.br +0 -0
  26. package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.js.gz +0 -0
  27. package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.cjs +1 -1
  28. package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.js +6 -6
  29. package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.js.br +0 -0
  30. package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.js.gz +0 -0
  31. package/package.json +1 -1
package/lib/index.css.br CHANGED
Binary file
package/lib/index.css.gz CHANGED
Binary file
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-7a22ee84"]]);exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-48e499ae"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7a22ee84"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-48e499ae"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var C=Object.defineProperty;var p=(c,o)=>C(c,"name",{value:o,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),_=,/* empty css */b=,/* empty css */m=,/* empty css */B=,/* empty css */S=,/* empty css */f=,/* empty css */h={class:"cell-item"},v=e.defineComponent({name:"LSDescriptions"}),D=e.defineComponent({...v,props:m.lsDescProp,setup(c){const o=e.useSlots(),l=c,k=e.ref({column:1}),d=e.ref(),y=B.useNamespace("descriptions").b();e.watch(()=>l.labelColor,async r=>{r&&n(r,1)},{deep:!0,immediate:!0}),e.watch(()=>l.labelBgColor,async r=>{r&&n(r,2)},{deep:!0,immediate:!0}),e.watch(()=>l.list,()=>{n(l.labelColor,2),n(l.labelBgColor,2)},{immediate:!0,deep:!0});async function n(r,u){var a;await e.nextTick(),(((a=d.value)==null?void 0:a.querySelectorAll(".el-descriptions__label"))||[]).forEach(t=>{u===1?t.style.color=r:u===2&&(t.style.backgroundColor=r)})}return p(n,"updateLabelStyle"),(r,u)=>{const i=f.ElDescriptionsItem,a=f.ElDescriptions;return e.openBlock(),e.createElementBlock("div",{ref_key:"lsDescRef",ref:d,class:e.normalizeClass([e.unref(y),`column-${r.$attrs.column||1}`,r.$attrs.title||r.$attrs.extra||e.unref(o).title||e.unref(o).extra?"":"no-header"])},[e.createVNode(a,e.mergeProps(e.unref(S.default)(e.unref(k),r.$attrs),{border:""}),{title:e.withCtx(()=>[e.renderSlot(r.$slots,"title",{},void 0,!0)]),extra:e.withCtx(()=>[e.renderSlot(r.$slots,"extra",{},void 0,!0)]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.list,(t,g)=>(e.openBlock(),e.createBlock(i,{key:g,label:t==null?void 0:t.label},{label:e.withCtx(()=>{var s;return[e.createElementVNode("div",h,[(s=t.iconConfig)!=null&&s.name||e.unref(o).icon?(e.openBlock(),e.createBlock(_.default,e.mergeProps({key:0,ref_for:!0},t.iconConfig),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"icon",{},void 0,!0)]),_:2},1040)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t==null?void 0:t.label),1)])]}),default:e.withCtx(()=>{var s;return[t.type==="date"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.value?e.unref(b.default)(t.value).format(t.format||"YYYY-MM-DD HH:mm:ss"):"--"),1)],64)):t.type==="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(((s=t.propMap[t.value])==null?void 0:s.label)||"--"),1)],64)):t.type=="slot"?e.renderSlot(r.$slots,t.slotName,{key:2,data:t==null?void 0:t.value},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString((t==null?void 0:t.value)||"--"),1)],64))]}),_:2},1032,["label"]))),128))]),_:3},16)],2)}}});exports.default=D;
1
+ "use strict";var m=Object.defineProperty;var p=(c,o)=>m(c,"name",{value:o,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),C=,/* empty css */B=,/* empty css */_=,/* empty css */b=,/* empty css */h=,/* empty css */f=,/* empty css */S={class:"cell-item"},v=e.defineComponent({name:"LSDescriptions"}),D=e.defineComponent({...v,props:_.lsDescProp,setup(c){const o=e.useSlots(),l=c,k=e.ref({column:1}),d=e.ref(),y=b.useNamespace("descriptions").b();e.watch(()=>l.labelColor,async r=>{r&&s(r,1)},{deep:!0,immediate:!0}),e.watch(()=>l.labelBgColor,async r=>{r&&s(r,2)},{deep:!0,immediate:!0}),e.watch(()=>l.list,()=>{s(l.labelColor,2),s(l.labelBgColor,2)},{immediate:!0,deep:!0});async function s(r,u){var a;await e.nextTick(),(((a=d.value)==null?void 0:a.querySelectorAll(".el-descriptions__label"))||[]).forEach(t=>{u===1?t.style.color=r:u===2&&(t.style.backgroundColor=r)})}return p(s,"updateLabelStyle"),(r,u)=>{const i=f.ElDescriptionsItem,a=f.ElDescriptions;return e.openBlock(),e.createElementBlock("div",{ref_key:"lsDescRef",ref:d,class:e.normalizeClass([e.unref(y),`column-${r.$attrs.column||1}`,r.$attrs.title||r.$attrs.extra||e.unref(o).title||e.unref(o).extra?"":"no-header"])},[e.createVNode(a,e.mergeProps(e.unref(h.default)(e.unref(k),r.$attrs),{border:""}),{title:e.withCtx(()=>[e.renderSlot(r.$slots,"title",{},void 0,!0)]),extra:e.withCtx(()=>[e.renderSlot(r.$slots,"extra",{},void 0,!0)]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.list,(t,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[t.hide?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(i,{key:0,label:t==null?void 0:t.label},{label:e.withCtx(()=>{var n;return[e.createElementVNode("div",S,[(n=t.iconConfig)!=null&&n.name||e.unref(o).icon?(e.openBlock(),e.createBlock(C.default,e.mergeProps({key:0,ref_for:!0},t.iconConfig),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"icon",{},void 0,!0)]),_:2},1040)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t==null?void 0:t.label),1)])]}),default:e.withCtx(()=>{var n;return[t.type==="date"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.value?e.unref(B.default)(t.value).format(t.format||"YYYY-MM-DD HH:mm:ss"):"--"),1)],64)):t.type==="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(((n=t.propMap[t.value])==null?void 0:n.label)||"--"),1)],64)):t.type=="slot"?e.renderSlot(r.$slots,t.slotName,{key:2,data:t==null?void 0:t.value},void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString((t==null?void 0:t.value)||"--"),1)],64))]}),_:2},1032,["label"]))],64))),128))]),_:3},16)],2)}}});exports.default=D;
@@ -1,9 +1,9 @@
1
- var E = Object.defineProperty;
2
- var v = (y, l) => E(y, "name", { value: l, configurable: !0 });
1
+ var L = Object.defineProperty;
2
+ var v = (y, a) => L(y, "name", { value: a, configurable: !0 });
3
3
  /* empty css */
4
4
  /* empty css */
5
5
  /* empty css */
6
- import { defineComponent as S, useSlots as L, ref as g, watch as _, nextTick as V, openBlock as r, createElementBlock as c, normalizeClass as Y, unref as t, createVNode as w, mergeProps as D, withCtx as s, renderSlot as u, Fragment as i, renderList as M, createBlock as $, createElementVNode as A, createCommentVNode as H, createTextVNode as f, toDisplayString as m } from "vue";
6
+ import { defineComponent as S, useSlots as V, ref as g, watch as _, nextTick as Y, openBlock as r, createElementBlock as s, normalizeClass as w, unref as t, createVNode as M, mergeProps as D, withCtx as l, renderSlot as i, Fragment as d, renderList as A, createBlock as $, createElementVNode as H, createCommentVNode as h, createTextVNode as f, toDisplayString as m } from "vue";
7
7
  import I from "../../icon/Index.vue/index.js";
8
8
  import P from "../../../../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min/index.js";
9
9
  import { lsDescProp as R } from "../types/index.js";
@@ -16,11 +16,11 @@ const F = { class: "cell-item" }, x = S({
16
16
  ...x,
17
17
  props: R,
18
18
  setup(y) {
19
- const l = L(), a = y, h = g({
19
+ const a = V(), n = y, N = g({
20
20
  column: 1
21
- }), k = g(), N = T("descriptions").b();
21
+ }), k = g(), B = T("descriptions").b();
22
22
  _(
23
- () => a.labelColor,
23
+ () => n.labelColor,
24
24
  async (o) => {
25
25
  o && p(o, 1);
26
26
  },
@@ -29,7 +29,7 @@ const F = { class: "cell-item" }, x = S({
29
29
  immediate: !0
30
30
  }
31
31
  ), _(
32
- () => a.labelBgColor,
32
+ () => n.labelBgColor,
33
33
  async (o) => {
34
34
  o && p(o, 2);
35
35
  },
@@ -38,9 +38,9 @@ const F = { class: "cell-item" }, x = S({
38
38
  immediate: !0
39
39
  }
40
40
  ), _(
41
- () => a.list,
41
+ () => n.list,
42
42
  () => {
43
- p(a.labelColor, 2), p(a.labelBgColor, 2);
43
+ p(n.labelColor, 2), p(n.labelBgColor, 2);
44
44
  },
45
45
  {
46
46
  immediate: !0,
@@ -48,68 +48,70 @@ const F = { class: "cell-item" }, x = S({
48
48
  }
49
49
  );
50
50
  async function p(o, b) {
51
- var d;
52
- await V(), (((d = k.value) == null ? void 0 : d.querySelectorAll(".el-descriptions__label")) || []).forEach((e) => {
51
+ var u;
52
+ await Y(), (((u = k.value) == null ? void 0 : u.querySelectorAll(".el-descriptions__label")) || []).forEach((e) => {
53
53
  b === 1 ? e.style.color = o : b === 2 && (e.style.backgroundColor = o);
54
54
  });
55
55
  }
56
56
  return v(p, "updateLabelStyle"), (o, b) => {
57
- const C = q, d = z;
58
- return r(), c("div", {
57
+ const C = q, u = z;
58
+ return r(), s("div", {
59
59
  ref_key: "lsDescRef",
60
60
  ref: k,
61
- class: Y([
62
- t(N),
61
+ class: w([
62
+ t(B),
63
63
  `column-${o.$attrs.column || 1}`,
64
- o.$attrs.title || o.$attrs.extra || t(l).title || t(l).extra ? "" : "no-header"
64
+ o.$attrs.title || o.$attrs.extra || t(a).title || t(a).extra ? "" : "no-header"
65
65
  ])
66
66
  }, [
67
- w(d, D(t(j)(t(h), o.$attrs), { border: "" }), {
68
- title: s(() => [
69
- u(o.$slots, "title", {}, void 0, !0)
67
+ M(u, D(t(j)(t(N), o.$attrs), { border: "" }), {
68
+ title: l(() => [
69
+ i(o.$slots, "title", {}, void 0, !0)
70
70
  ]),
71
- extra: s(() => [
72
- u(o.$slots, "extra", {}, void 0, !0)
71
+ extra: l(() => [
72
+ i(o.$slots, "extra", {}, void 0, !0)
73
73
  ]),
74
- default: s(() => [
75
- (r(!0), c(i, null, M(o.list, (e, B) => (r(), $(C, {
76
- key: B,
77
- label: e == null ? void 0 : e.label
78
- }, {
79
- label: s(() => {
80
- var n;
81
- return [
82
- A("div", F, [
83
- (n = e.iconConfig) != null && n.name || t(l).icon ? (r(), $(I, D({
84
- key: 0,
85
- ref_for: !0
86
- }, e.iconConfig), {
87
- default: s(() => [
88
- u(o.$slots, "icon", {}, void 0, !0)
89
- ]),
90
- _: 2
91
- }, 1040)) : H("", !0),
92
- f(" " + m(e == null ? void 0 : e.label), 1)
93
- ])
94
- ];
95
- }),
96
- default: s(() => {
97
- var n;
98
- return [
99
- e.type === "date" ? (r(), c(i, { key: 0 }, [
100
- f(m(e.value ? t(P)(e.value).format(e.format || "YYYY-MM-DD HH:mm:ss") : "--"), 1)
101
- ], 64)) : e.type === "select" ? (r(), c(i, { key: 1 }, [
102
- f(m(((n = e.propMap[e.value]) == null ? void 0 : n.label) || "--"), 1)
103
- ], 64)) : e.type == "slot" ? u(o.$slots, e.slotName, {
104
- key: 2,
105
- data: e == null ? void 0 : e.value
106
- }, void 0, !0) : (r(), c(i, { key: 3 }, [
107
- f(m((e == null ? void 0 : e.value) || "--"), 1)
108
- ], 64))
109
- ];
110
- }),
111
- _: 2
112
- }, 1032, ["label"]))), 128))
74
+ default: l(() => [
75
+ (r(!0), s(d, null, A(o.list, (e, E) => (r(), s(d, { key: E }, [
76
+ e.hide ? h("", !0) : (r(), $(C, {
77
+ key: 0,
78
+ label: e == null ? void 0 : e.label
79
+ }, {
80
+ label: l(() => {
81
+ var c;
82
+ return [
83
+ H("div", F, [
84
+ (c = e.iconConfig) != null && c.name || t(a).icon ? (r(), $(I, D({
85
+ key: 0,
86
+ ref_for: !0
87
+ }, e.iconConfig), {
88
+ default: l(() => [
89
+ i(o.$slots, "icon", {}, void 0, !0)
90
+ ]),
91
+ _: 2
92
+ }, 1040)) : h("", !0),
93
+ f(" " + m(e == null ? void 0 : e.label), 1)
94
+ ])
95
+ ];
96
+ }),
97
+ default: l(() => {
98
+ var c;
99
+ return [
100
+ e.type === "date" ? (r(), s(d, { key: 0 }, [
101
+ f(m(e.value ? t(P)(e.value).format(e.format || "YYYY-MM-DD HH:mm:ss") : "--"), 1)
102
+ ], 64)) : e.type === "select" ? (r(), s(d, { key: 1 }, [
103
+ f(m(((c = e.propMap[e.value]) == null ? void 0 : c.label) || "--"), 1)
104
+ ], 64)) : e.type == "slot" ? i(o.$slots, e.slotName, {
105
+ key: 2,
106
+ data: e == null ? void 0 : e.value
107
+ }, void 0, !0) : (r(), s(d, { key: 3 }, [
108
+ f(m((e == null ? void 0 : e.value) || "--"), 1)
109
+ ], 64))
110
+ ];
111
+ }),
112
+ _: 2
113
+ }, 1032, ["label"]))
114
+ ], 64))), 128))
113
115
  ]),
114
116
  _: 3
115
117
  }, 16)
@@ -1 +1 @@
1
- "use strict";var x=Object.defineProperty;var l=(t,o)=>x(t,"name",{value:o,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("pdfjs-dist"),N=require("../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.cjs"),m=require("vue"),b=require("../pdfs/destination/index.cjs"),T=require("../pdfs/miscellaneous/index.cjs");function U(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const u in t)if(u!=="default"){const i=Object.getOwnPropertyDescriptor(t,u);Object.defineProperty(o,u,i.get?i:{enumerable:!0,get:l(()=>t[u],"get")})}}return o.default=t,Object.freeze(o)}l(U,"_interopNamespaceDefault");const P=U(E);function _(t){P.GlobalWorkerOptions.workerSrc=t}l(_,"configWorker");function q(t,o={onProgress:void 0,onPassword:void 0,onError:void 0,password:""}){var S;(S=P.GlobalWorkerOptions)!=null&&S.workerSrc||_(N.default);const u=m.shallowRef(),i=m.shallowRef(),D=m.shallowRef(0),k=m.shallowRef({});function v(d){i.value&&i.value.destroy();const a=P.getDocument(d);if(o.onProgress&&(a.onProgress=o.onProgress),o.onPassword)a.onPassword=o.onPassword;else if(o.password){const e=l(c=>{c(o.password??"")},"onPassword");a.onPassword=e}return a.promise.then(async e=>{i.value=e,u.value=e.loadingTask,D.value=e.numPages;const c=await e.getMetadata(),s=await e.getAttachments(),r=await e.getJSActions(),f=await e.getOutline();k.value={metadata:c,attachments:s,javascript:r,outline:f}},e=>{typeof o.onError=="function"&&o.onError(e)})}l(v,"processLoadingTask");async function L(d){var n;const a=await((n=u.value)==null?void 0:n.promise);if(!a)return null;const e=await b.getDestinationArray(a,d),c=await b.getDestinationRef(a,e);if(!c||!e)return null;const s=await a.getPageIndex(c),r=e[1].name,f=e.slice(2),p=b.isSpecLike(f)?b.getLocation(r,f):null;return{pageIndex:s,location:p??{type:"Fit",spec:[]}}}l(L,"getPDFDestination");async function j(d="filename"){var r;if(!i.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const a=await((r=i.value)==null?void 0:r.saveDocument()),e=new Blob([a],{type:"application/pdf"}),c=URL.createObjectURL(e),s=document.createElement("a");document.body.appendChild(s),s.href=c,s.download=d,s.style.display="none",s.click(),setTimeout(()=>{URL.revokeObjectURL(c),document.body.removeChild(s)},10)}l(j,"download");async function F(d=150,a="filename"){var R,C;if(!i.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const e=await((R=i.value)==null?void 0:R.saveDocument()),s=await P.getDocument(e.buffer).promise,r=d/72,f=96/72,p=await T.createIframe(),n=p.contentWindow;n.document.title=a;const I=[...Array(s.numPages).keys()].map(y=>y+1);for(const y of I){const h=await s.getPage(y),g=h.getViewport({scale:1});y===1&&T.addStylesToIframe(n,g.width*r/f,g.height*r/f);const w=document.createElement("canvas");w.width=g.width*r,w.height=g.height*r;const O=w.cloneNode();n==null||n.document.body.appendChild(O),await(h==null?void 0:h.render({canvasContext:w.getContext("2d"),intent:"print",transform:[r,0,0,r,0,0],viewport:g}).promise),(C=O.getContext("2d"))==null||C.drawImage(w,0,0)}n==null||n.focus(),n==null||n.print(),document.body.removeChild(p)}return l(F,"print"),m.isRef(t)?(t.value&&v(t.value),m.watch(t,()=>{t.value&&v(t.value)})):t&&v(t),{pdf:u,pages:D,info:k,print:F,download:j,getPDFDestination:L,processLoadingTask:v}}l(q,"usePDF");exports.usePDF=q;
1
+ "use strict";var U=Object.defineProperty;var c=(s,r)=>U(s,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("pdfjs-dist"),N=require("../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.cjs"),f=require("vue"),h=require("../pdfs/destination/index.cjs"),L=require("../pdfs/miscellaneous/index.cjs");function O(s){P.GlobalWorkerOptions.workerSrc=s}c(O,"configWorker");function q(s,r={onProgress:void 0,onPassword:void 0,onError:void 0,password:""}){var R;(R=P.GlobalWorkerOptions)!=null&&R.workerSrc||O(N.default);const b=f.shallowRef(),l=f.shallowRef(),D=f.shallowRef(0),k=f.shallowRef({});function g(u){l.value&&l.value.destroy();const o=P.getDocument(u);if(r.onProgress&&(o.onProgress=r.onProgress),r.onPassword)o.onPassword=r.onPassword;else if(r.password){const e=c(i=>{i(r.password??"")},"onPassword");o.onPassword=e}return o.promise.then(async e=>{l.value=e,b.value=e.loadingTask,D.value=e.numPages;const i=await e.getMetadata(),a=await e.getAttachments(),n=await e.getJSActions(),d=await e.getOutline();k.value={metadata:i,attachments:a,javascript:n,outline:d}},e=>{typeof r.onError=="function"&&r.onError(e)})}c(g,"processLoadingTask");async function I(u){var t;const o=await((t=b.value)==null?void 0:t.promise);if(!o)return null;const e=await h.getDestinationArray(o,u),i=await h.getDestinationRef(o,e);if(!i||!e)return null;const a=await o.getPageIndex(i),n=e[1].name,d=e.slice(2),v=h.isSpecLike(d)?h.getLocation(n,d):null;return{pageIndex:a,location:v??{type:"Fit",spec:[]}}}c(I,"getPDFDestination");async function x(u="filename"){var n;if(!l.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const o=await((n=l.value)==null?void 0:n.saveDocument()),e=new Blob([o],{type:"application/pdf"}),i=URL.createObjectURL(e),a=document.createElement("a");document.body.appendChild(a),a.href=i,a.download=u,a.style.display="none",a.click(),setTimeout(()=>{URL.revokeObjectURL(i),document.body.removeChild(a)},10)}c(x,"download");async function E(u=150,o="filename"){var S,C;if(!l.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const e=await((S=l.value)==null?void 0:S.saveDocument()),a=await P.getDocument(e.buffer).promise,n=u/72,d=96/72,v=await L.createIframe(),t=v.contentWindow;t.document.title=o;const F=[...Array(a.numPages).keys()].map(p=>p+1);for(const p of F){const y=await a.getPage(p),m=y.getViewport({scale:1});p===1&&L.addStylesToIframe(t,m.width*n/d,m.height*n/d);const w=document.createElement("canvas");w.width=m.width*n,w.height=m.height*n;const T=w.cloneNode();t==null||t.document.body.appendChild(T),await(y==null?void 0:y.render({canvasContext:w.getContext("2d"),intent:"print",transform:[n,0,0,n,0,0],viewport:m}).promise),(C=T.getContext("2d"))==null||C.drawImage(w,0,0)}t==null||t.focus(),t==null||t.print(),document.body.removeChild(v)}return c(E,"print"),f.isRef(s)?(s.value&&g(s.value),f.watch(s,()=>{s.value&&g(s.value)})):s&&g(s),{pdf:b,pages:D,info:k,print:E,download:x,getPDFDestination:I,processLoadingTask:g}}c(q,"usePDF");exports.usePDF=q;
@@ -1,26 +1,26 @@
1
- var E = Object.defineProperty;
2
- var c = (r, s) => E(r, "name", { value: s, configurable: !0 });
3
- import * as h from "pdfjs-dist";
1
+ var U = Object.defineProperty;
2
+ var c = (r, s) => U(r, "name", { value: s, configurable: !0 });
3
+ import { GlobalWorkerOptions as S, getDocument as R } from "pdfjs-dist";
4
4
  import F from "../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.js";
5
- import { shallowRef as y, isRef as U, watch as N } from "vue";
6
- import { getDestinationArray as A, getDestinationRef as O, isSpecLike as j, getLocation as B } from "../pdfs/destination/index.js";
5
+ import { shallowRef as y, isRef as N, watch as A } from "vue";
6
+ import { getDestinationArray as O, getDestinationRef as j, isSpecLike as B, getLocation as _ } from "../pdfs/destination/index.js";
7
7
  import { createIframe as G, addStylesToIframe as J } from "../pdfs/miscellaneous/index.js";
8
- function _(r) {
9
- h.GlobalWorkerOptions.workerSrc = r;
8
+ function M(r) {
9
+ S.workerSrc = r;
10
10
  }
11
- c(_, "configWorker");
12
- function K(r, s = {
11
+ c(M, "configWorker");
12
+ function X(r, s = {
13
13
  onProgress: void 0,
14
14
  onPassword: void 0,
15
15
  onError: void 0,
16
16
  password: ""
17
17
  }) {
18
- var k;
19
- (k = h.GlobalWorkerOptions) != null && k.workerSrc || _(F);
20
- const P = y(), l = y(), b = y(0), D = y({});
21
- function w(d) {
22
- l.value && l.value.destroy();
23
- const o = h.getDocument(d);
18
+ var D;
19
+ (D = S) != null && D.workerSrc || M(F);
20
+ const h = y(), d = y(), P = y(0), b = y({});
21
+ function w(l) {
22
+ d.value && d.value.destroy();
23
+ const o = R(l);
24
24
  if (s.onProgress && (o.onProgress = s.onProgress), s.onPassword)
25
25
  o.onPassword = s.onPassword;
26
26
  else if (s.password) {
@@ -31,9 +31,9 @@ function K(r, s = {
31
31
  }
32
32
  return o.promise.then(
33
33
  async (e) => {
34
- l.value = e, P.value = e.loadingTask, b.value = e.numPages;
34
+ d.value = e, h.value = e.loadingTask, P.value = e.numPages;
35
35
  const i = await e.getMetadata(), a = await e.getAttachments(), n = await e.getJSActions(), u = await e.getOutline();
36
- D.value = {
36
+ b.value = {
37
37
  metadata: i,
38
38
  attachments: a,
39
39
  javascript: n,
@@ -46,32 +46,32 @@ function K(r, s = {
46
46
  );
47
47
  }
48
48
  c(w, "processLoadingTask");
49
- async function R(d) {
49
+ async function T(l) {
50
50
  var t;
51
- const o = await ((t = P.value) == null ? void 0 : t.promise);
51
+ const o = await ((t = h.value) == null ? void 0 : t.promise);
52
52
  if (!o) return null;
53
- const e = await A(o, d), i = await O(o, e);
53
+ const e = await O(o, l), i = await j(o, e);
54
54
  if (!i || !e) return null;
55
- const a = await o.getPageIndex(i), n = e[1].name, u = e.slice(2), g = j(u) ? B(n, u) : null;
55
+ const a = await o.getPageIndex(i), n = e[1].name, u = e.slice(2), g = B(u) ? _(n, u) : null;
56
56
  return { pageIndex: a, location: g ?? { type: "Fit", spec: [] } };
57
57
  }
58
- c(R, "getPDFDestination");
59
- async function T(d = "filename") {
58
+ c(T, "getPDFDestination");
59
+ async function x(l = "filename") {
60
60
  var n;
61
- if (!l.value) throw new Error("Current PDFDocumentProxy have not loaded yet");
62
- const o = await ((n = l.value) == null ? void 0 : n.saveDocument()), e = new Blob([o], { type: "application/pdf" }), i = URL.createObjectURL(e), a = document.createElement("a");
63
- document.body.appendChild(a), a.href = i, a.download = d, a.style.display = "none", a.click(), setTimeout(() => {
61
+ if (!d.value) throw new Error("Current PDFDocumentProxy have not loaded yet");
62
+ const o = await ((n = d.value) == null ? void 0 : n.saveDocument()), e = new Blob([o], { type: "application/pdf" }), i = URL.createObjectURL(e), a = document.createElement("a");
63
+ document.body.appendChild(a), a.href = i, a.download = l, a.style.display = "none", a.click(), setTimeout(() => {
64
64
  URL.revokeObjectURL(i), document.body.removeChild(a);
65
65
  }, 10);
66
66
  }
67
- c(T, "download");
68
- async function x(d = 150, o = "filename") {
69
- var C, S;
70
- if (!l.value) throw new Error("Current PDFDocumentProxy have not loaded yet");
71
- const e = await ((C = l.value) == null ? void 0 : C.saveDocument()), a = await h.getDocument(e.buffer).promise, n = d / 72, u = 96 / 72, g = await G(), t = g.contentWindow;
67
+ c(x, "download");
68
+ async function I(l = 150, o = "filename") {
69
+ var k, C;
70
+ if (!d.value) throw new Error("Current PDFDocumentProxy have not loaded yet");
71
+ const e = await ((k = d.value) == null ? void 0 : k.saveDocument()), a = await R(e.buffer).promise, n = l / 72, u = 96 / 72, g = await G(), t = g.contentWindow;
72
72
  t.document.title = o;
73
- const I = [...Array(a.numPages).keys()].map((v) => v + 1);
74
- for (const v of I) {
73
+ const E = [...Array(a.numPages).keys()].map((v) => v + 1);
74
+ for (const v of E) {
75
75
  const p = await a.getPage(v), m = p.getViewport({ scale: 1 });
76
76
  v === 1 && J(
77
77
  t,
@@ -86,23 +86,23 @@ function K(r, s = {
86
86
  intent: "print",
87
87
  transform: [n, 0, 0, n, 0, 0],
88
88
  viewport: m
89
- }).promise), (S = L.getContext("2d")) == null || S.drawImage(f, 0, 0);
89
+ }).promise), (C = L.getContext("2d")) == null || C.drawImage(f, 0, 0);
90
90
  }
91
91
  t == null || t.focus(), t == null || t.print(), document.body.removeChild(g);
92
92
  }
93
- return c(x, "print"), U(r) ? (r.value && w(r.value), N(r, () => {
93
+ return c(I, "print"), N(r) ? (r.value && w(r.value), A(r, () => {
94
94
  r.value && w(r.value);
95
95
  })) : r && w(r), {
96
- pdf: P,
97
- pages: b,
98
- info: D,
99
- print: x,
100
- download: T,
101
- getPDFDestination: R,
96
+ pdf: h,
97
+ pages: P,
98
+ info: b,
99
+ print: I,
100
+ download: x,
101
+ getPDFDestination: T,
102
102
  processLoadingTask: w
103
103
  };
104
104
  }
105
- c(K, "usePDF");
105
+ c(X, "usePDF");
106
106
  export {
107
- K as usePDF
107
+ X as usePDF
108
108
  };
@@ -1 +1 @@
1
- "use strict";var F=Object.defineProperty;var c=(s,l)=>F(s,"name",{value:l,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),j=require("pdfjs-dist"),y=require("../annotations/index.cjs"),k=require("../linkService/index.cjs");function P(s){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const d=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(l,e,d.get?d:{enumerable:!0,get:c(()=>s[e],"get")})}}return l.default=s,Object.freeze(l)}c(P,"_interopNamespaceDefault");const T=P(j),L=i.defineComponent({__name:"Annotation",props:{page:{},viewport:{},document:{},annotationsFilter:{},annotationsMap:{},imageResourcesPath:{},hideForms:{type:Boolean},enableScripting:{type:Boolean},intent:{}},emits:["annotation","annotationLoaded"],setup(s,{emit:l}){const e=s,d=l,r=i.ref(),v=i.ref();function w(o){const t=y.annotationEventsHandler(o,e.document,v.value);Promise.resolve(t).then(n=>{n&&d("annotation",n)})}c(w,"annotationsEvents");async function M(){var t;return await((t=i.toRaw(e.document))==null?void 0:t.getFieldObjects())}c(M,"getFieldObjects");async function O(){var t;return await((t=i.toRaw(e.document))==null?void 0:t.hasJSActions())}c(O,"getHasJSActions");async function b(){const o=e.page;let t=await(o==null?void 0:o.getAnnotations({intent:e.intent}));if(e.annotationsFilter){const n=e.annotationsFilter;t=t.filter(u=>{const p=u.subtype,f=u.fieldType?`${p}.${u.fieldType}`:null;return(n==null?void 0:n.includes(p))||f!==null&&(n==null?void 0:n.includes(f))})}return t}c(b,"getAnnotations");async function S(){var h,_;(_=(h=r.value).replaceChildren)==null||_.call(h);for(const a of y.EVENTS_TO_HANDLER)r.value.removeEventListener(a,w);const o=i.toRaw(e.document),t=e.page,n=e.viewport;v.value=await b();const u=new Map([]);for(const a of v.value)if(a.subtype==="Widget"&&a.fieldType==="Btn"&&a.pushButton){const g=a.rect[2]-a.rect[0],E=a.rect[3]-a.rect[1],m=document.createElement("canvas");m.setAttribute("width",(g*n.scale).toString()),m.setAttribute("height",(E*n.scale).toString()),u.set(a.id,m)}const p=o.annotationStorage;if(e.annotationsMap)for(const[a,g]of Object.entries(e.annotationsMap))p.setValue(a,g);const f={accessibilityManager:void 0,annotationCanvasMap:u,div:r.value,page:t,viewport:n.clone({dontFlip:!0}),annotationEditorUIManager:null,l10n:null},A={annotations:v.value,viewport:n.clone({dontFlip:!0}),linkService:new k.SimpleLinkService,annotationCanvasMap:u,div:r.value,annotationStorage:p,renderForms:!e.hideForms,page:t,enableScripting:!1,hasJSActions:await O(),fieldObjects:await M(),downloadManager:null,imageResourcesPath:e.imageResourcesPath};new T.AnnotationLayer(f).render(A).then(async()=>{d("annotationLoaded",await b())});for(const a of y.EVENTS_TO_HANDLER)r.value.addEventListener(a,w)}return c(S,"render"),i.watch(()=>e.viewport,()=>{e.page&&e.viewport&&r.value&&S()}),i.onMounted(()=>{e.page&&e.viewport&&r.value&&S()}),(o,t)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"layer",ref:r,class:"annotationLayer",style:{display:"block"}},null,512))}});exports.default=L;
1
+ "use strict";var k=Object.defineProperty;var c=(p,v)=>k(p,"name",{value:v,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),T=require("pdfjs-dist"),m=require("../annotations/index.cjs"),L=require("../linkService/index.cjs"),O=i.defineComponent({__name:"Annotation",props:{page:{},viewport:{},document:{},annotationsFilter:{},annotationsMap:{},imageResourcesPath:{},hideForms:{type:Boolean},enableScripting:{type:Boolean},intent:{}},emits:["annotation","annotationLoaded"],setup(p,{emit:v}){const t=p,y=v,s=i.ref(),u=i.ref();function w(o){const e=m.annotationEventsHandler(o,t.document,u.value);Promise.resolve(e).then(n=>{n&&y("annotation",n)})}c(w,"annotationsEvents");async function E(){var e;return await((e=i.toRaw(t.document))==null?void 0:e.getFieldObjects())}c(E,"getFieldObjects");async function M(){var e;return await((e=i.toRaw(t.document))==null?void 0:e.hasJSActions())}c(M,"getHasJSActions");async function h(){const o=t.page;let e=await(o==null?void 0:o.getAnnotations({intent:t.intent}));if(t.annotationsFilter){const n=t.annotationsFilter;e=e.filter(r=>{const l=r.subtype,d=r.fieldType?`${l}.${r.fieldType}`:null;return(n==null?void 0:n.includes(l))||d!==null&&(n==null?void 0:n.includes(d))})}return e}c(h,"getAnnotations");async function S(){var b,A;(A=(b=s.value).replaceChildren)==null||A.call(b);for(const a of m.EVENTS_TO_HANDLER)s.value.removeEventListener(a,w);const o=i.toRaw(t.document),e=t.page,n=t.viewport;u.value=await h();const r=new Map([]);for(const a of u.value)if(a.subtype==="Widget"&&a.fieldType==="Btn"&&a.pushButton){const f=a.rect[2]-a.rect[0],F=a.rect[3]-a.rect[1],g=document.createElement("canvas");g.setAttribute("width",(f*n.scale).toString()),g.setAttribute("height",(F*n.scale).toString()),r.set(a.id,g)}const l=o.annotationStorage;if(t.annotationsMap)for(const[a,f]of Object.entries(t.annotationsMap))l.setValue(a,f);const d={accessibilityManager:void 0,annotationCanvasMap:r,div:s.value,page:e,viewport:n.clone({dontFlip:!0}),annotationEditorUIManager:null,l10n:null},_={annotations:u.value,viewport:n.clone({dontFlip:!0}),linkService:new L.SimpleLinkService,annotationCanvasMap:r,div:s.value,annotationStorage:l,renderForms:!t.hideForms,page:e,enableScripting:!1,hasJSActions:await M(),fieldObjects:await E(),downloadManager:null,imageResourcesPath:t.imageResourcesPath};new T.AnnotationLayer(d).render(_).then(async()=>{y("annotationLoaded",await h())});for(const a of m.EVENTS_TO_HANDLER)s.value.addEventListener(a,w)}return c(S,"render"),i.watch(()=>t.viewport,()=>{t.page&&t.viewport&&s.value&&S()}),i.onMounted(()=>{t.page&&t.viewport&&s.value&&S()}),(o,e)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"layer",ref:s,class:"annotationLayer",style:{display:"block"}},null,512))}});exports.default=O;
@@ -1,10 +1,10 @@
1
1
  var L = Object.defineProperty;
2
2
  var r = (d, p) => L(d, "name", { value: p, configurable: !0 });
3
- import { defineComponent as O, ref as A, watch as P, onMounted as T, openBlock as j, createElementBlock as B, toRaw as m } from "vue";
4
- import * as H from "pdfjs-dist";
5
- import { EVENTS_TO_HANDLER as F, annotationEventsHandler as J } from "../annotations/index.js";
6
- import { SimpleLinkService as C } from "../linkService/index.js";
7
- const W = /* @__PURE__ */ O({
3
+ import { defineComponent as O, ref as A, watch as T, onMounted as j, openBlock as B, createElementBlock as H, toRaw as m } from "vue";
4
+ import { AnnotationLayer as P } from "pdfjs-dist";
5
+ import { EVENTS_TO_HANDLER as M, annotationEventsHandler as C } from "../annotations/index.js";
6
+ import { SimpleLinkService as J } from "../linkService/index.js";
7
+ const D = /* @__PURE__ */ O({
8
8
  __name: "Annotation",
9
9
  props: {
10
10
  page: {},
@@ -21,22 +21,22 @@ const W = /* @__PURE__ */ O({
21
21
  setup(d, { emit: p }) {
22
22
  const t = d, g = p, i = A(), l = A();
23
23
  function y(o) {
24
- const n = J(o, t.document, l.value);
24
+ const n = C(o, t.document, l.value);
25
25
  Promise.resolve(n).then((e) => {
26
26
  e && g("annotation", e);
27
27
  });
28
28
  }
29
29
  r(y, "annotationsEvents");
30
- async function M() {
30
+ async function E() {
31
31
  var n;
32
32
  return await ((n = m(t.document)) == null ? void 0 : n.getFieldObjects());
33
33
  }
34
- r(M, "getFieldObjects");
35
- async function E() {
34
+ r(E, "getFieldObjects");
35
+ async function F() {
36
36
  var n;
37
37
  return await ((n = m(t.document)) == null ? void 0 : n.hasJSActions());
38
38
  }
39
- r(E, "getHasJSActions");
39
+ r(F, "getHasJSActions");
40
40
  async function w() {
41
41
  const o = t.page;
42
42
  let n = await (o == null ? void 0 : o.getAnnotations({ intent: t.intent }));
@@ -53,7 +53,7 @@ const W = /* @__PURE__ */ O({
53
53
  async function h() {
54
54
  var b, S;
55
55
  (S = (b = i.value).replaceChildren) == null || S.call(b);
56
- for (const a of F) i.value.removeEventListener(a, y);
56
+ for (const a of M) i.value.removeEventListener(a, y);
57
57
  const o = m(t.document), n = t.page, e = t.viewport;
58
58
  l.value = await w();
59
59
  const s = /* @__PURE__ */ new Map([]);
@@ -76,31 +76,31 @@ const W = /* @__PURE__ */ O({
76
76
  }, k = {
77
77
  annotations: l.value,
78
78
  viewport: e.clone({ dontFlip: !0 }),
79
- linkService: new C(),
79
+ linkService: new J(),
80
80
  annotationCanvasMap: s,
81
81
  div: i.value,
82
82
  annotationStorage: c,
83
83
  renderForms: !t.hideForms,
84
84
  page: n,
85
85
  enableScripting: !1,
86
- hasJSActions: await E(),
87
- fieldObjects: await M(),
86
+ hasJSActions: await F(),
87
+ fieldObjects: await E(),
88
88
  downloadManager: null,
89
89
  imageResourcesPath: t.imageResourcesPath
90
90
  };
91
- new H.AnnotationLayer(u).render(k).then(async () => {
91
+ new P(u).render(k).then(async () => {
92
92
  g("annotationLoaded", await w());
93
93
  });
94
- for (const a of F) i.value.addEventListener(a, y);
94
+ for (const a of M) i.value.addEventListener(a, y);
95
95
  }
96
- return r(h, "render"), P(
96
+ return r(h, "render"), T(
97
97
  () => t.viewport,
98
98
  () => {
99
99
  t.page && t.viewport && i.value && h();
100
100
  }
101
- ), T(() => {
101
+ ), j(() => {
102
102
  t.page && t.viewport && i.value && h();
103
- }), (o, n) => (j(), B("div", {
103
+ }), (o, n) => (B(), H("div", {
104
104
  ref_key: "layer",
105
105
  ref: i,
106
106
  class: "annotationLayer",
@@ -109,5 +109,5 @@ const W = /* @__PURE__ */ O({
109
109
  }
110
110
  });
111
111
  export {
112
- W as default
112
+ D as default
113
113
  };
@@ -1 +1 @@
1
- "use strict";var D=Object.defineProperty;var r=(s,f)=>D(s,"name",{value:f,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),j=require("pdfjs-dist"),z=;/* empty css */;/* empty css */const H=,/* empty css */J=;/* empty css */;/* empty css */const X=;/* empty css */function I(s){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const p in s)if(p!=="default"){const o=Object.getOwnPropertyDescriptor(s,p);Object.defineProperty(f,p,o.get?o:{enumerable:!0,get:r(()=>s[p],"get")})}}return f.default=s,Object.freeze(f)}r(I,"_interopNamespaceDefault");const C=I(j),G=n.defineComponent({name:"LSPdf"}),K=n.defineComponent({...G,props:{pdf:{},page:{default:1},scale:{default:1},rotation:{},fitParent:{type:Boolean},width:{},height:{},textLayer:{type:Boolean},imageResourcesPath:{},hideForms:{type:Boolean},intent:{default:"display"},annotationLayer:{type:Boolean},annotationsFilter:{},annotationsMap:{},watermarkText:{},watermarkOptions:{},highlightText:{},highlightOptions:{}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(s,{expose:f,emit:p}){const o=s,u=p;n.watch(()=>o.pdf,()=>{W()},{immediate:!0,deep:!0});const v=n.ref(),y=n.ref(),_=n.ref(!1);let x;const c=n.computed(()=>({viewport:void 0,document:void 0,page:void 0})),A=n.computed(()=>({annotationsMap:o.annotationsMap,annotationsFilter:o.annotationsFilter,imageResourcesPath:o.imageResourcesPath,hideForms:o.hideForms,intent:o.intent})),O=n.computed(()=>({highlightText:o.highlightText,highlightOptions:o.highlightOptions}));function T(){return X.default({},{columns:4,rows:4,rotation:45,fontSize:18,color:"rgba(211, 210, 211, 0.4)"},o.watermarkOptions)}r(T,"getWatermarkOptionsWithDefaults");function b(a){if(!(typeof a=="number"&&a%90===0))return 0;const e=a/90;return e>4?b(a-360):e<0?b(a+360):a}r(b,"getRotation");function B(a){let e=o.scale;if(o.fitParent){const t=v.value.parentNode.clientWidth,i=a.getViewport({scale:1}).width;e=t/i}else if(o.width){const t=a.getViewport({scale:1}).width;e=o.width/t}else if(o.height){const t=a.getViewport({scale:1}).height;e=o.height/t}return e}r(B,"getScale");function F(a=1){if(!o.watermarkText)return;const e=M();if(!e)return;const t=e.getContext("2d");if(!t)return;const i=T(),h=o.watermarkText,l=i.columns,g=i.rows,d=l*g,w=i.rotation,P=i.fontSize*a;t.font=`${P}px Trebuchet MS`,t.fillStyle=i.color;for(let m=0;m<d;m++){const k=m%l*(e.width/l)+e.width/(l*2),q=Math.floor(m/l)*(e.height/g)+e.height/(g*2),$=t.measureText(h).width;t.save(),t.translate(k,q),t.rotate(-w*(Math.PI/180)),t.fillText(h,-$/2,P/2),t.restore()}}r(F,"paintWatermark");function M(){var e;let a=null;return(e=v.value)==null||e.childNodes.forEach(t=>{t.tagName==="CANVAS"&&(a=t)}),a}r(M,"getCurrentCanvas");function N(a){var h;let e;const t=M();t&&(t==null?void 0:t.getAttribute("role"))==="main"?e=t:(e=document.createElement("canvas"),e.style.display="block",e.setAttribute("dir","ltr"));const i=window.devicePixelRatio||1;return e.width=Math.floor(a.width*i),e.height=Math.floor(a.height*i),e.style.width=`${Math.floor(a.width)}px`,e.style.height=`${Math.floor(a.height)}px`,e.setAttribute("class","pdf-canvas"),(h=v.value)==null||h.style.setProperty("--scale-factor",`${a.scale}`),y.value.style.width=`${Math.floor(a.width)}px`,y.value.style.height=`${Math.floor(a.height)}px`,y.value.style.top="0",y.value.style.left="0",_.value=!0,e}r(N,"setupCanvas");function S(){x&&x.cancel()}r(S,"cancelRender");function L(a){var e;(e=n.toRaw(c.value.document))==null||e.getPage(a).then(t=>{var k;S();const i=t.getViewport(),h={scale:B(t),rotation:b((o.rotation||0)+i.rotation)},l=t.getViewport(h),g=M(),d=N(l),w=window.devicePixelRatio||1,P=w!==1?[w,0,0,w,0,0]:void 0,m={canvasContext:d.getContext("2d"),viewport:l,annotationMode:o.hideForms?C.AnnotationMode.ENABLE:C.AnnotationMode.ENABLE_FORMS,transform:P,intent:o.intent};(d==null?void 0:d.getAttribute("role"))!=="main"?g&&((k=v.value)==null||k.replaceChild(d,g)):d.removeAttribute("role"),c.value.page=t,c.value.viewport=l,x=t.render(m),x.promise.then(()=>{_.value=!1,F(l.scale),u("loaded",c.value.viewport),u("loadComplete")}).catch(()=>{u("loadError")})})}r(L,"renderPage");function V(a){a.promise&&a.promise.then(async e=>{c.value.document=e,L(o.page)})}r(V,"initDoc"),n.watch(()=>[o.page,o.scale,o.width,o.height,o.rotation,o.hideForms,o.intent],()=>{L(o.page)});function E(){L(o.page)}r(E,"reload");function R(){S()}r(R,"cancel");async function W(){if(o.pdf)try{V(o.pdf)}finally{}}return r(W,"initPdf"),f({reload:E,cancel:R}),(a,e)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"container",ref:v,style:{position:"relative",display:"block"}},[e[5]||(e[5]=n.createElementVNode("canvas",{dir:"ltr",style:{display:"block"},role:"main"},null,-1)),a.annotationLayer?(n.openBlock(),n.createBlock(z.default,n.mergeProps({key:0},{...n.unref(c),...n.unref(A)},{onAnnotation:e[0]||(e[0]=t=>u("annotation",t)),onAnnotationLoaded:e[1]||(e[1]=t=>u("annotationLoaded",t))}),null,16)):n.createCommentVNode("",!0),a.textLayer?(n.openBlock(),n.createBlock(H.default,n.mergeProps({key:1},{...n.unref(c),...n.unref(O)},{onHighlight:e[2]||(e[2]=t=>u("highlight",t)),onTextLoaded:e[3]||(e[3]=t=>u("textLoaded",t))}),null,16)):n.createCommentVNode("",!0),n.createVNode(J.default,n.mergeProps({...n.unref(c)},{onXfaLoaded:e[4]||(e[4]=t=>u("xfaLoaded"))}),null,16),n.withDirectives(n.createElementVNode("div",{ref_key:"loadingLayer",ref:y,style:{position:"absolute"}},[n.renderSlot(a.$slots,"default")],512),[[n.vShow,n.unref(_)]])],512))}});exports.default=K;
1
+ "use strict";var D=Object.defineProperty;var i=(x,k)=>D(x,"name",{value:k,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),A=require("pdfjs-dist"),z=;/* empty css */;/* empty css */const H=,/* empty css */X=;/* empty css */;/* empty css */const j=,/* empty css */I=o.defineComponent({name:"LSPdf"}),J=o.defineComponent({...I,props:{pdf:{},page:{default:1},scale:{default:1},rotation:{},fitParent:{type:Boolean},width:{},height:{},textLayer:{type:Boolean},imageResourcesPath:{},hideForms:{type:Boolean},intent:{default:"display"},annotationLayer:{type:Boolean},annotationsFilter:{},annotationsMap:{},watermarkText:{},watermarkOptions:{},highlightText:{},highlightOptions:{}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(x,{expose:k,emit:S}){const n=x,s=S;o.watch(()=>n.pdf,()=>{W()},{immediate:!0,deep:!0});const p=o.ref(),g=o.ref(),P=o.ref(!1);let v;const u=o.computed(()=>({viewport:void 0,document:void 0,page:void 0})),b=o.computed(()=>({annotationsMap:n.annotationsMap,annotationsFilter:n.annotationsFilter,imageResourcesPath:n.imageResourcesPath,hideForms:n.hideForms,intent:n.intent})),T=o.computed(()=>({highlightText:n.highlightText,highlightOptions:n.highlightOptions}));function B(){return j.default({},{columns:4,rows:4,rotation:45,fontSize:18,color:"rgba(211, 210, 211, 0.4)"},n.watermarkOptions)}i(B,"getWatermarkOptionsWithDefaults");function _(a){if(!(typeof a=="number"&&a%90===0))return 0;const e=a/90;return e>4?_(a-360):e<0?_(a+360):a}i(_,"getRotation");function V(a){let e=n.scale;if(n.fitParent){const t=p.value.parentNode.clientWidth,r=a.getViewport({scale:1}).width;e=t/r}else if(n.width){const t=a.getViewport({scale:1}).width;e=n.width/t}else if(n.height){const t=a.getViewport({scale:1}).height;e=n.height/t}return e}i(V,"getScale");function E(a=1){if(!n.watermarkText)return;const e=L();if(!e)return;const t=e.getContext("2d");if(!t)return;const r=B(),c=n.watermarkText,l=r.columns,f=r.rows,d=l*f,m=r.rotation,y=r.fontSize*a;t.font=`${y}px Trebuchet MS`,t.fillStyle=r.color;for(let h=0;h<d;h++){const w=h%l*(e.width/l)+e.width/(l*2),q=Math.floor(h/l)*(e.height/f)+e.height/(f*2),$=t.measureText(c).width;t.save(),t.translate(w,q),t.rotate(-m*(Math.PI/180)),t.fillText(c,-$/2,y/2),t.restore()}}i(E,"paintWatermark");function L(){var e;let a=null;return(e=p.value)==null||e.childNodes.forEach(t=>{t.tagName==="CANVAS"&&(a=t)}),a}i(L,"getCurrentCanvas");function F(a){var c;let e;const t=L();t&&(t==null?void 0:t.getAttribute("role"))==="main"?e=t:(e=document.createElement("canvas"),e.style.display="block",e.setAttribute("dir","ltr"));const r=window.devicePixelRatio||1;return e.width=Math.floor(a.width*r),e.height=Math.floor(a.height*r),e.style.width=`${Math.floor(a.width)}px`,e.style.height=`${Math.floor(a.height)}px`,e.setAttribute("class","pdf-canvas"),(c=p.value)==null||c.style.setProperty("--scale-factor",`${a.scale}`),g.value.style.width=`${Math.floor(a.width)}px`,g.value.style.height=`${Math.floor(a.height)}px`,g.value.style.top="0",g.value.style.left="0",P.value=!0,e}i(F,"setupCanvas");function C(){v&&v.cancel()}i(C,"cancelRender");function M(a){var e;(e=o.toRaw(u.value.document))==null||e.getPage(a).then(t=>{var w;C();const r=t.getViewport(),c={scale:V(t),rotation:_((n.rotation||0)+r.rotation)},l=t.getViewport(c),f=L(),d=F(l),m=window.devicePixelRatio||1,y=m!==1?[m,0,0,m,0,0]:void 0,h={canvasContext:d.getContext("2d"),viewport:l,annotationMode:n.hideForms?A.AnnotationMode.ENABLE:A.AnnotationMode.ENABLE_FORMS,transform:y,intent:n.intent};(d==null?void 0:d.getAttribute("role"))!=="main"?f&&((w=p.value)==null||w.replaceChild(d,f)):d.removeAttribute("role"),u.value.page=t,u.value.viewport=l,v=t.render(h),v.promise.then(()=>{P.value=!1,E(l.scale),s("loaded",u.value.viewport),s("loadComplete")}).catch(()=>{s("loadError")})})}i(M,"renderPage");function N(a){a.promise&&a.promise.then(async e=>{u.value.document=e,M(n.page)})}i(N,"initDoc"),o.watch(()=>[n.page,n.scale,n.width,n.height,n.rotation,n.hideForms,n.intent],()=>{M(n.page)});function O(){M(n.page)}i(O,"reload");function R(){C()}i(R,"cancel");async function W(){if(n.pdf)try{N(n.pdf)}finally{}}return i(W,"initPdf"),k({reload:O,cancel:R}),(a,e)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"container",ref:p,style:{position:"relative",display:"block"}},[e[5]||(e[5]=o.createElementVNode("canvas",{dir:"ltr",style:{display:"block"},role:"main"},null,-1)),a.annotationLayer?(o.openBlock(),o.createBlock(z.default,o.mergeProps({key:0},{...o.unref(u),...o.unref(b)},{onAnnotation:e[0]||(e[0]=t=>s("annotation",t)),onAnnotationLoaded:e[1]||(e[1]=t=>s("annotationLoaded",t))}),null,16)):o.createCommentVNode("",!0),a.textLayer?(o.openBlock(),o.createBlock(H.default,o.mergeProps({key:1},{...o.unref(u),...o.unref(T)},{onHighlight:e[2]||(e[2]=t=>s("highlight",t)),onTextLoaded:e[3]||(e[3]=t=>s("textLoaded",t))}),null,16)):o.createCommentVNode("",!0),o.createVNode(X.default,o.mergeProps({...o.unref(u)},{onXfaLoaded:e[4]||(e[4]=t=>s("xfaLoaded"))}),null,16),o.withDirectives(o.createElementVNode("div",{ref_key:"loadingLayer",ref:g,style:{position:"absolute"}},[o.renderSlot(a.$slots,"default")],512),[[o.vShow,o.unref(P)]])],512))}});exports.default=J;