@docling/docling-components 0.0.3 → 0.0.4

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Docling Components
2
2
 
3
- Web components for displaying Docling output, which simplifies document processing, parsing diverse formats — including advanced PDF understanding. This package requires the JSON output of documents that are converted by [Docling](https://ds4sd.github.io/docling).
3
+ Web components for displaying Docling output, which simplifies document processing, parsing diverse formats — including advanced PDF understanding. This package requires the JSON output of documents that are converted by [Docling](https://docling.io). Get started with the [interactive examples](https://docling-project.github.io/docling-ts/examples).
4
4
 
5
5
  ## Install package
6
6
 
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ ${i.map(f=>`
27
27
  ${l}in ${f}`).join("")}
28
28
  `}),re(e,"component_stack",{value:i});let _=e.stack;if(_){let f=_.split(`
29
29
  `),a=[];for(let c=0;c<f.length;c++){let u=f[c];u.includes("svelte/src/internal")||a.push(u)}re(e,"stack",{value:a.join(`
30
- `)})}if($o(e,t),wo(t))throw e}function Io(e,t,r=0){var n=e.reactions;if(n!==null)for(var i=0;i<n.length;i++){var o=n[i];o.f&2?Io(o,t,r+1):t===o&&(r===0?ce(o,2048):o.f&1024&&ce(o,4096),Lt(o))}}function br(e){var t=Te,r=Se,n=Ze,i=O,o=lt,s=Be,p=C,l=Ve,_=e.f;Te=null,Se=0,Ze=null,O=_&96?null:e,lt=!st&&(_&256)!==0,Be=null,C=e.ctx,Ve=!1,Ar++;try{var f=(0,e.fn)(),a=e.deps;if(Te!==null){var c;if(Tt(e,Se),a!==null&&Se>0)for(a.length=Se+Te.length,c=0;c<Te.length;c++)a[Se+c]=Te[c];else e.deps=a=Te;if(!lt)for(c=Se;c<a.length;c++)(a[c].reactions??=[]).push(e)}else a!==null&&Se<a.length&&(Tt(e,Se),a.length=Se);if(at()&&Ze!==null&&!(e.f&6146))for(c=0;c<Ze.length;c++)Io(Ze[c],e);return i!==null&&Ar++,f}finally{Te=t,Se=r,Ze=n,O=i,lt=o,Be=s,C=p,Ve=l}}function yi(e,t){let r=t.reactions;if(r!==null){var n=Mn.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}r===null&&t.f&2&&(Te===null||!Te.includes(t))&&(ce(t,4096),t.f&768||(t.f^=512),Tt(t,0))}function Tt(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)yi(e,r[n])}function Ot(e){var t=e.f;if(!(t&16384)){ce(e,1024);var r=I,n=C;if(I=e,x){var i=ke;ke=e.component_function}try{t&16?mo(e):dn(e),_n(e),pn(e);var o=br(e);e.teardown=typeof o=="function"?o:null,e.wv=So;var s=e.deps;if(x&&Ke&&e.f&2048&&s!==null)for(let l=0;l<s.length;l++){var p=s[l];p.trace_need_increase&&(p.wv=tr(),p.trace_need_increase=void 0,p.trace_v=void 0)}x&&lr.push(e)}catch(l){Ht(l,e,r,n||e.ctx)}finally{I=r,x&&(ke=i)}}}function Eo(){console.error("Last ten effects were: ",lr.slice(-10).map(e=>e.fn)),lr=[]}function No(){if(Yt>1e3){Yt=0;try{Yn()}catch(e){if(x&&re(e,"stack",{value:""}),Vt!==null)if(x)try{Ht(e,Vt,null,null)}catch(t){throw Eo(),t}else Ht(e,Vt,null,null);else throw x&&Eo(),e}}Yt++}function Do(e){var t=e.length;if(t!==0){No();var r=st;st=!0;try{for(var n=0;n<t;n++){var i=e[n];i.f&1024||(i.f^=1024);var o=[];Ro(i,o),bi(o)}}finally{st=r}}}function bi(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var n=e[r];if(!(n.f&24576))try{_t(n)&&(Ot(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?mn(n):n.fn=null))}catch(i){Ht(i,n,null,n.ctx)}}}function $i(){if(ar=!1,Yt>1001)return;let e=At;At=[],Do(e),ar||(Yt=0,Vt=null,x&&(lr=[]))}function Lt(e){Tr===Ao&&(ar||(ar=!0,queueMicrotask($i))),Vt=e;for(var t=e;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024))return;t.f^=1024}}At.push(t)}function Ro(e,t){var r=e.first,n=[];e:for(;r!==null;){var i=r.f,o=(i&32)!==0,s=o&&(i&1024)!==0,p=r.next;if(!s&&!(i&8192))if(i&8){if(o)r.f^=1024;else try{_t(r)&&Ot(r)}catch(a){Ht(a,r,null,r.ctx)}var l=r.first;if(l!==null){r=l;continue}}else i&4&&n.push(r);if(p===null){let a=r.parent;for(;a!==null;){if(e===a)break e;var _=a.next;if(_!==null){r=_;continue e}a=a.parent}}r=p}for(var f=0;f<n.length;f++)l=n[f],t.push(l),Ro(l,t)}function b(e){var t=Tr,r=At;try{No();let i=[];Tr=xi,At=i,ar=!1,Do(r);var n=e?.();return yo(),(At.length>0||i.length>0)&&b(),Yt=0,Vt=null,x&&(lr=[]),n}finally{Tr=t,At=r}}function d(e){var t=e.f,r=(t&2)!==0;if(r&&t&16384){var n=an(e);return sr(e),n}if(er!==null&&er.add(e),O!==null&&!Ve){Be!==null&&Be.includes(e)&&Wn();var i=O.deps;e.rv<Ar&&(e.rv=Ar,Te===null&&i!==null&&i[Se]===e?Se++:Te===null?Te=[e]:Te.push(e))}else if(r&&e.deps===null)for(var o=e,s=o.parent,p=o;s!==null;)if(s.f&2){var l=s;p=l,s=l.parent}else{var _=s;_.deriveds?.includes(p)||(_.deriveds??=[]).push(p);break}if(r&&(o=e,_t(o)&&ln(o)),x&&Ke&&Qt!==null&&O!==null&&Qt.reaction===O){if(e.debug)e.debug();else if(e.created){var f=Qt.entries.get(e);f===void 0&&(f={read:[]},Qt.entries.set(e,f)),f.read.push(nt("TracedAt"))}}return e.v}function J(e){var t=Ve;try{return Ve=!0,e()}finally{Ve=t}}var wi=-7169;function ce(e,t){e.f=e.f&wi|t}function Q(e,t=!1,r){C={p:C,c:null,e:null,m:!1,s:e,x:null,l:null},pt&&!t&&(C.l={s:null,u:null,r1:[],r2:z(!1)}),x&&(C.function=r,ke=r)}function ee(e){let t=C;if(t!==null){e!==void 0&&(t.x=e);let s=t.e;if(s!==null){var r=I,n=O;t.e=null;try{for(var i=0;i<s.length;i++){var o=s[i];W(o.effect),ae(o.reaction),tt(o.fn)}}finally{W(r),ae(n)}}C=t.p,x&&(ke=t.p?.function??null),t.m=!0}return e||{}}if(x){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;zn(t)},set:n=>{r=n}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}var Co=new Map;function Po(e,t){var r=Co.get(e);r||(r=new Set,Co.set(e,r)),r.add(t)}function xn(e){var t=O,r=I;ae(null),W(null);try{return e()}finally{ae(t),W(r)}}var yn=new Set,Nr=new Set;function Oo(e,t,r,n={}){function i(o){if(n.capture||zt.call(t,o),!o.cancelBubble)return xn(()=>r?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ae(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function Dr(e,t,r,n,i){var o={capture:n,passive:i},s=Oo(e,t,r,o);(t===document.body||t===window||t===document)&&Fe(()=>{t.removeEventListener(e,s,o)})}function Ut(e){for(var t=0;t<e.length;t++)yn.add(e[t]);for(var r of Nr)r(e)}function zt(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],o=i[0]||e.target,s=0,p=e.__root;if(p){var l=i.indexOf(p);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var _=i.indexOf(t);if(_===-1)return;l<=_&&(s=l)}if(o=i[s]||e.target,o!==t){re(e,"currentTarget",{configurable:!0,get(){return o||r}});var f=O,a=I;ae(null),W(null);try{for(var c,u=[];o!==null;){var g=o.assignedSlot||o.parentNode||o.host||null;try{var m=o["__"+n];if(m!==void 0&&!o.disabled)if(qe(m)){var[$,...h]=m;$.apply(o,[e,...h])}else m.call(o,e)}catch(v){c?u.push(v):c=v}if(e.cancelBubble||g===t||g===null)break;o=g}if(c){for(let v of u)queueMicrotask(()=>{throw v});throw c}}finally{e.__root=t,delete e.currentTarget,ae(f),W(a)}}}var ki;function Lo(){ki=void 0}function fr(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function xe(e,t){var r=I;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function L(e,t){var r=(t&1)!==0,n=(t&2)!==0,i,o=!e.startsWith("<!>");return()=>{if(T)return xe(S,null),S;i===void 0&&(i=fr(o?e:"<!>"+e),r||(i=G(i)));var s=n?document.importNode(i,!0):i.cloneNode(!0);if(r){var p=G(s),l=s.lastChild;xe(p,l)}else xe(s,s);return s}}function St(e,t,r="svg"){var n=!e.startsWith("<!>"),i=(t&1)!==0,o=`<${r}>${n?e:"<!>"+e}</${r}>`,s;return()=>{if(T)return xe(S,null),S;if(!s){var p=fr(o),l=G(p);if(i)for(s=document.createDocumentFragment();G(l);)s.appendChild(G(l));else s=G(l)}var _=s.cloneNode(!0);if(i){var f=G(_),a=_.lastChild;xe(f,a)}else xe(_,_);return _}}function cr(e=""){if(!T){var t=we(e+"");return xe(t,t),t}var r=S;return r.nodeType!==3&&(r.before(r=we()),Y(r)),xe(r,r),r}function H(){if(T)return xe(S,null),S;var e=document.createDocumentFragment(),t=document.createComment(""),r=we();return e.append(t,r),xe(t,r),e}function k(e,t){if(T){I.nodes_end=S,se();return}e!==null&&e.before(t)}var bn=!0;function Ie(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r==null?"":r+"")}function Rr(e,t){return Fo(e,t)}function wn(e,t){yr(),t.intro=t.intro??!1;let r=t.target,n=T,i=S;try{for(var o=G(r);o&&(o.nodeType!==8||o.data!==Dt);)o=he(o);if(!o)throw ut;$e(!0),Y(o),se();let s=Fo(e,{...t,anchor:o});if(S===null||S.nodeType!==8||S.data!==bt)throw Mt(),ut;return $e(!1),s}catch(s){if(s===ut)return t.recover===!1&&Hn(),yr(),or(r),$e(!1),Rr(e,t);throw s}finally{$e(n),Y(i),Lo()}}var jt=new Map;function Fo(e,{target:t,anchor:r,props:n={},events:i,context:o,intro:s=!0}){yr();var p=new Set,l=a=>{for(var c=0;c<a.length;c++){var u=a[c];if(!p.has(u)){p.add(u);var g=On(u);t.addEventListener(u,zt,{passive:g});var m=jt.get(u);m===void 0?(document.addEventListener(u,zt,{passive:g}),jt.set(u,1)):jt.set(u,m+1)}}};l(Zt(yn)),Nr.add(l);var _=void 0,f=_o(()=>{var a=r??t.appendChild(we());return X(()=>{if(o){Q({});var c=C;c.c=o}i&&(n.$$events=i),T&&xe(a,null),bn=s,_=e(a,n)||{},bn=!0,T&&(I.nodes_end=S),o&&ee()}),()=>{for(var c of p){t.removeEventListener(c,zt);var u=jt.get(c);--u===0?(document.removeEventListener(c,zt),jt.delete(c)):jt.set(c,u)}Nr.delete(l),a!==r&&a.parentNode?.removeChild(a)}});return $n.set(_,f),_}var $n=new WeakMap;function En(e,t){let r=$n.get(e);return r?($n.delete(e),r(t)):(x&&to(),Promise.resolve())}var Tn=0,Cr=1,kn=2;function ur(e,t,r,n,i){T&&se();var o=e,s=at(),p=C,l=x?C?.function:null,_=U,f,a,c,u=(s?z:Je)(void 0),g=(s?z:Je)(void 0),m=!1;function $(v,y){m=!0,y&&(W(h),ae(h),Sr(p),x&&Ir(l));try{v===Tn&&r&&(f?He(f):f=X(()=>r(o))),v===Cr&&n&&(a?He(a):a=X(()=>n(o,u))),v===kn&&i&&(c?He(c):c=X(()=>i(o,g))),v!==Tn&&f&&Ee(f,()=>f=null),v!==Cr&&a&&Ee(a,()=>a=null),v!==kn&&c&&Ee(c,()=>c=null)}finally{y&&(x&&Ir(null),Sr(null),ae(null),W(null),b())}}var h=ge(()=>{if(_!==(_=t())){if(qn(_)){var v=_;m=!1,v.then(y=>{v===_&&(it(u,y),$(Cr,!0))},y=>{if(v===_&&(it(g,y),$(kn,!0),!i))throw g.v}),T?r&&(f=X(()=>r(o))):Ae(()=>{m||$(Tn,!0)})}else it(u,_),$(Cr,!1);return()=>_=U}});T&&(o=S)}function M(e,t,r=!1){T&&se();var n=e,i=null,o=null,s=U,p=r?65536:0,l=!1;let _=(a,c=!0)=>{l=!0,f(c,a)},f=(a,c)=>{if(s===(s=a))return;let u=!1;if(T){let g=n.data===yt;!!s===g&&(n=Ft(),Y(n),$e(!1),u=!0)}s?(i?He(i):c&&(i=X(()=>c(n))),o&&Ee(o,()=>{o=null})):(o?He(o):c&&(o=X(()=>c(n))),i&&Ee(i,()=>{i=null})),u&&$e(!0)};ge(()=>{l=!1,t(_),l||f(null,null)},p),T&&(n=S)}var pr=null;function pe(e,t){return t}function Di(e,t,r,n){for(var i=[],o=t.length,s=0;s<o;s++)$r(t[s].e,i,!0);var p=o>0&&i.length===0&&r!==null;if(p){var l=r.parentNode;or(l),l.append(r),n.clear(),mt(e,t[0].prev,t[o-1].next)}vn(i,()=>{for(var _=0;_<o;_++){var f=t[_];p||(n.delete(f.k),mt(e,f.prev,f.next)),ue(f.e,!p)}})}function _e(e,t,r,n,i,o=null){var s=e,p={flags:t,items:new Map,first:null},l=(t&4)!==0;if(l){var _=e;s=T?Y(G(_)):_.appendChild(we())}T&&se();var f=null,a=!1,c=ir(()=>{var u=r();return qe(u)?u:u==null?[]:Zt(u)});ge(()=>{var u=d(c),g=u.length;if(a&&g===0)return;a=g===0;let m=!1;if(T){var $=s.data===yt;$!==(g===0)&&(s=Ft(),Y(s),$e(!1),m=!0)}if(T){for(var h=null,v,y=0;y<g;y++){if(S.nodeType===8&&S.data===bt){s=S,m=!0,$e(!1);break}var R=u[y],w=n(R,y);v=Vo(S,p,h,null,R,w,y,i,t,r),p.items.set(w,v),h=v}g>0&&Y(Ft())}if(!T){var N=O;Ri(u,p,s,i,t,(N.f&8192)!==0,n,r)}o!==null&&(g===0?f?He(f):f=X(()=>o(s)):f!==null&&Ee(f,()=>{f=null})),m&&$e(!0),d(c)}),T&&(s=S)}function Ri(e,t,r,n,i,o,s,p){var l=(i&8)!==0,_=(i&3)!==0,f=e.length,a=t.items,c=t.first,u=c,g,m=null,$,h=[],v=[],y,R,w,N;if(l)for(N=0;N<f;N+=1)y=e[N],R=s(y,N),w=a.get(R),w!==void 0&&(w.a?.measure(),($??=new Set).add(w));for(N=0;N<f;N+=1){if(y=e[N],R=s(y,N),w=a.get(R),w===void 0){var F=u?u.e.nodes_start:r;m=Vo(F,t,m,m===null?t.first:m.next,y,R,N,n,i,p),a.set(R,m),h=[],v=[],u=m.next;continue}if(_&&Ci(w,y,N,i),w.e.f&8192&&(He(w.e),l&&(w.a?.unfix(),($??=new Set).delete(w))),w!==u){if(g!==void 0&&g.has(w)){if(h.length<v.length){var de=v[0],K;m=de.prev;var _r=h[0],Nt=h[h.length-1];for(K=0;K<h.length;K+=1)qo(h[K],de,r);for(K=0;K<v.length;K+=1)g.delete(v[K]);mt(t,_r.prev,Nt.next),mt(t,m,_r),mt(t,Nt,de),u=de,m=Nt,N-=1,h=[],v=[]}else g.delete(w),qo(w,u,r),mt(t,w.prev,w.next),mt(t,w,m===null?t.first:m.next),mt(t,m,w),m=w;continue}for(h=[],v=[];u!==null&&u.k!==R;)(o||!(u.e.f&8192))&&(g??=new Set).add(u),v.push(u),u=u.next;if(u===null)continue;w=u}h.push(w),m=w,u=w.next}if(u!==null||g!==void 0){for(var gt=g===void 0?[]:Zt(g);u!==null;)(o||!(u.e.f&8192))&&gt.push(u),u=u.next;var Kt=gt.length;if(Kt>0){var zr=i&4&&f===0?r:null;if(l){for(N=0;N<Kt;N+=1)gt[N].a?.measure();for(N=0;N<Kt;N+=1)gt[N].a?.fix()}Di(t,gt,zr,a)}}l&&Ae(()=>{if($!==void 0)for(w of $)w.a?.apply()}),I.first=t.first&&t.first.e,I.last=m&&m.e}function Ci(e,t,r,n){n&1&&it(e.v,t),n&2?it(e.i,r):e.i=r}function Vo(e,t,r,n,i,o,s,p,l,_){var f=pr,a=(l&1)!==0,c=(l&16)===0,u=a?c?Je(i):z(i):i,g=l&2?z(s):s;x&&a&&(u.debug=()=>{var $=typeof g=="number"?s:g.v;_()[$]});var m={i:g,v:u,k:o,a:null,e:null,prev:r,next:n};pr=m;try{return m.e=X(()=>p(e,u,g,_),T),m.e.prev=r&&r.e,m.e.next=n&&n.e,r===null?t.first=m:(r.next=m,r.e.next=m.e),n!==null&&(n.prev=m,n.e.prev=m.e),m}finally{pr=f}}function qo(e,t,r){for(var n=e.next?e.next.e.nodes_start:r,i=t?t.e.nodes_start:r,o=e.e.nodes_start;o!==n;){var s=he(o);i.before(o),o=s}}function mt(e,t,r){t===null?e.first=r:(t.next=r,t.e.next=r&&r.e),r!==null&&(r.prev=t,r.e.prev=t&&t.e)}function le(e,t){Ae(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){let i=document.createElement("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i),x&&Po(t.hash,i)}})}function Ho(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Ho(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Uo(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Ho(e))&&(n&&(n+=" "),n+=t);return n}function Pr(e){return typeof e=="object"?Uo(e):e??""}function A(e,t,r,n){var i=e.__attributes??={};if(T&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")){n||Mi(e,t,r??"");return}i[t]!==(i[t]=r)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[Bn]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Li(e).includes(t)?e[t]=r:e.setAttribute(t,r))}var zo=new Map;function Li(e){var t=zo.get(e.nodeName);if(t)return t;zo.set(e.nodeName,t=[]);for(var r,n=e,i=Element.prototype;i!==n;){r=Wr(n);for(var o in r)r[o].set&&t.push(o);n=$t(n)}return t}function Mi(e,t,r){x&&(t==="srcset"&&Fi(e,r)||In(e.getAttribute(t)??"",r)||eo(t,e.outerHTML.replace(e.innerHTML,e.innerHTML&&"..."),String(r)))}function In(e,t){return e===t?!0:new URL(e,document.baseURI).href===new URL(t,document.baseURI).href}function jo(e){return e.split(",").map(t=>t.trim().split(" ").filter(Boolean))}function Fi(e,t){var r=jo(e.srcset),n=jo(t);return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(In(r[s][0],i)||In(i,r[s][0])))}function Nn(e,t,r){var n=e.__className,i=qi(t,r);T&&e.className===i?e.__className=i:(n!==i||T&&e.className!==i)&&(t==null&&!r?e.removeAttribute("class"):e.className=i,e.__className=i)}function qi(e,t){return(e??"")+(t?" "+t:"")}function Or(e,t,r,n){var i=e.__styles??={};i[t]!==r&&(i[t]=r,r==null?e.style.removeProperty(t):e.style.setProperty(t,r,n?"important":""))}var Mr=!1,rd=Symbol();function Dn(e){var t=Mr;try{return Mr=!1,[e(),Mr]}finally{Mr=t}}function Wo(e){for(var t=I,r=I;t!==null&&!(t.f&96);)t=t.parent;try{return W(t),e()}finally{W(r)}}function E(e,t,r,n){var i=(r&1)!==0,o=!pt||(r&2)!==0,s=(r&8)!==0,p=(r&16)!==0,l=!1,_;s?[_,l]=Dn(()=>e[t]):_=e[t];var f=De in e||dr in e,a=s&&(Ne(e,t)?.set??(f&&t in e&&(F=>e[t]=F)))||void 0,c=n,u=!0,g=!1,m=()=>(g=!0,u&&(u=!1,p?c=J(n):c=n),c);_===void 0&&n!==void 0&&(a&&o&&Un(t),_=m(),a&&a(_));var $;if(o)$=()=>{var F=e[t];return F===void 0?m():(u=!0,g=!1,F)};else{var h=Wo(()=>(i?D:ir)(()=>e[t]));h.f|=131072,$=()=>{var F=d(h);return F!==void 0&&(c=void 0),F===void 0?c:F}}if(!(r&4))return $;if(a){var v=e.$$legacy;return function(F,de){return arguments.length>0?((!o||!de||v||l)&&a(de?$():F),F):$()}}var y=!1,R=!1,w=Je(_),N=Wo(()=>D(()=>{var F=$(),de=d(w);return y?(y=!1,R=!0,de):(R=!1,w.v=F)}));return i||(N.equals=Rt),function(F,de){if(er!==null&&(y=R,$(),d(w)),arguments.length>0){let K=de?d(N):o&&s?Qe(F):F;return N.equals(K)||(y=!0,j(w,K),g&&c!==void 0&&(c=K),J(()=>d(N))),F}return d(N)}}function Ko(e){return new Rn(e)}var Rn=class{#t;#e;constructor(t){var r=new Map,n=(o,s)=>{var p=Je(s);return r.set(o,p),p};let i=new Proxy({...t.props||{},$$events:{}},{get(o,s){return d(r.get(s)??n(s,Reflect.get(o,s)))},has(o,s){return s===dr?!0:(d(r.get(s)??n(s,Reflect.get(o,s))),Reflect.has(o,s))},set(o,s,p){return j(r.get(s)??n(s,p),p),Reflect.set(o,s,p)}});this.#e=(t.hydrate?wn:Rr)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&b(),this.#t=i.$$events;for(let o of Object.keys(this.#e))o==="$set"||o==="$destroy"||o==="$on"||re(this,o,{get(){return this.#e[o]},set(s){this.#e[o]=s},enumerable:!0});this.#e.$set=o=>{Object.assign(i,o)},this.#e.$destroy=()=>{En(this.#e)}}$set(t){this.#e.$set(t)}$on(t,r){this.#t[t]=this.#t[t]||[];let n=(...i)=>r.call(this,...i);return this.#t[t].push(n),()=>{this.#t[t]=this.#t[t].filter(i=>i!==n)}}$destroy(){this.#e.$destroy()}};var Zo;typeof HTMLElement=="function"&&(Zo=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){let n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{let o=document.createElement("slot");n!=="default"&&(o.name=n),k(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},r=fs(this);for(let n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(let n of this.attributes){let i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Fr(i,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Ko({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=un(()=>{Le(()=>{this.$$r=!0;for(let n of Xt(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let i=Fr(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(let n in this.$$l)for(let i of this.$$l[n]){let o=this.$$c.$on(n,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Fr(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Xt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Fr(e,t,r,n){let i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function fs(e){let t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function fe(e,t,r,n,i,o){let s=class extends Zo{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return Xt(t).map(p=>(t[p].attribute||p).toLowerCase())}};return Xt(t).forEach(p=>{re(s.prototype,p,{get(){return this.$$c&&p in this.$$c?this.$$c[p]:this.$$d[p]},set(l){l=Fr(p,l,t),this.$$d[p]=l;var _=this.$$c;if(_){var f=Ne(_,p)?.get;f?_[p]=l:_.$set({[p]:l})}}})}),n.forEach(p=>{re(s.prototype,p,{get(){return this.$$c?.[p]}})}),o&&(s=o(s)),e.element=s,s}function Gt(...e){return function(t){return rt.DocItem(t)&&e.includes(t.label)}}var ht={CodeItem:Gt("code"),ListItem:Gt("list_item"),PictureItem:Gt("picture"),SectionHeaderItem:Gt("section_header"),TableItem:Gt("document_index","table"),TextItem:Gt("caption","checkbox_selected","checkbox_unselected","footnote","formula","page_footer","page_header","paragraph","reference","text","title")},rt={Document(e){return"schema_name"in e&&e.schema_name==="DoclingDocument"},NodeItem(e){return"self_ref"in e},GroupItem(e){return rt.NodeItem(e)&&(e.self_ref.startsWith("#/groups/")||e.self_ref==="#/body")},DocItem(e){return rt.NodeItem(e)&&!rt.GroupItem(e)},...ht};function*Xo(e,t={}){e&&(yield*r(t.root??e.body));function*r(n,i=0){if((!rt.GroupItem(n)||t.withGroups)&&(rt.DocItem(n)?(t.pageNo===void 0||n.prov?.some(o=>o.page_no===t.pageNo))&&(yield[n,i]):yield[n,i]),!(rt.PictureItem(n)&&!t.traversePictures))for(let o of n.children??[]){let s=us(e,o);rt.NodeItem(s)&&(yield*r(s,i+1))}}}function us(e,t){return t.$ref.split("/").slice(1).reduce((n,i)=>n[i],e)}function ps(e){return Object.values(e?.pages??{}).sort((t,r)=>t.page_no-r.page_no)}async function qr(e,t={}){let r;typeof e=="string"?r=await(await fetch(e)).json():typeof e=="object"&&rt.Document(e)&&(r=e);let n=ps(r),i=Array.from(Xo(r)).map(([l])=>l),o=i,s=new Set;if(typeof t.items=="string"){let l=new Set(t.items.split(",").map(_=>_.trim()).filter(_=>_.length>0));if(l.size>0){o=[];for(let _ of i){let f=_.self_ref.split("/"),a=[];for(let c=2;c<f.length+1;c++)a.push(f.slice(0,c).join("/"));_.prov?.forEach(c=>a.push(`#/pages/${c.page_no}`)),a.some(c=>l.has(c))?o.push(_):_.prov?.forEach(c=>s.add(c.page_no))}}}else if(Array.isArray(t.items)){o=[];let l=new Set(t.items);for(let _ of i)l.has(_)?o.push(_):_.prov?.forEach(f=>s.add(f.page_no))}let p={};for(let l of n)p[l.page_no]=[];for(let l of o)for(let _ of l.prov??[])p[_.page_no].push(l);return n.map(l=>({page:l,items:p[l.page_no],trimmed:s.has(l.page_no)}))}var _s=L("<td> </td>"),ds=L("<tr></tr>"),ms=L('<div class="container svelte-1c6yx17"><table class="svelte-1c6yx17"><tbody></tbody></table></div>'),vs={hash:"svelte-1c6yx17",code:".container.svelte-1c6yx17 {position:relative;min-width:0;max-width:100%;min-height:0;overflow:auto;}table.svelte-1c6yx17 {border-collapse:collapse;}td.svelte-1c6yx17 {padding:0 0.5rem;background-color:var(--cds-layer);border:1px solid rgb(220, 220, 220);color:black;font-size:0.75rem;line-height:1.5rem;text-decoration:none;word-break:normal;text-align:left;}td.header.svelte-1c6yx17 {font-weight:bold;}td.svelte-1c6yx17:hover {filter:brightness(95%);}td.svelte-1c6yx17:target {outline:3px solid blue;}"};function Br(e,t){Q(t,!0),le(e,vs);let r=E(t,"item",7),n=D(()=>function(){let p=new Set;return function(l){let _=p.has([l.start_col_offset_idx,l.start_row_offset_idx].join());if(!_)for(let f=l.start_col_offset_idx;f<l.end_col_offset_idx;f++)for(let a=l.start_row_offset_idx;a<l.end_row_offset_idx;a++)p.add([f,a].join());return _}}());var i=ms(),o=B(i),s=B(o);return _e(s,21,()=>r().data.grid,pe,(p,l)=>{var _=ds();_e(_,21,()=>d(l),pe,(f,a)=>{var c=H(),u=V(c);{var g=m=>{var $=_s();let h=D(()=>`${r().self_ref}/${d(a).start_col_offset_idx}/${d(a).start_row_offset_idx}`.slice(1));var v=B($,!0);P($),q(()=>{A($,"id",d(h)),Nn($,Pr(d(a).column_header||d(a).row_header?"header":""),"svelte-1c6yx17"),A($,"colspan",d(a).col_span),A($,"rowspan",d(a).row_span),Ie(v,d(a).text)}),k(m,$)};M(u,m=>{d(n)(d(a))||m(g)})}k(f,c)}),P(_),k(p,_)}),P(s),P(o),P(i),k(e,i),ee({get item(){return r()},set item(p){r(p),b()}})}fe(Br,{item:{}},[],[],!0);var hs=L('<p class="svelte-1v2vl7q"> </p>'),gs=L('<h2 class="svelte-1v2vl7q"> </h2>'),xs=L("<div><span> </span></div>"),ys={hash:"svelte-1v2vl7q",code:`p.svelte-1v2vl7q,
30
+ `)})}if($o(e,t),wo(t))throw e}function Io(e,t,r=0){var n=e.reactions;if(n!==null)for(var i=0;i<n.length;i++){var o=n[i];o.f&2?Io(o,t,r+1):t===o&&(r===0?ce(o,2048):o.f&1024&&ce(o,4096),Lt(o))}}function br(e){var t=Te,r=Se,n=Ze,i=O,o=lt,s=Be,p=C,l=Ve,_=e.f;Te=null,Se=0,Ze=null,O=_&96?null:e,lt=!st&&(_&256)!==0,Be=null,C=e.ctx,Ve=!1,Ar++;try{var f=(0,e.fn)(),a=e.deps;if(Te!==null){var c;if(Tt(e,Se),a!==null&&Se>0)for(a.length=Se+Te.length,c=0;c<Te.length;c++)a[Se+c]=Te[c];else e.deps=a=Te;if(!lt)for(c=Se;c<a.length;c++)(a[c].reactions??=[]).push(e)}else a!==null&&Se<a.length&&(Tt(e,Se),a.length=Se);if(at()&&Ze!==null&&!(e.f&6146))for(c=0;c<Ze.length;c++)Io(Ze[c],e);return i!==null&&Ar++,f}finally{Te=t,Se=r,Ze=n,O=i,lt=o,Be=s,C=p,Ve=l}}function yi(e,t){let r=t.reactions;if(r!==null){var n=Mn.call(r,e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}r===null&&t.f&2&&(Te===null||!Te.includes(t))&&(ce(t,4096),t.f&768||(t.f^=512),Tt(t,0))}function Tt(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)yi(e,r[n])}function Ot(e){var t=e.f;if(!(t&16384)){ce(e,1024);var r=I,n=C;if(I=e,x){var i=ke;ke=e.component_function}try{t&16?mo(e):dn(e),_n(e),pn(e);var o=br(e);e.teardown=typeof o=="function"?o:null,e.wv=So;var s=e.deps;if(x&&Ke&&e.f&2048&&s!==null)for(let l=0;l<s.length;l++){var p=s[l];p.trace_need_increase&&(p.wv=tr(),p.trace_need_increase=void 0,p.trace_v=void 0)}x&&lr.push(e)}catch(l){Ht(l,e,r,n||e.ctx)}finally{I=r,x&&(ke=i)}}}function Eo(){console.error("Last ten effects were: ",lr.slice(-10).map(e=>e.fn)),lr=[]}function No(){if(Yt>1e3){Yt=0;try{Yn()}catch(e){if(x&&re(e,"stack",{value:""}),Vt!==null)if(x)try{Ht(e,Vt,null,null)}catch(t){throw Eo(),t}else Ht(e,Vt,null,null);else throw x&&Eo(),e}}Yt++}function Do(e){var t=e.length;if(t!==0){No();var r=st;st=!0;try{for(var n=0;n<t;n++){var i=e[n];i.f&1024||(i.f^=1024);var o=[];Ro(i,o),bi(o)}}finally{st=r}}}function bi(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var n=e[r];if(!(n.f&24576))try{_t(n)&&(Ot(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?mn(n):n.fn=null))}catch(i){Ht(i,n,null,n.ctx)}}}function $i(){if(ar=!1,Yt>1001)return;let e=At;At=[],Do(e),ar||(Yt=0,Vt=null,x&&(lr=[]))}function Lt(e){Tr===Ao&&(ar||(ar=!0,queueMicrotask($i))),Vt=e;for(var t=e;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024))return;t.f^=1024}}At.push(t)}function Ro(e,t){var r=e.first,n=[];e:for(;r!==null;){var i=r.f,o=(i&32)!==0,s=o&&(i&1024)!==0,p=r.next;if(!s&&!(i&8192))if(i&8){if(o)r.f^=1024;else try{_t(r)&&Ot(r)}catch(a){Ht(a,r,null,r.ctx)}var l=r.first;if(l!==null){r=l;continue}}else i&4&&n.push(r);if(p===null){let a=r.parent;for(;a!==null;){if(e===a)break e;var _=a.next;if(_!==null){r=_;continue e}a=a.parent}}r=p}for(var f=0;f<n.length;f++)l=n[f],t.push(l),Ro(l,t)}function b(e){var t=Tr,r=At;try{No();let i=[];Tr=xi,At=i,ar=!1,Do(r);var n=e?.();return yo(),(At.length>0||i.length>0)&&b(),Yt=0,Vt=null,x&&(lr=[]),n}finally{Tr=t,At=r}}function d(e){var t=e.f,r=(t&2)!==0;if(r&&t&16384){var n=an(e);return sr(e),n}if(er!==null&&er.add(e),O!==null&&!Ve){Be!==null&&Be.includes(e)&&Wn();var i=O.deps;e.rv<Ar&&(e.rv=Ar,Te===null&&i!==null&&i[Se]===e?Se++:Te===null?Te=[e]:Te.push(e))}else if(r&&e.deps===null)for(var o=e,s=o.parent,p=o;s!==null;)if(s.f&2){var l=s;p=l,s=l.parent}else{var _=s;_.deriveds?.includes(p)||(_.deriveds??=[]).push(p);break}if(r&&(o=e,_t(o)&&ln(o)),x&&Ke&&Qt!==null&&O!==null&&Qt.reaction===O){if(e.debug)e.debug();else if(e.created){var f=Qt.entries.get(e);f===void 0&&(f={read:[]},Qt.entries.set(e,f)),f.read.push(nt("TracedAt"))}}return e.v}function J(e){var t=Ve;try{return Ve=!0,e()}finally{Ve=t}}var wi=-7169;function ce(e,t){e.f=e.f&wi|t}function Q(e,t=!1,r){C={p:C,c:null,e:null,m:!1,s:e,x:null,l:null},pt&&!t&&(C.l={s:null,u:null,r1:[],r2:z(!1)}),x&&(C.function=r,ke=r)}function ee(e){let t=C;if(t!==null){e!==void 0&&(t.x=e);let s=t.e;if(s!==null){var r=I,n=O;t.e=null;try{for(var i=0;i<s.length;i++){var o=s[i];W(o.effect),ae(o.reaction),tt(o.fn)}}finally{W(r),ae(n)}}C=t.p,x&&(ke=t.p?.function??null),t.m=!0}return e||{}}if(x){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;zn(t)},set:n=>{r=n}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}var Co=new Map;function Po(e,t){var r=Co.get(e);r||(r=new Set,Co.set(e,r)),r.add(t)}function xn(e){var t=O,r=I;ae(null),W(null);try{return e()}finally{ae(t),W(r)}}var yn=new Set,Nr=new Set;function Oo(e,t,r,n={}){function i(o){if(n.capture||zt.call(t,o),!o.cancelBubble)return xn(()=>r?.call(this,o))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Ae(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function Dr(e,t,r,n,i){var o={capture:n,passive:i},s=Oo(e,t,r,o);(t===document.body||t===window||t===document)&&Fe(()=>{t.removeEventListener(e,s,o)})}function Ut(e){for(var t=0;t<e.length;t++)yn.add(e[t]);for(var r of Nr)r(e)}function zt(e){var t=this,r=t.ownerDocument,n=e.type,i=e.composedPath?.()||[],o=i[0]||e.target,s=0,p=e.__root;if(p){var l=i.indexOf(p);if(l!==-1&&(t===document||t===window)){e.__root=t;return}var _=i.indexOf(t);if(_===-1)return;l<=_&&(s=l)}if(o=i[s]||e.target,o!==t){re(e,"currentTarget",{configurable:!0,get(){return o||r}});var f=O,a=I;ae(null),W(null);try{for(var c,u=[];o!==null;){var g=o.assignedSlot||o.parentNode||o.host||null;try{var m=o["__"+n];if(m!==void 0&&!o.disabled)if(qe(m)){var[$,...h]=m;$.apply(o,[e,...h])}else m.call(o,e)}catch(v){c?u.push(v):c=v}if(e.cancelBubble||g===t||g===null)break;o=g}if(c){for(let v of u)queueMicrotask(()=>{throw v});throw c}}finally{e.__root=t,delete e.currentTarget,ae(f),W(a)}}}var ki;function Lo(){ki=void 0}function fr(e){var t=document.createElement("template");return t.innerHTML=e,t.content}function xe(e,t){var r=I;r.nodes_start===null&&(r.nodes_start=e,r.nodes_end=t)}function L(e,t){var r=(t&1)!==0,n=(t&2)!==0,i,o=!e.startsWith("<!>");return()=>{if(T)return xe(S,null),S;i===void 0&&(i=fr(o?e:"<!>"+e),r||(i=G(i)));var s=n?document.importNode(i,!0):i.cloneNode(!0);if(r){var p=G(s),l=s.lastChild;xe(p,l)}else xe(s,s);return s}}function St(e,t,r="svg"){var n=!e.startsWith("<!>"),i=(t&1)!==0,o=`<${r}>${n?e:"<!>"+e}</${r}>`,s;return()=>{if(T)return xe(S,null),S;if(!s){var p=fr(o),l=G(p);if(i)for(s=document.createDocumentFragment();G(l);)s.appendChild(G(l));else s=G(l)}var _=s.cloneNode(!0);if(i){var f=G(_),a=_.lastChild;xe(f,a)}else xe(_,_);return _}}function cr(e=""){if(!T){var t=we(e+"");return xe(t,t),t}var r=S;return r.nodeType!==3&&(r.before(r=we()),Y(r)),xe(r,r),r}function H(){if(T)return xe(S,null),S;var e=document.createDocumentFragment(),t=document.createComment(""),r=we();return e.append(t,r),xe(t,r),e}function k(e,t){if(T){I.nodes_end=S,se();return}e!==null&&e.before(t)}var bn=!0;function Ie(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r==null?"":r+"")}function Rr(e,t){return Fo(e,t)}function wn(e,t){yr(),t.intro=t.intro??!1;let r=t.target,n=T,i=S;try{for(var o=G(r);o&&(o.nodeType!==8||o.data!==Dt);)o=he(o);if(!o)throw ut;$e(!0),Y(o),se();let s=Fo(e,{...t,anchor:o});if(S===null||S.nodeType!==8||S.data!==bt)throw Mt(),ut;return $e(!1),s}catch(s){if(s===ut)return t.recover===!1&&Hn(),yr(),or(r),$e(!1),Rr(e,t);throw s}finally{$e(n),Y(i),Lo()}}var jt=new Map;function Fo(e,{target:t,anchor:r,props:n={},events:i,context:o,intro:s=!0}){yr();var p=new Set,l=a=>{for(var c=0;c<a.length;c++){var u=a[c];if(!p.has(u)){p.add(u);var g=On(u);t.addEventListener(u,zt,{passive:g});var m=jt.get(u);m===void 0?(document.addEventListener(u,zt,{passive:g}),jt.set(u,1)):jt.set(u,m+1)}}};l(Zt(yn)),Nr.add(l);var _=void 0,f=_o(()=>{var a=r??t.appendChild(we());return X(()=>{if(o){Q({});var c=C;c.c=o}i&&(n.$$events=i),T&&xe(a,null),bn=s,_=e(a,n)||{},bn=!0,T&&(I.nodes_end=S),o&&ee()}),()=>{for(var c of p){t.removeEventListener(c,zt);var u=jt.get(c);--u===0?(document.removeEventListener(c,zt),jt.delete(c)):jt.set(c,u)}Nr.delete(l),a!==r&&a.parentNode?.removeChild(a)}});return $n.set(_,f),_}var $n=new WeakMap;function En(e,t){let r=$n.get(e);return r?($n.delete(e),r(t)):(x&&to(),Promise.resolve())}var Tn=0,Cr=1,kn=2;function ur(e,t,r,n,i){T&&se();var o=e,s=at(),p=C,l=x?C?.function:null,_=U,f,a,c,u=(s?z:Je)(void 0),g=(s?z:Je)(void 0),m=!1;function $(v,y){m=!0,y&&(W(h),ae(h),Sr(p),x&&Ir(l));try{v===Tn&&r&&(f?He(f):f=X(()=>r(o))),v===Cr&&n&&(a?He(a):a=X(()=>n(o,u))),v===kn&&i&&(c?He(c):c=X(()=>i(o,g))),v!==Tn&&f&&Ee(f,()=>f=null),v!==Cr&&a&&Ee(a,()=>a=null),v!==kn&&c&&Ee(c,()=>c=null)}finally{y&&(x&&Ir(null),Sr(null),ae(null),W(null),b())}}var h=ge(()=>{if(_!==(_=t())){if(qn(_)){var v=_;m=!1,v.then(y=>{v===_&&(it(u,y),$(Cr,!0))},y=>{if(v===_&&(it(g,y),$(kn,!0),!i))throw g.v}),T?r&&(f=X(()=>r(o))):Ae(()=>{m||$(Tn,!0)})}else it(u,_),$(Cr,!1);return()=>_=U}});T&&(o=S)}function M(e,t,r=!1){T&&se();var n=e,i=null,o=null,s=U,p=r?65536:0,l=!1;let _=(a,c=!0)=>{l=!0,f(c,a)},f=(a,c)=>{if(s===(s=a))return;let u=!1;if(T){let g=n.data===yt;!!s===g&&(n=Ft(),Y(n),$e(!1),u=!0)}s?(i?He(i):c&&(i=X(()=>c(n))),o&&Ee(o,()=>{o=null})):(o?He(o):c&&(o=X(()=>c(n))),i&&Ee(i,()=>{i=null})),u&&$e(!0)};ge(()=>{l=!1,t(_),l||f(null,null)},p),T&&(n=S)}var pr=null;function pe(e,t){return t}function Di(e,t,r,n){for(var i=[],o=t.length,s=0;s<o;s++)$r(t[s].e,i,!0);var p=o>0&&i.length===0&&r!==null;if(p){var l=r.parentNode;or(l),l.append(r),n.clear(),mt(e,t[0].prev,t[o-1].next)}vn(i,()=>{for(var _=0;_<o;_++){var f=t[_];p||(n.delete(f.k),mt(e,f.prev,f.next)),ue(f.e,!p)}})}function _e(e,t,r,n,i,o=null){var s=e,p={flags:t,items:new Map,first:null},l=(t&4)!==0;if(l){var _=e;s=T?Y(G(_)):_.appendChild(we())}T&&se();var f=null,a=!1,c=ir(()=>{var u=r();return qe(u)?u:u==null?[]:Zt(u)});ge(()=>{var u=d(c),g=u.length;if(a&&g===0)return;a=g===0;let m=!1;if(T){var $=s.data===yt;$!==(g===0)&&(s=Ft(),Y(s),$e(!1),m=!0)}if(T){for(var h=null,v,y=0;y<g;y++){if(S.nodeType===8&&S.data===bt){s=S,m=!0,$e(!1);break}var R=u[y],w=n(R,y);v=Vo(S,p,h,null,R,w,y,i,t,r),p.items.set(w,v),h=v}g>0&&Y(Ft())}if(!T){var N=O;Ri(u,p,s,i,t,(N.f&8192)!==0,n,r)}o!==null&&(g===0?f?He(f):f=X(()=>o(s)):f!==null&&Ee(f,()=>{f=null})),m&&$e(!0),d(c)}),T&&(s=S)}function Ri(e,t,r,n,i,o,s,p){var l=(i&8)!==0,_=(i&3)!==0,f=e.length,a=t.items,c=t.first,u=c,g,m=null,$,h=[],v=[],y,R,w,N;if(l)for(N=0;N<f;N+=1)y=e[N],R=s(y,N),w=a.get(R),w!==void 0&&(w.a?.measure(),($??=new Set).add(w));for(N=0;N<f;N+=1){if(y=e[N],R=s(y,N),w=a.get(R),w===void 0){var F=u?u.e.nodes_start:r;m=Vo(F,t,m,m===null?t.first:m.next,y,R,N,n,i,p),a.set(R,m),h=[],v=[],u=m.next;continue}if(_&&Ci(w,y,N,i),w.e.f&8192&&(He(w.e),l&&(w.a?.unfix(),($??=new Set).delete(w))),w!==u){if(g!==void 0&&g.has(w)){if(h.length<v.length){var de=v[0],K;m=de.prev;var _r=h[0],Nt=h[h.length-1];for(K=0;K<h.length;K+=1)qo(h[K],de,r);for(K=0;K<v.length;K+=1)g.delete(v[K]);mt(t,_r.prev,Nt.next),mt(t,m,_r),mt(t,Nt,de),u=de,m=Nt,N-=1,h=[],v=[]}else g.delete(w),qo(w,u,r),mt(t,w.prev,w.next),mt(t,w,m===null?t.first:m.next),mt(t,m,w),m=w;continue}for(h=[],v=[];u!==null&&u.k!==R;)(o||!(u.e.f&8192))&&(g??=new Set).add(u),v.push(u),u=u.next;if(u===null)continue;w=u}h.push(w),m=w,u=w.next}if(u!==null||g!==void 0){for(var gt=g===void 0?[]:Zt(g);u!==null;)(o||!(u.e.f&8192))&&gt.push(u),u=u.next;var Kt=gt.length;if(Kt>0){var zr=i&4&&f===0?r:null;if(l){for(N=0;N<Kt;N+=1)gt[N].a?.measure();for(N=0;N<Kt;N+=1)gt[N].a?.fix()}Di(t,gt,zr,a)}}l&&Ae(()=>{if($!==void 0)for(w of $)w.a?.apply()}),I.first=t.first&&t.first.e,I.last=m&&m.e}function Ci(e,t,r,n){n&1&&it(e.v,t),n&2?it(e.i,r):e.i=r}function Vo(e,t,r,n,i,o,s,p,l,_){var f=pr,a=(l&1)!==0,c=(l&16)===0,u=a?c?Je(i):z(i):i,g=l&2?z(s):s;x&&a&&(u.debug=()=>{var $=typeof g=="number"?s:g.v;_()[$]});var m={i:g,v:u,k:o,a:null,e:null,prev:r,next:n};pr=m;try{return m.e=X(()=>p(e,u,g,_),T),m.e.prev=r&&r.e,m.e.next=n&&n.e,r===null?t.first=m:(r.next=m,r.e.next=m.e),n!==null&&(n.prev=m,n.e.prev=m.e),m}finally{pr=f}}function qo(e,t,r){for(var n=e.next?e.next.e.nodes_start:r,i=t?t.e.nodes_start:r,o=e.e.nodes_start;o!==n;){var s=he(o);i.before(o),o=s}}function mt(e,t,r){t===null?e.first=r:(t.next=r,t.e.next=r&&r.e),r!==null&&(r.prev=t,r.e.prev=t&&t.e)}function le(e,t){Ae(()=>{var r=e.getRootNode(),n=r.host?r:r.head??r.ownerDocument.head;if(!n.querySelector("#"+t.hash)){let i=document.createElement("style");i.id=t.hash,i.textContent=t.code,n.appendChild(i),x&&Po(t.hash,i)}})}function Ho(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Ho(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Uo(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Ho(e))&&(n&&(n+=" "),n+=t);return n}function Pr(e){return typeof e=="object"?Uo(e):e??""}function A(e,t,r,n){var i=e.__attributes??={};if(T&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")){n||Mi(e,t,r??"");return}i[t]!==(i[t]=r)&&(t==="style"&&"__styles"in e&&(e.__styles={}),t==="loading"&&(e[Bn]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Li(e).includes(t)?e[t]=r:e.setAttribute(t,r))}var zo=new Map;function Li(e){var t=zo.get(e.nodeName);if(t)return t;zo.set(e.nodeName,t=[]);for(var r,n=e,i=Element.prototype;i!==n;){r=Wr(n);for(var o in r)r[o].set&&t.push(o);n=$t(n)}return t}function Mi(e,t,r){x&&(t==="srcset"&&Fi(e,r)||In(e.getAttribute(t)??"",r)||eo(t,e.outerHTML.replace(e.innerHTML,e.innerHTML&&"..."),String(r)))}function In(e,t){return e===t?!0:new URL(e,document.baseURI).href===new URL(t,document.baseURI).href}function jo(e){return e.split(",").map(t=>t.trim().split(" ").filter(Boolean))}function Fi(e,t){var r=jo(e.srcset),n=jo(t);return n.length===r.length&&n.every(([i,o],s)=>o===r[s][1]&&(In(r[s][0],i)||In(i,r[s][0])))}function Nn(e,t,r){var n=e.__className,i=qi(t,r);T&&e.className===i?e.__className=i:(n!==i||T&&e.className!==i)&&(t==null&&!r?e.removeAttribute("class"):e.className=i,e.__className=i)}function qi(e,t){return(e??"")+(t?" "+t:"")}function Or(e,t,r,n){var i=e.__styles??={};i[t]!==r&&(i[t]=r,r==null?e.style.removeProperty(t):e.style.setProperty(t,r,n?"important":""))}var Mr=!1,rd=Symbol();function Dn(e){var t=Mr;try{return Mr=!1,[e(),Mr]}finally{Mr=t}}function Wo(e){for(var t=I,r=I;t!==null&&!(t.f&96);)t=t.parent;try{return W(t),e()}finally{W(r)}}function E(e,t,r,n){var i=(r&1)!==0,o=!pt||(r&2)!==0,s=(r&8)!==0,p=(r&16)!==0,l=!1,_;s?[_,l]=Dn(()=>e[t]):_=e[t];var f=De in e||dr in e,a=s&&(Ne(e,t)?.set??(f&&t in e&&(F=>e[t]=F)))||void 0,c=n,u=!0,g=!1,m=()=>(g=!0,u&&(u=!1,p?c=J(n):c=n),c);_===void 0&&n!==void 0&&(a&&o&&Un(t),_=m(),a&&a(_));var $;if(o)$=()=>{var F=e[t];return F===void 0?m():(u=!0,g=!1,F)};else{var h=Wo(()=>(i?D:ir)(()=>e[t]));h.f|=131072,$=()=>{var F=d(h);return F!==void 0&&(c=void 0),F===void 0?c:F}}if(!(r&4))return $;if(a){var v=e.$$legacy;return function(F,de){return arguments.length>0?((!o||!de||v||l)&&a(de?$():F),F):$()}}var y=!1,R=!1,w=Je(_),N=Wo(()=>D(()=>{var F=$(),de=d(w);return y?(y=!1,R=!0,de):(R=!1,w.v=F)}));return i||(N.equals=Rt),function(F,de){if(er!==null&&(y=R,$(),d(w)),arguments.length>0){let K=de?d(N):o&&s?Qe(F):F;return N.equals(K)||(y=!0,j(w,K),g&&c!==void 0&&(c=K),J(()=>d(N))),F}return d(N)}}function Ko(e){return new Rn(e)}var Rn=class{#t;#e;constructor(t){var r=new Map,n=(o,s)=>{var p=Je(s);return r.set(o,p),p};let i=new Proxy({...t.props||{},$$events:{}},{get(o,s){return d(r.get(s)??n(s,Reflect.get(o,s)))},has(o,s){return s===dr?!0:(d(r.get(s)??n(s,Reflect.get(o,s))),Reflect.has(o,s))},set(o,s,p){return j(r.get(s)??n(s,p),p),Reflect.set(o,s,p)}});this.#e=(t.hydrate?wn:Rr)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&b(),this.#t=i.$$events;for(let o of Object.keys(this.#e))o==="$set"||o==="$destroy"||o==="$on"||re(this,o,{get(){return this.#e[o]},set(s){this.#e[o]=s},enumerable:!0});this.#e.$set=o=>{Object.assign(i,o)},this.#e.$destroy=()=>{En(this.#e)}}$set(t){this.#e.$set(t)}$on(t,r){this.#t[t]=this.#t[t]||[];let n=(...i)=>r.call(this,...i);return this.#t[t].push(n),()=>{this.#t[t]=this.#t[t].filter(i=>i!==n)}}$destroy(){this.#e.$destroy()}};var Zo;typeof HTMLElement=="function"&&(Zo=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,r){super(),this.$$ctor=e,this.$$s=t,r&&this.attachShadow({mode:"open"})}addEventListener(e,t,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,r)}removeEventListener(e,t,r){if(super.removeEventListener(e,t,r),this.$$c){let n=this.$$l_u.get(t);n&&(n(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return i=>{let o=document.createElement("slot");n!=="default"&&(o.name=n),k(i,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let t={},r=fs(this);for(let n of this.$$s)n in r&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),t.default=!0):t[n]=e(n));for(let n of this.attributes){let i=this.$$g_p(n.name);i in this.$$d||(this.$$d[i]=Fr(i,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Ko({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=un(()=>{Le(()=>{this.$$r=!0;for(let n of Xt(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let i=Fr(n,this.$$d[n],this.$$p_d,"toAttribute");i==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,i)}this.$$r=!1})});for(let n in this.$$l)for(let i of this.$$l[n]){let o=this.$$c.$on(n,i);this.$$l_u.set(i,o)}this.$$l={}}}attributeChangedCallback(e,t,r){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Fr(e,r,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Xt(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Fr(e,t,r,n){let i=r[e]?.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!n||!r[e])return t;if(n==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function fs(e){let t={};return e.childNodes.forEach(r=>{t[r.slot||"default"]=!0}),t}function fe(e,t,r,n,i,o){let s=class extends Zo{constructor(){super(e,r,i),this.$$p_d=t}static get observedAttributes(){return Xt(t).map(p=>(t[p].attribute||p).toLowerCase())}};return Xt(t).forEach(p=>{re(s.prototype,p,{get(){return this.$$c&&p in this.$$c?this.$$c[p]:this.$$d[p]},set(l){l=Fr(p,l,t),this.$$d[p]=l;var _=this.$$c;if(_){var f=Ne(_,p)?.get;f?_[p]=l:_.$set({[p]:l})}}})}),n.forEach(p=>{re(s.prototype,p,{get(){return this.$$c?.[p]}})}),o&&(s=o(s)),e.element=s,s}function Gt(...e){return function(t){return rt.DocItem(t)&&e.includes(t.label)}}var ht={CodeItem:Gt("code"),ListItem:Gt("list_item"),PictureItem:Gt("picture"),SectionHeaderItem:Gt("section_header"),TableItem:Gt("document_index","table"),TextItem:Gt("caption","checkbox_selected","checkbox_unselected","footnote","page_footer","page_header","paragraph","reference","text")},rt={Document(e){return"schema_name"in e&&e.schema_name==="DoclingDocument"},NodeItem(e){return"self_ref"in e},GroupItem(e){return rt.NodeItem(e)&&(e.self_ref.startsWith("#/groups/")||e.self_ref==="#/body")},DocItem(e){return rt.NodeItem(e)&&!rt.GroupItem(e)},...ht};function*Xo(e,t={}){e&&(yield*r(t.root??e.body));function*r(n,i=0){if((!rt.GroupItem(n)||t.withGroups)&&(rt.DocItem(n)?(t.pageNo===void 0||n.prov?.some(o=>o.page_no===t.pageNo))&&(yield[n,i]):yield[n,i]),!(rt.PictureItem(n)&&!t.traversePictures))for(let o of n.children??[]){let s=us(e,o);rt.NodeItem(s)&&(yield*r(s,i+1))}}}function us(e,t){return t.$ref.split("/").slice(1).reduce((n,i)=>n[i],e)}function ps(e){return Object.values(e?.pages??{}).sort((t,r)=>t.page_no-r.page_no)}async function qr(e,t={}){let r;typeof e=="string"?r=await(await fetch(e)).json():typeof e=="object"&&rt.Document(e)&&(r=e);let n=ps(r),i=Array.from(Xo(r)).map(([l])=>l),o=i,s=new Set;if(typeof t.items=="string"){let l=new Set(t.items.split(",").map(_=>_.trim()).filter(_=>_.length>0));if(l.size>0){o=[];for(let _ of i){let f=_.self_ref.split("/"),a=[];for(let c=2;c<f.length+1;c++)a.push(f.slice(0,c).join("/"));_.prov?.forEach(c=>a.push(`#/pages/${c.page_no}`)),a.some(c=>l.has(c))?o.push(_):_.prov?.forEach(c=>s.add(c.page_no))}}}else if(Array.isArray(t.items)){o=[];let l=new Set(t.items);for(let _ of i)l.has(_)?o.push(_):_.prov?.forEach(f=>s.add(f.page_no))}let p={};for(let l of n)p[l.page_no]=[];for(let l of o)for(let _ of l.prov??[])p[_.page_no].push(l);return n.map(l=>({page:l,items:p[l.page_no],trimmed:s.has(l.page_no)}))}var _s=L("<td> </td>"),ds=L("<tr></tr>"),ms=L('<div class="container svelte-1c6yx17"><table class="svelte-1c6yx17"><tbody></tbody></table></div>'),vs={hash:"svelte-1c6yx17",code:".container.svelte-1c6yx17 {position:relative;min-width:0;max-width:100%;min-height:0;overflow:auto;}table.svelte-1c6yx17 {border-collapse:collapse;}td.svelte-1c6yx17 {padding:0 0.5rem;background-color:var(--cds-layer);border:1px solid rgb(220, 220, 220);color:black;font-size:0.75rem;line-height:1.5rem;text-decoration:none;word-break:normal;text-align:left;}td.header.svelte-1c6yx17 {font-weight:bold;}td.svelte-1c6yx17:hover {filter:brightness(95%);}td.svelte-1c6yx17:target {outline:3px solid blue;}"};function Br(e,t){Q(t,!0),le(e,vs);let r=E(t,"item",7),n=D(()=>function(){let p=new Set;return function(l){let _=p.has([l.start_col_offset_idx,l.start_row_offset_idx].join());if(!_)for(let f=l.start_col_offset_idx;f<l.end_col_offset_idx;f++)for(let a=l.start_row_offset_idx;a<l.end_row_offset_idx;a++)p.add([f,a].join());return _}}());var i=ms(),o=B(i),s=B(o);return _e(s,21,()=>r().data.grid,pe,(p,l)=>{var _=ds();_e(_,21,()=>d(l),pe,(f,a)=>{var c=H(),u=V(c);{var g=m=>{var $=_s();let h=D(()=>`${r().self_ref}/${d(a).start_col_offset_idx}/${d(a).start_row_offset_idx}`.slice(1));var v=B($,!0);P($),q(()=>{A($,"id",d(h)),Nn($,Pr(d(a).column_header||d(a).row_header?"header":""),"svelte-1c6yx17"),A($,"colspan",d(a).col_span),A($,"rowspan",d(a).row_span),Ie(v,d(a).text)}),k(m,$)};M(u,m=>{d(n)(d(a))||m(g)})}k(f,c)}),P(_),k(p,_)}),P(s),P(o),P(i),k(e,i),ee({get item(){return r()},set item(p){r(p),b()}})}fe(Br,{item:{}},[],[],!0);var hs=L('<p class="svelte-1v2vl7q"> </p>'),gs=L('<h2 class="svelte-1v2vl7q"> </h2>'),xs=L("<div><span> </span></div>"),ys={hash:"svelte-1v2vl7q",code:`p.svelte-1v2vl7q,
31
31
  h2.svelte-1v2vl7q {margin:0;overflow-wrap:anywhere;}p.svelte-1v2vl7q {font-size:1rem;line-height:1.25rem;}h2.svelte-1v2vl7q {font-size:1.5rem;line-height:2rem;}`};function Wt(e,t){Q(t,!0),le(e,ys);let r=E(t,"item",7);var n=H(),i=V(n);{var o=p=>{var l=hs(),_=B(l,!0);P(l),q(()=>Ie(_,r().text)),k(p,l)},s=p=>{var l=H(),_=V(l);{var f=c=>{var u=gs(),g=B(u,!0);P(u),q(()=>Ie(g,r().text)),k(c,u)},a=c=>{var u=H(),g=V(u);{var m=h=>{var v=xs();Or(v,"display","flex"),Or(v,"gap","0.5rem");var y=B(v),R=B(y,!0);P(y),P(v),q(()=>Ie(R,r().text)),k(h,v)},$=h=>{var v=H(),y=V(v);{var R=w=>{Br(w,{get item(){return r()}})};M(y,w=>{ht.TableItem(r())&&w(R)},!0)}k(h,v)};M(g,h=>{ht.ListItem(r())?h(m):h($,!1)},!0)}k(c,u)};M(_,c=>{ht.SectionHeaderItem(r())?c(f):c(a,!1)},!0)}k(p,l)};M(i,p=>{ht.TextItem(r())?p(o):p(s,!1)})}return k(e,n),ee({get item(){return r()},set item(p){r(p),b()}})}fe(Wt,{item:{}},[],[],!0);var bs=["TextItem","SectionHeaderItem","ListItem","TableItem"];function Jo(e){return bs.some(t=>ht[t](e))}var $s=(e,t)=>d(t)?.(e),ws=St('<rect class="svelte-1fyhyqt"></rect>'),Es=St('<image class="backdrop svelte-1fyhyqt"></image><clipPath></clipPath>',1),Ts=(e,t,r)=>{e.stopPropagation(),d(t)?.(e,d(r))},ks=St('<rect vector-effect="non-scaling-stroke" class="svelte-1fyhyqt"></rect>'),As=L('<header part="page-number-top" class="page-number-top svelte-1fyhyqt"> </header> <header part="page-number-bottom" class="page-number-bottom svelte-1fyhyqt"> </header>',1),Ss=L('<div part="tooltip" class="tooltip svelte-1fyhyqt"></div>'),Is=L('<div part="page" class="page svelte-1fyhyqt" role="tab"><svg class="svelte-1fyhyqt"><!><image id="image"></image><!></svg> <!> <!></div>'),Ns={hash:"svelte-1fyhyqt",code:`svg.svelte-1fyhyqt {max-width:100%;}.page.svelte-1fyhyqt {position:relative;width:fit-content;max-width:100%;display:flex;flex-direction:column;gap:1px;}.backdrop.svelte-1fyhyqt {opacity:0.3;}.page-number-top.svelte-1fyhyqt,
32
32
  .page-number-bottom.svelte-1fyhyqt {position:absolute;width:fit-content;padding:0 0.25rem;font-size:0.75rem;line-height:1rem;color:rgb(120, 120, 120);mix-blend-mode:difference;}.page-number-top.svelte-1fyhyqt {top:0;}.page-number-bottom.svelte-1fyhyqt {bottom:0;}rect.svelte-1fyhyqt {fill:blue;fill-opacity:0.0001; /* To activate hover. */stroke:grey;stroke-width:1px;stroke-dasharray:1;cursor:pointer;}rect.svelte-1fyhyqt:hover {fill-opacity:0.1;stroke:blue;}rect.svelte-1fyhyqt:target {stroke:blue;stroke-width:3px;stroke-dasharray:none;}.tooltip.svelte-1fyhyqt {position:fixed;z-index:100;padding:1rem;margin:1rem;background:white;border:1px solid rgb(230, 230, 230);box-shadow:0 0.5rem 1rem 0 rgba(0, 0, 0, 0.2);}`};function Vr(e,t){Q(t,!0),le(e,Ns);let r=E(t,"page",7),n=E(t,"items",23,()=>[]),i=E(t,"pagenumbers",7),o=E(t,"backdrop",7),s=E(t,"tooltip",7,""),p=E(t,"itemPart",7),l=E(t,"itemStyle",7),_=E(t,"onclick",7),f=new Set(["parsed"]),a=s().split(",").map(v=>v.trim()).filter(v=>f.has(v)),c=Qr(void 0),u=D(()=>_()?(v,y)=>_()(v,r(),y):void 0);var g=H(),m=V(g);{var $=v=>{var y=Is();let R=D(()=>{let{size:ne}=r();return{size:ne}}),w=D(()=>{let{width:ne=1,height:te=1}=d(R).size;return{width:ne,height:te}});y.__click=[$s,u];var N=B(y),F=B(N);{var de=ne=>{var te=Es(),ye=V(te),Ue=Ye(ye);_e(Ue,21,n,pe,(ze,xt)=>{var je=H();let oe=D(()=>d(xt).prov?.find(me=>me.page_no===r().page_no));var ft=V(je);{var ct=me=>{var Ge=ws();let We=D(()=>{let{l:jr,r:Gr,t:ti,b:ri}=d(oe).bbox;return{l:jr,r:Gr,t:ti,b:ri}});q(()=>{A(Ge,"x",d(We).l),A(Ge,"y",d(w).height-d(We).t),A(Ge,"width",d(We).r-d(We).l),A(Ge,"height",d(We).t-d(We).b)}),k(me,Ge)};M(ft,me=>{d(oe)&&me(ct)})}k(ze,je)}),P(Ue),q(()=>{A(ye,"href",r().image.uri),A(ye,"width",d(w).width),A(ye,"height",d(w).height),A(Ue,"id",`clip-page-${r().page_no??""}`)}),k(ne,te)};M(F,ne=>{o()&&ne(de)})}var K=Ye(F),_r=Ye(K);_e(_r,17,n,pe,(ne,te)=>{var ye=H();let Ue=D(()=>d(te).prov?.find(je=>je.page_no===r().page_no));var ze=V(ye);{var xt=je=>{var oe=ks();let ft=D(()=>{let{l:ct,r:me,t:Ge,b:We}=d(Ue).bbox;return{l:ct,r:me,t:Ge,b:We}});oe.__click=[Ts,u,te],q((ct,me)=>{A(oe,"part",ct),A(oe,"style",me),A(oe,"x",d(ft).l),A(oe,"y",d(w).height-d(ft).t),A(oe,"width",d(ft).r-d(ft).l),A(oe,"height",d(ft).t-d(ft).b)},[()=>"item"+(p()?" "+p()(r(),d(te)):""),()=>l()?.(r(),d(te))]),Dr("mouseenter",oe,ct=>{let me=ct.currentTarget.getBoundingClientRect(),Ge=[me.top*window.innerWidth,(window.innerWidth-me.right)*window.innerHeight,(window.innerHeight-me.bottom)*window.innerWidth,me.left*window.innerHeight],We=Math.max(...Ge),jr=Ge.findIndex(Gr=>Gr===We);j(c,Qe({item:d(te),bounds:me,quadrant:jr}))}),Dr("mouseleave",oe,ct=>j(c,void 0)),k(je,oe)};M(ze,je=>{d(Ue)&&je(xt)})}k(ne,ye)}),P(N);var Nt=Ye(N,2);{var gt=ne=>{var te=As(),ye=V(te),Ue=B(ye,!0);P(ye);var ze=Ye(ye,2),xt=B(ze,!0);P(ze),q(()=>{A(ye,"title",`Page ${r().page_no??""}`),Ie(Ue,r().page_no),A(ze,"title",`Page ${r().page_no??""}`),Ie(xt,r().page_no)}),k(ne,te)};M(Nt,ne=>{i()&&ne(gt)})}var Kt=Ye(Nt,2);{var zr=ne=>{var te=Ss();_e(te,21,()=>a,pe,(ye,Ue)=>{var ze=H(),xt=V(ze);{var je=oe=>{Wt(oe,{get item(){return d(c).item}})};M(xt,oe=>{d(Ue)==="parsed"&&oe(je)})}k(ye,ze)}),P(te),q(()=>A(te,"style",`
33
33
  ${(d(c).quadrant===1?`left: ${d(c).bounds.right}px`:d(c).quadrant===3?`right: ${document.body.clientWidth-d(c).bounds.left}px`:`left: calc(${d(c).bounds.left}px - 2rem)`)??""};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docling/docling-components",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Web components for displaying Docling output.",
5
5
  "main": "./dist/index.js",
6
6
  "files": [
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "homepage": "https://github.com/DS4SD/docling-ts/tree/main/docling-components",
54
54
  "dependencies": {
55
- "@docling/docling-core": "^0.0.3",
55
+ "@docling/docling-core": "^0.0.4",
56
56
  "svelte": "^5.2.0"
57
57
  },
58
58
  "devDependencies": {