diff --git a/CHANGELOG.md b/CHANGELOG.md index 910cabc0..2b4dcdec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.0.1](https://github.com/watson-developer-cloud/discovery-components/compare/v6.0.0...v6.0.1) (2024-08-13) + + +### Bug Fixes + +* return normalized text divs/content values ([#581](https://github.com/watson-developer-cloud/discovery-components/issues/581)) ([a357da2](https://github.com/watson-developer-cloud/discovery-components/commit/a357da2bf166fe6ec125dfbd89a67b51b365a4f2)) + + + + + # [6.0.0](https://github.com/watson-developer-cloud/discovery-components/compare/v5.0.4...v6.0.0) (2024-08-08) diff --git a/docs/storybook/assets/Color-6VNJS4EI-buA192xZ.js b/docs/storybook/assets/Color-6VNJS4EI--3Onf2Q9.js similarity index 99% rename from docs/storybook/assets/Color-6VNJS4EI-buA192xZ.js rename to docs/storybook/assets/Color-6VNJS4EI--3Onf2Q9.js index 110a9a62..7c0bda72 100644 --- a/docs/storybook/assets/Color-6VNJS4EI-buA192xZ.js +++ b/docs/storybook/assets/Color-6VNJS4EI--3Onf2Q9.js @@ -1 +1 @@ -import{n as w,f as Z,T as me,F as pe,I as ve,g as ye}from"./index-zqxewmvn.js";import{R as f,r as b,g as ee}from"./index-RfLt4OUa.js";import{d as xe}from"./debounce-A_lzSYvo.js";import{c as we}from"./callBound-Uz6qjr9w.js";import"./iframe-FA3YUiXb.js";import"../sb-preview/runtime.js";import"./pickBy-ZgIsky0p.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";function k(){return(k=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function T(e){var t=b.useRef(e),n=b.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var $=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:v.buttons>0)&&o.current?a(A(o.current,v,s.current)):E(!1)},j=function(){return E(!1)};function E(v){var m=c.current,x=L(o.current),N=v?x.addEventListener:x.removeEventListener;N(m?"touchmove":"mousemove",_),N(m?"touchend":"mouseup",j)}return[function(v){var m=v.nativeEvent,x=o.current;if(x&&(U(m),!function(ge,be){return be&&!O(ge)}(m,c.current)&&x)){if(O(m)){c.current=!0;var N=m.changedTouches||[];N.length&&(s.current=N[0].identifier)}x.focus(),a(A(x,m,s.current)),E(!0)}},function(v){var m=v.which||v.keyCode;m<37||m>40||(v.preventDefault(),l({left:m===39?.05:m===37?-.05:0,top:m===40?.05:m===38?-.05:0}))},E]},[l,a]),d=u[0],h=u[1],g=u[2];return b.useEffect(function(){return g},[g]),f.createElement("div",k({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"}))}),S=function(e){return e.filter(Boolean).join(" ")},W=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,a=S(["react-colorful__pointer",e.className]);return f.createElement("div",{className:a,style:{top:100*o+"%",left:100*n+"%"}},f.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},p=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},ke={grad:.9,turn:360,rad:360/(2*Math.PI)},_e=function(e){return re(X(e))},X=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?p(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?p(parseInt(e.substring(6,8),16)/255,2):1}},Ee=function(e,t){return t===void 0&&(t="deg"),Number(e)*(ke[t]||1)},Me=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?Ce({h:Ee(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},Ce=function(e){var t=e.s,n=e.l;return{h:e.h,s:(t*=(n<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}},$e=function(e){return Oe(ne(e))},te=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:p(e.h),s:p(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:p(o/2),a:p(r,2)}},B=function(e){var t=te(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},H=function(e){var t=te(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},ne=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),l=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),u=a%6;return{r:p(255*[r,s,l,l,c,r][u]),g:p(255*[c,r,r,s,l,l][u]),b:p(255*[l,l,c,r,r,s][u]),a:p(o,2)}},Ne=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?re({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},z=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Oe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=o<1?z(p(255*o)):"";return"#"+z(t)+z(n)+z(r)+a},re=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),l=a-Math.min(t,n,r),s=l?a===t?(n-r)/l:a===n?2+(r-t)/l:4+(t-n)/l:0;return{h:p(60*(s<0?s+6:s)),s:p(a?l/a*100:0),v:p(a/255*100),a:o}},oe=f.memo(function(e){var t=e.hue,n=e.onChange,r=S(["react-colorful__hue",e.className]);return f.createElement("div",{className:r},f.createElement(G,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:$(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":p(t),"aria-valuemax":"360","aria-valuemin":"0"},f.createElement(W,{className:"react-colorful__hue-pointer",left:t/360,color:B({h:t,s:100,v:100,a:1})})))}),ae=f.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:B({h:t.h,s:100,v:100,a:1})};return f.createElement("div",{className:"react-colorful__saturation",style:r},f.createElement(G,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:$(t.s+100*o.left,0,100),v:$(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+p(t.s)+"%, Brightness "+p(t.v)+"%"},f.createElement(W,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:B(t)})))}),le=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},se=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},Re=function(e,t){return e.toLowerCase()===t.toLowerCase()||le(X(e),X(t))};function ce(e,t,n){var r=T(n),o=b.useState(function(){return e.toHsva(t)}),a=o[0],l=o[1],s=b.useRef({color:t,hsva:a});b.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},l(u)}},[t,e]),b.useEffect(function(){var u;le(a,s.current.hsva)||e.equal(u=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:u},r(u))},[a,e,r]);var c=b.useCallback(function(u){l(function(d){return Object.assign({},d,u)})},[]);return[a,c]}var Se=typeof window<"u"?b.useLayoutEffect:b.useEffect,je=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Y=new Map,ie=function(e){Se(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Y.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Y.set(t,n);var r=je();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},ze=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=V(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ie(s);var c=ce(n,o,a),u=c[0],d=c[1],h=S(["react-colorful",t]);return f.createElement("div",k({},l,{ref:s,className:h}),f.createElement(ae,{hsva:u,onChange:d}),f.createElement(oe,{hue:u.h,onChange:d,className:"react-colorful__last-control"}))},Ie={defaultColor:"000",toHsva:_e,fromHsva:function(e){return $e({h:e.h,s:e.s,v:e.v,a:1})},equal:Re},Fe=function(e){return f.createElement(ze,k({},e,{colorModel:Ie}))},He=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+H(Object.assign({},n,{a:0}))+", "+H(Object.assign({},n,{a:1}))+")"},a=S(["react-colorful__alpha",t]),l=p(100*n.a);return f.createElement("div",{className:a},f.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),f.createElement(G,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:$(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},f.createElement(W,{className:"react-colorful__alpha-pointer",left:n.a,color:H(n)})))},ue=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=V(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ie(s);var c=ce(n,o,a),u=c[0],d=c[1],h=S(["react-colorful",t]);return f.createElement("div",k({},l,{ref:s,className:h}),f.createElement(ae,{hsva:u,onChange:d}),f.createElement(oe,{hue:u.h,onChange:d}),f.createElement(He,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},Pe={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:Me,fromHsva:H,equal:se},qe=function(e){return f.createElement(ue,k({},e,{colorModel:Pe}))},Te={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Ne,fromHsva:function(e){var t=ne(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:se},Le=function(e){return f.createElement(ue,k({},e,{colorModel:Te}))},Xe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const R=Xe,fe={};for(const e of Object.keys(R))fe[R[e]]=e;const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var he=i;for(const e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),a=Math.max(t,n,r),l=a-o;let s,c;a===o?s=0:t===a?s=(n-r)/l:n===a?s=2+(r-t)/l:r===a&&(s=4+(t-n)/l),s=Math.min(s*60,360),s<0&&(s+=360);const u=(o+a)/2;return a===o?c=0:u<=.5?c=l/(a+o):c=l/(2-a-o),[s,c*100,u*100]};i.rgb.hsv=function(e){let t,n,r,o,a;const l=e[0]/255,s=e[1]/255,c=e[2]/255,u=Math.max(l,s,c),d=u-Math.min(l,s,c),h=function(g){return(u-g)/6/d+1/2};return d===0?(o=0,a=0):(a=d/u,t=h(l),n=h(s),r=h(c),l===u?o=r-n:s===u?o=1/3+t-r:c===u&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,a*100,u*100]};i.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=i.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,a*100,r*100]};i.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),a=(1-t-o)/(1-o)||0,l=(1-n-o)/(1-o)||0,s=(1-r-o)/(1-o)||0;return[a*100,l*100,s*100,o*100]};function Be(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){const t=fe[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(R)){const a=R[o],l=Be(e,a);l.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,l=t*.0193+n*.1192+r*.9505;return[o*100,a*100,l*100]};i.rgb.lab=function(e){const t=i.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const a=116*r-16,l=500*(n-r),s=200*(r-o);return[a,l,s]};i.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,a,l;if(n===0)return l=r*255,[l,l,l];r<.5?o=r*(1+n):o=r+n-r*n;const s=2*r-o,c=[0,0,0];for(let u=0;u<3;u++)a=t+1/3*-(u-1),a<0&&a++,a>1&&a--,6*a<1?l=s+(o-s)*6*a:2*a<1?l=o:3*a<2?l=s+(o-s)*(2/3-a)*6:l=s,c[u]=l*255;return c};i.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=a<=1?a:2-a;const l=(r+n)/2,s=r===0?2*o/(a+o):2*n/(r+n);return[t,s*100,l*100]};i.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,a=t-Math.floor(t),l=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,o){case 0:return[r,c,l];case 1:return[s,r,l];case 2:return[l,r,c];case 3:return[l,s,r];case 4:return[c,l,r];case 5:return[r,l,s]}};i.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let a,l;l=(2-n)*r;const s=(2-n)*o;return a=n*o,a/=s<=1?s:2-s,a=a||0,l/=2,[t,a*100,l*100]};i.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let a;o>1&&(n/=o,r/=o);const l=Math.floor(6*t),s=1-r;a=6*t-l,l&1&&(a=1-a);const c=n+a*(s-n);let u,d,h;switch(l){default:case 6:case 0:u=s,d=c,h=n;break;case 1:u=c,d=s,h=n;break;case 2:u=n,d=s,h=c;break;case 3:u=n,d=c,h=s;break;case 4:u=c,d=n,h=s;break;case 5:u=s,d=n,h=c;break}return[u*255,d*255,h*255]};i.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,a=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,n*(1-o)+o),s=1-Math.min(1,r*(1-o)+o);return[a*255,l*255,s*255]};i.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,a,l;return o=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,l=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),l=Math.min(Math.max(0,l),1),[o*255,a*255,l*255]};i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,a=500*(t-n),l=200*(n-r);return[o,a,l]};i.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,a,l;a=(t+16)/116,o=n/500+a,l=a-r/200;const s=a**3,c=o**3,u=l**3;return a=s>.008856?s:(a-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,l=u>.008856?u:(l-16/116)/7.787,o*=95.047,a*=100,l*=108.883,[o,a,l]};i.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const l=Math.sqrt(n*n+r*r);return[t,l,o]};i.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,a=n*Math.cos(o),l=n*Math.sin(o);return[t,a,l]};i.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let a=t===null?i.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let l=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(l+=60),l};i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])};i.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,o,a]};i.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};i.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};i.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),o=r>>16&255,a=r>>8&255,l=r&255;return[o,a,l]};i.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),l=o-a;let s,c;return l<1?s=a/(1-l):s=0,l<=0?c=0:o===t?c=(n-r)/l%6:o===n?c=2+(r-t)/l:c=4+(t-n)/l,c/=6,c%=1,[c*360,l*100,s*100]};i.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};i.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};i.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],a=t%1*6,l=a%1,s=1-l;let c=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return c=(1-n)*r,[(n*o[0]+c)*255,(n*o[1]+c)*255,(n*o[2]+c)*255]};i.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};i.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};i.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};i.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let a=0;return o<1&&(a=(r-o)/(1-o)),[e[0],o*100,a*100]};i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};i.gray.hsl=function(e){return[0,0,e[0]]};i.gray.hsv=i.gray.hsl;i.gray.hwb=function(e){return[0,100,e[0]]};i.gray.cmyk=function(e){return[0,0,0,e[0]]};i.gray.lab=function(e){return[e[0],0,0]};i.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const P=he;function De(){const e={},t=Object.keys(P);for(let n=t.length,r=0;r1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function Je(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let a=o.length,l=0;l{M[e]={},Object.defineProperty(M[e],"channels",{value:D[e].channels}),Object.defineProperty(M[e],"labels",{value:D[e].labels});const t=Ae(e);Object.keys(t).forEach(r=>{const o=t[r];M[e][r]=Je(o),M[e][r].raw=Ye(o)})});var Qe=M;const y=ee(Qe);var Ze=xe,et=we,tt="Expected a function";function nt(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(tt);return et(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ze(e,t,{leading:r,maxWait:t,trailing:o})}var rt=nt;const ot=ee(rt);var at=w.div({position:"relative",maxWidth:250}),lt=w(Z)({position:"absolute",zIndex:1,top:4,left:4}),st=w.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),ct=w(me)(({theme:e})=>({fontFamily:e.typography.fonts.base})),it=w.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),ut=w.div(({theme:e,active:t})=>({width:16,height:16,boxShadow:t?`${e.appBorderColor} 0 0 0 1px inset, ${e.textMutedColor}50 0 0 0 4px`:`${e.appBorderColor} 0 0 0 1px inset`,borderRadius:e.appBorderRadius})),ft=`url('data:image/svg+xml;charset=utf-8,')`,J=({value:e,active:t,onClick:n,style:r,...o})=>{let a=`linear-gradient(${e}, ${e}), ${ft}, linear-gradient(#fff, #fff)`;return f.createElement(ut,{...o,active:t,onClick:n,style:{...r,backgroundImage:a}})},ht=w(pe.Input)(({theme:e})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:e.typography.fonts.base})),dt=w(ve)(({theme:e})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:e.input.color})),de=(e=>(e.RGB="rgb",e.HSL="hsl",e.HEX="hex",e))(de||{}),I=Object.values(de),gt=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,bt=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,mt=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,K=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,pt=/^\s*#?([0-9a-f]{3})\s*$/i,vt={hex:Fe,rgb:Le,hsl:qe},F={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},Q=e=>{let t=e==null?void 0:e.match(gt);if(!t)return[0,0,0,1];let[,n,r,o,a=1]=t;return[n,r,o,a].map(Number)},C=e=>{if(!e)return;let t=!0;if(bt.test(e)){let[l,s,c,u]=Q(e),[d,h,g]=y.rgb.hsl([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:y.rgb.keyword([l,s,c]),colorSpace:"rgb",rgb:e,hsl:`hsla(${d}, ${h}%, ${g}%, ${u})`,hex:`#${y.rgb.hex([l,s,c]).toLowerCase()}`}}if(mt.test(e)){let[l,s,c,u]=Q(e),[d,h,g]=y.hsl.rgb([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:y.hsl.keyword([l,s,c]),colorSpace:"hsl",rgb:`rgba(${d}, ${h}, ${g}, ${u})`,hsl:e,hex:`#${y.hsl.hex([l,s,c]).toLowerCase()}`}}let n=e.replace("#",""),r=y.keyword.rgb(n)||y.hex.rgb(n),o=y.rgb.hsl(r),a=e;if(/[^#a-f0-9]/i.test(e)?a=n:K.test(e)&&(a=`#${n}`),a.startsWith("#"))t=K.test(a);else try{y.keyword.hex(a)}catch{t=!1}return{valid:t,value:a,keyword:y.rgb.keyword(r),colorSpace:"hex",rgb:`rgba(${r[0]}, ${r[1]}, ${r[2]}, 1)`,hsl:`hsla(${o[0]}, ${o[1]}%, ${o[2]}%, 1)`,hex:a}},yt=(e,t,n)=>{if(!e||!(t!=null&&t.valid))return F[n];if(n!=="hex")return(t==null?void 0:t[n])||F[n];if(!t.hex.startsWith("#"))try{return`#${y.keyword.hex(t.hex)}`}catch{return F.hex}let r=t.hex.match(pt);if(!r)return K.test(t.hex)?t.hex:F.hex;let[o,a,l]=r[1].split("");return`#${o}${o}${a}${a}${l}${l}`},xt=(e,t)=>{let[n,r]=b.useState(e||""),[o,a]=b.useState(()=>C(n)),[l,s]=b.useState((o==null?void 0:o.colorSpace)||"hex");b.useEffect(()=>{let h=e||"",g=C(h);r(h),a(g),s((g==null?void 0:g.colorSpace)||"hex")},[e]);let c=b.useMemo(()=>yt(n,o,l).toLowerCase(),[n,o,l]),u=b.useCallback(h=>{let g=C(h),_=(g==null?void 0:g.value)||h||"";r(_),_===""&&(a(void 0),t(void 0)),g&&(a(g),s(g.colorSpace),t(g.value))},[t]),d=b.useCallback(()=>{let h=I.indexOf(l)+1;h>=I.length&&(h=0),s(I[h]);let g=(o==null?void 0:o[I[h]])||"";r(g),t(g)},[o,l,t]);return{value:n,realValue:c,updateValue:u,color:o,colorSpace:l,cycleColorSpace:d}},q=e=>e.replace(/\s*/,"").toLowerCase(),wt=(e,t,n)=>{let[r,o]=b.useState(t!=null&&t.valid?[t]:[]);b.useEffect(()=>{t===void 0&&o([])},[t]);let a=b.useMemo(()=>(e||[]).map(s=>typeof s=="string"?C(s):s.title?{...C(s.color),keyword:s.title}:C(s.color)).concat(r).filter(Boolean).slice(-27),[e,r]),l=b.useCallback(s=>{s!=null&&s.valid&&(a.some(c=>q(c[n])===q(s[n]))||o(c=>c.concat(s)))},[n,a]);return{presets:a,addPreset:l}},kt=({name:e,value:t,onChange:n,onFocus:r,onBlur:o,presetColors:a,startOpen:l=!1})=>{let s=b.useCallback(ot(n,200),[n]),{value:c,realValue:u,updateValue:d,color:h,colorSpace:g,cycleColorSpace:_}=xt(t,s),{presets:j,addPreset:E}=wt(a,h,g),v=vt[g];return f.createElement(at,null,f.createElement(lt,{startOpen:l,closeOnOutsideClick:!0,onVisibleChange:()=>E(h),tooltip:f.createElement(st,null,f.createElement(v,{color:u==="transparent"?"#000000":u,onChange:d,onFocus:r,onBlur:o}),j.length>0&&f.createElement(it,null,j.map((m,x)=>f.createElement(Z,{key:`${m.value}-${x}`,hasChrome:!1,tooltip:f.createElement(ct,{note:m.keyword||m.value})},f.createElement(J,{value:m[g],active:h&&q(m[g])===q(h[g]),onClick:()=>d(m.value)})))))},f.createElement(J,{value:u,style:{margin:4}})),f.createElement(ht,{id:ye(e),value:c,onChange:m=>d(m.target.value),onFocus:m=>m.target.select(),placeholder:"Choose color..."}),c?f.createElement(dt,{icon:"markup",onClick:_}):null)},Dt=kt;export{kt as ColorControl,Dt as default}; +import{n as w,f as Z,T as me,F as pe,I as ve,g as ye}from"./index-tQLynm0T.js";import{R as f,r as b,g as ee}from"./index-RfLt4OUa.js";import{d as xe}from"./debounce-A_lzSYvo.js";import{c as we}from"./callBound-Uz6qjr9w.js";import"./iframe-xC5OGfiz.js";import"../sb-preview/runtime.js";import"./pickBy-ZgIsky0p.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";function k(){return(k=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function T(e){var t=b.useRef(e),n=b.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var $=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:v.buttons>0)&&o.current?a(A(o.current,v,s.current)):E(!1)},j=function(){return E(!1)};function E(v){var m=c.current,x=L(o.current),N=v?x.addEventListener:x.removeEventListener;N(m?"touchmove":"mousemove",_),N(m?"touchend":"mouseup",j)}return[function(v){var m=v.nativeEvent,x=o.current;if(x&&(U(m),!function(ge,be){return be&&!O(ge)}(m,c.current)&&x)){if(O(m)){c.current=!0;var N=m.changedTouches||[];N.length&&(s.current=N[0].identifier)}x.focus(),a(A(x,m,s.current)),E(!0)}},function(v){var m=v.which||v.keyCode;m<37||m>40||(v.preventDefault(),l({left:m===39?.05:m===37?-.05:0,top:m===40?.05:m===38?-.05:0}))},E]},[l,a]),d=u[0],h=u[1],g=u[2];return b.useEffect(function(){return g},[g]),f.createElement("div",k({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"}))}),S=function(e){return e.filter(Boolean).join(" ")},W=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,a=S(["react-colorful__pointer",e.className]);return f.createElement("div",{className:a,style:{top:100*o+"%",left:100*n+"%"}},f.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},p=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},ke={grad:.9,turn:360,rad:360/(2*Math.PI)},_e=function(e){return re(X(e))},X=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?p(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?p(parseInt(e.substring(6,8),16)/255,2):1}},Ee=function(e,t){return t===void 0&&(t="deg"),Number(e)*(ke[t]||1)},Me=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?Ce({h:Ee(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},Ce=function(e){var t=e.s,n=e.l;return{h:e.h,s:(t*=(n<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}},$e=function(e){return Oe(ne(e))},te=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:p(e.h),s:p(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:p(o/2),a:p(r,2)}},B=function(e){var t=te(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},H=function(e){var t=te(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},ne=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),l=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),u=a%6;return{r:p(255*[r,s,l,l,c,r][u]),g:p(255*[c,r,r,s,l,l][u]),b:p(255*[l,l,c,r,r,s][u]),a:p(o,2)}},Ne=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?re({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},z=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Oe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=o<1?z(p(255*o)):"";return"#"+z(t)+z(n)+z(r)+a},re=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),l=a-Math.min(t,n,r),s=l?a===t?(n-r)/l:a===n?2+(r-t)/l:4+(t-n)/l:0;return{h:p(60*(s<0?s+6:s)),s:p(a?l/a*100:0),v:p(a/255*100),a:o}},oe=f.memo(function(e){var t=e.hue,n=e.onChange,r=S(["react-colorful__hue",e.className]);return f.createElement("div",{className:r},f.createElement(G,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:$(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":p(t),"aria-valuemax":"360","aria-valuemin":"0"},f.createElement(W,{className:"react-colorful__hue-pointer",left:t/360,color:B({h:t,s:100,v:100,a:1})})))}),ae=f.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:B({h:t.h,s:100,v:100,a:1})};return f.createElement("div",{className:"react-colorful__saturation",style:r},f.createElement(G,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:$(t.s+100*o.left,0,100),v:$(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+p(t.s)+"%, Brightness "+p(t.v)+"%"},f.createElement(W,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:B(t)})))}),le=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},se=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},Re=function(e,t){return e.toLowerCase()===t.toLowerCase()||le(X(e),X(t))};function ce(e,t,n){var r=T(n),o=b.useState(function(){return e.toHsva(t)}),a=o[0],l=o[1],s=b.useRef({color:t,hsva:a});b.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},l(u)}},[t,e]),b.useEffect(function(){var u;le(a,s.current.hsva)||e.equal(u=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:u},r(u))},[a,e,r]);var c=b.useCallback(function(u){l(function(d){return Object.assign({},d,u)})},[]);return[a,c]}var Se=typeof window<"u"?b.useLayoutEffect:b.useEffect,je=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Y=new Map,ie=function(e){Se(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Y.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Y.set(t,n);var r=je();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},ze=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=V(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ie(s);var c=ce(n,o,a),u=c[0],d=c[1],h=S(["react-colorful",t]);return f.createElement("div",k({},l,{ref:s,className:h}),f.createElement(ae,{hsva:u,onChange:d}),f.createElement(oe,{hue:u.h,onChange:d,className:"react-colorful__last-control"}))},Ie={defaultColor:"000",toHsva:_e,fromHsva:function(e){return $e({h:e.h,s:e.s,v:e.v,a:1})},equal:Re},Fe=function(e){return f.createElement(ze,k({},e,{colorModel:Ie}))},He=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+H(Object.assign({},n,{a:0}))+", "+H(Object.assign({},n,{a:1}))+")"},a=S(["react-colorful__alpha",t]),l=p(100*n.a);return f.createElement("div",{className:a},f.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),f.createElement(G,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:$(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},f.createElement(W,{className:"react-colorful__alpha-pointer",left:n.a,color:H(n)})))},ue=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=V(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ie(s);var c=ce(n,o,a),u=c[0],d=c[1],h=S(["react-colorful",t]);return f.createElement("div",k({},l,{ref:s,className:h}),f.createElement(ae,{hsva:u,onChange:d}),f.createElement(oe,{hue:u.h,onChange:d}),f.createElement(He,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},Pe={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:Me,fromHsva:H,equal:se},qe=function(e){return f.createElement(ue,k({},e,{colorModel:Pe}))},Te={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Ne,fromHsva:function(e){var t=ne(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:se},Le=function(e){return f.createElement(ue,k({},e,{colorModel:Te}))},Xe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const R=Xe,fe={};for(const e of Object.keys(R))fe[R[e]]=e;const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var he=i;for(const e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),a=Math.max(t,n,r),l=a-o;let s,c;a===o?s=0:t===a?s=(n-r)/l:n===a?s=2+(r-t)/l:r===a&&(s=4+(t-n)/l),s=Math.min(s*60,360),s<0&&(s+=360);const u=(o+a)/2;return a===o?c=0:u<=.5?c=l/(a+o):c=l/(2-a-o),[s,c*100,u*100]};i.rgb.hsv=function(e){let t,n,r,o,a;const l=e[0]/255,s=e[1]/255,c=e[2]/255,u=Math.max(l,s,c),d=u-Math.min(l,s,c),h=function(g){return(u-g)/6/d+1/2};return d===0?(o=0,a=0):(a=d/u,t=h(l),n=h(s),r=h(c),l===u?o=r-n:s===u?o=1/3+t-r:c===u&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,a*100,u*100]};i.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=i.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,a*100,r*100]};i.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),a=(1-t-o)/(1-o)||0,l=(1-n-o)/(1-o)||0,s=(1-r-o)/(1-o)||0;return[a*100,l*100,s*100,o*100]};function Be(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){const t=fe[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(R)){const a=R[o],l=Be(e,a);l.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,l=t*.0193+n*.1192+r*.9505;return[o*100,a*100,l*100]};i.rgb.lab=function(e){const t=i.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const a=116*r-16,l=500*(n-r),s=200*(r-o);return[a,l,s]};i.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,a,l;if(n===0)return l=r*255,[l,l,l];r<.5?o=r*(1+n):o=r+n-r*n;const s=2*r-o,c=[0,0,0];for(let u=0;u<3;u++)a=t+1/3*-(u-1),a<0&&a++,a>1&&a--,6*a<1?l=s+(o-s)*6*a:2*a<1?l=o:3*a<2?l=s+(o-s)*(2/3-a)*6:l=s,c[u]=l*255;return c};i.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=a<=1?a:2-a;const l=(r+n)/2,s=r===0?2*o/(a+o):2*n/(r+n);return[t,s*100,l*100]};i.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,a=t-Math.floor(t),l=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,o){case 0:return[r,c,l];case 1:return[s,r,l];case 2:return[l,r,c];case 3:return[l,s,r];case 4:return[c,l,r];case 5:return[r,l,s]}};i.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let a,l;l=(2-n)*r;const s=(2-n)*o;return a=n*o,a/=s<=1?s:2-s,a=a||0,l/=2,[t,a*100,l*100]};i.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let a;o>1&&(n/=o,r/=o);const l=Math.floor(6*t),s=1-r;a=6*t-l,l&1&&(a=1-a);const c=n+a*(s-n);let u,d,h;switch(l){default:case 6:case 0:u=s,d=c,h=n;break;case 1:u=c,d=s,h=n;break;case 2:u=n,d=s,h=c;break;case 3:u=n,d=c,h=s;break;case 4:u=c,d=n,h=s;break;case 5:u=s,d=n,h=c;break}return[u*255,d*255,h*255]};i.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,a=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,n*(1-o)+o),s=1-Math.min(1,r*(1-o)+o);return[a*255,l*255,s*255]};i.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,a,l;return o=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,l=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),l=Math.min(Math.max(0,l),1),[o*255,a*255,l*255]};i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,a=500*(t-n),l=200*(n-r);return[o,a,l]};i.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,a,l;a=(t+16)/116,o=n/500+a,l=a-r/200;const s=a**3,c=o**3,u=l**3;return a=s>.008856?s:(a-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,l=u>.008856?u:(l-16/116)/7.787,o*=95.047,a*=100,l*=108.883,[o,a,l]};i.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const l=Math.sqrt(n*n+r*r);return[t,l,o]};i.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,a=n*Math.cos(o),l=n*Math.sin(o);return[t,a,l]};i.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let a=t===null?i.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let l=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(l+=60),l};i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])};i.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,o,a]};i.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};i.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};i.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),o=r>>16&255,a=r>>8&255,l=r&255;return[o,a,l]};i.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),l=o-a;let s,c;return l<1?s=a/(1-l):s=0,l<=0?c=0:o===t?c=(n-r)/l%6:o===n?c=2+(r-t)/l:c=4+(t-n)/l,c/=6,c%=1,[c*360,l*100,s*100]};i.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};i.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};i.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],a=t%1*6,l=a%1,s=1-l;let c=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return c=(1-n)*r,[(n*o[0]+c)*255,(n*o[1]+c)*255,(n*o[2]+c)*255]};i.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};i.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};i.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};i.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let a=0;return o<1&&(a=(r-o)/(1-o)),[e[0],o*100,a*100]};i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};i.gray.hsl=function(e){return[0,0,e[0]]};i.gray.hsv=i.gray.hsl;i.gray.hwb=function(e){return[0,100,e[0]]};i.gray.cmyk=function(e){return[0,0,0,e[0]]};i.gray.lab=function(e){return[e[0],0,0]};i.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const P=he;function De(){const e={},t=Object.keys(P);for(let n=t.length,r=0;r1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function Je(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let a=o.length,l=0;l{M[e]={},Object.defineProperty(M[e],"channels",{value:D[e].channels}),Object.defineProperty(M[e],"labels",{value:D[e].labels});const t=Ae(e);Object.keys(t).forEach(r=>{const o=t[r];M[e][r]=Je(o),M[e][r].raw=Ye(o)})});var Qe=M;const y=ee(Qe);var Ze=xe,et=we,tt="Expected a function";function nt(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(tt);return et(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ze(e,t,{leading:r,maxWait:t,trailing:o})}var rt=nt;const ot=ee(rt);var at=w.div({position:"relative",maxWidth:250}),lt=w(Z)({position:"absolute",zIndex:1,top:4,left:4}),st=w.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),ct=w(me)(({theme:e})=>({fontFamily:e.typography.fonts.base})),it=w.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),ut=w.div(({theme:e,active:t})=>({width:16,height:16,boxShadow:t?`${e.appBorderColor} 0 0 0 1px inset, ${e.textMutedColor}50 0 0 0 4px`:`${e.appBorderColor} 0 0 0 1px inset`,borderRadius:e.appBorderRadius})),ft=`url('data:image/svg+xml;charset=utf-8,')`,J=({value:e,active:t,onClick:n,style:r,...o})=>{let a=`linear-gradient(${e}, ${e}), ${ft}, linear-gradient(#fff, #fff)`;return f.createElement(ut,{...o,active:t,onClick:n,style:{...r,backgroundImage:a}})},ht=w(pe.Input)(({theme:e})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:e.typography.fonts.base})),dt=w(ve)(({theme:e})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:e.input.color})),de=(e=>(e.RGB="rgb",e.HSL="hsl",e.HEX="hex",e))(de||{}),I=Object.values(de),gt=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,bt=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,mt=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,K=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,pt=/^\s*#?([0-9a-f]{3})\s*$/i,vt={hex:Fe,rgb:Le,hsl:qe},F={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},Q=e=>{let t=e==null?void 0:e.match(gt);if(!t)return[0,0,0,1];let[,n,r,o,a=1]=t;return[n,r,o,a].map(Number)},C=e=>{if(!e)return;let t=!0;if(bt.test(e)){let[l,s,c,u]=Q(e),[d,h,g]=y.rgb.hsl([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:y.rgb.keyword([l,s,c]),colorSpace:"rgb",rgb:e,hsl:`hsla(${d}, ${h}%, ${g}%, ${u})`,hex:`#${y.rgb.hex([l,s,c]).toLowerCase()}`}}if(mt.test(e)){let[l,s,c,u]=Q(e),[d,h,g]=y.hsl.rgb([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:y.hsl.keyword([l,s,c]),colorSpace:"hsl",rgb:`rgba(${d}, ${h}, ${g}, ${u})`,hsl:e,hex:`#${y.hsl.hex([l,s,c]).toLowerCase()}`}}let n=e.replace("#",""),r=y.keyword.rgb(n)||y.hex.rgb(n),o=y.rgb.hsl(r),a=e;if(/[^#a-f0-9]/i.test(e)?a=n:K.test(e)&&(a=`#${n}`),a.startsWith("#"))t=K.test(a);else try{y.keyword.hex(a)}catch{t=!1}return{valid:t,value:a,keyword:y.rgb.keyword(r),colorSpace:"hex",rgb:`rgba(${r[0]}, ${r[1]}, ${r[2]}, 1)`,hsl:`hsla(${o[0]}, ${o[1]}%, ${o[2]}%, 1)`,hex:a}},yt=(e,t,n)=>{if(!e||!(t!=null&&t.valid))return F[n];if(n!=="hex")return(t==null?void 0:t[n])||F[n];if(!t.hex.startsWith("#"))try{return`#${y.keyword.hex(t.hex)}`}catch{return F.hex}let r=t.hex.match(pt);if(!r)return K.test(t.hex)?t.hex:F.hex;let[o,a,l]=r[1].split("");return`#${o}${o}${a}${a}${l}${l}`},xt=(e,t)=>{let[n,r]=b.useState(e||""),[o,a]=b.useState(()=>C(n)),[l,s]=b.useState((o==null?void 0:o.colorSpace)||"hex");b.useEffect(()=>{let h=e||"",g=C(h);r(h),a(g),s((g==null?void 0:g.colorSpace)||"hex")},[e]);let c=b.useMemo(()=>yt(n,o,l).toLowerCase(),[n,o,l]),u=b.useCallback(h=>{let g=C(h),_=(g==null?void 0:g.value)||h||"";r(_),_===""&&(a(void 0),t(void 0)),g&&(a(g),s(g.colorSpace),t(g.value))},[t]),d=b.useCallback(()=>{let h=I.indexOf(l)+1;h>=I.length&&(h=0),s(I[h]);let g=(o==null?void 0:o[I[h]])||"";r(g),t(g)},[o,l,t]);return{value:n,realValue:c,updateValue:u,color:o,colorSpace:l,cycleColorSpace:d}},q=e=>e.replace(/\s*/,"").toLowerCase(),wt=(e,t,n)=>{let[r,o]=b.useState(t!=null&&t.valid?[t]:[]);b.useEffect(()=>{t===void 0&&o([])},[t]);let a=b.useMemo(()=>(e||[]).map(s=>typeof s=="string"?C(s):s.title?{...C(s.color),keyword:s.title}:C(s.color)).concat(r).filter(Boolean).slice(-27),[e,r]),l=b.useCallback(s=>{s!=null&&s.valid&&(a.some(c=>q(c[n])===q(s[n]))||o(c=>c.concat(s)))},[n,a]);return{presets:a,addPreset:l}},kt=({name:e,value:t,onChange:n,onFocus:r,onBlur:o,presetColors:a,startOpen:l=!1})=>{let s=b.useCallback(ot(n,200),[n]),{value:c,realValue:u,updateValue:d,color:h,colorSpace:g,cycleColorSpace:_}=xt(t,s),{presets:j,addPreset:E}=wt(a,h,g),v=vt[g];return f.createElement(at,null,f.createElement(lt,{startOpen:l,closeOnOutsideClick:!0,onVisibleChange:()=>E(h),tooltip:f.createElement(st,null,f.createElement(v,{color:u==="transparent"?"#000000":u,onChange:d,onFocus:r,onBlur:o}),j.length>0&&f.createElement(it,null,j.map((m,x)=>f.createElement(Z,{key:`${m.value}-${x}`,hasChrome:!1,tooltip:f.createElement(ct,{note:m.keyword||m.value})},f.createElement(J,{value:m[g],active:h&&q(m[g])===q(h[g]),onClick:()=>d(m.value)})))))},f.createElement(J,{value:u,style:{margin:4}})),f.createElement(ht,{id:ye(e),value:c,onChange:m=>d(m.target.value),onFocus:m=>m.target.select(),placeholder:"Choose color..."}),c?f.createElement(dt,{icon:"markup",onClick:_}):null)},Dt=kt;export{kt as ColorControl,Dt as default}; diff --git a/docs/storybook/assets/DocsRenderer-NNNQARDV-IFd-AFEu.js b/docs/storybook/assets/DocsRenderer-NNNQARDV-5-Yx17EK.js similarity index 92% rename from docs/storybook/assets/DocsRenderer-NNNQARDV-IFd-AFEu.js rename to docs/storybook/assets/DocsRenderer-NNNQARDV-5-Yx17EK.js index eda501a4..7df6ccc5 100644 --- a/docs/storybook/assets/DocsRenderer-NNNQARDV-IFd-AFEu.js +++ b/docs/storybook/assets/DocsRenderer-NNNQARDV-5-Yx17EK.js @@ -1,4 +1,4 @@ -import{_ as a}from"./iframe-FA3YUiXb.js";import{R as o,r as c}from"./index-RfLt4OUa.js";import{r as l,u}from"./react-16-hgR7FrAp.js";import{C as h,A as E,H as d,D as x}from"./index-zqxewmvn.js";import"../sb-preview/runtime.js";import"./index-miLrID2P.js";import"./pickBy-ZgIsky0p.js";import"./callBound-Uz6qjr9w.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";var _={code:h,a:E,...d},D=class extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){let{showException:r}=this.props;r(t)}render(){let{hasError:t}=this.state,{children:r}=this.props;return t?null:o.createElement(o.Fragment,null,r)}},j=class{constructor(){this.render=async(t,r,e)=>{let n={..._,...r==null?void 0:r.components},m=x;return new Promise((s,i)=>{a(()=>import("./index-4YXVTraW.js"),__vite__mapDeps([0,1]),import.meta.url).then(({MDXProvider:p})=>l(o.createElement(D,{showException:i,key:Math.random()},o.createElement(p,{components:n},o.createElement(m,{context:t,docsParameter:r}))),e)).then(()=>s())})},this.unmount=t=>{u(t)}}};export{j as DocsRenderer,_ as defaultComponents}; +import{_ as a}from"./iframe-xC5OGfiz.js";import{R as o,r as c}from"./index-RfLt4OUa.js";import{r as l,u}from"./react-16-hgR7FrAp.js";import{C as h,A as E,H as d,D as x}from"./index-tQLynm0T.js";import"../sb-preview/runtime.js";import"./index-miLrID2P.js";import"./pickBy-ZgIsky0p.js";import"./callBound-Uz6qjr9w.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";var _={code:h,a:E,...d},D=class extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){let{showException:r}=this.props;r(t)}render(){let{hasError:t}=this.state,{children:r}=this.props;return t?null:o.createElement(o.Fragment,null,r)}},j=class{constructor(){this.render=async(t,r,e)=>{let n={..._,...r==null?void 0:r.components},m=x;return new Promise((s,i)=>{a(()=>import("./index-4YXVTraW.js"),__vite__mapDeps([0,1]),import.meta.url).then(({MDXProvider:p})=>l(o.createElement(D,{showException:i,key:Math.random()},o.createElement(p,{components:n},o.createElement(m,{context:t,docsParameter:r}))),e)).then(()=>s())})},this.unmount=t=>{u(t)}}};export{j as DocsRenderer,_ as defaultComponents}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = ["./index-4YXVTraW.js","./index-RfLt4OUa.js"] diff --git a/docs/storybook/assets/DocumentPreview.stories-zKUa4qDs.js b/docs/storybook/assets/DocumentPreview.stories-YcbEC6Qs.js similarity index 98% rename from docs/storybook/assets/DocumentPreview.stories-zKUa4qDs.js rename to docs/storybook/assets/DocumentPreview.stories-YcbEC6Qs.js index ccc028c1..53eb767f 100644 --- a/docs/storybook/assets/DocumentPreview.stories-zKUa4qDs.js +++ b/docs/storybook/assets/DocumentPreview.stories-YcbEC6Qs.js @@ -1,4 +1,4 @@ -var wA=Object.defineProperty;var AA=(l,e,t)=>e in l?wA(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var U=(l,e,t)=>(AA(l,typeof e!="symbol"?e+"":e,t),t),J1=(l,e,t)=>{if(!e.has(l))throw TypeError("Cannot "+t)};var r=(l,e,t)=>(J1(l,e,"read from private field"),t?t.call(l):e.get(l)),g=(l,e,t)=>{if(e.has(l))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(l):e.set(l,t)},b=(l,e,t,i)=>(J1(l,e,"write to private field"),i?i.call(l,t):e.set(l,t),t);var et=(l,e,t,i)=>({set _(n){b(l,e,n,t)},get _(){return r(l,e,i)}}),m=(l,e,t)=>(J1(l,e,"access private method"),t);import{j}from"./jsx-runtime-FsUICBgo.js";import{f as xA,b as yA,e as MA,i as vA,d as od}from"./index-zZCSeRuV.js";import{S as E1,a as R1}from"./chunk-WFFRPTHA-GGX4IOMG.js";import{R as ue,r as B,g as S5}from"./index-RfLt4OUa.js";import{_ as T5}from"./extends-z9a7DBh-.js";import{_ as N5,I as P5,a as E5,b as R5,u as B5,c as Yg,d as br,o as DA,i as IA,B as CA,s as Tt,z as SA,A as TA}from"./Button-BahrfF6T.js";import{P as Ht}from"./index-4QtD-hFu.js";import{S as NA}from"./getDocumentTitle-olcUjOng.js";import{c as Ml}from"./index-tUYgphcS.js";import{T as PA,o as ku}from"./omit-J2xkfX-U.js";import{e as EA,c as i9,f as n9,a as a9,s as s9,p as r9,d as RA,g as l2,b as BA,i as UA,T as LA,h as o9,j as jA,k as d2,O as FA,w as GA}from"./withErrorBoundary-hW5QtRQy.js";import{g as B1,L as kA,r as OA,Q as l9,y as WA,p as mr,d as zA,I as QA}from"./callBound-Uz6qjr9w.js";import{p as Ou}from"./purify.es-29Q0w72t.js";import{_ as Sr}from"./iframe-FA3YUiXb.js";import{B as h2,D as Tu}from"./browser-l0_MOcmM.js";import{u as VA}from"./uniq-TDmnBOQ0.js";import{p as ZA}from"./pickBy-zEDcIzXe.js";import"./pickBy-ZgIsky0p.js";import"./isPlainObject-4EZXVN1F.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-A_lzSYvo.js";import"./v4-yQnnJER4.js";import"./bucket-34-dzXWEVBo.js";import"./_baseClone-YJfCp7aQ.js";import"./last-zLtIjBiu.js";import"./_baseSlice-BktYtjHb.js";import"./possibleConstructorReturn-WWGP77t3.js";import"./setPrototypeOf-08Rm0-g8.js";import"./_baseUniq-tk6_MLAQ.js";import"./index-miLrID2P.js";import"./wrapFocus-e-GadNjh.js";import"./mergeRefs-Zi_35mDS.js";import"./events-fK0UhkIE.js";import"./cloneDeep-BBxW03fY.js";import"../sb-preview/runtime.js";var c2,YA=["children"],KA=ue.forwardRef(function(e,t){var i=e.children,n=N5(e,YA);return ue.createElement(P5,E5({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:t},n),c2||(c2=ue.createElement("path",{d:"M18,28A12,12,0,1,0,6,16v6.2L2.4,18.6,1,20l6,6,6-6-1.4-1.4L8,22.2V16H8A10,10,0,1,1,18,26Z"})),i)}),u2,g2,p2,m2,HA=["children"],qA=["children"],XA=ue.forwardRef(function(e,t){var i=e.children,n=N5(e,HA);return ue.createElement(P5,E5({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:t},n),u2||(u2=ue.createElement("path",{d:"M18 12L14 12 14 8 12 8 12 12 8 12 8 14 12 14 12 18 14 18 14 14 18 14 18 12z"})),g2||(g2=ue.createElement("path",{d:"M21.4479,20A10.856,10.856,0,0,0,24,13,11,11,0,1,0,13,24a10.856,10.856,0,0,0,7-2.5521L27.5859,29,29,27.5859ZM13,22a9,9,0,1,1,9-9A9.01,9.01,0,0,1,13,22Z"})),i)}),JA=ue.forwardRef(function(e,t){var i=e.children,n=N5(e,qA);return ue.createElement(P5,E5({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:t},n),p2||(p2=ue.createElement("path",{d:"M8 12H18V14H8z"})),m2||(m2=ue.createElement("path",{d:"M21.4479,20A10.856,10.856,0,0,0,24,13,11,11,0,1,0,13,24a10.856,10.856,0,0,0,7-2.5521L27.5859,29,29,27.5859ZM13,22a9,9,0,1,1,9-9A9.01,9.01,0,0,1,13,22Z"})),i)}),_A=["id","active","className","withOverlay","small","description"],$A=DA();function U5(l){var e,t,i=l.id,n=l.active,a=l.className,s=l.withOverlay,o=l.small,d=l.description,h=R5(l,_A),c=B5(),u=B.useRef($A()),p=u.current,f=Yg(a,(e={},br(e,"".concat(c,"--loading"),!0),br(e,"".concat(c,"--loading--small"),o),br(e,"".concat(c,"--loading--stop"),!n),e)),w=Yg((t={},br(t,"".concat(c,"--loading-overlay"),!0),br(t,"".concat(c,"--loading-overlay--stop"),!n),t)),A=i||"loading-id-".concat(p),y=ue.createElement("div",T5({},h,{"aria-atomic":"true","aria-live":n?"assertive":"off",className:f}),ue.createElement("label",{id:A,className:"".concat(c,"--visually-hidden")},d),ue.createElement("svg",{className:"".concat(c,"--loading__svg"),viewBox:"0 0 100 100"},ue.createElement("title",null,d),o?ue.createElement("circle",{className:"".concat(c,"--loading__background"),cx:"50%",cy:"50%",r:"44"}):null,ue.createElement("circle",{className:"".concat(c,"--loading__stroke"),cx:"50%",cy:"50%",r:"44"})));return s?ue.createElement("div",{className:w},y):y}U5.propTypes={active:Ht.bool,className:Ht.string,description:Ht.string,id:Ht.string,small:Ht.bool,withOverlay:Ht.bool};U5.defaultProps={active:!0,withOverlay:!0,small:!1,description:"Active loading indicator"};var ex=["className","children"],d9=function(e){var t=e.className,i=e.children,n=R5(e,ex),a=B5(),s=Yg("".concat(a,"--form"),t);return ue.createElement("form",T5({className:s},n)," ",i," ")};d9.propTypes={children:Ht.node,className:Ht.string};const tx=d9;var ix=["className","children","id"];function h9(l){var e=l.className,t=l.children,i=l.id,n=R5(l,ix),a=B5(),s=Yg("".concat(a,"--label"),br({},"".concat(a,"--label--no-margin"),IA("enable-v11-release")),e);return ue.createElement("label",T5({htmlFor:i,className:s},n),t)}h9.propTypes={children:Ht.node,className:Ht.string,id:Ht.string};const c9={noDataMessage:"No document data",errorMessage:"Error previewing document",formatTotalPages:l=>l===1?`${l} page`:`${l} pages`,previousPageLabel:"Previous page",nextPageLabel:"Next page",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",resetZoomLabel:"Reset zoom"},u9="zoom-in",g9="zoom-out",p9="reset-zoom",Jt=`${Tt.prefix}--preview-toolbar`,nx=({loading:l=!1,hideControls:e=!1,userActions:t=[],current:i,total:n,onZoom:a,onChange:s,messages:o})=>{const d=B.useRef(null);B.useEffect(()=>{d.current!=null&&(d.current.value=i.toString())},[i]);const h={...c9,...o};return j.jsxs("div",{className:Ml(Jt,{[`${Jt}__hidden`]:e&&t.length===0}),children:[j.jsx("div",{className:`${Jt}__left`,children:!e&&j.jsxs("div",{className:`${Jt}__nav`,children:[fr({renderIcon:SA,iconDescription:h.previousPageLabel,onClick:()=>b2(i,n,s,-1),disabled:l||i===1}),fr({renderIcon:TA,iconDescription:h.nextPageLabel,onClick:()=>b2(i,n,s,1),disabled:l||i===n}),j.jsx(tx,{onSubmit:c=>f2(c,s,d),autoComplete:"off",children:j.jsx(PA,{id:"pageInput",defaultValue:i,type:"number",ref:d,min:1,max:n,className:`${Jt}__input`,onBlur:c=>f2(c,s,d),labelText:"labelText",hideLabel:!0,disabled:l})}),j.jsxs(h9,{className:`${Jt}__pageLabel`,children:["/ ",h.formatTotalPages(n)]})]})}),j.jsx("div",{className:`${Jt}__center ${Jt}__nav`}),j.jsxs("div",{className:`${Jt}__right`,children:[!e&&j.jsxs(j.Fragment,{children:[fr({renderIcon:XA,iconDescription:h.zoomInLabel,onClick:()=>a(u9),disabled:l}),fr({renderIcon:JA,iconDescription:h.zoomOutLabel,onClick:()=>a(g9),disabled:l}),fr({renderIcon:KA,iconDescription:h.resetZoomLabel,onClick:()=>a(p9),disabled:l})]}),t.map((c,u)=>ax({...c,key:`toolbar-action-${c.id||u}`}))]})]})};function ax(l){if(l!=null&&l.renderIcon)return fr(l);if(l!=null&&l.render){const{key:e,...t}=l,i=t.render;return j.jsx(i,{},l.key)}return null}function fr(l){const{key:e,className:t,...i}=l;return j.jsx(CA,{"data-testid":e,className:Ml(`${Jt}__button`,t),size:"small",kind:"ghost",tooltipPosition:"bottom",tooltipAlignment:"center",hasIconOnly:!0,...i},e)}function b2(l,e,t,i){const n=l+i;n>=1&&n<=e&&t(n)}function f2(l,e,t){l.preventDefault();const i=Number(t.current.value);e(i)}const Cl=nx;Cl.ZOOM_IN=u9;Cl.ZOOM_OUT=g9;Cl.ZOOM_RESET=p9;function ld(l){return l&&"passage_text"in l}function L5(l){var e;return!!((e=l==null?void 0:l.table)!=null&&e.location)}function j5(l){let e=B1(l,"extracted_metadata.text_mappings");if(e&&typeof e=="string")try{e=JSON.parse(e)}catch(t){console.error("Failure parsing text_mappings",t),e=null}else e=null;return e}function m9(l){return B1(l,"extracted_metadata.file_type")==="csv"}function b9(l){return B1(l,"extracted_metadata.file_type")==="json"}function sx(l,e,t,i){var u,p;const n=(u=l.extracted_metadata)==null?void 0:u.file_type,a=!!((p=l.extracted_metadata)!=null&&p.text_mappings),s=!!t,o=ld(t),d=L5(t);if(n==="pdf"&&e&&!i&&(!s||a))return"PDF";const h=b9(l),c=m9(l);return l.html&&!h&&!c&&(!s||o&&a||d)?"HTML":"TEXT"}const rx=l=>B.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"1em",height:"1em",...l},B.createElement("title",null,"document preview"),B.createElement("g",{id:"analyze"},B.createElement("g",{id:"analyze-2","data-name":"analyze"},B.createElement("path",{d:"M24,46.86H9a.33.33,0,0,1-.25-.11l-7.5-7.5A.33.33,0,0,1,1.14,39V16.5a.36.36,0,0,1,.36-.36H8.64a15.36,15.36,0,1,1,26.47,11L46.75,38.75l-.5.5L34.6,27.61a15.24,15.24,0,0,1-10.24,4.25V46.5A.36.36,0,0,1,24,46.86ZM9.36,46.14H23.64V31.86a15.39,15.39,0,0,1-15-15H1.86V38.64H9a.36.36,0,0,1,.36.36Zm-7-6.78,6.27,6.27V39.36ZM24,1.86A14.64,14.64,0,1,0,38.64,16.5,14.66,14.66,0,0,0,24,1.86Z"}))),B.createElement("path",{d:"M19.73,19.37a.76.76,0,0,1-.61-.22,1,1,0,0,1-.24-.55h-.05a1.31,1.31,0,0,1-.49.64,1.56,1.56,0,0,1-.91.23,1.69,1.69,0,0,1-1.15-.37,1.31,1.31,0,0,1-.42-1,1.2,1.2,0,0,1,.48-1,2.7,2.7,0,0,1,1.53-.35h.95v-.41a1,1,0,0,0-.27-.74,1.1,1.1,0,0,0-.79-.25,1.54,1.54,0,0,0-.75.17,1.38,1.38,0,0,0-.47.49L16,15.54a1.52,1.52,0,0,1,.25-.35,1.65,1.65,0,0,1,.39-.29,1.89,1.89,0,0,1,.52-.21,2.71,2.71,0,0,1,.66-.08,2,2,0,0,1,1.33.42,1.48,1.48,0,0,1,.49,1.19v2.45h.62v.7Zm-2.1-.55a1.4,1.4,0,0,0,.85-.24.67.67,0,0,0,.34-.58v-.72h-.94a1.69,1.69,0,0,0-.88.17.53.53,0,0,0-.28.49v.19a.61.61,0,0,0,.24.52A1.18,1.18,0,0,0,17.63,18.82Z"}),B.createElement("path",{d:"M22.11,12.71H23V15.5h0a1.6,1.6,0,0,1,.56-.66,1.55,1.55,0,0,1,.86-.23,1.57,1.57,0,0,1,1.32.63,2.92,2.92,0,0,1,.49,1.8,2.92,2.92,0,0,1-.49,1.8,1.57,1.57,0,0,1-1.32.63,1.55,1.55,0,0,1-.86-.22,1.6,1.6,0,0,1-.56-.66h0v.78h-.84Zm2,6.05A1.2,1.2,0,0,0,25,18.4a1.44,1.44,0,0,0,.32-1v-.77a1.42,1.42,0,0,0-.32-1,1.2,1.2,0,0,0-.93-.37,1.42,1.42,0,0,0-.42.06,1,1,0,0,0-.36.18.83.83,0,0,0-.25.28.8.8,0,0,0-.09.39v1.62a.84.84,0,0,0,.09.4.75.75,0,0,0,.25.28.86.86,0,0,0,.36.17A1.42,1.42,0,0,0,24.07,18.76Z"}),B.createElement("path",{d:"M30.22,19.47a2.17,2.17,0,0,1-.91-.17,1.75,1.75,0,0,1-.68-.49,2.33,2.33,0,0,1-.42-.76,3.44,3.44,0,0,1,0-2,2.23,2.23,0,0,1,.42-.76,1.88,1.88,0,0,1,.68-.5,2.33,2.33,0,0,1,.9-.17A1.76,1.76,0,0,1,32,15.7l-.66.36a1.1,1.1,0,0,0-.4-.54,1.33,1.33,0,0,0-1.63.18,1.36,1.36,0,0,0-.33.95v.79a1.37,1.37,0,0,0,.33.95,1.2,1.2,0,0,0,.95.37,1.22,1.22,0,0,0,.74-.21,1.57,1.57,0,0,0,.47-.57l.6.4a1.84,1.84,0,0,1-.66.78A2,2,0,0,1,30.22,19.47Z"})),ym=({header:l,message:e})=>{const t=`${Tt.prefix}--simple-document__error-view`;return j.jsxs("div",{className:t,"data-testid":"error_state",children:[j.jsx("div",{className:`${t}__icon`,children:j.jsx(rx,{})}),j.jsxs("div",{children:[j.jsx("h1",{className:`${t}__header`,children:l}),j.jsx("div",{className:`${t}__message`,children:e})]})]})};try{ym.displayName="ErrorView",ym.__docgenInfo={description:"",displayName:"ErrorView",props:{header:{defaultValue:null,description:"",name:"header",required:!0,type:{name:"ReactNode"}},message:{defaultValue:null,description:"",name:"message",required:!0,type:{name:"ReactNode"}}}}}catch{}const Mm=B.forwardRef(({document:l,highlight:e,loading:t,setLoading:i,hideToolbarControls:n,setHideToolbarControls:a,fallbackComponent:s,cannotPreviewMessage:o="Can't preview document",cannotPreviewMessage2:d="Try the JSON tab for a different view of this document's data.",...h},c)=>{var x,M,v,I;const u=B.useRef(null),p=B.useRef(null),{componentSettings:f}=B.useContext(E1);let w,A=null;if(l){const S=b9(l)||m9(l);let D=((M=(x=f==null?void 0:f.fields_shown)==null?void 0:x.body)==null?void 0:M.field)??"text";if(S&&(!e||!ld(e))&&l[D]===void 0)w=null;else{e&&ld(e)?(A=e,D=A.field,D||(D="text",e=void 0)):D=((I=(v=f==null?void 0:f.fields_shown)==null?void 0:v.body)==null?void 0:I.field)||"text";let T;typeof l[D]>"u"?(T=l.text||"",A=null):T=l[D],Array.isArray(T)||(T=[T]);let P=0;w=T.map(C=>{const N=P+C.length-1,R=`

${EA(C)}

`;return P=N+1,R}).join(` +var wA=Object.defineProperty;var AA=(l,e,t)=>e in l?wA(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var U=(l,e,t)=>(AA(l,typeof e!="symbol"?e+"":e,t),t),J1=(l,e,t)=>{if(!e.has(l))throw TypeError("Cannot "+t)};var r=(l,e,t)=>(J1(l,e,"read from private field"),t?t.call(l):e.get(l)),g=(l,e,t)=>{if(e.has(l))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(l):e.set(l,t)},b=(l,e,t,i)=>(J1(l,e,"write to private field"),i?i.call(l,t):e.set(l,t),t);var et=(l,e,t,i)=>({set _(n){b(l,e,n,t)},get _(){return r(l,e,i)}}),m=(l,e,t)=>(J1(l,e,"access private method"),t);import{j}from"./jsx-runtime-FsUICBgo.js";import{f as xA,b as yA,e as MA,i as vA,d as od}from"./index-zZCSeRuV.js";import{S as E1,a as R1}from"./chunk-WFFRPTHA-GGX4IOMG.js";import{R as ue,r as B,g as S5}from"./index-RfLt4OUa.js";import{_ as T5}from"./extends-z9a7DBh-.js";import{_ as N5,I as P5,a as E5,b as R5,u as B5,c as Yg,d as br,o as DA,i as IA,B as CA,s as Tt,z as SA,A as TA}from"./Button-BahrfF6T.js";import{P as Ht}from"./index-4QtD-hFu.js";import{S as NA}from"./getDocumentTitle-olcUjOng.js";import{c as Ml}from"./index-tUYgphcS.js";import{T as PA,o as ku}from"./omit-J2xkfX-U.js";import{e as EA,c as i9,f as n9,a as a9,s as s9,p as r9,d as RA,g as l2,b as BA,i as UA,T as LA,h as o9,j as jA,k as d2,O as FA,w as GA}from"./withErrorBoundary-hW5QtRQy.js";import{g as B1,L as kA,r as OA,Q as l9,y as WA,p as mr,d as zA,I as QA}from"./callBound-Uz6qjr9w.js";import{p as Ou}from"./purify.es-29Q0w72t.js";import{_ as Sr}from"./iframe-xC5OGfiz.js";import{B as h2,D as Tu}from"./browser-l0_MOcmM.js";import{u as VA}from"./uniq-TDmnBOQ0.js";import{p as ZA}from"./pickBy-zEDcIzXe.js";import"./pickBy-ZgIsky0p.js";import"./isPlainObject-4EZXVN1F.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-A_lzSYvo.js";import"./v4-yQnnJER4.js";import"./bucket-34-dzXWEVBo.js";import"./_baseClone-YJfCp7aQ.js";import"./last-zLtIjBiu.js";import"./_baseSlice-BktYtjHb.js";import"./possibleConstructorReturn-WWGP77t3.js";import"./setPrototypeOf-08Rm0-g8.js";import"./_baseUniq-tk6_MLAQ.js";import"./index-miLrID2P.js";import"./wrapFocus-e-GadNjh.js";import"./mergeRefs-Zi_35mDS.js";import"./events-fK0UhkIE.js";import"./cloneDeep-BBxW03fY.js";import"../sb-preview/runtime.js";var c2,YA=["children"],KA=ue.forwardRef(function(e,t){var i=e.children,n=N5(e,YA);return ue.createElement(P5,E5({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:t},n),c2||(c2=ue.createElement("path",{d:"M18,28A12,12,0,1,0,6,16v6.2L2.4,18.6,1,20l6,6,6-6-1.4-1.4L8,22.2V16H8A10,10,0,1,1,18,26Z"})),i)}),u2,g2,p2,m2,HA=["children"],qA=["children"],XA=ue.forwardRef(function(e,t){var i=e.children,n=N5(e,HA);return ue.createElement(P5,E5({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:t},n),u2||(u2=ue.createElement("path",{d:"M18 12L14 12 14 8 12 8 12 12 8 12 8 14 12 14 12 18 14 18 14 14 18 14 18 12z"})),g2||(g2=ue.createElement("path",{d:"M21.4479,20A10.856,10.856,0,0,0,24,13,11,11,0,1,0,13,24a10.856,10.856,0,0,0,7-2.5521L27.5859,29,29,27.5859ZM13,22a9,9,0,1,1,9-9A9.01,9.01,0,0,1,13,22Z"})),i)}),JA=ue.forwardRef(function(e,t){var i=e.children,n=N5(e,qA);return ue.createElement(P5,E5({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:t},n),p2||(p2=ue.createElement("path",{d:"M8 12H18V14H8z"})),m2||(m2=ue.createElement("path",{d:"M21.4479,20A10.856,10.856,0,0,0,24,13,11,11,0,1,0,13,24a10.856,10.856,0,0,0,7-2.5521L27.5859,29,29,27.5859ZM13,22a9,9,0,1,1,9-9A9.01,9.01,0,0,1,13,22Z"})),i)}),_A=["id","active","className","withOverlay","small","description"],$A=DA();function U5(l){var e,t,i=l.id,n=l.active,a=l.className,s=l.withOverlay,o=l.small,d=l.description,h=R5(l,_A),c=B5(),u=B.useRef($A()),p=u.current,f=Yg(a,(e={},br(e,"".concat(c,"--loading"),!0),br(e,"".concat(c,"--loading--small"),o),br(e,"".concat(c,"--loading--stop"),!n),e)),w=Yg((t={},br(t,"".concat(c,"--loading-overlay"),!0),br(t,"".concat(c,"--loading-overlay--stop"),!n),t)),A=i||"loading-id-".concat(p),y=ue.createElement("div",T5({},h,{"aria-atomic":"true","aria-live":n?"assertive":"off",className:f}),ue.createElement("label",{id:A,className:"".concat(c,"--visually-hidden")},d),ue.createElement("svg",{className:"".concat(c,"--loading__svg"),viewBox:"0 0 100 100"},ue.createElement("title",null,d),o?ue.createElement("circle",{className:"".concat(c,"--loading__background"),cx:"50%",cy:"50%",r:"44"}):null,ue.createElement("circle",{className:"".concat(c,"--loading__stroke"),cx:"50%",cy:"50%",r:"44"})));return s?ue.createElement("div",{className:w},y):y}U5.propTypes={active:Ht.bool,className:Ht.string,description:Ht.string,id:Ht.string,small:Ht.bool,withOverlay:Ht.bool};U5.defaultProps={active:!0,withOverlay:!0,small:!1,description:"Active loading indicator"};var ex=["className","children"],d9=function(e){var t=e.className,i=e.children,n=R5(e,ex),a=B5(),s=Yg("".concat(a,"--form"),t);return ue.createElement("form",T5({className:s},n)," ",i," ")};d9.propTypes={children:Ht.node,className:Ht.string};const tx=d9;var ix=["className","children","id"];function h9(l){var e=l.className,t=l.children,i=l.id,n=R5(l,ix),a=B5(),s=Yg("".concat(a,"--label"),br({},"".concat(a,"--label--no-margin"),IA("enable-v11-release")),e);return ue.createElement("label",T5({htmlFor:i,className:s},n),t)}h9.propTypes={children:Ht.node,className:Ht.string,id:Ht.string};const c9={noDataMessage:"No document data",errorMessage:"Error previewing document",formatTotalPages:l=>l===1?`${l} page`:`${l} pages`,previousPageLabel:"Previous page",nextPageLabel:"Next page",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",resetZoomLabel:"Reset zoom"},u9="zoom-in",g9="zoom-out",p9="reset-zoom",Jt=`${Tt.prefix}--preview-toolbar`,nx=({loading:l=!1,hideControls:e=!1,userActions:t=[],current:i,total:n,onZoom:a,onChange:s,messages:o})=>{const d=B.useRef(null);B.useEffect(()=>{d.current!=null&&(d.current.value=i.toString())},[i]);const h={...c9,...o};return j.jsxs("div",{className:Ml(Jt,{[`${Jt}__hidden`]:e&&t.length===0}),children:[j.jsx("div",{className:`${Jt}__left`,children:!e&&j.jsxs("div",{className:`${Jt}__nav`,children:[fr({renderIcon:SA,iconDescription:h.previousPageLabel,onClick:()=>b2(i,n,s,-1),disabled:l||i===1}),fr({renderIcon:TA,iconDescription:h.nextPageLabel,onClick:()=>b2(i,n,s,1),disabled:l||i===n}),j.jsx(tx,{onSubmit:c=>f2(c,s,d),autoComplete:"off",children:j.jsx(PA,{id:"pageInput",defaultValue:i,type:"number",ref:d,min:1,max:n,className:`${Jt}__input`,onBlur:c=>f2(c,s,d),labelText:"labelText",hideLabel:!0,disabled:l})}),j.jsxs(h9,{className:`${Jt}__pageLabel`,children:["/ ",h.formatTotalPages(n)]})]})}),j.jsx("div",{className:`${Jt}__center ${Jt}__nav`}),j.jsxs("div",{className:`${Jt}__right`,children:[!e&&j.jsxs(j.Fragment,{children:[fr({renderIcon:XA,iconDescription:h.zoomInLabel,onClick:()=>a(u9),disabled:l}),fr({renderIcon:JA,iconDescription:h.zoomOutLabel,onClick:()=>a(g9),disabled:l}),fr({renderIcon:KA,iconDescription:h.resetZoomLabel,onClick:()=>a(p9),disabled:l})]}),t.map((c,u)=>ax({...c,key:`toolbar-action-${c.id||u}`}))]})]})};function ax(l){if(l!=null&&l.renderIcon)return fr(l);if(l!=null&&l.render){const{key:e,...t}=l,i=t.render;return j.jsx(i,{},l.key)}return null}function fr(l){const{key:e,className:t,...i}=l;return j.jsx(CA,{"data-testid":e,className:Ml(`${Jt}__button`,t),size:"small",kind:"ghost",tooltipPosition:"bottom",tooltipAlignment:"center",hasIconOnly:!0,...i},e)}function b2(l,e,t,i){const n=l+i;n>=1&&n<=e&&t(n)}function f2(l,e,t){l.preventDefault();const i=Number(t.current.value);e(i)}const Cl=nx;Cl.ZOOM_IN=u9;Cl.ZOOM_OUT=g9;Cl.ZOOM_RESET=p9;function ld(l){return l&&"passage_text"in l}function L5(l){var e;return!!((e=l==null?void 0:l.table)!=null&&e.location)}function j5(l){let e=B1(l,"extracted_metadata.text_mappings");if(e&&typeof e=="string")try{e=JSON.parse(e)}catch(t){console.error("Failure parsing text_mappings",t),e=null}else e=null;return e}function m9(l){return B1(l,"extracted_metadata.file_type")==="csv"}function b9(l){return B1(l,"extracted_metadata.file_type")==="json"}function sx(l,e,t,i){var u,p;const n=(u=l.extracted_metadata)==null?void 0:u.file_type,a=!!((p=l.extracted_metadata)!=null&&p.text_mappings),s=!!t,o=ld(t),d=L5(t);if(n==="pdf"&&e&&!i&&(!s||a))return"PDF";const h=b9(l),c=m9(l);return l.html&&!h&&!c&&(!s||o&&a||d)?"HTML":"TEXT"}const rx=l=>B.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"1em",height:"1em",...l},B.createElement("title",null,"document preview"),B.createElement("g",{id:"analyze"},B.createElement("g",{id:"analyze-2","data-name":"analyze"},B.createElement("path",{d:"M24,46.86H9a.33.33,0,0,1-.25-.11l-7.5-7.5A.33.33,0,0,1,1.14,39V16.5a.36.36,0,0,1,.36-.36H8.64a15.36,15.36,0,1,1,26.47,11L46.75,38.75l-.5.5L34.6,27.61a15.24,15.24,0,0,1-10.24,4.25V46.5A.36.36,0,0,1,24,46.86ZM9.36,46.14H23.64V31.86a15.39,15.39,0,0,1-15-15H1.86V38.64H9a.36.36,0,0,1,.36.36Zm-7-6.78,6.27,6.27V39.36ZM24,1.86A14.64,14.64,0,1,0,38.64,16.5,14.66,14.66,0,0,0,24,1.86Z"}))),B.createElement("path",{d:"M19.73,19.37a.76.76,0,0,1-.61-.22,1,1,0,0,1-.24-.55h-.05a1.31,1.31,0,0,1-.49.64,1.56,1.56,0,0,1-.91.23,1.69,1.69,0,0,1-1.15-.37,1.31,1.31,0,0,1-.42-1,1.2,1.2,0,0,1,.48-1,2.7,2.7,0,0,1,1.53-.35h.95v-.41a1,1,0,0,0-.27-.74,1.1,1.1,0,0,0-.79-.25,1.54,1.54,0,0,0-.75.17,1.38,1.38,0,0,0-.47.49L16,15.54a1.52,1.52,0,0,1,.25-.35,1.65,1.65,0,0,1,.39-.29,1.89,1.89,0,0,1,.52-.21,2.71,2.71,0,0,1,.66-.08,2,2,0,0,1,1.33.42,1.48,1.48,0,0,1,.49,1.19v2.45h.62v.7Zm-2.1-.55a1.4,1.4,0,0,0,.85-.24.67.67,0,0,0,.34-.58v-.72h-.94a1.69,1.69,0,0,0-.88.17.53.53,0,0,0-.28.49v.19a.61.61,0,0,0,.24.52A1.18,1.18,0,0,0,17.63,18.82Z"}),B.createElement("path",{d:"M22.11,12.71H23V15.5h0a1.6,1.6,0,0,1,.56-.66,1.55,1.55,0,0,1,.86-.23,1.57,1.57,0,0,1,1.32.63,2.92,2.92,0,0,1,.49,1.8,2.92,2.92,0,0,1-.49,1.8,1.57,1.57,0,0,1-1.32.63,1.55,1.55,0,0,1-.86-.22,1.6,1.6,0,0,1-.56-.66h0v.78h-.84Zm2,6.05A1.2,1.2,0,0,0,25,18.4a1.44,1.44,0,0,0,.32-1v-.77a1.42,1.42,0,0,0-.32-1,1.2,1.2,0,0,0-.93-.37,1.42,1.42,0,0,0-.42.06,1,1,0,0,0-.36.18.83.83,0,0,0-.25.28.8.8,0,0,0-.09.39v1.62a.84.84,0,0,0,.09.4.75.75,0,0,0,.25.28.86.86,0,0,0,.36.17A1.42,1.42,0,0,0,24.07,18.76Z"}),B.createElement("path",{d:"M30.22,19.47a2.17,2.17,0,0,1-.91-.17,1.75,1.75,0,0,1-.68-.49,2.33,2.33,0,0,1-.42-.76,3.44,3.44,0,0,1,0-2,2.23,2.23,0,0,1,.42-.76,1.88,1.88,0,0,1,.68-.5,2.33,2.33,0,0,1,.9-.17A1.76,1.76,0,0,1,32,15.7l-.66.36a1.1,1.1,0,0,0-.4-.54,1.33,1.33,0,0,0-1.63.18,1.36,1.36,0,0,0-.33.95v.79a1.37,1.37,0,0,0,.33.95,1.2,1.2,0,0,0,.95.37,1.22,1.22,0,0,0,.74-.21,1.57,1.57,0,0,0,.47-.57l.6.4a1.84,1.84,0,0,1-.66.78A2,2,0,0,1,30.22,19.47Z"})),ym=({header:l,message:e})=>{const t=`${Tt.prefix}--simple-document__error-view`;return j.jsxs("div",{className:t,"data-testid":"error_state",children:[j.jsx("div",{className:`${t}__icon`,children:j.jsx(rx,{})}),j.jsxs("div",{children:[j.jsx("h1",{className:`${t}__header`,children:l}),j.jsx("div",{className:`${t}__message`,children:e})]})]})};try{ym.displayName="ErrorView",ym.__docgenInfo={description:"",displayName:"ErrorView",props:{header:{defaultValue:null,description:"",name:"header",required:!0,type:{name:"ReactNode"}},message:{defaultValue:null,description:"",name:"message",required:!0,type:{name:"ReactNode"}}}}}catch{}const Mm=B.forwardRef(({document:l,highlight:e,loading:t,setLoading:i,hideToolbarControls:n,setHideToolbarControls:a,fallbackComponent:s,cannotPreviewMessage:o="Can't preview document",cannotPreviewMessage2:d="Try the JSON tab for a different view of this document's data.",...h},c)=>{var x,M,v,I;const u=B.useRef(null),p=B.useRef(null),{componentSettings:f}=B.useContext(E1);let w,A=null;if(l){const S=b9(l)||m9(l);let D=((M=(x=f==null?void 0:f.fields_shown)==null?void 0:x.body)==null?void 0:M.field)??"text";if(S&&(!e||!ld(e))&&l[D]===void 0)w=null;else{e&&ld(e)?(A=e,D=A.field,D||(D="text",e=void 0)):D=((I=(v=f==null?void 0:f.fields_shown)==null?void 0:v.body)==null?void 0:I.field)||"text";let T;typeof l[D]>"u"?(T=l.text||"",A=null):T=l[D],Array.isArray(T)||(T=[T]);let P=0;w=T.map(C=>{const N=P+C.length-1,R=`

${EA(C)}

`;return P=N+1,R}).join(` `)}}B.useEffect(()=>{l&&(t&&i(!1),typeof a=="function"&&!n&&a(!0))},[l,n,t,a,i]),B.useEffect(()=>{const S=u.current,D=p.current;if(D&&i9(D),!A||!S||!D)return;const{start_offset:T,end_offset:P}=A;if(!(typeof T>"u"||typeof P>"u"))try{const C=n9(S,T,P),N=window.document.createDocumentFragment(),R=S.getBoundingClientRect();a9({fragment:N,parentRect:R,fieldType:"passage",fieldValue:"",fieldId:T.toString(),...C}),D.appendChild(N);const L=D.querySelector(".field--rect");L&&L.scrollIntoView({block:"center"})}catch(C){console.error("Error creating field rects",C)}},[A]);const y=`${Tt.prefix}--simple-document`;return j.jsx("div",{ref:c,className:y,...h,children:w?j.jsxs("div",{className:`${y}__wrapper`,children:[j.jsx("div",{ref:p}),j.jsx("div",{className:`${y}__content`,dangerouslySetInnerHTML:{__html:w},ref:u})]}):s?j.jsx(s,{document:l}):j.jsx(ym,{header:o,message:d})})});try{Mm.displayName="SimpleDocument",Mm.__docgenInfo={description:"",displayName:"SimpleDocument",props:{document:{defaultValue:null,description:"Document data returned by query",name:"document",required:!0,type:{name:"QueryResult"}},highlight:{defaultValue:null,description:"",name:"highlight",required:!1,type:{name:"QueryTableResult | QueryResultPassage"}},setLoading:{defaultValue:null,description:"Check to disable toolbar in parent",name:"setLoading",required:!0,type:{name:"(loading: boolean) => void"}},setHideToolbarControls:{defaultValue:null,description:"Callback which is invoked with whether to enable/disable toolbar controls",name:"setHideToolbarControls",required:!1,type:{name:"((disabled: boolean) => void)"}},fallbackComponent:{defaultValue:null,description:"React component rendered as a fallback when no preview is available.\nWhen specified, the default error component which displays `cannotPreviewMessage`\nwon't be displayed.",name:"fallbackComponent",required:!1,type:{name:"ComponentType"}},cannotPreviewMessage:{defaultValue:{value:"Can't preview document"},description:"Error title displayed when no preview can be displayed by this component.\nUnused when `fallbackComponent` is provided",name:"cannotPreviewMessage",required:!1,type:{name:"string"}},cannotPreviewMessage2:{defaultValue:{value:"Try the JSON tab for a different view of this document's data."},description:"Error message displayed when no preview can be displayed by this component.\nUnused when `fallbackComponent` is provided",name:"cannotPreviewMessage2",required:!1,type:{name:"string"}},loading:{defaultValue:null,description:"",name:"loading",required:!0,type:{name:"boolean"}},hideToolbarControls:{defaultValue:null,description:"",name:"hideToolbarControls",required:!0,type:{name:"boolean"}}}}}catch{}var ox=xA(),lx=kA;function dx(l,e){var t=-1,i=lx(l)?Array(l.length):[];return ox(l,function(n,a,s){i[++t]=e(n,a,s)}),i}var hx=dx,cx=OA(),ux=l9,gx=hx,px=WA;function mx(l,e){var t=px(l)?cx:gx;return t(l,ux(e))}var bx=mx,fx=yA,wx=bx;function Ax(l,e){return fx(wx(l,e),1)}var xx=Ax;const F5=S5(xx);function G5(l,e){const[t,i,n,a,s]=l,[o,d,h,c,u]=e;return!(o>=n||h<=t||d>=a||c<=i||s!==u)}const yx=(l,e)=>e.filter(t=>{const{left:i,top:n,right:a,bottom:s,page:o}=t,[d,h,c,u]=l.bbox;return G5([d,h,c,u,l.page_number],[i,n,a,s,o])}),Mx=0,vx=1;function Dx(l,e){const{start_offset:t,end_offset:i,field:n}=e;return typeof t!="number"||typeof i!="number"?null:((l==null?void 0:l.text_mappings)||[]).filter(s=>{const{field:{name:o,span:d}}=s;return o===n&&s9({begin:d[Mx],end:d[vx]},{begin:t,end:i})}).map(s=>s.page)}const w2=l=>!!B1(l,"html"),A2={ADD_TAGS:["bbox"],ADD_ATTR:["page"],FORBID_TAGS:["input","form","a","button","script","style"],FORBID_CONTENTS:["script","style"],KEEP_CONTENT:!0,WHOLE_DOCUMENT:!0},x2=`${Tt.prefix}--html`,vm=B.forwardRef(({document:l,highlight:e,setHideToolbarControls:t,setLoading:i,...n},a)=>{const s=B.useRef(null),o=B.useRef(null);B.useEffect(()=>{t&&t(!0)},[t]);const[d,h]=B.useState(null),[c,u]=B.useState(null),[p,f]=B.useState([]);return B.useLayoutEffect(()=>(Ou.addHook("afterSanitizeAttributes",function(w){w.tagName==="TABLE"&&w.setAttribute("role","presentation")}),()=>{Ou.removeHook("afterSanitizeAttributes")}),[]),B.useEffect(()=>{if(l){const w=l.html;w&&e?(async()=>{const y=await r9({...l,docHtml:w},{sections:!0,bbox:!0}),x=y.sections?y.sections.map(M=>M.html).join(""):"";u(y),h(Ou.sanitize(x,A2)),i&&i(!1)})():(h(w?Ou.sanitize(w,A2):""),i&&i(!1))}},[l,e,i]),B.useEffect(()=>{var w;if(e){const A=j5(l);if(ld(e)&&A){const y=Dx(A,e);if(c&&c.bboxes&&y){const x=F5(y,M=>yx(M,c.bboxes)).map(M=>M.location);f(x)}}else{const y=(w=e==null?void 0:e.table)==null?void 0:w.location;f(y?[y]:[])}}},[l,e,c]),B.useEffect(()=>{if(!d||!p)return;const w=s.current,A=o.current;if(A&&i9(A),!e||!w||!A)return;p.forEach(x=>{try{const{begin:M,end:v}=x;if(typeof M>"u"||typeof v>"u")return;const I=n9(w,M,v),S=window.document.createDocumentFragment(),D=w.getBoundingClientRect();a9({fragment:S,parentRect:D,fieldType:"highlight",fieldValue:"",fieldId:M.toString(),...I}),A.appendChild(S)}catch(M){console.error("Error creating field rects",M)}});const y=A.querySelector(".field--rect");y&&y.scrollIntoView({block:"center"})},[e,d,p]),j.jsxs("div",{ref:a,className:x2,...n,children:[j.jsx("div",{ref:o}),d&&j.jsx("div",{className:`${x2}__content`,dangerouslySetInnerHTML:{__html:d},ref:s})]})});try{w2.displayName="canRenderHtmlView",w2.__docgenInfo={description:"",displayName:"canRenderHtmlView",props:{}}}catch{}try{vm.displayName="HtmlView",vm.__docgenInfo={description:"",displayName:"HtmlView",props:{document:{defaultValue:null,description:"Document data returned by query",name:"document",required:!0,type:{name:"QueryResultWithOptionalMetadata"}},highlight:{defaultValue:null,description:"table to highlight in document. Reference to item with `document.table_results`",name:"highlight",required:!1,type:{name:"QueryTableResult | QueryResultPassage"}},setLoading:{defaultValue:null,description:"Check to disable toolbar in parent",name:"setLoading",required:!1,type:{name:"((loading: boolean) => void)"}},setHideToolbarControls:{defaultValue:null,description:"Callback which is invoked with whether to enable/disable toolbar controls",name:"setHideToolbarControls",required:!1,type:{name:"((disabled: boolean) => void)"}}}}}catch{}function U1(l){return l!=null}const se=0,oe=1;function L1([l,e],[t,i]){return lt}function k5(l,e){return l&&(wt(e)===0?"":l.substring(e[se],e[oe]))}function wt(l){return Math.max(0,l[oe]-l[se])}function y2([l,e],t){return l<=t&&ts9(d,{begin:a,end:s}));if(o)return o}return null}var td={};td.d=(l,e)=>{for(var t in e)td.o(e,t)&&!td.o(l,t)&&Object.defineProperty(l,t,{enumerable:!0,get:e[t]})};td.o=(l,e)=>Object.prototype.hasOwnProperty.call(l,e);var Q=globalThis.pdfjsLib={};td.d(Q,{AbortException:()=>gr,AnnotationEditorLayer:()=>I3,AnnotationEditorParamsType:()=>W,AnnotationEditorType:()=>K,AnnotationEditorUIManager:()=>dd,AnnotationLayer:()=>v3,AnnotationMode:()=>vn,CMapCompressionType:()=>Sm,ColorPicker:()=>G4,DOMSVGFactory:()=>z5,DrawLayer:()=>C3,FeatureTest:()=>at,GlobalWorkerOptions:()=>rr,ImageKind:()=>og,InvalidPDFException:()=>w9,MissingPDFException:()=>ur,OPS:()=>Rt,PDFDataRangeTransport:()=>u4,PDFDateString:()=>D9,PDFWorker:()=>bg,PasswordResponses:()=>Ex,PermissionFlag:()=>Px,PixelsPerInch:()=>vl,RenderingCancelledException:()=>Q5,TextLayer:()=>sb,UnexpectedResponseException:()=>O1,Util:()=>F,VerbosityLevel:()=>F1,XfaLayer:()=>p4,build:()=>n3,createValidAbsoluteUrl:()=>Lx,fetchData:()=>Z1,getDocument:()=>Hy,getFilenameFromUrl:()=>Zx,getPdfFilenameFromUrl:()=>Yx,getXfaPageViewport:()=>Kx,isDataScheme:()=>Y1,isPdfFile:()=>V5,noContextMenu:()=>st,normalizeUnicode:()=>Wx,setLayerDimensions:()=>hr,shadow:()=>q,version:()=>i3});const Ke=typeof mr=="object"&&mr+""=="[object process]"&&!mr.versions.nw&&!(mr.versions.electron&&mr.type&&mr.type!=="browser"),f9=[1,0,0,1,0,0],Cm=[.001,0,0,.001,0,0],Tx=1e7,_1=1.35,bt={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},vn={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Nx="pdfjs_internal_editor_",K={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},W={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},Px={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},ke={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},og={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},we={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},Tl={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},F1={ERRORS:0,WARNINGS:1,INFOS:5},Sm={NONE:0,BINARY:1},Rt={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},Ex={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let G1=F1.WARNINGS;function Rx(l){Number.isInteger(l)&&(G1=l)}function Bx(){return G1}function k1(l){G1>=F1.INFOS&&console.log(`Info: ${l}`)}function Z(l){G1>=F1.WARNINGS&&console.log(`Warning: ${l}`)}function te(l){throw new Error(l)}function Ie(l,e){l||te(e)}function Ux(l){switch(l==null?void 0:l.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Lx(l,e=null,t=null){if(!l)return null;try{if(t&&typeof l=="string"){if(t.addDefaultProtocol&&l.startsWith("www.")){const n=l.match(/\./g);(n==null?void 0:n.length)>=2&&(l=`http://${l}`)}if(t.tryConvertEncoding)try{l=Ox(l)}catch{}}const i=e?new URL(l,e):new URL(l);if(Ux(i))return i}catch{}return null}function q(l,e,t,i=!1){return Object.defineProperty(l,e,{value:t,enumerable:!i,configurable:!0,writable:!1}),t}const fa=function(){function e(t,i){this.constructor===e&&te("Cannot initialize BaseException."),this.message=t,this.name=i}return e.prototype=new Error,e.constructor=e,e}();class Tm extends fa{constructor(e,t){super(e,"PasswordException"),this.code=t}}class Nm extends fa{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}let w9=class extends fa{constructor(e){super(e,"InvalidPDFException")}},ur=class extends fa{constructor(e){super(e,"MissingPDFException")}},O1=class extends fa{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}};class jx extends fa{constructor(e){super(e,"FormatError")}}let gr=class extends fa{constructor(e){super(e,"AbortException")}};function A9(l){(typeof l!="object"||(l==null?void 0:l.length)===void 0)&&te("Invalid argument for bytesToString");const e=l.length,t=8192;if(e>24&255,l>>16&255,l>>8&255,l&255)}function O5(l){const e=Object.create(null);for(const[t,i]of l)e[t]=i;return e}function Gx(){const l=new Uint8Array(4);return l[0]=1,new Uint32Array(l.buffer,0,1)[0]===1}function kx(){try{return new Function(""),!0}catch{return!1}}class at{static get isLittleEndian(){return q(this,"isLittleEndian",Gx())}static get isEvalSupported(){return q(this,"isEvalSupported",kx())}static get isOffscreenCanvasSupported(){return q(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.platform)=="string"?q(this,"platform",{isMac:navigator.platform.includes("Mac")}):q(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var e,t;return q(this,"isCSSRoundSupported",(t=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:t.call(e,"width: round(1.5px, 1px)"))}}const $1=Array.from(Array(256).keys(),l=>l.toString(16).padStart(2,"0"));var Lr,sg,lg,pd,Pm;let F=(sg=class{static makeHexColor(e,t,i){return`#${$1[e]}${$1[t]}${$1[i]}`}static scaleMinMax(e,t){let i;e[0]?(e[0]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[3],t[3]*=e[3]):(i=t[0],t[0]=t[1],t[1]=i,i=t[2],t[2]=t[3],t[3]=i,e[1]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){const i=e[0]*t[0]+e[1]*t[2]+t[4],n=e[0]*t[1]+e[1]*t[3]+t[5];return[i,n]}static applyInverseTransform(e,t){const i=t[0]*t[3]-t[1]*t[2],n=(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/i,a=(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/i;return[n,a]}static getAxialAlignedBoundingBox(e,t){const i=this.applyTransform(e,t),n=this.applyTransform(e.slice(2,4),t),a=this.applyTransform([e[0],e[3]],t),s=this.applyTransform([e[2],e[1]],t);return[Math.min(i[0],n[0],a[0],s[0]),Math.min(i[1],n[1],a[1],s[1]),Math.max(i[0],n[0],a[0],s[0]),Math.max(i[1],n[1],a[1],s[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],i=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],a=e[2]*t[0]+e[3]*t[2],s=e[2]*t[1]+e[3]*t[3],o=(i+s)/2,d=Math.sqrt((i+s)**2-4*(i*s-a*n))/2,h=o+d||1,c=o-d||1;return[Math.sqrt(h),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const i=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(i>n)return null;const a=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return a>s?null:[i,a,n,s]}static bezierBoundingBox(e,t,i,n,a,s,o,d,h){return h?(h[0]=Math.min(h[0],e,o),h[1]=Math.min(h[1],t,d),h[2]=Math.max(h[2],e,o),h[3]=Math.max(h[3],t,d)):h=[Math.min(e,o),Math.min(t,d),Math.max(e,o),Math.max(t,d)],m(this,pd,Pm).call(this,e,i,a,o,t,n,s,d,3*(-e+3*(i-a)+o),6*(e-2*i+a),3*(i-e),h),m(this,pd,Pm).call(this,e,i,a,o,t,n,s,d,3*(-t+3*(n-s)+d),6*(t-2*n+s),3*(n-t),h),h}},Lr=new WeakSet,lg=function(e,t,i,n,a,s,o,d,h,c){if(h<=0||h>=1)return;const u=1-h,p=h*h,f=p*h,w=u*(u*(u*e+3*h*t)+3*p*i)+f*n,A=u*(u*(u*a+3*h*s)+3*p*o)+f*d;c[0]=Math.min(c[0],w),c[1]=Math.min(c[1],A),c[2]=Math.max(c[2],w),c[3]=Math.max(c[3],A)},pd=new WeakSet,Pm=function(e,t,i,n,a,s,o,d,h,c,u,p){if(Math.abs(h)<1e-12){Math.abs(c)>=1e-12&&m(this,Lr,lg).call(this,e,t,i,n,a,s,o,d,-u/c,p);return}const f=c**2-4*u*h;if(f<0)return;const w=Math.sqrt(f),A=2*h;m(this,Lr,lg).call(this,e,t,i,n,a,s,o,d,(-c+w)/A,p),m(this,Lr,lg).call(this,e,t,i,n,a,s,o,d,(-c-w)/A,p)},g(sg,Lr),g(sg,pd),sg);function Ox(l){return decodeURIComponent(escape(l))}let em=null,M2=null;function Wx(l){return em||(em=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,M2=new Map([["ſt","ſt"]])),l.replaceAll(em,(e,t,i)=>t?t.normalize("NFKC"):M2.get(i))}function zx(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const l=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(l);else for(let e=0;e<32;e++)l[e]=Math.floor(Math.random()*255);return A9(l)}const x9="pdfjs_internal_id_",Di={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};class z1{constructor(){this.constructor===z1&&te("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,i,n,a){return"none"}destroy(e=!1){}}var md;const n2=class n2{constructor({enableHWA:e=!1}={}){g(this,md,!1);this.constructor===n2&&te("Cannot initialize BaseCanvasFactory."),b(this,md,e)}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(e,t);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!r(this,md)})}}reset(e,t,i){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||i<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=i}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){te("Abstract method `_createCanvas` called.")}};md=new WeakMap;let Kg=n2;class Q1{constructor({baseUrl:e=null,isCompressed:t=!0}){this.constructor===Q1&&te("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":""),i=this.isCompressed?Sm.BINARY:Sm.NONE;return this._fetchData(t,i).catch(n=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}_fetchData(e,t){te("Abstract method `_fetchData` called.")}}class V1{constructor({baseUrl:e=null}){this.constructor===V1&&te("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetchData(t).catch(i=>{throw new Error(`Unable to load font data at: ${t}`)})}_fetchData(e){te("Abstract method `_fetchData` called.")}}class W5{constructor(){this.constructor===W5&&te("Cannot initialize BaseSVGFactory.")}create(e,t,i=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width",`${e}px`),n.setAttribute("height",`${t}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${e} ${t}`),n}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){te("Abstract method `_createSVG` called.")}}const Ci="http://www.w3.org/2000/svg";var gn;let vl=(gn=class{},U(gn,"CSS",96),U(gn,"PDF",72),U(gn,"PDF_TO_CSS_UNITS",gn.CSS/gn.PDF),gn);var Na,Pa,_t,Bi,We,hp,Ea,Ce,Oe,Dn,wr,In,Ar,jr,dg,Cn,xr,cp,y9,bd,Em,Sn,yr,Ra,Ul,Ba,Ll,fd,Rm,Ua,jl;class Qx extends z1{constructor({docId:t,ownerDocument:i=globalThis.document}={}){super();g(this,Ce);g(this,Dn);g(this,In);g(this,jr);g(this,Cn);g(this,cp);g(this,bd);g(this,Sn);g(this,Ra);g(this,Ba);g(this,fd);g(this,Ua);g(this,Na,void 0);g(this,Pa,void 0);g(this,_t,void 0);g(this,Bi,void 0);g(this,We,void 0);g(this,hp,void 0);g(this,Ea,0);b(this,Bi,t),b(this,We,i)}addFilter(t){if(!t)return"none";let i=r(this,Ce,Oe).get(t);if(i)return i;const[n,a,s]=m(this,jr,dg).call(this,t),o=t.length===1?n:`${n}${a}${s}`;if(i=r(this,Ce,Oe).get(o),i)return r(this,Ce,Oe).set(t,i),i;const d=`g_${r(this,Bi)}_transfer_map_${et(this,Ea)._++}`,h=m(this,Cn,xr).call(this,d);r(this,Ce,Oe).set(t,h),r(this,Ce,Oe).set(o,h);const c=m(this,Sn,yr).call(this,d);return m(this,Ba,Ll).call(this,n,a,s,c),h}addHCMFilter(t,i){var w;const n=`${t}-${i}`,a="base";let s=r(this,Dn,wr).get(a);if((s==null?void 0:s.key)===n||(s?((w=s.filter)==null||w.remove(),s.key=n,s.url="none",s.filter=null):(s={key:n,url:"none",filter:null},r(this,Dn,wr).set(a,s)),!t||!i))return s.url;const o=m(this,Ua,jl).call(this,t);t=F.makeHexColor(...o);const d=m(this,Ua,jl).call(this,i);if(i=F.makeHexColor(...d),r(this,In,Ar).style.color="",t==="#000000"&&i==="#ffffff"||t===i)return s.url;const h=new Array(256);for(let A=0;A<=255;A++){const y=A/255;h[A]=y<=.03928?y/12.92:((y+.055)/1.055)**2.4}const c=h.join(","),u=`g_${r(this,Bi)}_hcm_filter`,p=s.filter=m(this,Sn,yr).call(this,u);m(this,Ba,Ll).call(this,c,c,c,p),m(this,bd,Em).call(this,p);const f=(A,y)=>{const x=o[A]/255,M=d[A]/255,v=new Array(y+1);for(let I=0;I<=y;I++)v[I]=x+I/y*(M-x);return v.join(",")};return m(this,Ba,Ll).call(this,f(0,5),f(1,5),f(2,5),p),s.url=m(this,Cn,xr).call(this,u),s.url}addAlphaFilter(t){let i=r(this,Ce,Oe).get(t);if(i)return i;const[n]=m(this,jr,dg).call(this,[t]),a=`alpha_${n}`;if(i=r(this,Ce,Oe).get(a),i)return r(this,Ce,Oe).set(t,i),i;const s=`g_${r(this,Bi)}_alpha_map_${et(this,Ea)._++}`,o=m(this,Cn,xr).call(this,s);r(this,Ce,Oe).set(t,o),r(this,Ce,Oe).set(a,o);const d=m(this,Sn,yr).call(this,s);return m(this,fd,Rm).call(this,n,d),o}addLuminosityFilter(t){let i=r(this,Ce,Oe).get(t||"luminosity");if(i)return i;let n,a;if(t?([n]=m(this,jr,dg).call(this,[t]),a=`luminosity_${n}`):a="luminosity",i=r(this,Ce,Oe).get(a),i)return r(this,Ce,Oe).set(t,i),i;const s=`g_${r(this,Bi)}_luminosity_map_${et(this,Ea)._++}`,o=m(this,Cn,xr).call(this,s);r(this,Ce,Oe).set(t,o),r(this,Ce,Oe).set(a,o);const d=m(this,Sn,yr).call(this,s);return m(this,cp,y9).call(this,d),t&&m(this,fd,Rm).call(this,n,d),o}addHighlightHCMFilter(t,i,n,a,s){var M;const o=`${i}-${n}-${a}-${s}`;let d=r(this,Dn,wr).get(t);if((d==null?void 0:d.key)===o||(d?((M=d.filter)==null||M.remove(),d.key=o,d.url="none",d.filter=null):(d={key:o,url:"none",filter:null},r(this,Dn,wr).set(t,d)),!i||!n))return d.url;const[h,c]=[i,n].map(m(this,Ua,jl).bind(this));let u=Math.round(.2126*h[0]+.7152*h[1]+.0722*h[2]),p=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[f,w]=[a,s].map(m(this,Ua,jl).bind(this));p{const D=new Array(256),T=(p-u)/S,P=v/255,C=(I-v)/(255*S);let N=0;for(let R=0;R<=S;R++){const L=Math.round(u+R*T),k=P+R*C;for(let O=N;O<=L;O++)D[O]=k;N=L+1}for(let R=N;R<256;R++)D[R]=D[N-1];return D.join(",")},y=`g_${r(this,Bi)}_hcm_${t}_filter`,x=d.filter=m(this,Sn,yr).call(this,y);return m(this,bd,Em).call(this,x),m(this,Ba,Ll).call(this,A(f[0],w[0],5),A(f[1],w[1],5),A(f[2],w[2],5),x),d.url=m(this,Cn,xr).call(this,y),d.url}destroy(t=!1){t&&r(this,Dn,wr).size!==0||(r(this,_t)&&(r(this,_t).parentNode.parentNode.remove(),b(this,_t,null)),r(this,Pa)&&(r(this,Pa).clear(),b(this,Pa,null)),b(this,Ea,0))}}Na=new WeakMap,Pa=new WeakMap,_t=new WeakMap,Bi=new WeakMap,We=new WeakMap,hp=new WeakMap,Ea=new WeakMap,Ce=new WeakSet,Oe=function(){return r(this,Pa)||b(this,Pa,new Map)},Dn=new WeakSet,wr=function(){return r(this,hp)||b(this,hp,new Map)},In=new WeakSet,Ar=function(){if(!r(this,_t)){const t=r(this,We).createElement("div"),{style:i}=t;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const n=r(this,We).createElementNS(Ci,"svg");n.setAttribute("width",0),n.setAttribute("height",0),b(this,_t,r(this,We).createElementNS(Ci,"defs")),t.append(n),n.append(r(this,_t)),r(this,We).body.append(t)}return r(this,_t)},jr=new WeakSet,dg=function(t){if(t.length===1){const h=t[0],c=new Array(256);for(let p=0;p<256;p++)c[p]=h[p]/255;const u=c.join(",");return[u,u,u]}const[i,n,a]=t,s=new Array(256),o=new Array(256),d=new Array(256);for(let h=0;h<256;h++)s[h]=i[h]/255,o[h]=n[h]/255,d[h]=a[h]/255;return[s.join(","),o.join(","),d.join(",")]},Cn=new WeakSet,xr=function(t){if(r(this,Na)===void 0){b(this,Na,"");const i=r(this,We).URL;i!==r(this,We).baseURI&&(Y1(i)?Z('#createUrl: ignore "data:"-URL for performance reasons.'):b(this,Na,i.split("#",1)[0]))}return`url(${r(this,Na)}#${t})`},cp=new WeakSet,y9=function(t){const i=r(this,We).createElementNS(Ci,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(i)},bd=new WeakSet,Em=function(t){const i=r(this,We).createElementNS(Ci,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(i)},Sn=new WeakSet,yr=function(t){const i=r(this,We).createElementNS(Ci,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",t),r(this,In,Ar).append(i),i},Ra=new WeakSet,Ul=function(t,i,n){const a=r(this,We).createElementNS(Ci,i);a.setAttribute("type","discrete"),a.setAttribute("tableValues",n),t.append(a)},Ba=new WeakSet,Ll=function(t,i,n,a){const s=r(this,We).createElementNS(Ci,"feComponentTransfer");a.append(s),m(this,Ra,Ul).call(this,s,"feFuncR",t),m(this,Ra,Ul).call(this,s,"feFuncG",i),m(this,Ra,Ul).call(this,s,"feFuncB",n)},fd=new WeakSet,Rm=function(t,i){const n=r(this,We).createElementNS(Ci,"feComponentTransfer");i.append(n),m(this,Ra,Ul).call(this,n,"feFuncA",t)},Ua=new WeakSet,jl=function(t){return r(this,In,Ar).style.color=t,Z5(getComputedStyle(r(this,In,Ar)).getPropertyValue("color"))};class Vx extends Kg{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}={}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const i=this._document.createElement("canvas");return i.width=e,i.height=t,i}}async function Z1(l,e="text"){if(Fl(l,document.baseURI)){const t=await fetch(l);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,i)=>{const n=new XMLHttpRequest;n.open("GET",l,!0),n.responseType=e,n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(n.status===200||n.status===0){switch(e){case"arraybuffer":case"blob":case"json":t(n.response);return}t(n.responseText);return}i(new Error(n.statusText))}},n.send(null)})}class M9 extends Q1{_fetchData(e,t){return Z1(e,this.isCompressed?"arraybuffer":"text").then(i=>({cMapData:i instanceof ArrayBuffer?new Uint8Array(i):W1(i),compressionType:t}))}}class v9 extends V1{_fetchData(e){return Z1(e,"arraybuffer").then(t=>new Uint8Array(t))}}let z5=class extends W5{_createSVG(e){return document.createElementNS(Ci,e)}};class Nu{constructor({viewBox:e,scale:t,rotation:i,offsetX:n=0,offsetY:a=0,dontFlip:s=!1}){this.viewBox=e,this.scale=t,this.rotation=i,this.offsetX=n,this.offsetY=a;const o=(e[2]+e[0])/2,d=(e[3]+e[1])/2;let h,c,u,p;switch(i%=360,i<0&&(i+=360),i){case 180:h=-1,c=0,u=0,p=1;break;case 90:h=0,c=1,u=1,p=0;break;case 270:h=0,c=-1,u=-1,p=0;break;case 0:h=1,c=0,u=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(u=-u,p=-p);let f,w,A,y;h===0?(f=Math.abs(d-e[1])*t+n,w=Math.abs(o-e[0])*t+a,A=(e[3]-e[1])*t,y=(e[2]-e[0])*t):(f=Math.abs(o-e[0])*t+n,w=Math.abs(d-e[1])*t+a,A=(e[2]-e[0])*t,y=(e[3]-e[1])*t),this.transform=[h*t,c*t,u*t,p*t,f-h*t*o-u*t*d,w-c*t*o-p*t*d],this.width=A,this.height=y}get rawDims(){const{viewBox:e}=this;return q(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:a=!1}={}){return new Nu({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:a})}convertToViewportPoint(e,t){return F.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=F.applyTransform([e[0],e[1]],this.transform),i=F.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],i[0],i[1]]}convertToPdfPoint(e,t){return F.applyInverseTransform([e,t],this.transform)}}let Q5=class extends fa{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}};function Y1(l){const e=l.length;let t=0;for(;t=1&&n<=12?n-1:0;let a=parseInt(t[3],10);a=a>=1&&a<=31?a:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let d=parseInt(t[6],10);d=d>=0&&d<=59?d:0;const h=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,h==="-"?(s+=c,o+=u):h==="+"&&(s-=c,o-=u),new Date(Date.UTC(i,n,a,s,o,d))}};function Kx(l,{scale:e=1,rotation:t=0}){const{width:i,height:n}=l.attributes.style,a=[0,0,parseInt(i),parseInt(n)];return new Nu({viewBox:a,scale:e,rotation:t})}function Z5(l){if(l.startsWith("#")){const e=parseInt(l.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return l.startsWith("rgb(")?l.slice(4,-1).split(",").map(e=>parseInt(e)):l.startsWith("rgba(")?l.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(Z(`Not a valid color format: "${l}"`),[0,0,0])}function Hx(l){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const t of l.keys()){e.style.color=t;const i=window.getComputedStyle(e).color;l.set(t,Z5(i))}e.remove()}function re(l){const{a:e,b:t,c:i,d:n,e:a,f:s}=l.getTransform();return[e,t,i,n,a,s]}function Ii(l){const{a:e,b:t,c:i,d:n,e:a,f:s}=l.getTransform().invertSelf();return[e,t,i,n,a,s]}function hr(l,e,t=!1,i=!0){if(e instanceof Nu){const{pageWidth:n,pageHeight:a}=e.rawDims,{style:s}=l,o=at.isCSSRoundSupported,d=`var(--scale-factor) * ${n}px`,h=`var(--scale-factor) * ${a}px`,c=o?`round(${d}, 1px)`:`calc(${d})`,u=o?`round(${h}, 1px)`:`calc(${h})`;!t||e.rotation%180===0?(s.width=c,s.height=u):(s.width=u,s.height=c)}i&&l.setAttribute("data-main-rotation",e.rotation)}var La,ja,ot,Fa,up,I9,gp,C9,pp,S9,Fr,hg,mp,T9,wd,Um;const bp=class bp{constructor(e){g(this,gp);g(this,pp);g(this,Fr);g(this,mp);g(this,wd);g(this,La,null);g(this,ja,null);g(this,ot,void 0);g(this,Fa,null);b(this,ot,e)}render(){const e=b(this,La,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");const t=r(this,ot)._uiManager._signal;e.addEventListener("contextmenu",st,{signal:t}),e.addEventListener("pointerdown",m(bp,up,I9),{signal:t});const i=b(this,Fa,document.createElement("div"));i.className="buttons",e.append(i);const n=r(this,ot).toolbarPosition;if(n){const{style:a}=e,s=r(this,ot)._uiManager.direction==="ltr"?1-n[0]:n[0];a.insetInlineEnd=`${100*s}%`,a.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return m(this,mp,T9).call(this),e}hide(){var e;r(this,La).classList.add("hidden"),(e=r(this,ja))==null||e.hideDropdown()}show(){r(this,La).classList.remove("hidden")}addAltTextButton(e){m(this,Fr,hg).call(this,e),r(this,Fa).prepend(e,r(this,wd,Um))}addColorPicker(e){b(this,ja,e);const t=e.renderButton();m(this,Fr,hg).call(this,t),r(this,Fa).prepend(t,r(this,wd,Um))}remove(){var e;r(this,La).remove(),(e=r(this,ja))==null||e.destroy(),b(this,ja,null)}};La=new WeakMap,ja=new WeakMap,ot=new WeakMap,Fa=new WeakMap,up=new WeakSet,I9=function(e){e.stopPropagation()},gp=new WeakSet,C9=function(e){r(this,ot)._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()},pp=new WeakSet,S9=function(e){r(this,ot)._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()},Fr=new WeakSet,hg=function(e){const t=r(this,ot)._uiManager._signal;e.addEventListener("focusin",m(this,gp,C9).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",m(this,pp,S9).bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",st,{signal:t})},mp=new WeakSet,T9=function(){const e=document.createElement("button");e.className="delete",e.tabIndex=0,e.setAttribute("data-l10n-id",`pdfjs-editor-remove-${r(this,ot).editorType}-button`),m(this,Fr,hg).call(this,e),e.addEventListener("click",t=>{r(this,ot)._uiManager.delete()},{signal:r(this,ot)._uiManager._signal}),r(this,Fa).append(e)},wd=new WeakSet,Um=function(){const e=document.createElement("div");return e.className="divider",e},g(bp,up);let Bm=bp;var Ad,Ga,ka,fp,N9,wp,P9,Ap,E9;class qx{constructor(e){g(this,fp);g(this,wp);g(this,Ap);g(this,Ad,null);g(this,Ga,null);g(this,ka,void 0);b(this,ka,e)}show(e,t,i){const[n,a]=m(this,wp,P9).call(this,t,i),{style:s}=r(this,Ga)||b(this,Ga,m(this,fp,N9).call(this));e.append(r(this,Ga)),s.insetInlineEnd=`${100*n}%`,s.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){r(this,Ga).remove()}}Ad=new WeakMap,Ga=new WeakMap,ka=new WeakMap,fp=new WeakSet,N9=function(){const e=b(this,Ga,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",st,{signal:r(this,ka)._signal});const t=b(this,Ad,document.createElement("div"));return t.className="buttons",e.append(t),m(this,Ap,E9).call(this),e},wp=new WeakSet,P9=function(e,t){let i=0,n=0;for(const a of e){const s=a.y+a.height;if(si){n=o,i=s;continue}t?o>n&&(n=o):o{r(this,ka).highlightSelection("floating_button")},{signal:i}),r(this,Ad).append(e)};function Hg(l,e,t){for(const i of t)e.addEventListener(i,l[i].bind(l))}function Xx(l){return Math.round(Math.min(255,Math.max(1,255*l))).toString(16).padStart(2,"0")}var xp;class Jx{constructor(){g(this,xp,0)}get id(){return`${Nx}${et(this,xp)._++}`}}xp=new WeakMap;var xd,yp,xt,yd,jm;const a2=class a2{constructor(){g(this,yd);g(this,xd,zx());g(this,yp,0);g(this,xt,null)}static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),n=new Image;n.src=e;const a=n.decode().then(()=>(i.drawImage(n,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return q(this,"_isSVGFittingCanvas",a)}async getFromFile(e){const{lastModified:t,name:i,size:n,type:a}=e;return m(this,yd,jm).call(this,`${t}_${i}_${n}_${a}`,e)}async getFromUrl(e){return m(this,yd,jm).call(this,e,e)}async getFromId(e){r(this,xt)||b(this,xt,new Map);const t=r(this,xt).get(e);return t?t.bitmap?(t.refCounter+=1,t):t.file?this.getFromFile(t.file):this.getFromUrl(t.url):null}getSvgUrl(e){const t=r(this,xt).get(e);return t!=null&&t.isSvg?t.svgUrl:null}deleteId(e){r(this,xt)||b(this,xt,new Map);const t=r(this,xt).get(e);t&&(t.refCounter-=1,t.refCounter===0&&(t.bitmap=null))}isValidId(e){return e.startsWith(`image_${r(this,xd)}_`)}};xd=new WeakMap,yp=new WeakMap,xt=new WeakMap,yd=new WeakSet,jm=async function(e,t){r(this,xt)||b(this,xt,new Map);let i=r(this,xt).get(e);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:`image_${r(this,xd)}_${et(this,yp)._++}`,refCounter:0,isSvg:!1});let n;if(typeof t=="string"?(i.url=t,n=await Z1(t,"blob")):n=i.file=t,n.type==="image/svg+xml"){const a=a2._isSVGFittingCanvas,s=new FileReader,o=new Image,d=new Promise((h,c)=>{o.onload=()=>{i.bitmap=o,i.isSvg=!0,h()},s.onload=async()=>{const u=i.svgUrl=s.result;o.src=await a?`${u}#svgView(preserveAspectRatio(none))`:u},o.onerror=s.onerror=c});s.readAsDataURL(n),await d}else i.bitmap=await createImageBitmap(n);i.refCounter=1}catch(n){console.error(n),i=null}return r(this,xt).set(e,i),i&&r(this,xt).set(i.id,i),i};let Lm=a2;var Se,Tn,Md,Te;class _x{constructor(e=128){g(this,Se,[]);g(this,Tn,!1);g(this,Md,void 0);g(this,Te,-1);b(this,Md,e)}add({cmd:e,undo:t,post:i,mustExec:n,type:a=NaN,overwriteIfSameType:s=!1,keepUndo:o=!1}){if(n&&e(),r(this,Tn))return;const d={cmd:e,undo:t,post:i,type:a};if(r(this,Te)===-1){r(this,Se).length>0&&(r(this,Se).length=0),b(this,Te,0),r(this,Se).push(d);return}if(s&&r(this,Se)[r(this,Te)].type===a){o&&(d.undo=r(this,Se)[r(this,Te)].undo),r(this,Se)[r(this,Te)]=d;return}const h=r(this,Te)+1;h===r(this,Md)?r(this,Se).splice(0,1):(b(this,Te,h),ha===t[s]))return vp._colorsMapping.get(i);return t}getHexCode(e){const t=this._colors.get(e);return t?F.makeHexColor(...t):e}};U(vp,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let Fm=vp;var Gr,lt,Ae,Be,kr,Ui,Or,Bt,Wr,Oa,$t,Ut,Wa,vd,Dd,Id,ei,zr,Nn,ti,Dp,Pn,Cd,za,Sd,Qr,Ne,$,Li,Qa,Td,Nd,Pd,Ed,Rd,Bd,Ud,Ld,jd,Fd,Gd,kd,Od,En,ii,ji,Wd,ba,Vr,cg,zd,Gm,Ip,B9,Cp,U9,Zr,ug,Sp,L9,Tp,j9,Np,F9,Qd,km,Pp,G9,Vd,Om,Zd,Wm,Ep,k9,Ue,qe,ni,wn,Rp,O9,Bp,W9,Yd,zm,Up,z9,Va,Gl,Kd,Qm;let dd=(ba=class{constructor(e,t,i,n,a,s,o,d,h,c){g(this,Vr);g(this,zd);g(this,Ip);g(this,Cp);g(this,Zr);g(this,Sp);g(this,Tp);g(this,Np);g(this,Qd);g(this,Pp);g(this,Vd);g(this,Zd);g(this,Ep);g(this,Ue);g(this,ni);g(this,Rp);g(this,Bp);g(this,Yd);g(this,Up);g(this,Va);g(this,Kd);g(this,Gr,new AbortController);g(this,lt,null);g(this,Ae,new Map);g(this,Be,new Map);g(this,kr,null);g(this,Ui,null);g(this,Or,null);g(this,Bt,new _x);g(this,Wr,0);g(this,Oa,new Set);g(this,$t,null);g(this,Ut,null);g(this,Wa,new Set);g(this,vd,!1);g(this,Dd,!1);g(this,Id,null);g(this,ei,null);g(this,zr,null);g(this,Nn,!1);g(this,ti,null);g(this,Dp,new Jx);g(this,Pn,!1);g(this,Cd,!1);g(this,za,null);g(this,Sd,null);g(this,Qr,null);g(this,Ne,K.NONE);g(this,$,new Set);g(this,Li,null);g(this,Qa,null);g(this,Td,null);g(this,Nd,this.blur.bind(this));g(this,Pd,this.focus.bind(this));g(this,Ed,this.copy.bind(this));g(this,Rd,this.cut.bind(this));g(this,Bd,this.paste.bind(this));g(this,Ud,this.keydown.bind(this));g(this,Ld,this.keyup.bind(this));g(this,jd,this.onEditingAction.bind(this));g(this,Fd,this.onPageChanging.bind(this));g(this,Gd,this.onScaleChanging.bind(this));g(this,kd,this.onRotationChanging.bind(this));g(this,Od,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});g(this,En,[0,0]);g(this,ii,null);g(this,ji,null);g(this,Wd,null);this._signal=r(this,Gr).signal,b(this,ji,e),b(this,Wd,t),b(this,kr,i),this._eventBus=n,this._eventBus._on("editingaction",r(this,jd)),this._eventBus._on("pagechanging",r(this,Fd)),this._eventBus._on("scalechanging",r(this,Gd)),this._eventBus._on("rotationchanging",r(this,kd)),m(this,Sp,L9).call(this),m(this,Ep,k9).call(this),m(this,Qd,km).call(this),b(this,Ui,a.annotationStorage),b(this,Id,a.filterFactory),b(this,Qa,s),b(this,zr,o||null),b(this,vd,d),b(this,Dd,h),b(this,Qr,c||null),this.viewParameters={realScale:vl.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}static get _keyboardManager(){const e=ba.prototype,t=s=>r(s,ji).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),i=(s,{target:o})=>{if(o instanceof HTMLInputElement){const{type:d}=o;return d!=="text"&&d!=="number"}return!0},n=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return q(this,"_keyboardManager",new Pu([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],e.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:i}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:o})=>!(o instanceof HTMLButtonElement)&&r(s,ji).contains(o)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:o})=>!(o instanceof HTMLButtonElement)&&r(s,ji).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-a,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[a,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-a],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,a],checker:t}]]))}destroy(){var e,t,i;(e=r(this,Gr))==null||e.abort(),b(this,Gr,null),this._signal=null,this._eventBus._off("editingaction",r(this,jd)),this._eventBus._off("pagechanging",r(this,Fd)),this._eventBus._off("scalechanging",r(this,Gd)),this._eventBus._off("rotationchanging",r(this,kd));for(const n of r(this,Be).values())n.destroy();r(this,Be).clear(),r(this,Ae).clear(),r(this,Wa).clear(),b(this,lt,null),r(this,$).clear(),r(this,Bt).destroy(),(t=r(this,kr))==null||t.destroy(),(i=r(this,ti))==null||i.hide(),b(this,ti,null),r(this,ei)&&(clearTimeout(r(this,ei)),b(this,ei,null)),r(this,ii)&&(clearTimeout(r(this,ii)),b(this,ii,null))}async mlGuess(e){var t;return((t=r(this,Qr))==null?void 0:t.guess(e))||null}async isMLEnabledFor(e){var t;return!!await((t=r(this,Qr))==null?void 0:t.isEnabledFor(e))}get useNewAltTextFlow(){return r(this,Dd)}get hcmFilter(){return q(this,"hcmFilter",r(this,Qa)?r(this,Id).addHCMFilter(r(this,Qa).foreground,r(this,Qa).background):"none")}get direction(){return q(this,"direction",getComputedStyle(r(this,ji)).direction)}get highlightColors(){return q(this,"highlightColors",r(this,zr)?new Map(r(this,zr).split(",").map(e=>e.split("=").map(t=>t.trim()))):null)}get highlightColorNames(){return q(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){b(this,Sd,e)}editAltText(e){var t;(t=r(this,kr))==null||t.editAltText(this,e)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onPageChanging({pageNumber:e}){b(this,Wr,e-1)}focusMainContainer(){r(this,ji).focus()}findParent(e,t){for(const i of r(this,Be).values()){const{x:n,y:a,width:s,height:o}=i.div.getBoundingClientRect();if(e>=n&&e<=n+s&&t>=a&&t<=a+o)return i}return null}disableUserSelect(e=!1){r(this,Wd).classList.toggle("noUserSelect",e)}addShouldRescale(e){r(this,Wa).add(e)}removeShouldRescale(e){r(this,Wa).delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*vl.PDF_TO_CSS_UNITS;for(const t of r(this,Wa))t.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e=""){const t=document.getSelection();if(!t||t.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:a,focusOffset:s}=t,o=t.toString(),h=m(this,Vr,cg).call(this,t).closest(".textLayer"),c=this.getSelectionBoxes(h);if(!c)return;t.empty();const u=m(this,zd,Gm).call(this,h),p=r(this,Ne)===K.NONE,f=()=>{u==null||u.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:c,anchorNode:i,anchorOffset:n,focusNode:a,focusOffset:s,text:o}),p&&this.showAllEditors("highlight",!0,!0)};if(p){this.switchToMode(K.HIGHLIGHT,f);return}f()}addToAnnotationStorage(e){!e.isEmpty()&&r(this,Ui)&&!r(this,Ui).has(e.id)&&r(this,Ui).setValue(e.id,e)}blur(){if(this.isShiftKeyDown=!1,r(this,Nn)&&(b(this,Nn,!1),m(this,Zr,ug).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of r(this,$))if(t.div.contains(e)){b(this,za,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!r(this,za))return;const[e,t]=r(this,za);b(this,za,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}addEditListeners(){m(this,Qd,km).call(this),m(this,Vd,Om).call(this)}removeEditListeners(){m(this,Pp,G9).call(this),m(this,Zd,Wm).call(this)}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const i of r(this,Ut))if(i.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const t of e.dataTransfer.items)for(const i of r(this,Ut))if(i.isHandlingMimeForPasting(t.type)){i.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){var i;if(e.preventDefault(),(i=r(this,lt))==null||i.commitOrRemove(),!this.hasSelection)return;const t=[];for(const n of r(this,$)){const a=n.serialize(!0);a&&t.push(a)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();const{clipboardData:t}=e;for(const a of t.items)for(const s of r(this,Ut))if(s.isHandlingMimeForPasting(a.type)){s.paste(a,this.currentLayer);return}let i=t.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(a){Z(`paste: "${a.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const a=[];for(const d of i){const h=n.deserialize(d);if(!h)return;a.push(h)}const s=()=>{for(const d of a)m(this,Yd,zm).call(this,d);m(this,Kd,Qm).call(this,a)},o=()=>{for(const d of a)d.remove()};this.addCommands({cmd:s,undo:o,mustExec:!0})}catch(a){Z(`paste: "${a.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),r(this,Ne)!==K.NONE&&!this.isEditorHandlingKeyboard&&ba._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,r(this,Nn)&&(b(this,Nn,!1),m(this,Zr,ug).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(e){e?(m(this,Tp,j9).call(this),m(this,Vd,Om).call(this),m(this,Ue,qe).call(this,{isEditing:r(this,Ne)!==K.NONE,isEmpty:m(this,Va,Gl).call(this),hasSomethingToUndo:r(this,Bt).hasSomethingToUndo(),hasSomethingToRedo:r(this,Bt).hasSomethingToRedo(),hasSelectedEditor:!1})):(m(this,Np,F9).call(this),m(this,Zd,Wm).call(this),m(this,Ue,qe).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!r(this,Ut)){b(this,Ut,e);for(const t of r(this,Ut))m(this,ni,wn).call(this,t.defaultPropertiesToUpdate)}}getId(){return r(this,Dp).id}get currentLayer(){return r(this,Be).get(r(this,Wr))}getLayer(e){return r(this,Be).get(e)}get currentPageIndex(){return r(this,Wr)}addLayer(e){r(this,Be).set(e.pageIndex,e),r(this,Pn)?e.enable():e.disable()}removeLayer(e){r(this,Be).delete(e.pageIndex)}updateMode(e,t=null,i=!1){if(r(this,Ne)!==e){if(b(this,Ne,e),e===K.NONE){this.setEditingState(!1),m(this,Bp,W9).call(this);return}this.setEditingState(!0),m(this,Rp,O9).call(this),this.unselectAll();for(const n of r(this,Be).values())n.updateMode(e);if(!t&&i){this.addNewEditorFromKeyboard();return}if(t){for(const n of r(this,Ae).values())if(n.annotationElementId===t){this.setSelected(n),n.enterInEditMode();break}}}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==r(this,Ne)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){var i;if(r(this,Ut)){switch(e){case W.CREATE:this.currentLayer.addNewEditor();return;case W.HIGHLIGHT_DEFAULT_COLOR:(i=r(this,Sd))==null||i.updateColor(t);break;case W.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(r(this,Td)||b(this,Td,new Map)).set(e,t),this.showAllEditors("highlight",t);break}for(const n of r(this,$))n.updateParams(e,t);for(const n of r(this,Ut))n.updateDefaultParams(e,t)}}showAllEditors(e,t,i=!1){var a;for(const s of r(this,Ae).values())s.editorType===e&&s.show(t);(((a=r(this,Td))==null?void 0:a.get(W.HIGHLIGHT_SHOW_ALL))??!0)!==t&&m(this,ni,wn).call(this,[[W.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(r(this,Cd)!==e){b(this,Cd,e);for(const t of r(this,Be).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}getEditors(e){const t=[];for(const i of r(this,Ae).values())i.pageIndex===e&&t.push(i);return t}getEditor(e){return r(this,Ae).get(e)}addEditor(e){r(this,Ae).set(e.id,e)}removeEditor(e){var t;e.div.contains(document.activeElement)&&(r(this,ei)&&clearTimeout(r(this,ei)),b(this,ei,setTimeout(()=>{this.focusMainContainer(),b(this,ei,null)},0))),r(this,Ae).delete(e.id),this.unselect(e),(!e.annotationElementId||!r(this,Oa).has(e.annotationElementId))&&((t=r(this,Ui))==null||t.remove(e.id))}addDeletedAnnotationElement(e){r(this,Oa).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return r(this,Oa).has(e)}removeDeletedAnnotationElement(e){r(this,Oa).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){r(this,lt)!==e&&(b(this,lt,e),e&&m(this,ni,wn).call(this,e.propertiesToUpdate))}updateUI(e){r(this,Up,z9)===e&&m(this,ni,wn).call(this,e.propertiesToUpdate)}toggleSelected(e){if(r(this,$).has(e)){r(this,$).delete(e),e.unselect(),m(this,Ue,qe).call(this,{hasSelectedEditor:this.hasSelection});return}r(this,$).add(e),e.select(),m(this,ni,wn).call(this,e.propertiesToUpdate),m(this,Ue,qe).call(this,{hasSelectedEditor:!0})}setSelected(e){for(const t of r(this,$))t!==e&&t.unselect();r(this,$).clear(),r(this,$).add(e),e.select(),m(this,ni,wn).call(this,e.propertiesToUpdate),m(this,Ue,qe).call(this,{hasSelectedEditor:!0})}isSelected(e){return r(this,$).has(e)}get firstSelectedEditor(){return r(this,$).values().next().value}unselect(e){e.unselect(),r(this,$).delete(e),m(this,Ue,qe).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return r(this,$).size!==0}get isEnterHandled(){return r(this,$).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){r(this,Bt).undo(),m(this,Ue,qe).call(this,{hasSomethingToUndo:r(this,Bt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:m(this,Va,Gl).call(this)})}redo(){r(this,Bt).redo(),m(this,Ue,qe).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:r(this,Bt).hasSomethingToRedo(),isEmpty:m(this,Va,Gl).call(this)})}addCommands(e){r(this,Bt).add(e),m(this,Ue,qe).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:m(this,Va,Gl).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...r(this,$)],t=()=>{for(const n of e)n.remove()},i=()=>{for(const n of e)m(this,Yd,zm).call(this,n)};this.addCommands({cmd:t,undo:i,mustExec:!0})}commitOrRemove(){var e;(e=r(this,lt))==null||e.commitOrRemove()}hasSomethingToControl(){return r(this,lt)||this.hasSelection}selectAll(){for(const e of r(this,$))e.commit();m(this,Kd,Qm).call(this,r(this,Ae).values())}unselectAll(){if(!(r(this,lt)&&(r(this,lt).commitOrRemove(),r(this,Ne)!==K.NONE))&&this.hasSelection){for(const e of r(this,$))e.unselect();r(this,$).clear(),m(this,Ue,qe).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;r(this,En)[0]+=e,r(this,En)[1]+=t;const[n,a]=r(this,En),s=[...r(this,$)],o=1e3;r(this,ii)&&clearTimeout(r(this,ii)),b(this,ii,setTimeout(()=>{b(this,ii,null),r(this,En)[0]=r(this,En)[1]=0,this.addCommands({cmd:()=>{for(const d of s)r(this,Ae).has(d.id)&&d.translateInPage(n,a)},undo:()=>{for(const d of s)r(this,Ae).has(d.id)&&d.translateInPage(-n,-a)},mustExec:!1})},o));for(const d of s)d.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),b(this,$t,new Map);for(const e of r(this,$))r(this,$t).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!r(this,$t))return!1;this.disableUserSelect(!1);const e=r(this,$t);b(this,$t,null);let t=!1;for(const[{x:n,y:a,pageIndex:s},o]of e)o.newX=n,o.newY=a,o.newPageIndex=s,t||(t=n!==o.savedX||a!==o.savedY||s!==o.savedPageIndex);if(!t)return!1;const i=(n,a,s,o)=>{if(r(this,Ae).has(n.id)){const d=r(this,Be).get(o);d?n._setParentAndPosition(d,a,s):(n.pageIndex=o,n.x=a,n.y=s)}};return this.addCommands({cmd:()=>{for(const[n,{newX:a,newY:s,newPageIndex:o}]of e)i(n,a,s,o)},undo:()=>{for(const[n,{savedX:a,savedY:s,savedPageIndex:o}]of e)i(n,a,s,o)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(r(this,$t))for(const i of r(this,$t).keys())i.drag(e,t)}rebuild(e){if(e.parent===null){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||r(this,$).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return r(this,lt)===e}getActive(){return r(this,lt)}getMode(){return r(this,Ne)}get imageManager(){return q(this,"imageManager",new Lm)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let h=0,c=t.rangeCount;h({x:(c-n)/s,y:1-(h+u-i)/a,width:p/s,height:u/a});break;case"180":o=(h,c,u,p)=>({x:1-(h+u-i)/a,y:1-(c+p-n)/s,width:u/a,height:p/s});break;case"270":o=(h,c,u,p)=>({x:1-(c+p-n)/s,y:(h-i)/a,width:p/s,height:u/a});break;default:o=(h,c,u,p)=>({x:(h-i)/a,y:(c-n)/s,width:u/a,height:p/s});break}const d=[];for(let h=0,c=t.rangeCount;h{u.type==="pointerup"&&u.button!==0||(d==null||d.toggleDrawing(!0),window.removeEventListener("pointerup",c),window.removeEventListener("blur",c),u.type==="pointerup"&&m(this,Zr,ug).call(this,"main_toolbar"))};window.addEventListener("pointerup",c,{signal:h}),window.addEventListener("blur",c,{signal:h})}},Zr=new WeakSet,ug=function(e=""){r(this,Ne)===K.HIGHLIGHT?this.highlightSelection(e):r(this,vd)&&m(this,Ip,B9).call(this)},Sp=new WeakSet,L9=function(){document.addEventListener("selectionchange",m(this,Cp,U9).bind(this),{signal:this._signal})},Tp=new WeakSet,j9=function(){const e=this._signal;window.addEventListener("focus",r(this,Pd),{signal:e}),window.addEventListener("blur",r(this,Nd),{signal:e})},Np=new WeakSet,F9=function(){window.removeEventListener("focus",r(this,Pd)),window.removeEventListener("blur",r(this,Nd))},Qd=new WeakSet,km=function(){const e=this._signal;window.addEventListener("keydown",r(this,Ud),{signal:e}),window.addEventListener("keyup",r(this,Ld),{signal:e})},Pp=new WeakSet,G9=function(){window.removeEventListener("keydown",r(this,Ud)),window.removeEventListener("keyup",r(this,Ld))},Vd=new WeakSet,Om=function(){const e=this._signal;document.addEventListener("copy",r(this,Ed),{signal:e}),document.addEventListener("cut",r(this,Rd),{signal:e}),document.addEventListener("paste",r(this,Bd),{signal:e})},Zd=new WeakSet,Wm=function(){document.removeEventListener("copy",r(this,Ed)),document.removeEventListener("cut",r(this,Rd)),document.removeEventListener("paste",r(this,Bd))},Ep=new WeakSet,k9=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},Ue=new WeakSet,qe=function(e){Object.entries(e).some(([i,n])=>r(this,Od)[i]!==n)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(r(this,Od),e)}),r(this,Ne)===K.HIGHLIGHT&&e.hasSelectedEditor===!1&&m(this,ni,wn).call(this,[[W.HIGHLIGHT_FREE,!0]]))},ni=new WeakSet,wn=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},Rp=new WeakSet,O9=function(){if(!r(this,Pn)){b(this,Pn,!0);for(const e of r(this,Be).values())e.enable();for(const e of r(this,Ae).values())e.enable()}},Bp=new WeakSet,W9=function(){if(this.unselectAll(),r(this,Pn)){b(this,Pn,!1);for(const e of r(this,Be).values())e.disable();for(const e of r(this,Ae).values())e.disable()}},Yd=new WeakSet,zm=function(e){const t=r(this,Be).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},Up=new WeakSet,z9=function(){let e=null;for(e of r(this,$));return e},Va=new WeakSet,Gl=function(){if(r(this,Ae).size===0)return!0;if(r(this,Ae).size===1)for(const e of r(this,Ae).values())return e.isEmpty();return!1},Kd=new WeakSet,Qm=function(e){for(const t of r(this,$))t.unselect();r(this,$).clear();for(const t of e)t.isEmpty()||(r(this,$).add(t),t.select());m(this,Ue,qe).call(this,{hasSelectedEditor:this.hasSelection})},U(ba,"TRANSLATE_SMALL",1),U(ba,"TRANSLATE_BIG",10),ba);var Fi,Gi,Lt,ki,dt,Yr,jt,Hd,Vm;const Ti=class Ti{constructor(e){g(this,Hd);g(this,Fi,"");g(this,Gi,!1);g(this,Lt,null);g(this,ki,null);g(this,dt,null);g(this,Yr,!1);g(this,jt,null);b(this,jt,e)}static initialize(e){Ti._l10nPromise||(Ti._l10nPromise=e)}async render(){const e=b(this,Lt,document.createElement("button"));e.className="altText";const t=await Ti._l10nPromise.get("pdfjs-editor-alt-text-button-label");e.textContent=t,e.setAttribute("aria-label",t),e.tabIndex="0";const i=r(this,jt)._uiManager._signal;e.addEventListener("contextmenu",st,{signal:i}),e.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:i});const n=a=>{a.preventDefault(),r(this,jt)._uiManager.editAltText(r(this,jt))};return e.addEventListener("click",n,{capture:!0,signal:i}),e.addEventListener("keydown",a=>{a.target===e&&a.key==="Enter"&&(b(this,Yr,!0),n(a))},{signal:i}),await m(this,Hd,Vm).call(this),e}finish(){r(this,Lt)&&(r(this,Lt).focus({focusVisible:r(this,Yr)}),b(this,Yr,!1))}isEmpty(){return!r(this,Fi)&&!r(this,Gi)}get data(){return{altText:r(this,Fi),decorative:r(this,Gi)}}set data({altText:e,decorative:t}){r(this,Fi)===e&&r(this,Gi)===t||(b(this,Fi,e),b(this,Gi,t),m(this,Hd,Vm).call(this))}toggle(e=!1){r(this,Lt)&&(!e&&r(this,dt)&&(clearTimeout(r(this,dt)),b(this,dt,null)),r(this,Lt).disabled=!e)}destroy(){var e;(e=r(this,Lt))==null||e.remove(),b(this,Lt,null),b(this,ki,null)}};Fi=new WeakMap,Gi=new WeakMap,Lt=new WeakMap,ki=new WeakMap,dt=new WeakMap,Yr=new WeakMap,jt=new WeakMap,Hd=new WeakSet,Vm=async function(){var n;const e=r(this,Lt);if(!e)return;if(!r(this,Fi)&&!r(this,Gi)){e.classList.remove("done"),(n=r(this,ki))==null||n.remove();return}e.classList.add("done"),Ti._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(a=>{e.setAttribute("aria-label",a)});let t=r(this,ki);if(!t){b(this,ki,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip");const a=t.id=`alt-text-tooltip-${r(this,jt).id}`;e.setAttribute("aria-describedby",a);const s=100,o=r(this,jt)._uiManager._signal;o.addEventListener("abort",()=>{clearTimeout(r(this,dt)),b(this,dt,null)},{once:!0}),e.addEventListener("mouseenter",()=>{b(this,dt,setTimeout(()=>{b(this,dt,null),r(this,ki).classList.add("show"),r(this,jt)._reportTelemetry({action:"alt_text_tooltip"})},s))},{signal:o}),e.addEventListener("mouseleave",()=>{var d;r(this,dt)&&(clearTimeout(r(this,dt)),b(this,dt,null)),(d=r(this,ki))==null||d.classList.remove("show")},{signal:o})}t.innerText=r(this,Gi)?await Ti._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):r(this,Fi),t.parentNode||e.append(t);const i=r(this,jt).getImageForAltText();i==null||i.setAttribute("aria-describedby",t.id)},U(Ti,"_l10nPromise",null);let qg=Ti;var Za,Ft,ze,Kr,Ya,Le,Ka,Hr,qr,Qe,qd,Ha,Rn,Xd,qa,Oi,ai,Xr,Jr,yt,Jd,Lp,_d,Zm,$d,Ym,eh,Km,jp,Q9,Fp,V9,th,Hm,ih,qm,nh,Xm,Gp,Z9,kp,Y9,Op,K9,Wp,H9,ah,Jm,Xa,kl;const ie=class ie{constructor(e){g(this,_d);g(this,eh);g(this,jp);g(this,Fp);g(this,th);g(this,ih);g(this,nh);g(this,Gp);g(this,kp);g(this,Op);g(this,Wp);g(this,ah);g(this,Xa);g(this,Za,null);g(this,Ft,null);g(this,ze,null);g(this,Kr,!1);g(this,Ya,!1);g(this,Le,null);g(this,Ka,null);g(this,Hr,this.focusin.bind(this));g(this,qr,this.focusout.bind(this));g(this,Qe,null);g(this,qd,"");g(this,Ha,!1);g(this,Rn,null);g(this,Xd,!1);g(this,qa,!1);g(this,Oi,!1);g(this,ai,null);g(this,Xr,0);g(this,Jr,0);g(this,yt,null);U(this,"_initialOptions",Object.create(null));U(this,"_isVisible",!0);U(this,"_uiManager",null);U(this,"_focusEventsAllowed",!0);U(this,"_l10nPromise",null);g(this,Jd,!1);g(this,Lp,ie._zIndex++);this.constructor===ie&&te("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:t,rawDims:{pageWidth:i,pageHeight:n,pageX:a,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[a,s];const[o,d]=this.parentDimensions;this.x=e.x/o,this.y=e.y/d,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=ie.prototype._resizeWithKeyboard,t=dd.TRANSLATE_SMALL,i=dd.TRANSLATE_BIG;return q(this,"_resizerKeyboardManager",new Pu([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,i]}],[["Escape","mac+Escape"],ie.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return q(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new $x({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t,i){if(ie._l10nPromise||(ie._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(a=>[a,e.get(a.replaceAll(/([A-Z])/g,s=>`-${s.toLowerCase()}`))]))),i!=null&&i.strings)for(const a of i.strings)ie._l10nPromise.set(a,e.get(a));if(ie._borderLineWidth!==-1)return;const n=getComputedStyle(document.documentElement);ie._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){te("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return r(this,Jd)}set _isDraggable(e){var t;b(this,Jd,e),(t=this.div)==null||t.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=r(this,Lp)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):m(this,Xa,kl).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&(r(this,Ha)?b(this,Ha,!1):this.parent.setSelected(this))}focusout(e){var i;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const t=e.relatedTarget;t!=null&&t.closest(`#${this.id}`)||(e.preventDefault(),(i=this.parent)!=null&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,i,n){const[a,s]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(e+i)/a,this.y=(t+n)/s,this.fixAndSetPosition()}translate(e,t){m(this,_d,Zm).call(this,this.parentDimensions,e,t)}translateInPage(e,t){r(this,Rn)||b(this,Rn,[this.x,this.y]),m(this,_d,Zm).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){r(this,Rn)||b(this,Rn,[this.x,this.y]);const[i,n]=this.parentDimensions;if(this.x+=e/i,this.y+=t/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:h,y:c}=this.div.getBoundingClientRect();this.parent.findNewParent(this,h,c)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:s}=this;const[o,d]=this.getBaseTranslation();a+=o,s+=d,this.div.style.left=`${(100*a).toFixed(2)}%`,this.div.style.top=`${(100*s).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!r(this,Rn)&&(r(this,Rn)[0]!==this.x||r(this,Rn)[1]!==this.y)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:i}=ie,n=i/e,a=i/t;switch(this.rotation){case 90:return[-n,a];case 180:return[n,a];case 270:return[n,-a];default:return[-n,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const[t,i]=this.pageDimensions;let{x:n,y:a,width:s,height:o}=this;if(s*=t,o*=i,n*=t,a*=i,this._mustFixPosition)switch(e){case 0:n=Math.max(0,Math.min(t-s,n)),a=Math.max(0,Math.min(i-o,a));break;case 90:n=Math.max(0,Math.min(t-o,n)),a=Math.min(i,Math.max(s,a));break;case 180:n=Math.min(t,Math.max(s,n)),a=Math.min(i,Math.max(o,a));break;case 270:n=Math.min(t,Math.max(o,n)),a=Math.max(0,Math.min(i-s,a));break}this.x=n/=t,this.y=a/=i;const[d,h]=this.getBaseTranslation();n+=d,a+=h;const{style:c}=this.div;c.left=`${(100*n).toFixed(2)}%`,c.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,t){var i;return m(i=ie,$d,Ym).call(i,e,t,this.parentRotation)}pageTranslationToScreen(e,t){var i;return m(i=ie,$d,Ym).call(i,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,i]}=this,n=t*e,a=i*e;return at.isCSSRoundSupported?[Math.round(n),Math.round(a)]:[n,a]}setDims(e,t){const[i,n]=this.parentDimensions;this.div.style.width=`${(100*e/i).toFixed(2)}%`,r(this,Ya)||(this.div.style.height=`${(100*t/n).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:t,width:i}=e,n=i.endsWith("%"),a=!r(this,Ya)&&t.endsWith("%");if(n&&a)return;const[s,o]=this.parentDimensions;n||(e.width=`${(100*parseFloat(i)/s).toFixed(2)}%`),!r(this,Ya)&&!a&&(e.height=`${(100*parseFloat(t)/o).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}altTextFinish(){var e;(e=r(this,ze))==null||e.finish()}async addEditToolbar(){return r(this,Qe)||r(this,qa)?r(this,Qe):(b(this,Qe,new Bm(this)),this.div.append(r(this,Qe).render()),r(this,ze)&&r(this,Qe).addAltTextButton(await r(this,ze).render()),r(this,Qe))}removeEditToolbar(){var e;r(this,Qe)&&(r(this,Qe).remove(),b(this,Qe,null),(e=r(this,ze))==null||e.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){r(this,ze)||(qg.initialize(ie._l10nPromise),b(this,ze,new qg(this)),r(this,Za)&&(r(this,ze).data=r(this,Za),b(this,Za,null)),await this.addEditToolbar())}get altTextData(){var e;return(e=r(this,ze))==null?void 0:e.data}set altTextData(e){r(this,ze)&&(r(this,ze).data=e)}hasAltText(){var e;return!((e=r(this,ze))!=null&&e.isEmpty())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=r(this,Kr)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const e=this._uiManager._signal;this.div.addEventListener("focusin",r(this,Hr),{signal:e}),this.div.addEventListener("focusout",r(this,qr),{signal:e});const[t,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*i/t).toFixed(2)}%`,this.div.style.maxHeight=`${(100*t/i).toFixed(2)}%`);const[n,a]=this.getInitialTranslation();return this.translate(n,a),Hg(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:t}=at.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(b(this,Ha,!0),this._isDraggable){m(this,Gp,Z9).call(this,e);return}m(this,nh,Xm).call(this,e)}moveInDOM(){r(this,ai)&&clearTimeout(r(this,ai)),b(this,ai,setTimeout(()=>{var e;b(this,ai,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,t,i){e.changeParent(this),this.x=t,this.y=i,this.fixAndSetPosition()}getRect(e,t,i=this.rotation){const n=this.parentScale,[a,s]=this.pageDimensions,[o,d]=this.pageTranslation,h=e/n,c=t/n,u=this.x*a,p=this.y*s,f=this.width*a,w=this.height*s;switch(i){case 0:return[u+h+o,s-p-c-w+d,u+h+f+o,s-p-c+d];case 90:return[u+c+o,s-p+h+d,u+c+w+o,s-p+h+f+d];case 180:return[u-h-f+o,s-p+c+d,u-h+o,s-p+c+w+d];case 270:return[u-c-w+o,s-p-h-f+d,u-c+o,s-p-h+d];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[i,n,a,s]=e,o=a-i,d=s-n;switch(this.rotation){case 0:return[i,t-s,o,d];case 90:return[i,t-n,d,o];case 180:return[a,t-n,o,d];case 270:return[a,t-s,d,o];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){b(this,qa,!0)}disableEditMode(){b(this,qa,!1)}isInEditMode(){return r(this,qa)}shouldGetKeyboardEvents(){return r(this,Oi)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t,i;const e=this._uiManager._signal;(t=this.div)==null||t.addEventListener("focusin",r(this,Hr),{signal:e}),(i=this.div)==null||i.addEventListener("focusout",r(this,qr),{signal:e})}rotate(e){}serialize(e=!1,t=null){te("An editor must be serializable")}static deserialize(e,t,i){const n=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:i});n.rotation=e.rotation,b(n,Za,e.accessibilityData);const[a,s]=n.pageDimensions,[o,d,h,c]=n.getRectInCurrentCoords(e.rect,s);return n.x=o/a,n.y=d/s,n.width=h/a,n.height=c/s,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.div.removeEventListener("focusin",r(this,Hr)),this.div.removeEventListener("focusout",r(this,qr)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),r(this,ai)&&(clearTimeout(r(this,ai)),b(this,ai,null)),m(this,Xa,kl).call(this),this.removeEditToolbar(),r(this,yt)){for(const e of r(this,yt).values())clearTimeout(e);b(this,yt,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(m(this,jp,Q9).call(this),r(this,Le).classList.remove("hidden"),Hg(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),b(this,Ka,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const t=r(this,Le).children;if(!r(this,Ft)){b(this,Ft,Array.from(t));const s=m(this,kp,Y9).bind(this),o=m(this,Op,K9).bind(this),d=this._uiManager._signal;for(const h of r(this,Ft)){const c=h.getAttribute("data-resizer-name");h.setAttribute("role","spinbutton"),h.addEventListener("keydown",s,{signal:d}),h.addEventListener("blur",o,{signal:d}),h.addEventListener("focus",m(this,Wp,H9).bind(this,c),{signal:d}),ie._l10nPromise.get(`pdfjs-editor-resizer-label-${c}`).then(u=>h.setAttribute("aria-label",u))}}const i=r(this,Ft)[0];let n=0;for(const s of t){if(s===i)break;n++}const a=(360-this.rotation+this.parentRotation)%360/90*(r(this,Ft).length/4);if(a!==n){if(an)for(let o=0;oo.setAttribute("aria-label",c))}}m(this,ah,Jm).call(this,0),b(this,Oi,!0),r(this,Le).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){r(this,Oi)&&m(this,ih,qm).call(this,r(this,qd),{movementX:e,movementY:t})}_stopResizingWithKeyboard(){m(this,Xa,kl).call(this),this.div.focus()}select(){var e,t;if(this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!r(this,Qe)){this.addEditToolbar().then(()=>{var i,n;(i=this.div)!=null&&i.classList.contains("selectedEditor")&&((n=r(this,Qe))==null||n.show())});return}(t=r(this,Qe))==null||t.show()}unselect(){var e,t,i,n;(e=r(this,Le))==null||e.classList.add("hidden"),(t=this.div)==null||t.classList.remove("selectedEditor"),(i=this.div)!=null&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(n=r(this,Qe))==null||n.hide()}updateParams(e,t){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return r(this,Xd)}set isEditing(e){b(this,Xd,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){b(this,Ya,!0);const i=e/t,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){r(this,yt)||b(this,yt,new Map);const{action:i}=e;let n=r(this,yt).get(i);n&&clearTimeout(n),n=setTimeout(()=>{this._reportTelemetry(e),r(this,yt).delete(i),r(this,yt).size===0&&b(this,yt,null)},ie._telemetryTimeout),r(this,yt).set(i,n);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),b(this,Kr,!1)}disable(){this.div&&(this.div.tabIndex=-1),b(this,Kr,!0)}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){const i=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),i.before(t)}return t}resetAnnotationElement(e){const{firstChild:t}=e.container;t.nodeName==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}};Za=new WeakMap,Ft=new WeakMap,ze=new WeakMap,Kr=new WeakMap,Ya=new WeakMap,Le=new WeakMap,Ka=new WeakMap,Hr=new WeakMap,qr=new WeakMap,Qe=new WeakMap,qd=new WeakMap,Ha=new WeakMap,Rn=new WeakMap,Xd=new WeakMap,qa=new WeakMap,Oi=new WeakMap,ai=new WeakMap,Xr=new WeakMap,Jr=new WeakMap,yt=new WeakMap,Jd=new WeakMap,Lp=new WeakMap,_d=new WeakSet,Zm=function([e,t],i,n){[i,n]=this.screenToPageTranslation(i,n),this.x+=i/e,this.y+=n/t,this.fixAndSetPosition()},$d=new WeakSet,Ym=function(e,t,i){switch(i){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}},eh=new WeakSet,Km=function(e){switch(e){case 90:{const[t,i]=this.pageDimensions;return[0,-t/i,i/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,i]=this.pageDimensions;return[0,t/i,-i/t,0]}default:return[1,0,0,1]}},jp=new WeakSet,Q9=function(){if(r(this,Le))return;b(this,Le,document.createElement("div")),r(this,Le).classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const i of e){const n=document.createElement("div");r(this,Le).append(n),n.classList.add("resizer",i),n.setAttribute("data-resizer-name",i),n.addEventListener("pointerdown",m(this,Fp,V9).bind(this,i),{signal:t}),n.addEventListener("contextmenu",st,{signal:t}),n.tabIndex=-1}this.div.prepend(r(this,Le))},Fp=new WeakSet,V9=function(e,t){var A;t.preventDefault();const{isMac:i}=at.platform;if(t.button!==0||t.ctrlKey&&i)return;(A=r(this,ze))==null||A.toggle(!1);const n=m(this,ih,qm).bind(this,e),a=this._isDraggable;this._isDraggable=!1;const s=this._uiManager._signal,o={passive:!0,capture:!0,signal:s};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",n,o),window.addEventListener("contextmenu",st,{signal:s});const d=this.x,h=this.y,c=this.width,u=this.height,p=this.parent.div.style.cursor,f=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const w=()=>{var y;this.parent.togglePointerEvents(!0),(y=r(this,ze))==null||y.toggle(!0),this._isDraggable=a,window.removeEventListener("pointerup",w),window.removeEventListener("blur",w),window.removeEventListener("pointermove",n,o),window.removeEventListener("contextmenu",st),this.parent.div.style.cursor=p,this.div.style.cursor=f,m(this,th,Hm).call(this,d,h,c,u)};window.addEventListener("pointerup",w,{signal:s}),window.addEventListener("blur",w,{signal:s})},th=new WeakSet,Hm=function(e,t,i,n){const a=this.x,s=this.y,o=this.width,d=this.height;a===e&&s===t&&o===i&&d===n||this.addCommands({cmd:()=>{this.width=o,this.height=d,this.x=a,this.y=s;const[h,c]=this.parentDimensions;this.setDims(h*o,c*d),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=e,this.y=t;const[h,c]=this.parentDimensions;this.setDims(h*i,c*n),this.fixAndSetPosition()},mustExec:!0})},ih=new WeakSet,qm=function(e,t){const[i,n]=this.parentDimensions,a=this.x,s=this.y,o=this.width,d=this.height,h=ie.MIN_SIZE/i,c=ie.MIN_SIZE/n,u=z=>Math.round(z*1e4)/1e4,p=m(this,eh,Km).call(this,this.rotation),f=(z,V)=>[p[0]*z+p[2]*V,p[1]*z+p[3]*V],w=m(this,eh,Km).call(this,360-this.rotation),A=(z,V)=>[w[0]*z+w[2]*V,w[1]*z+w[3]*V];let y,x,M=!1,v=!1;switch(e){case"topLeft":M=!0,y=(z,V)=>[0,0],x=(z,V)=>[z,V];break;case"topMiddle":y=(z,V)=>[z/2,0],x=(z,V)=>[z/2,V];break;case"topRight":M=!0,y=(z,V)=>[z,0],x=(z,V)=>[0,V];break;case"middleRight":v=!0,y=(z,V)=>[z,V/2],x=(z,V)=>[0,V/2];break;case"bottomRight":M=!0,y=(z,V)=>[z,V],x=(z,V)=>[0,0];break;case"bottomMiddle":y=(z,V)=>[z/2,V],x=(z,V)=>[z/2,0];break;case"bottomLeft":M=!0,y=(z,V)=>[0,V],x=(z,V)=>[z,0];break;case"middleLeft":v=!0,y=(z,V)=>[0,V/2],x=(z,V)=>[z,V/2];break}const I=y(o,d),S=x(o,d);let D=f(...S);const T=u(a+D[0]),P=u(s+D[1]);let C=1,N=1,[R,L]=this.screenToPageTranslation(t.movementX,t.movementY);if([R,L]=A(R/i,L/n),M){const z=Math.hypot(o,d);C=N=Math.max(Math.min(Math.hypot(S[0]-I[0]-R,S[1]-I[1]-L)/z,1/o,1/d),h/o,c/d)}else v?C=Math.max(h,Math.min(1,Math.abs(S[0]-I[0]-R)))/o:N=Math.max(c,Math.min(1,Math.abs(S[1]-I[1]-L)))/d;const k=u(o*C),O=u(d*N);D=f(...x(k,O));const _=T-D[0],Ge=P-D[1];this.width=k,this.height=O,this.x=_,this.y=Ge,this.setDims(i*k,n*O),this.fixAndSetPosition()},nh=new WeakSet,Xm=function(e){const{isMac:t}=at.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)},Gp=new WeakSet,Z9=function(e){const t=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let i,n;const a=this._uiManager._signal;t&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:a},b(this,Xr,e.clientX),b(this,Jr,e.clientY),n=o=>{const{clientX:d,clientY:h}=o,[c,u]=this.screenToPageTranslation(d-r(this,Xr),h-r(this,Jr));b(this,Xr,d),b(this,Jr,h),this._uiManager.dragSelectedEditors(c,u)},window.addEventListener("pointermove",n,i));const s=()=>{window.removeEventListener("pointerup",s),window.removeEventListener("blur",s),t&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",n,i)),b(this,Ha,!1),this._uiManager.endDragSession()||m(this,nh,Xm).call(this,e)};window.addEventListener("pointerup",s,{signal:a}),window.addEventListener("blur",s,{signal:a})},kp=new WeakSet,Y9=function(e){ie._resizerKeyboardManager.exec(this,e)},Op=new WeakSet,K9=function(e){var t;r(this,Oi)&&((t=e.relatedTarget)==null?void 0:t.parentNode)!==r(this,Le)&&m(this,Xa,kl).call(this)},Wp=new WeakSet,H9=function(e){b(this,qd,r(this,Oi)?e:"")},ah=new WeakSet,Jm=function(e){if(r(this,Ft))for(const t of r(this,Ft))t.tabIndex=e},Xa=new WeakSet,kl=function(){if(b(this,Oi,!1),m(this,ah,Jm).call(this,-1),r(this,Ka)){const{savedX:e,savedY:t,savedWidth:i,savedHeight:n}=r(this,Ka);m(this,th,Hm).call(this,e,t,i,n),b(this,Ka,null)}},g(ie,$d),U(ie,"_borderLineWidth",-1),U(ie,"_colorManager",new Fm),U(ie,"_zIndex",1),U(ie,"_telemetryTimeout",1e3);let J=ie;class $x extends J{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const I2=3285377520,At=4294901760,qt=65535;class q9{constructor(e){this.h1=e?e&4294967295:I2,this.h2=e?e&4294967295:I2}update(e){let t,i;if(typeof e=="string"){t=new Uint8Array(e.length*2),i=0;for(let A=0,y=e.length;A>>8,t[i++]=x&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),i=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const n=i>>2,a=i-n*4,s=new Uint32Array(t.buffer,0,n);let o=0,d=0,h=this.h1,c=this.h2;const u=3432918353,p=461845907,f=u&qt,w=p&qt;for(let A=0;A>>17,o=o*p&At|o*w&qt,h^=o,h=h<<13|h>>>19,h=h*5+3864292196):(d=s[A],d=d*u&At|d*f&qt,d=d<<15|d>>>17,d=d*p&At|d*w&qt,c^=d,c=c<<13|c>>>19,c=c*5+3864292196);switch(o=0,a){case 3:o^=t[n*4+2]<<16;case 2:o^=t[n*4+1]<<8;case 1:o^=t[n*4],o=o*u&At|o*f&qt,o=o<<15|o>>>17,o=o*p&At|o*w&qt,n&1?h^=o:c^=o}this.h1=h,this.h2=c}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&At|e*36045&qt,t=t*4283543511&At|((t<<16|e>>>16)*2950163797&At)>>>16,e^=t>>>1,e=e*444984403&At|e*60499&qt,t=t*3301882366&At|((t<<16|e>>>16)*3120437893&At)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const _m=Object.freeze({map:null,hash:"",transfer:void 0});var Ja,_a,Pe,zp,X9;class Y5{constructor(){g(this,zp);g(this,Ja,!1);g(this,_a,null);g(this,Pe,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const i=r(this,Pe).get(e);return i===void 0?t:Object.assign(t,i)}getRawValue(e){return r(this,Pe).get(e)}remove(e){if(r(this,Pe).delete(e),r(this,Pe).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const t of r(this,Pe).values())if(t instanceof J)return;this.onAnnotationEditor(null)}}setValue(e,t){const i=r(this,Pe).get(e);let n=!1;if(i!==void 0)for(const[a,s]of Object.entries(t))i[a]!==s&&(n=!0,i[a]=s);else n=!0,r(this,Pe).set(e,t);n&&m(this,zp,X9).call(this),t instanceof J&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type)}has(e){return r(this,Pe).has(e)}getAll(){return r(this,Pe).size>0?O5(r(this,Pe)):null}setAll(e){for(const[t,i]of Object.entries(e))this.setValue(t,i)}get size(){return r(this,Pe).size}resetModified(){r(this,Ja)&&(b(this,Ja,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new J9(this)}get serializable(){if(r(this,Pe).size===0)return _m;const e=new Map,t=new q9,i=[],n=Object.create(null);let a=!1;for(const[s,o]of r(this,Pe)){const d=o instanceof J?o.serialize(!1,n):o;d&&(e.set(s,d),t.update(`${s}:${JSON.stringify(d)}`),a||(a=!!d.bitmap))}if(a)for(const s of e.values())s.bitmap&&i.push(s.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:i}:_m}get editorStats(){let e=null;const t=new Map;for(const i of r(this,Pe).values()){if(!(i instanceof J))continue;const n=i.telemetryFinalData;if(!n)continue;const{type:a}=n;t.has(a)||t.set(a,Object.getPrototypeOf(i).constructor),e||(e=Object.create(null));const s=e[a]||(e[a]=new Map);for(const[o,d]of Object.entries(n)){if(o==="type")continue;let h=s.get(o);h||(h=new Map,s.set(o,h));const c=h.get(d)??0;h.set(d,c+1)}}for(const[i,n]of t)e[i]=n.computeTelemetryFinalData(e[i]);return e}resetModifiedIds(){b(this,_a,null)}get modifiedIds(){if(r(this,_a))return r(this,_a);const e=[];for(const t of r(this,Pe).values())!(t instanceof J)||!t.annotationElementId||!t.serialize()||e.push(t.annotationElementId);return b(this,_a,{ids:new Set(e),hash:e.join(",")})}}Ja=new WeakMap,_a=new WeakMap,Pe=new WeakMap,zp=new WeakSet,X9=function(){r(this,Ja)||(b(this,Ja,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var sh;class J9 extends Y5{constructor(t){super();g(this,sh,void 0);const{map:i,hash:n,transfer:a}=t.serializable,s=structuredClone(i,a?{transfer:a}:null);b(this,sh,{map:s,hash:n,transfer:a})}get print(){te("Should not call PrintAnnotationStorage.print")}get serializable(){return r(this,sh)}get modifiedIds(){return q(this,"modifiedIds",{ids:new Set,hash:""})}}sh=new WeakMap;var _r;class ey{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){g(this,_r,new Set);this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),r(this,_r).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:t}){if(!(!e||r(this,_r).has(e.loadedName))){if(Ie(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:n,style:a}=e,s=new FontFace(i,n,a);this.addNativeFontFace(s);try{await s.load(),r(this,_r).add(i),t==null||t(e)}catch{Z(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(s)}return}te("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const i=e.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(n){throw Z(`Failed to load font '${i.family}': '${n}'.`),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const n=this._queueLoadingCallback(i);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){var t;const e=!!((t=this._document)!=null&&t.fonts);return q(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(Ke||typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.userAgent)=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),q(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function t(){for(Ie(!n.done,"completeRequest() cannot be called twice."),n.done=!0;i.length>0&&i[0].done;){const a=i.shift();setTimeout(a.callback,0)}}const{loadingRequests:i}=this,n={done:!1,complete:t,callback:e};return i.push(n),n}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return q(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function i(I,S){return I.charCodeAt(S)<<24|I.charCodeAt(S+1)<<16|I.charCodeAt(S+2)<<8|I.charCodeAt(S+3)&255}function n(I,S,D,T){const P=I.substring(0,S),C=I.substring(S+D);return P+T+C}let a,s;const o=this._document.createElement("canvas");o.width=1,o.height=1;const d=o.getContext("2d");let h=0;function c(I,S){if(++h>30){Z("Load test font never loaded."),S();return}if(d.font="30px "+I,d.fillText(".",0,20),d.getImageData(0,0,1,1).data[3]>0){S();return}setTimeout(c.bind(null,I,S))}const u=`lt${Date.now()}${this.loadTestFontId++}`;let p=this._loadTestFont;p=n(p,976,u.length,u);const w=16,A=1482184792;let y=i(p,w);for(a=0,s=u.length-3;a{v.remove(),t.complete()})}}_r=new WeakMap;class ty{constructor(e,{disableFontFace:t=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(const n in e)this[n]=e[n];this.disableFontFace=t===!0,this._inspectFont=i}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}return(t=this._inspectFont)==null||t.call(this,this),e}createFontFaceRule(){var n;if(!this.data||this.disableFontFace)return null;const e=A9(this.data),t=`url(data:${this.mimetype};base64,${btoa(e)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let a=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(a+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${a}src:${t}}`}return(n=this._inspectFont)==null||n.call(this,this,t),i}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let i;try{i=e.get(this.loadedName+"_path_"+t)}catch(a){Z(`getPathGenerator - ignoring character: "${a}".`)}if(!Array.isArray(i)||i.length===0)return this.compiledGlyphs[t]=function(a,s){};const n=[];for(let a=0,s=i.length;af.bezierCurveTo(o,d,h,c,u,p)),a+=6}break;case Di.MOVE_TO:{const[o,d]=i.slice(a,a+2);n.push(h=>h.moveTo(o,d)),a+=2}break;case Di.LINE_TO:{const[o,d]=i.slice(a,a+2);n.push(h=>h.lineTo(o,d)),a+=2}break;case Di.QUADRATIC_CURVE_TO:{const[o,d,h,c]=i.slice(a,a+4);n.push(u=>u.quadraticCurveTo(o,d,h,c)),a+=4}break;case Di.RESTORE:n.push(o=>o.restore());break;case Di.SAVE:n.push(o=>o.save());break;case Di.SCALE:Ie(n.length===2,"Scale command is only valid at the third position.");break;case Di.TRANSFORM:{const[o,d,h,c,u,p]=i.slice(a,a+6);n.push(f=>f.transform(o,d,h,c,u,p)),a+=6}break;case Di.TRANSLATE:{const[o,d]=i.slice(a,a+2);n.push(h=>h.translate(o,d)),a+=2}break}return this.compiledGlyphs[t]=function(s,o){n[0](s),n[1](s),s.scale(o,-o);for(let d=2,h=n.length;d{const e=await Sr(()=>import("./index-zZCSeRuV.js").then(o=>o.j),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),t=await Sr(()=>import("./index-Tqe2LtrA.js").then(o=>o.i),__vite__mapDeps([8,2,9,1,10,11,12,0,3,4,5,6,7,13]),import.meta.url),i=await Sr(()=>import("./index-3tb_HT71.js").then(o=>o.i),__vite__mapDeps([14,2,8,9,1,10,11,12,0,3,4,5,6,7,13]),import.meta.url),n=await Sr(()=>import("./url-xgBfOcQT.js").then(o=>o.u),__vite__mapDeps([13,2]),import.meta.url);let a,s;return new Map(Object.entries({fs:e,http:t,https:i,url:n,canvas:a,path2d:s}))})().then(e=>{id=e,$m.resolve()},e=>{Z(`loadPackages: ${e}`),id=new Map,$m.resolve()})}class Mi{static get promise(){return $m.promise}static get(e){return id==null?void 0:id.get(e)}}const _9=function(l){return Mi.get("fs").promises.readFile(l).then(t=>new Uint8Array(t))};class iy extends z1{}class ny extends Kg{_createCanvas(e,t){return Mi.get("canvas").createCanvas(e,t)}}class ay extends Q1{_fetchData(e,t){return _9(e).then(i=>({cMapData:i,compressionType:t}))}}class sy extends V1{_fetchData(e){return _9(e)}}const $e={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function eb(l,e){if(!e)return;const t=e[2]-e[0],i=e[3]-e[1],n=new Path2D;n.rect(e[0],e[1],t,i),l.clip(n)}class Eu{constructor(){this.constructor===Eu&&te("Cannot initialize BaseShadingPattern.")}getPattern(){te("Abstract method `getPattern` called.")}}class ry extends Eu{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type==="axial"?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)t.addColorStop(i[0],i[1]);return t}getPattern(e,t,i,n){let a;if(n===$e.STROKE||n===$e.FILL){const s=t.current.getClippedPathBoundingBox(n,re(e))||[0,0,0,0],o=Math.ceil(s[2]-s[0])||1,d=Math.ceil(s[3]-s[1])||1,h=t.cachedCanvases.getCanvas("pattern",o,d,!0),c=h.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-s[0],-s[1]),i=F.transform(i,[1,0,0,1,s[0],s[1]]),c.transform(...t.baseTransform),this.matrix&&c.transform(...this.matrix),eb(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),a=e.createPattern(h.canvas,"no-repeat");const u=new DOMMatrix(i);a.setTransform(u)}else eb(e,this._bbox),a=this._createGradient(e);return a}}function tm(l,e,t,i,n,a,s,o){const d=e.coords,h=e.colors,c=l.data,u=l.width*4;let p;d[t+1]>d[i+1]&&(p=t,t=i,i=p,p=a,a=s,s=p),d[i+1]>d[n+1]&&(p=i,i=n,n=p,p=s,s=o,o=p),d[t+1]>d[i+1]&&(p=t,t=i,i=p,p=a,a=s,s=p);const f=(d[t]+e.offsetX)*e.scaleX,w=(d[t+1]+e.offsetY)*e.scaleY,A=(d[i]+e.offsetX)*e.scaleX,y=(d[i+1]+e.offsetY)*e.scaleY,x=(d[n]+e.offsetX)*e.scaleX,M=(d[n+1]+e.offsetY)*e.scaleY;if(w>=M)return;const v=h[a],I=h[a+1],S=h[a+2],D=h[s],T=h[s+1],P=h[s+2],C=h[o],N=h[o+1],R=h[o+2],L=Math.round(w),k=Math.round(M);let O,_,Ge,z,V,Lu,ju,Fu;for(let He=L;He<=k;He++){if(HeM?fe=1:y===M?fe=0:fe=(y-He)/(y-M),O=A-(A-x)*fe,_=D-(D-C)*fe,Ge=T-(T-N)*fe,z=P-(P-R)*fe}let Re;HeM?Re=1:Re=(w-He)/(w-M),V=f-(f-x)*Re,Lu=v-(v-C)*Re,ju=I-(I-N)*Re,Fu=S-(S-R)*Re;const Gu=Math.round(Math.min(O,V)),wa=Math.round(Math.max(O,V));let fn=u*He+Gu*4;for(let fe=Gu;fe<=wa;fe++)Re=(O-fe)/(O-V),Re<0?Re=0:Re>1&&(Re=1),c[fn++]=_-(_-Lu)*Re|0,c[fn++]=Ge-(Ge-ju)*Re|0,c[fn++]=z-(z-Fu)*Re|0,c[fn++]=255}}function oy(l,e,t){const i=e.coords,n=e.colors;let a,s;switch(e.type){case"lattice":const o=e.verticesPerRow,d=Math.floor(i.length/o)-1,h=o-1;for(a=0;a=n?a=n:i=a/e,{scale:i,size:a}}clipBbox(e,t,i,n,a){const s=n-t,o=a-i;e.ctx.rect(t,i,s,o),e.current.updateRectMinMax(re(e.ctx),[t,i,n,a]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,i){const n=e.ctx,a=e.current;switch(t){case C2.COLORED:const s=this.ctx;n.fillStyle=s.fillStyle,n.strokeStyle=s.strokeStyle,a.fillColor=s.fillStyle,a.strokeColor=s.strokeStyle;break;case C2.UNCOLORED:const o=F.makeHexColor(i[0],i[1],i[2]);n.fillStyle=o,n.strokeStyle=o,a.fillColor=o,a.strokeColor=o;break;default:throw new jx(`Unsupported paint type: ${t}`)}}getPattern(e,t,i,n){let a=i;n!==$e.SHADING&&(a=F.transform(a,t.baseTransform),this.matrix&&(a=F.transform(a,this.matrix)));const s=this.createPatternCanvas(t);let o=new DOMMatrix(a);o=o.translate(s.offsetX,s.offsetY),o=o.scale(1/s.scaleX,1/s.scaleY);const d=e.createPattern(s.canvas,"repeat");return d.setTransform(o),d}};U(Qp,"MAX_PATTERN_SIZE",3e3);let tb=Qp;function cy({src:l,srcPos:e=0,dest:t,width:i,height:n,nonBlackColor:a=4294967295,inverseDecode:s=!1}){const o=at.isLittleEndian?4278190080:255,[d,h]=s?[a,o]:[o,a],c=i>>3,u=i&7,p=l.length;t=new Uint32Array(t.buffer);let f=0;for(let w=0;w{l.save=l.__originalSave,l.restore=l.__originalRestore,l.rotate=l.__originalRotate,l.scale=l.__originalScale,l.translate=l.__originalTranslate,l.transform=l.__originalTransform,l.setTransform=l.__originalSetTransform,l.resetTransform=l.__originalResetTransform,l.clip=l.__originalClip,l.moveTo=l.__originalMoveTo,l.lineTo=l.__originalLineTo,l.bezierCurveTo=l.__originalBezierCurveTo,l.rect=l.__originalRect,l.closePath=l.__originalClosePath,l.beginPath=l.__originalBeginPath,delete l._removeMirroring},l.save=function(){e.save(),this.__originalSave()},l.restore=function(){e.restore(),this.__originalRestore()},l.translate=function(i,n){e.translate(i,n),this.__originalTranslate(i,n)},l.scale=function(i,n){e.scale(i,n),this.__originalScale(i,n)},l.transform=function(i,n,a,s,o,d){e.transform(i,n,a,s,o,d),this.__originalTransform(i,n,a,s,o,d)},l.setTransform=function(i,n,a,s,o,d){e.setTransform(i,n,a,s,o,d),this.__originalSetTransform(i,n,a,s,o,d)},l.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},l.rotate=function(i){e.rotate(i),this.__originalRotate(i)},l.clip=function(i){e.clip(i),this.__originalClip(i)},l.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},l.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},l.bezierCurveTo=function(t,i,n,a,s,o){e.bezierCurveTo(t,i,n,a,s,o),this.__originalBezierCurveTo(t,i,n,a,s,o)},l.rect=function(t,i,n,a){e.rect(t,i,n,a),this.__originalRect(t,i,n,a)},l.closePath=function(){e.closePath(),this.__originalClosePath()},l.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class py{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,i){let n;return this.cache[e]!==void 0?(n=this.cache[e],this.canvasFactory.reset(n,t,i)):(n=this.canvasFactory.create(t,i),this.cache[e]=n),n}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function Wu(l,e,t,i,n,a,s,o,d,h){const[c,u,p,f,w,A]=re(l);if(u===0&&p===0){const M=s*c+w,v=Math.round(M),I=o*f+A,S=Math.round(I),D=(s+d)*c+w,T=Math.abs(Math.round(D)-v)||1,P=(o+h)*f+A,C=Math.abs(Math.round(P)-S)||1;return l.setTransform(Math.sign(c),0,0,Math.sign(f),v,S),l.drawImage(e,t,i,n,a,0,0,T,C),l.setTransform(c,u,p,f,w,A),[T,C]}if(c===0&&f===0){const M=o*p+w,v=Math.round(M),I=s*u+A,S=Math.round(I),D=(o+h)*p+w,T=Math.abs(Math.round(D)-v)||1,P=(s+d)*u+A,C=Math.abs(Math.round(P)-S)||1;return l.setTransform(0,Math.sign(u),Math.sign(p),0,v,S),l.drawImage(e,t,i,n,a,0,0,C,T),l.setTransform(c,u,p,f,w,A),[C,T]}l.drawImage(e,t,i,n,a,s,o,d,h);const y=Math.hypot(c,u),x=Math.hypot(p,f);return[y*d,x*h]}function my(l){const{width:e,height:t}=l;if(e>P2||t>P2)return null;const i=1e3,n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),a=e+1;let s=new Uint8Array(a*(t+1)),o,d,h;const c=e+7&-8;let u=new Uint8Array(c*t),p=0;for(const x of l.data){let M=128;for(;M>0;)u[p++]=x&M?0:255,M>>=1}let f=0;for(p=0,u[p]!==0&&(s[0]=1,++f),d=1;d>2)+(u[p+1]?4:0)+(u[p-c+1]?8:0),n[x]&&(s[h+d]=n[x],++f),p++;if(u[p-c]!==u[p]&&(s[h+d]=u[p]?2:4,++f),f>i)return null}for(p=c*(t-1),h=o*a,u[p]!==0&&(s[h]=8,++f),d=1;di)return null;const w=new Int32Array([0,a,-1,0,-a,0,0,0,1]),A=new Path2D;for(o=0;f&&o<=t;o++){let x=o*a;const M=x+e;for(;x>4,s[x]&=I>>2|I<<2),A.lineTo(x%a,x/a|0),s[x]||--f}while(v!==x);--o}return u=null,s=null,function(x){x.save(),x.scale(1/e,-1/t),x.translate(0,-t),x.fill(A),x.beginPath(),x.restore()}}class E2{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=f9,this.textMatrixScale=1,this.fontMatrix=Cm,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=ke.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,i){[t,i]=F.applyTransform([t,i],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(e,t){const i=F.applyTransform(t,e),n=F.applyTransform(t.slice(2),e),a=F.applyTransform([t[0],t[3]],e),s=F.applyTransform([t[2],t[1]],e);this.minX=Math.min(this.minX,i[0],n[0],a[0],s[0]),this.minY=Math.min(this.minY,i[1],n[1],a[1],s[1]),this.maxX=Math.max(this.maxX,i[0],n[0],a[0],s[0]),this.maxY=Math.max(this.maxY,i[1],n[1],a[1],s[1])}updateScalingPathMinMax(e,t){F.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.minY=Math.min(this.minY,t[1]),this.maxX=Math.max(this.maxX,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,i,n,a,s,o,d,h,c){const u=F.bezierBoundingBox(t,i,n,a,s,o,d,h,c);c||this.updateRectMinMax(e,u)}getPathBoundingBox(e=$e.FILL,t=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(e===$e.STROKE){t||te("Stroke bounding box must include transform.");const n=F.singularValueDecompose2dScale(t),a=n[0]*this.lineWidth/2,s=n[1]*this.lineWidth/2;i[0]-=a,i[1]-=s,i[2]+=a,i[3]+=s}return i}updateClipFromPath(){const e=F.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=$e.FILL,t=null){return F.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function R2(l,e){if(typeof ImageData<"u"&&e instanceof ImageData){l.putImageData(e,0,0);return}const t=e.height,i=e.width,n=t%nt,a=(t-n)/nt,s=n===0?a:a+1,o=l.createImageData(i,nt);let d=0,h;const c=e.data,u=o.data;let p,f,w,A;if(e.kind===og.GRAYSCALE_1BPP){const y=c.byteLength,x=new Uint32Array(u.buffer,0,u.byteLength>>2),M=x.length,v=i+7>>3,I=4294967295,S=at.isLittleEndian?4278190080:255;for(p=0;pv?i:D*8-7,C=P&-8;let N=0,R=0;for(;T>=1}for(;h=a&&(w=n,A=i*w),h=0,f=A;f--;)u[h++]=c[d++],u[h++]=c[d++],u[h++]=c[d++],u[h++]=255;l.putImageData(o,0,p*nt)}else throw new Error(`bad image kind: ${e.kind}`)}function B2(l,e){if(e.bitmap){l.drawImage(e.bitmap,0,0);return}const t=e.height,i=e.width,n=t%nt,a=(t-n)/nt,s=n===0?a:a+1,o=l.createImageData(i,nt);let d=0;const h=e.data,c=o.data;for(let u=0;uN2&&typeof i=="function",c=h?Date.now()+uy:0;let u=0;const p=this.commonObjs,f=this.objs;let w;for(;;){if(n!==void 0&&o===n.nextBreakPoint)return n.breakIt(o,i),o;if(w=s[o],w!==Rt.dependency)this[w].apply(this,a[o]);else for(const A of a[o]){const y=A.startsWith("g_")?p:f;if(!y.has(A))return y.get(A,i),o}if(o++,o===d)return o;if(h&&++u>N2){if(Date.now()>c)return i(),o;u=0}}}endDrawing(){m(this,rh,ib).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),m(this,oh,nb).call(this)}_scaleImage(e,t){const i=e.width,n=e.height;let a=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),o=i,d=n,h="prescale1",c,u;for(;a>2&&o>1||s>2&&d>1;){let p=o,f=d;a>2&&o>1&&(p=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),a/=o/p),s>2&&d>1&&(f=d>=16384?Math.floor(d/2)-1||1:Math.ceil(d)/2,s/=d/f),c=this.cachedCanvases.getCanvas(h,p,f),u=c.context,u.clearRect(0,0,p,f),u.drawImage(e,0,0,o,d,0,0,p,f),e=c.canvas,o=p,d=f,h=h==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:d}}_createMaskCanvas(e){const t=this.ctx,{width:i,height:n}=e,a=this.current.fillColor,s=this.current.patternFill,o=re(t);let d,h,c,u;if((e.bitmap||e.data)&&e.count>1){const P=e.bitmap||e.data.buffer;h=JSON.stringify(s?o:[o.slice(0,4),a]),d=this._cachedBitmapsMap.get(P),d||(d=new Map,this._cachedBitmapsMap.set(P,d));const C=d.get(h);if(C&&!s){const N=Math.round(Math.min(o[0],o[2])+o[4]),R=Math.round(Math.min(o[1],o[3])+o[5]);return{canvas:C,offsetX:N,offsetY:R}}c=C}c||(u=this.cachedCanvases.getCanvas("maskCanvas",i,n),B2(u.context,e));let p=F.transform(o,[1/i,0,0,-1/n,0,0]);p=F.transform(p,[1,0,0,1,0,-n]);const[f,w,A,y]=F.getAxialAlignedBoundingBox([0,0,i,n],p),x=Math.round(A-f)||1,M=Math.round(y-w)||1,v=this.cachedCanvases.getCanvas("fillCanvas",x,M),I=v.context,S=f,D=w;I.translate(-S,-D),I.transform(...p),c||(c=this._scaleImage(u.canvas,Ii(I)),c=c.img,d&&s&&d.set(h,c)),I.imageSmoothingEnabled=U2(re(I),e.interpolate),Wu(I,c,0,0,c.width,c.height,0,0,i,n),I.globalCompositeOperation="source-in";const T=F.transform(Ii(I),[1,0,0,1,-S,-D]);return I.fillStyle=s?a.getPattern(t,this,T,$e.FILL):a,I.fillRect(0,0,i,n),d&&!s&&(this.cachedCanvases.delete("fillCanvas"),d.set(h,v.canvas)),{canvas:v.canvas,offsetX:Math.round(S),offsetY:Math.round(D)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=by[e]}setLineJoin(e){this.ctx.lineJoin=fy[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(e),i.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,i]of e)switch(t){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,e,t);this.suspendedCtx=this.ctx,this.ctx=n.context;const a=this.ctx;a.setTransform(...re(this.suspendedCtx)),Nl(this.suspendedCtx,a),gy(a,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Nl(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,i,n){const a=n[0],s=n[1],o=n[2]-a,d=n[3]-s;o===0||d===0||(this.genericComposeSMask(t.context,i,o,d,t.subtype,t.backdrop,t.transferMap,a,s,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(i.canvas,0,0),e.restore())}genericComposeSMask(e,t,i,n,a,s,o,d,h,c,u){let p=e.canvas,f=d-c,w=h-u;if(s){if(f<0||w<0||f+i>p.width||w+n>p.height){const y=this.cachedCanvases.getCanvas("maskExtension",i,n),x=y.context;x.drawImage(p,-f,-w),s.some(M=>M!==0)&&(x.globalCompositeOperation="destination-atop",x.fillStyle=F.makeHexColor(...s),x.fillRect(0,0,i,n),x.globalCompositeOperation="source-over"),p=y.canvas,f=w=0}else if(s.some(y=>y!==0)){e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const y=new Path2D;y.rect(f,w,i,n),e.clip(y),e.globalCompositeOperation="destination-atop",e.fillStyle=F.makeHexColor(...s),e.fillRect(f,w,i,n),e.restore()}}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),a==="Alpha"&&o?t.filter=this.filterFactory.addAlphaFilter(o):a==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(o));const A=new Path2D;A.rect(d,h,i,n),t.clip(A),t.globalCompositeOperation="destination-in",t.drawImage(p,f,w,i,n,d,h,i,n),t.restore()}save(){this.inSMaskMode?(Nl(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Nl(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,i,n,a,s){this.ctx.transform(e,t,i,n,a,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,i){const n=this.ctx,a=this.current;let s=a.x,o=a.y,d,h;const c=re(n),u=c[0]===0&&c[3]===0||c[1]===0&&c[2]===0,p=u?i.slice(0):null;for(let f=0,w=0,A=e.length;fT2&&(h=T2),this.current.fontSizeScale=t/h,this.ctx.font=`${d} ${o} ${h}px ${s}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,i,n,a,s){this.current.textMatrix=[e,t,i,n,a,s],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,i,n){const a=this.ctx,s=this.current,o=s.font,d=s.textRenderingMode,h=s.fontSize/s.fontSizeScale,c=d&ke.FILL_STROKE_MASK,u=!!(d&ke.ADD_TO_PATH_FLAG),p=s.patternFill&&!o.missingFile;let f;(o.disableFontFace||u||p)&&(f=o.getPathGenerator(this.commonObjs,e)),o.disableFontFace||p?(a.save(),a.translate(t,i),a.beginPath(),f(a,h),n&&a.setTransform(...n),(c===ke.FILL||c===ke.FILL_STROKE)&&a.fill(),(c===ke.STROKE||c===ke.FILL_STROKE)&&a.stroke(),a.restore()):((c===ke.FILL||c===ke.FILL_STROKE)&&a.fillText(e,t,i),(c===ke.STROKE||c===ke.FILL_STROKE)&&a.strokeText(e,t,i)),u&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:re(a),x:t,y:i,fontSize:h,addToPath:f})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n0&&t[n]<255){i=!0;break}return q(this,"isFontSubpixelAAEnabled",i)}showText(e){const t=this.current,i=t.font;if(i.isType3Font)return this.showType3Text(e);const n=t.fontSize;if(n===0)return;const a=this.ctx,s=t.fontSizeScale,o=t.charSpacing,d=t.wordSpacing,h=t.fontDirection,c=t.textHScale*h,u=e.length,p=i.vertical,f=p?1:-1,w=i.defaultVMetrics,A=n*t.fontMatrix[0],y=t.textRenderingMode===ke.FILL&&!i.disableFontFace&&!t.patternFill;a.save(),a.transform(...t.textMatrix),a.translate(t.x,t.y+t.textRise),h>0?a.scale(c,-1):a.scale(c,1);let x;if(t.patternFill){a.save();const D=t.fillColor.getPattern(a,this,Ii(a),$e.FILL);x=re(a),a.restore(),a.fillStyle=D}let M=t.lineWidth;const v=t.textMatrixScale;if(v===0||M===0){const D=t.textRenderingMode&ke.FILL_STROKE_MASK;(D===ke.STROKE||D===ke.FILL_STROKE)&&(M=this.getSinglePixelWidth())}else M/=v;if(s!==1&&(a.scale(s,s),M/=s),a.lineWidth=M,i.isInvalidPDFjsFont){const D=[];let T=0;for(const P of e)D.push(P.unicode),T+=P.width;a.fillText(D.join(""),0,0),t.x+=T*A*c,a.restore(),this.compose();return}let I=0,S;for(S=0;S0){const _=a.measureText(C).width*1e3/n*s;if(k<_&&this.isFontSubpixelAAEnabled){const Ge=k/_;T=!0,a.save(),a.scale(Ge,1),R/=Ge}else k!==_&&(R+=(k-_)/2e3*n/s)}if(this.contentVisible&&(D.isInFont||i.missingFile)){if(y&&!N)a.fillText(C,R,L);else if(this.paintChar(C,R,L,x),N){const _=R+n*N.offset.x/s,Ge=L-n*N.offset.y/s;this.paintChar(N.fontChar,_,Ge,x)}}const O=p?k*A-P*h:k*A+P*h;I+=O,T&&a.restore()}p?t.y-=I:t.x+=I*c,a.restore(),this.compose()}showType3Text(e){const t=this.ctx,i=this.current,n=i.font,a=i.fontSize,s=i.fontDirection,o=n.vertical?1:-1,d=i.charSpacing,h=i.wordSpacing,c=i.textHScale*s,u=i.fontMatrix||Cm,p=e.length,f=i.textRenderingMode===ke.INVISIBLE;let w,A,y,x;if(!(f||a===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...i.textMatrix),t.translate(i.x,i.y),t.scale(c,s),w=0;wnew s2(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new tb(e,i,this.ctx,a,n)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,i){this.ctx.strokeStyle=this.current.strokeColor=F.makeHexColor(e,t,i)}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(e,t,i){this.ctx.fillStyle=this.current.fillColor=F.makeHexColor(e,t,i),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t=null){let i;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=hy(this.getObject(e)),this.cachedPatterns.set(e,i)),t&&(i.matrix=t),i}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const i=this._getPattern(e);t.fillStyle=i.getPattern(t,this,Ii(t),$e.SHADING);const n=Ii(t);if(n){const{width:a,height:s}=t.canvas,[o,d,h,c]=F.getAxialAlignedBoundingBox([0,0,a,s],n);this.ctx.fillRect(o,d,h-o,c-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){te("Should not call beginInlineImage")}beginImageData(){te("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=re(this.ctx),t)){const i=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],i,n),this.current.updateRectMinMax(re(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||k1("TODO: Support non-isolated groups."),e.knockout&&Z("Knockout groups not supported.");const i=re(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let n=F.getAxialAlignedBoundingBox(e.bbox,re(t));const a=[0,0,t.canvas.width,t.canvas.height];n=F.intersect(n,a)||[0,0,0,0];const s=Math.floor(n[0]),o=Math.floor(n[1]),d=Math.max(Math.ceil(n[2])-s,1),h=Math.max(Math.ceil(n[3])-o,1);this.current.startNewPathAndClipBox([0,0,d,h]);let c="groupAt"+this.groupLevel;e.smask&&(c+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(c,d,h),p=u.context;p.translate(-s,-o),p.transform(...i),e.smask?this.smaskStack.push({canvas:u.canvas,context:p,offsetX:s,offsetY:o,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(s,o),t.save()),Nl(t,p),this.ctx=p,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const n=re(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...n);const a=F.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],n);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(a)}}beginAnnotation(e,t,i,n,a){if(m(this,rh,ib).call(this),zu(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),t){const s=t[2]-t[0],o=t[3]-t[1];if(a&&this.annotationCanvasMap){i=i.slice(),i[4]-=t[0],i[5]-=t[1],t=t.slice(),t[0]=t[1]=0,t[2]=s,t[3]=o;const[d,h]=F.singularValueDecompose2dScale(re(this.ctx)),{viewportScale:c}=this,u=Math.ceil(s*this.outputScaleX*c),p=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(u,p);const{canvas:f,context:w}=this.annotationCanvas;this.annotationCanvasMap.set(e,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=w,this.ctx.save(),this.ctx.setTransform(d,0,0,-h,0,o*h),zu(this.ctx)}else zu(this.ctx),this.ctx.rect(t[0],t[1],s,o),this.ctx.clip(),this.endPath()}this.current=new E2(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),m(this,oh,nb).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;e=this.getObject(e.data,e),e.count=t;const i=this.ctx,n=this.processingType3;if(n&&(n.compiled===void 0&&(n.compiled=my(e)),n.compiled)){n.compiled(i);return}const a=this._createMaskCanvas(e),s=a.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(s,a.offsetX,a.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,i=0,n=0,a,s){if(!this.contentVisible)return;e=this.getObject(e.data,e);const o=this.ctx;o.save();const d=re(o);o.transform(t,i,n,a,0,0);const h=this._createMaskCanvas(e);o.setTransform(1,0,0,1,h.offsetX-d[4],h.offsetY-d[5]);for(let c=0,u=s.length;cu?c/u:1,o=h>u?h/u:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:i}=this.current,[n,a]=this.getScaleForStroking();if(t.lineWidth=i||1,n===1&&a===1){t.stroke();return}const s=t.getLineDash();if(e&&t.save(),t.scale(n,a),s.length>0){const o=Math.max(n,a);t.setLineDash(s.map(d=>d/o)),t.lineDashOffset/=o}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};rh=new WeakSet,ib=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},oh=new WeakSet,nb=function(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}};let Pr=s2;for(const l in Rt)Pr.prototype[l]!==void 0&&(Pr.prototype[Rt[l]]=Pr.prototype[l]);var rg,lh,dh;let rr=(rg=class{static get workerPort(){return r(this,lh)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");b(this,lh,e)}static get workerSrc(){return r(this,dh)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");b(this,dh,e)}},lh=new WeakMap,dh=new WeakMap,g(rg,lh,null),g(rg,dh,""),rg);const Qu={UNKNOWN:0,DATA:1,ERROR:2},pe={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function rt(l){switch(l instanceof Error||typeof l=="object"&&l!==null||te('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),l.name){case"AbortException":return new gr(l.message);case"MissingPDFException":return new ur(l.message);case"PasswordException":return new Tm(l.message,l.code);case"UnexpectedResponseException":return new O1(l.message,l.status);case"UnknownErrorException":return new Nm(l.message,l.details);default:return new Nm(l.message,l.toString())}}var Vp,$9,Zp,e4,$r,gg;class Ol{constructor(e,t,i){g(this,Vp);g(this,Zp);g(this,$r);this.sourceName=e,this.targetName=t,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=n=>{const a=n.data;if(a.targetName!==this.sourceName)return;if(a.stream){m(this,Zp,e4).call(this,a);return}if(a.callback){const o=a.callbackId,d=this.callbackCapabilities[o];if(!d)throw new Error(`Cannot resolve callback ${o}`);if(delete this.callbackCapabilities[o],a.callback===Qu.DATA)d.resolve(a.data);else if(a.callback===Qu.ERROR)d.reject(rt(a.reason));else throw new Error("Unexpected callback case");return}const s=this.actionHandler[a.action];if(!s)throw new Error(`Unknown action from worker: ${a.action}`);if(a.callbackId){const o=this.sourceName,d=a.sourceName;new Promise(function(h){h(s(a.data))}).then(function(h){i.postMessage({sourceName:o,targetName:d,callback:Qu.DATA,callbackId:a.callbackId,data:h})},function(h){i.postMessage({sourceName:o,targetName:d,callback:Qu.ERROR,callbackId:a.callbackId,reason:rt(h)})});return}if(a.streamId){m(this,Vp,$9).call(this,a);return}s(a.data)},i.addEventListener("message",this._onComObjOnMessage)}on(e,t){const i=this.actionHandler;if(i[e])throw new Error(`There is already an actionName called "${e}"`);i[e]=t}send(e,t,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},i)}sendWithPromise(e,t,i){const n=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[n]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},i)}catch(s){a.reject(s)}return a.promise}sendWithStream(e,t,i,n){const a=this.streamId++,s=this.sourceName,o=this.targetName,d=this.comObj;return new ReadableStream({start:h=>{const c=Promise.withResolvers();return this.streamControllers[a]={controller:h,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},d.postMessage({sourceName:s,targetName:o,action:e,streamId:a,data:t,desiredSize:h.desiredSize},n),c.promise},pull:h=>{const c=Promise.withResolvers();return this.streamControllers[a].pullCall=c,d.postMessage({sourceName:s,targetName:o,stream:pe.PULL,streamId:a,desiredSize:h.desiredSize}),c.promise},cancel:h=>{Ie(h instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[a].cancelCall=c,this.streamControllers[a].isClosed=!0,d.postMessage({sourceName:s,targetName:o,stream:pe.CANCEL,streamId:a,reason:rt(h)}),c.promise}},i)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}Vp=new WeakSet,$9=function(e){const t=e.streamId,i=this.sourceName,n=e.sourceName,a=this.comObj,s=this,o=this.actionHandler[e.action],d={enqueue(h,c=1,u){if(this.isCancelled)return;const p=this.desiredSize;this.desiredSize-=c,p>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:i,targetName:n,stream:pe.ENQUEUE,streamId:t,chunk:h},u)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:i,targetName:n,stream:pe.CLOSE,streamId:t}),delete s.streamSinks[t])},error(h){Ie(h instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,a.postMessage({sourceName:i,targetName:n,stream:pe.ERROR,streamId:t,reason:rt(h)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[t]=d,new Promise(function(h){h(o(e.data,d))}).then(function(){a.postMessage({sourceName:i,targetName:n,stream:pe.START_COMPLETE,streamId:t,success:!0})},function(h){a.postMessage({sourceName:i,targetName:n,stream:pe.START_COMPLETE,streamId:t,reason:rt(h)})})},Zp=new WeakSet,e4=function(e){const t=e.streamId,i=this.sourceName,n=e.sourceName,a=this.comObj,s=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case pe.START_COMPLETE:e.success?s.startCall.resolve():s.startCall.reject(rt(e.reason));break;case pe.PULL_COMPLETE:e.success?s.pullCall.resolve():s.pullCall.reject(rt(e.reason));break;case pe.PULL:if(!o){a.postMessage({sourceName:i,targetName:n,stream:pe.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,new Promise(function(d){var h;d((h=o.onPull)==null?void 0:h.call(o))}).then(function(){a.postMessage({sourceName:i,targetName:n,stream:pe.PULL_COMPLETE,streamId:t,success:!0})},function(d){a.postMessage({sourceName:i,targetName:n,stream:pe.PULL_COMPLETE,streamId:t,reason:rt(d)})});break;case pe.ENQUEUE:if(Ie(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case pe.CLOSE:if(Ie(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),m(this,$r,gg).call(this,s,t);break;case pe.ERROR:Ie(s,"error should have stream controller"),s.controller.error(rt(e.reason)),m(this,$r,gg).call(this,s,t);break;case pe.CANCEL_COMPLETE:e.success?s.cancelCall.resolve():s.cancelCall.reject(rt(e.reason)),m(this,$r,gg).call(this,s,t);break;case pe.CANCEL:if(!o)break;new Promise(function(d){var h;d((h=o.onCancel)==null?void 0:h.call(o,rt(e.reason)))}).then(function(){a.postMessage({sourceName:i,targetName:n,stream:pe.CANCEL_COMPLETE,streamId:t,success:!0})},function(d){a.postMessage({sourceName:i,targetName:n,stream:pe.CANCEL_COMPLETE,streamId:t,reason:rt(d)})}),o.sinkCapability.reject(rt(e.reason)),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}},$r=new WeakSet,gg=async function(e,t){var i,n,a;await Promise.allSettled([(i=e.startCall)==null?void 0:i.promise,(n=e.pullCall)==null?void 0:n.promise,(a=e.cancelCall)==null?void 0:a.promise]),delete this.streamControllers[t]};var $a,hh;class Ay{constructor({parsedData:e,rawData:t}){g(this,$a,void 0);g(this,hh,void 0);b(this,$a,e),b(this,hh,t)}getRaw(){return r(this,hh)}get(e){return r(this,$a).get(e)??null}getAll(){return O5(r(this,$a))}has(e){return r(this,$a).has(e)}}$a=new WeakMap,hh=new WeakMap;const An=Symbol("INTERNAL");var ch,uh,gh,eo;class xy{constructor(e,{name:t,intent:i,usage:n}){g(this,ch,!1);g(this,uh,!1);g(this,gh,!1);g(this,eo,!0);b(this,ch,!!(e&bt.DISPLAY)),b(this,uh,!!(e&bt.PRINT)),this.name=t,this.intent=i,this.usage=n}get visible(){if(r(this,gh))return r(this,eo);if(!r(this,eo))return!1;const{print:e,view:t}=this.usage;return r(this,ch)?(t==null?void 0:t.viewState)!=="OFF":r(this,uh)?(e==null?void 0:e.printState)!=="OFF":!0}_setVisible(e,t,i=!1){e!==An&&te("Internal method `_setVisible` called."),b(this,gh,i),b(this,eo,t)}}ch=new WeakMap,uh=new WeakMap,gh=new WeakMap,eo=new WeakMap;var Bn,ee,to,io,ph,ab;class yy{constructor(e,t=bt.DISPLAY){g(this,ph);g(this,Bn,null);g(this,ee,new Map);g(this,to,null);g(this,io,null);if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,b(this,io,e.order);for(const i of e.groups)r(this,ee).set(i.id,new xy(t,i));if(e.baseState==="OFF")for(const i of r(this,ee).values())i._setVisible(An,!1);for(const i of e.on)r(this,ee).get(i)._setVisible(An,!0);for(const i of e.off)r(this,ee).get(i)._setVisible(An,!1);b(this,to,this.getHash())}}isVisible(e){if(r(this,ee).size===0)return!0;if(!e)return k1("Optional content group not defined."),!0;if(e.type==="OCG")return r(this,ee).has(e.id)?r(this,ee).get(e.id).visible:(Z(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return m(this,ph,ab).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const t of e.ids){if(!r(this,ee).has(t))return Z(`Optional content group not found: ${t}`),!0;if(r(this,ee).get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const t of e.ids){if(!r(this,ee).has(t))return Z(`Optional content group not found: ${t}`),!0;if(!r(this,ee).get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const t of e.ids){if(!r(this,ee).has(t))return Z(`Optional content group not found: ${t}`),!0;if(!r(this,ee).get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const t of e.ids){if(!r(this,ee).has(t))return Z(`Optional content group not found: ${t}`),!0;if(r(this,ee).get(t).visible)return!1}return!0}return Z(`Unknown optional content policy ${e.policy}.`),!0}return Z(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0){const i=r(this,ee).get(e);if(!i){Z(`Optional content group not found: ${e}`);return}i._setVisible(An,!!t,!0),b(this,Bn,null)}setOCGState({state:e,preserveRB:t}){let i;for(const n of e){switch(n){case"ON":case"OFF":case"Toggle":i=n;continue}const a=r(this,ee).get(n);if(a)switch(i){case"ON":a._setVisible(An,!0);break;case"OFF":a._setVisible(An,!1);break;case"Toggle":a._setVisible(An,!a.visible);break}}b(this,Bn,null)}get hasInitialVisibility(){return r(this,to)===null||this.getHash()===r(this,to)}getOrder(){return r(this,ee).size?r(this,io)?r(this,io).slice():[...r(this,ee).keys()]:null}getGroups(){return r(this,ee).size>0?O5(r(this,ee)):null}getGroup(e){return r(this,ee).get(e)||null}getHash(){if(r(this,Bn)!==null)return r(this,Bn);const e=new q9;for(const[t,i]of r(this,ee))e.update(`${t}:${i.visible}`);return b(this,Bn,e.hexdigest())}}Bn=new WeakMap,ee=new WeakMap,to=new WeakMap,io=new WeakMap,ph=new WeakSet,ab=function(e){const t=e.length;if(t<2)return!0;const i=e[0];for(let n=1;n0){const d=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(d)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!i,this._isRangeSupported=!t,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((d,h)=>{this._onReceiveData({begin:d,chunk:h})}),e.addProgressListener((d,h)=>{this._onProgress({loaded:d,total:h})}),e.addProgressiveReadListener(d=>{this._onReceiveData({chunk:d})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){const i=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const n=this._rangeReaders.some(function(a){return a._begin!==e?!1:(a._enqueue(i),!0)});Ie(n,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}_onProgress(e){var t,i,n,a;e.total===void 0?(i=(t=this._rangeReaders[0])==null?void 0:t.onProgress)==null||i.call(t,{loaded:e.loaded}):(a=(n=this._fullRequestReader)==null?void 0:n.onProgress)==null||a.call(n,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;(e=this._fullRequestReader)==null||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){Ie(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new vy(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=new Dy(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(i),i}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const i of this._rangeReaders.slice(0))i.cancel(e);this._pdfDataRangeTransport.abort()}}class vy{constructor(e,t,i=!1,n=null){this._stream=e,this._done=i||!1,this._filename=V5(n)?n:null,this._queuedChunks=t||[],this._loaded=0;for(const a of this._queuedChunks)this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Dy{constructor(e,t,i){this._stream=e,this._begin=t,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Iy(l){let e=!0,t=i("filename\\*","i").exec(l);if(t){t=t[1];let c=o(t);return c=unescape(c),c=d(c),c=h(c),a(c)}if(t=s(l),t){const c=h(t);return a(c)}if(t=i("filename","i").exec(l),t){t=t[1];let c=o(t);return c=h(c),a(c)}function i(c,u){return new RegExp("(?:^|;)\\s*"+c+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function n(c,u){if(c){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const p=new TextDecoder(c,{fatal:!0}),f=W1(u);u=p.decode(f),e=!1}catch{}}return u}function a(c){return e&&/[\x80-\xff]/.test(c)&&(c=n("utf-8",c),e&&(c=n("iso-8859-1",c))),c}function s(c){const u=[];let p;const f=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(p=f.exec(c))!==null;){let[,A,y,x]=p;if(A=parseInt(A,10),A in u){if(A===0)break;continue}u[A]=[y,x]}const w=[];for(let A=0;A{if(!t4(n.status))throw K1(n.status,i);this._reader=n.body.getReader(),this._headersCapability.resolve();const a=d=>n.headers.get(d),{allowRangeRequests:s,suggestedLength:o}=K5({getResponseHeader:a,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=o||this._contentLength,this._filename=H5(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new gr("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded,total:this._contentLength}),{value:a4(e),done:!1})}cancel(e){var t;(t=this._reader)==null||t.cancel(e),this._abortController.abort()}}class Sy{constructor(e,t,i){this._stream=e,this._reader=null,this._loaded=0;const n=e.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController,this._headers=n4(this._stream.httpHeaders),this._headers.append("Range",`bytes=${t}-${i-1}`);const a=n.url;fetch(a,i4(this._headers,this._withCredentials,this._abortController)).then(s=>{if(!t4(s.status))throw K1(s.status,a);this._readCapability.resolve(),this._reader=s.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded}),{value:a4(e),done:!1})}cancel(e){var t;(t=this._reader)==null||t.cancel(e),this._abortController.abort()}}const im=200,nm=206;function Ty(l){const e=l.response;return typeof e!="string"?e:W1(e).buffer}class Ny{constructor(e,t={}){this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,i){const n={begin:e,end:t};for(const a in i)n[a]=i[a];return this.request(n)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const a in this.httpHeaders){const s=this.httpHeaders[a];s!==void 0&&t.setRequestHeader(a,s)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),n.expectedStatus=nm):n.expectedStatus=im,t.responseType="arraybuffer",e.onError&&(t.onerror=function(a){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,i),t.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=e.onHeadersReceived,n.onDone=e.onDone,n.onError=e.onError,n.onProgress=e.onProgress,t.send(null),i}onProgress(e,t){var n;const i=this.pendingRequests[e];i&&((n=i.onProgress)==null||n.call(i,t))}onStateChange(e,t){var d,h,c;const i=this.pendingRequests[e];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),n.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],n.status===0&&this.isHttp){(d=i.onError)==null||d.call(i,n.status);return}const a=n.status||im;if(!(a===im&&i.expectedStatus===nm)&&a!==i.expectedStatus){(h=i.onError)==null||h.call(i,n.status);return}const o=Ty(n);if(a===nm){const u=n.getResponseHeader("Content-Range"),p=/bytes (\d+)-(\d+)\/(\d+)/.exec(u);i.onDone({begin:parseInt(p[1],10),chunk:o})}else o?i.onDone({begin:0,chunk:o}):(c=i.onError)==null||c.call(i,n.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class Py{constructor(e){this._source=e,this._manager=new Ny(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return Ie(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Ey(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const i=new Ry(this._manager,e,t);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const i of this._rangeRequestReaders.slice(0))i.cancel(e)}}class Ey{constructor(e,t){this._manager=e;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),i=s=>t.getResponseHeader(s),{allowRangeRequests:n,suggestedLength:a}=K5({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=H5(i),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=K1(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var t;(t=this.onProgress)==null||t.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Ry{constructor(e,t,i){this._manager=e;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var e;(e=this.onClosed)==null||e.call(this,this)}_onDone(e){const t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=K1(e,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var t;this.isStreamingSupported||(t=this.onProgress)==null||t.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const s4=/^file:\/\/\/[a-zA-Z]:\//;function By(l){const e=Mi.get("url"),t=e.parse(l);return t.protocol==="file:"||t.host?t:/^[a-z]:[/\\]/i.test(l)?e.parse(`file:///${l}`):(t.host||(t.protocol="file:"),t)}class Uy{constructor(e){this.source=e,this.url=By(e.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return Ie(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new Fy(this):new Ly(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const i=this.isFsUrl?new Gy(this,e,t):new jy(this,e,t);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){var t;(t=this._fullRequestReader)==null||t.cancel(e);for(const i of this._rangeRequestReaders.slice(0))i.cancel(e)}}class r4{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new gr("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class o4{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function Xg(l,e){return{protocol:l.protocol,auth:l.auth,host:l.hostname,port:l.port,path:l.path,method:"GET",headers:e}}class Ly extends r4{constructor(e){super(e);const t=i=>{if(i.statusCode===404){const o=new ur(`Missing PDF "${this._url}".`);this._storedError=o,this._headersCapability.reject(o);return}this._headersCapability.resolve(),this._setReadableStream(i);const n=o=>this._readableStream.headers[o.toLowerCase()],{allowRangeRequests:a,suggestedLength:s}=K5({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=s||this._contentLength,this._filename=H5(n)};if(this._request=null,this._url.protocol==="http:"){const i=Mi.get("http");this._request=i.request(Xg(this._url,e.httpHeaders),t)}else{const i=Mi.get("https");this._request=i.request(Xg(this._url,e.httpHeaders),t)}this._request.on("error",i=>{this._storedError=i,this._headersCapability.reject(i)}),this._request.end()}}class jy extends o4{constructor(e,t,i){super(e),this._httpHeaders={};for(const a in e.httpHeaders){const s=e.httpHeaders[a];s!==void 0&&(this._httpHeaders[a]=s)}this._httpHeaders.Range=`bytes=${t}-${i-1}`;const n=a=>{if(a.statusCode===404){const s=new ur(`Missing PDF "${this._url}".`);this._storedError=s;return}this._setReadableStream(a)};if(this._request=null,this._url.protocol==="http:"){const a=Mi.get("http");this._request=a.request(Xg(this._url,this._httpHeaders),n)}else{const a=Mi.get("https");this._request=a.request(Xg(this._url,this._httpHeaders),n)}this._request.on("error",a=>{this._storedError=a}),this._request.end()}}class Fy extends r4{constructor(e){super(e);let t=decodeURIComponent(this._url.path);s4.test(this._url.href)&&(t=t.replace(/^\//,""));const i=Mi.get("fs");i.promises.lstat(t).then(n=>{this._contentLength=n.size,this._setReadableStream(i.createReadStream(t)),this._headersCapability.resolve()},n=>{n.code==="ENOENT"&&(n=new ur(`Missing PDF "${t}".`)),this._storedError=n,this._headersCapability.reject(n)})}}class Gy extends o4{constructor(e,t,i){super(e);let n=decodeURIComponent(this._url.path);s4.test(this._url.href)&&(n=n.replace(/^\//,""));const a=Mi.get("fs");this._setReadableStream(a.createReadStream(n,{start:t,end:i-1}))}}const ky=1e5,tt=30,Oy=.8;var kf,Un,it,mh,bh,es,Wi,fh,wh,ts,no,ao,Ln,so,Ah,ro,is,xh,yh,me,ns,as,jn,oo,Yp,l4,Kp,d4,Mh,rb,lo,pg,Hp,h4,qp,c4;let sb=(me=class{constructor({textContentSource:e,container:t,viewport:i}){g(this,Yp);g(this,Kp);g(this,Mh);g(this,Un,Promise.withResolvers());g(this,it,null);g(this,mh,!1);g(this,bh,!!((kf=globalThis.FontInspector)!=null&&kf.enabled));g(this,es,null);g(this,Wi,null);g(this,fh,0);g(this,wh,0);g(this,ts,null);g(this,no,null);g(this,ao,0);g(this,Ln,0);g(this,so,Object.create(null));g(this,Ah,[]);g(this,ro,null);g(this,is,[]);g(this,xh,new WeakMap);g(this,yh,null);var d;if(e instanceof ReadableStream)b(this,ro,e);else if(typeof e=="object")b(this,ro,new ReadableStream({start(h){h.enqueue(e),h.close()}}));else throw new Error('No "textContentSource" parameter specified.');b(this,it,b(this,no,t)),b(this,Ln,i.scale*(globalThis.devicePixelRatio||1)),b(this,ao,i.rotation),b(this,Wi,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:n,pageHeight:a,pageX:s,pageY:o}=i.rawDims;b(this,yh,[1,0,0,-1,-s,o+a]),b(this,wh,n),b(this,fh,a),m(d=me,Hp,h4).call(d),hr(t,i),r(this,Un).promise.catch(()=>{}).then(()=>{r(me,oo).delete(this),b(this,Wi,null),b(this,so,null)})}render(){const e=()=>{r(this,ts).read().then(({value:t,done:i})=>{if(i){r(this,Un).resolve();return}r(this,es)??b(this,es,t.lang),Object.assign(r(this,so),t.styles),m(this,Yp,l4).call(this,t.items),e()},r(this,Un).reject)};return b(this,ts,r(this,ro).getReader()),r(me,oo).add(this),e(),r(this,Un).promise}update({viewport:e,onBefore:t=null}){var a;const i=e.scale*(globalThis.devicePixelRatio||1),n=e.rotation;if(n!==r(this,ao)&&(t==null||t(),b(this,ao,n),hr(r(this,no),{rotation:n})),i!==r(this,Ln)){t==null||t(),b(this,Ln,i);const s={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:m(a=me,lo,pg).call(a,r(this,es))};for(const o of r(this,is))s.properties=r(this,xh).get(o),s.div=o,m(this,Mh,rb).call(this,s)}}cancel(){var t;const e=new gr("TextLayer task cancelled.");(t=r(this,ts))==null||t.cancel(e).catch(()=>{}),b(this,ts,null),r(this,Un).reject(e)}get textDivs(){return r(this,is)}get textContentItemsStr(){return r(this,Ah)}static cleanup(){if(!(r(this,oo).size>0)){r(this,ns).clear();for(const{canvas:e}of r(this,as).values())e.remove();r(this,as).clear()}}},Un=new WeakMap,it=new WeakMap,mh=new WeakMap,bh=new WeakMap,es=new WeakMap,Wi=new WeakMap,fh=new WeakMap,wh=new WeakMap,ts=new WeakMap,no=new WeakMap,ao=new WeakMap,Ln=new WeakMap,so=new WeakMap,Ah=new WeakMap,ro=new WeakMap,is=new WeakMap,xh=new WeakMap,yh=new WeakMap,ns=new WeakMap,as=new WeakMap,jn=new WeakMap,oo=new WeakMap,Yp=new WeakSet,l4=function(e){var n,a;if(r(this,mh))return;(a=r(this,Wi)).ctx??(a.ctx=m(n=me,lo,pg).call(n,r(this,es)));const t=r(this,is),i=r(this,Ah);for(const s of e){if(t.length>ky){Z("Ignoring additional textDivs for performance reasons."),b(this,mh,!0);return}if(s.str===void 0){if(s.type==="beginMarkedContentProps"||s.type==="beginMarkedContent"){const o=r(this,it);b(this,it,document.createElement("span")),r(this,it).classList.add("markedContent"),s.id!==null&&r(this,it).setAttribute("id",`${s.id}`),o.append(r(this,it))}else s.type==="endMarkedContent"&&b(this,it,r(this,it).parentNode);continue}i.push(s.str),m(this,Kp,d4).call(this,s)}},Kp=new WeakSet,d4=function(e){var A;const t=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};r(this,is).push(t);const n=F.transform(r(this,yh),e.transform);let a=Math.atan2(n[1],n[0]);const s=r(this,so)[e.fontName];s.vertical&&(a+=Math.PI/2);const o=r(this,bh)&&s.fontSubstitution||s.fontFamily,d=Math.hypot(n[2],n[3]),h=d*m(A=me,qp,c4).call(A,o,r(this,es));let c,u;a===0?(c=n[4],u=n[5]-h):(c=n[4]+h*Math.sin(a),u=n[5]-h*Math.cos(a));const p="calc(var(--scale-factor)*",f=t.style;r(this,it)===r(this,no)?(f.left=`${(100*c/r(this,wh)).toFixed(2)}%`,f.top=`${(100*u/r(this,fh)).toFixed(2)}%`):(f.left=`${p}${c.toFixed(2)}px)`,f.top=`${p}${u.toFixed(2)}px)`),f.fontSize=`${p}${(r(me,jn)*d).toFixed(2)}px)`,f.fontFamily=o,i.fontSize=d,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,r(this,bh)&&(t.dataset.fontName=s.fontSubstitutionLoadedName||e.fontName),a!==0&&(i.angle=a*(180/Math.PI));let w=!1;if(e.str.length>1)w=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const y=Math.abs(e.transform[0]),x=Math.abs(e.transform[3]);y!==x&&Math.max(y,x)/Math.min(y,x)>1.5&&(w=!0)}if(w&&(i.canvasWidth=s.vertical?e.height:e.width),r(this,xh).set(t,i),r(this,Wi).div=t,r(this,Wi).properties=i,m(this,Mh,rb).call(this,r(this,Wi)),i.hasText&&r(this,it).append(t),i.hasEOL){const y=document.createElement("br");y.setAttribute("role","presentation"),r(this,it).append(y)}},Mh=new WeakSet,rb=function(e){const{div:t,properties:i,ctx:n,prevFontSize:a,prevFontFamily:s}=e,{style:o}=t;let d="";if(r(me,jn)>1&&(d=`scale(${1/r(me,jn)})`),i.canvasWidth!==0&&i.hasText){const{fontFamily:h}=o,{canvasWidth:c,fontSize:u}=i;(a!==u||s!==h)&&(n.font=`${u*r(this,Ln)}px ${h}`,e.prevFontSize=u,e.prevFontFamily=h);const{width:p}=n.measureText(t.textContent);p>0&&(d=`scaleX(${c*r(this,Ln)/p}) ${d}`)}i.angle!==0&&(d=`rotate(${i.angle}deg) ${d}`),d.length>0&&(o.transform=d)},lo=new WeakSet,pg=function(e=null){let t=r(this,as).get(e||(e=""));if(!t){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=e,document.body.append(i),t=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),r(this,as).set(e,t)}return t},Hp=new WeakSet,h4=function(){if(r(this,jn)!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),b(this,jn,e.getBoundingClientRect().height),e.remove()},qp=new WeakSet,c4=function(e,t){const i=r(this,ns).get(e);if(i)return i;const n=m(this,lo,pg).call(this,t),a=n.font;n.canvas.width=n.canvas.height=tt,n.font=`${tt}px ${e}`;const s=n.measureText("");let o=s.fontBoundingBoxAscent,d=Math.abs(s.fontBoundingBoxDescent);if(o){const u=o/(o+d);return r(this,ns).set(e,u),n.canvas.width=n.canvas.height=0,n.font=a,u}n.strokeStyle="red",n.clearRect(0,0,tt,tt),n.strokeText("g",0,0);let h=n.getImageData(0,0,tt,tt).data;d=0;for(let u=h.length-1-3;u>=0;u-=4)if(h[u]>0){d=Math.ceil(u/4/tt);break}n.clearRect(0,0,tt,tt),n.strokeText("A",0,tt),h=n.getImageData(0,0,tt,tt).data,o=0;for(let u=0,p=h.length;u0){o=tt-Math.floor(u/4/tt);break}n.canvas.width=n.canvas.height=0,n.font=a;const c=o?o/(o+d):Oy;return r(this,ns).set(e,c),c},g(me,lo),g(me,Hp),g(me,qp),g(me,ns,new Map),g(me,as,new Map),g(me,jn,null),g(me,oo,new Set),me);class hd{static textContent(e){const t=[],i={items:t,styles:Object.create(null)};function n(a){var d;if(!a)return;let s=null;const o=a.name;if(o==="#text")s=a.value;else if(hd.shouldBuildText(o))(d=a==null?void 0:a.attributes)!=null&&d.textContent?s=a.attributes.textContent:a.value&&(s=a.value);else return;if(s!==null&&t.push({str:s}),!!a.children)for(const h of a.children)n(h)}return n(e),i}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const Wy=65536,zy=100,Qy=5e3,Vy=Ke?ny:Vx,Zy=Ke?ay:M9,Yy=Ke?iy:Qx,Ky=Ke?sy:v9;function Hy(l={}){typeof l=="string"||l instanceof URL?l={url:l}:(l instanceof ArrayBuffer||ArrayBuffer.isView(l))&&(l={data:l});const e=new ob,{docId:t}=e,i=l.url?qy(l.url):null,n=l.data?Xy(l.data):null,a=l.httpHeaders||null,s=l.withCredentials===!0,o=l.password??null,d=l.range instanceof u4?l.range:null,h=Number.isInteger(l.rangeChunkSize)&&l.rangeChunkSize>0?l.rangeChunkSize:Wy;let c=l.worker instanceof bg?l.worker:null;const u=l.verbosity,p=typeof l.docBaseUrl=="string"&&!Y1(l.docBaseUrl)?l.docBaseUrl:null,f=typeof l.cMapUrl=="string"?l.cMapUrl:null,w=l.cMapPacked!==!1,A=l.CMapReaderFactory||Zy,y=typeof l.standardFontDataUrl=="string"?l.standardFontDataUrl:null,x=l.StandardFontDataFactory||Ky,M=l.stopAtErrors!==!0,v=Number.isInteger(l.maxImageSize)&&l.maxImageSize>-1?l.maxImageSize:-1,I=l.isEvalSupported!==!1,S=typeof l.isOffscreenCanvasSupported=="boolean"?l.isOffscreenCanvasSupported:!Ke,D=Number.isInteger(l.canvasMaxAreaInBytes)?l.canvasMaxAreaInBytes:-1,T=typeof l.disableFontFace=="boolean"?l.disableFontFace:Ke,P=l.fontExtraProperties===!0,C=l.enableXfa===!0,N=l.ownerDocument||globalThis.document,R=l.disableRange===!0,L=l.disableStream===!0,k=l.disableAutoFetch===!0,O=l.pdfBug===!0,_=l.enableHWA===!0,Ge=d?d.length:l.length??NaN,z=typeof l.useSystemFonts=="boolean"?l.useSystemFonts:!Ke&&!T,V=typeof l.useWorkerFetch=="boolean"?l.useWorkerFetch:A===M9&&x===v9&&f&&y&&Fl(f,document.baseURI)&&Fl(y,document.baseURI),Lu=l.canvasFactory||new Vy({ownerDocument:N,enableHWA:_}),ju=l.filterFactory||new Yy({docId:t,ownerDocument:N}),Fu=null;Rx(u);const He={canvasFactory:Lu,filterFactory:ju};if(V||(He.cMapReaderFactory=new A({baseUrl:f,isCompressed:w}),He.standardFontDataFactory=new x({baseUrl:y})),!c){const wa={verbosity:u,port:rr.workerPort};c=wa.port?bg.fromPort(wa):new bg(wa),e._worker=c}const Re={docId:t,apiVersion:"4.5.136",data:n,password:o,disableAutoFetch:k,rangeChunkSize:h,length:Ge,docBaseUrl:p,enableXfa:C,evaluatorOptions:{maxImageSize:v,disableFontFace:T,ignoreErrors:M,isEvalSupported:I,isOffscreenCanvasSupported:S,canvasMaxAreaInBytes:D,fontExtraProperties:P,useSystemFonts:z,cMapUrl:V?f:null,standardFontDataUrl:V?y:null}},Gu={disableFontFace:T,fontExtraProperties:P,ownerDocument:N,pdfBug:O,styleElement:Fu,loadingParams:{disableAutoFetch:k,enableXfa:C}};return c.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const wa=c.messageHandler.sendWithPromise("GetDocRequest",Re,n?[n.buffer]:null);let fn;if(d)fn=new My(d,{disableRange:R,disableStream:L});else if(!n){if(!i)throw new Error("getDocument - no `url` parameter provided.");fn=(vi=>Ke?function(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype}()&&Fl(vi.url)?new j2(vi):new Uy(vi):Fl(vi.url)?new j2(vi):new Py(vi))({url:i,length:Ge,httpHeaders:a,withCredentials:s,rangeChunkSize:h,disableRange:R,disableStream:L})}return wa.then(fe=>{if(e.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const vi=new Ol(t,fe,c.port),o2=new e3(vi,e,fn,Gu,He);e._transport=o2,vi.send("Ready",null)})}).catch(e._capability.reject),e}function qy(l){if(l instanceof URL)return l.href;try{return new URL(l,window.location).href}catch{if(Ke&&typeof l=="string")return l}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function Xy(l){if(Ke&&typeof h2<"u"&&l instanceof h2)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(l instanceof Uint8Array&&l.byteLength===l.buffer.byteLength)return l;if(typeof l=="string")return W1(l);if(l instanceof ArrayBuffer||ArrayBuffer.isView(l)||typeof l=="object"&&!isNaN(l==null?void 0:l.length))return new Uint8Array(l);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function F2(l){return typeof l=="object"&&Number.isInteger(l==null?void 0:l.num)&&l.num>=0&&Number.isInteger(l==null?void 0:l.gen)&&l.gen>=0}var Xp;const Jp=class Jp{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${et(Jp,Xp)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var e,t,i;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((t=this._transport)==null?void 0:t.destroy())}catch(n){throw(i=this._worker)!=null&&i.port&&delete this._worker._pendingDestroy,n}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};Xp=new WeakMap,g(Jp,Xp,0);let ob=Jp,u4=class{constructor(e,t,i=!1,n=null){this.length=e,this.initialData=t,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const i of this._rangeListeners)i(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(e,t)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){te("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class Jy{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return q(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var Fn,zi,Gn,Mr,ho,mg;class _y{constructor(e,t,i,n=!1){g(this,Gn);g(this,ho);g(this,Fn,null);g(this,zi,!1);this._pageIndex=e,this._pageInfo=t,this._transport=i,this._stats=n?new v2:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new g4,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:a=!1}={}){return new Nu({viewBox:this.view,scale:e,rotation:t,offsetX:i,offsetY:n,dontFlip:a})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return q(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return((e=this._transport._htmlForXfa)==null?void 0:e.children[this._pageIndex])||null}render({canvasContext:e,viewport:t,intent:i="display",annotationMode:n=vn.ENABLE,transform:a=null,background:s=null,optionalContentConfigPromise:o=null,annotationCanvasMap:d=null,pageColors:h=null,printAnnotationStorage:c=null,isEditing:u=!1}){var I,S;(I=this._stats)==null||I.time("Overall");const p=this._transport.getRenderingIntent(i,n,c,u),{renderingIntent:f,cacheKey:w}=p;b(this,zi,!1),m(this,ho,mg).call(this),o||(o=this._transport.getOptionalContentConfig(f));let A=this._intentStates.get(w);A||(A=Object.create(null),this._intentStates.set(w,A)),A.streamReaderCancelTimeout&&(clearTimeout(A.streamReaderCancelTimeout),A.streamReaderCancelTimeout=null);const y=!!(f&bt.PRINT);A.displayReadyCapability||(A.displayReadyCapability=Promise.withResolvers(),A.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(S=this._stats)==null||S.time("Page Request"),this._pumpOperatorList(p));const x=D=>{var T;A.renderTasks.delete(M),(this._maybeCleanupAfterRender||y)&&b(this,zi,!0),m(this,Gn,Mr).call(this,!y),D?(M.capability.reject(D),this._abortOperatorList({intentState:A,reason:D instanceof Error?D:new Error(D)})):M.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(T=globalThis.Stats)!=null&&T.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},M=new db({callback:x,params:{canvasContext:e,viewport:t,transform:a,background:s},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:A.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:h});(A.renderTasks||(A.renderTasks=new Set)).add(M);const v=M.task;return Promise.all([A.displayReadyCapability.promise,o]).then(([D,T])=>{var P;if(this.destroyed){x();return}if((P=this._stats)==null||P.time("Rendering"),!(T.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");M.initializeGraphics({transparency:D,optionalContentConfig:T}),M.operatorListChanged()}).catch(x),v}getOperatorList({intent:e="display",annotationMode:t=vn.ENABLE,printAnnotationStorage:i=null,isEditing:n=!1}={}){var h;function a(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(d))}const s=this._transport.getRenderingIntent(e,t,i,n,!0);let o=this._intentStates.get(s.cacheKey);o||(o=Object.create(null),this._intentStates.set(s.cacheKey,o));let d;return o.opListReadCapability||(d=Object.create(null),d.operatorListChanged=a,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(d),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(h=this._stats)==null||h.time("Page Request"),this._pumpOperatorList(s)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(n){return n.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>hd.textContent(i));const t=this.streamTextContent(e);return new Promise(function(i,n){function a(){s.read().then(function({value:d,done:h}){if(h){i(o);return}o.lang??(o.lang=d.lang),Object.assign(o.styles,d.styles),o.items.push(...d.items),a()},n)}const s=t.getReader(),o={items:[],styles:Object.create(null),lang:null};a()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const i of t.renderTasks)e.push(i.completed),i.cancel();return this.objs.clear(),b(this,zi,!1),m(this,ho,mg).call(this),Promise.all(e)}cleanup(e=!1){b(this,zi,!0);const t=m(this,Gn,Mr).call(this,!1);return e&&t&&this._stats&&(this._stats=new v2),t}_startRenderPage(e,t){var n,a;const i=this._intentStates.get(t);i&&((n=this._stats)==null||n.timeEnd("Page Request"),(a=i.displayReadyCapability)==null||a.resolve(e))}_renderPageChunk(e,t){for(let i=0,n=e.length;i{d.read().then(({value:u,done:p})=>{if(p){h.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(u,h),c())},u=>{if(h.streamReader=null,!this._transport.destroyed){if(h.operatorList){h.operatorList.lastChunk=!0;for(const p of h.renderTasks)p.operatorListChanged();m(this,Gn,Mr).call(this,!0)}if(h.displayReadyCapability)h.displayReadyCapability.reject(u);else if(h.opListReadCapability)h.opListReadCapability.reject(u);else throw u}})};c()}_abortOperatorList({intentState:e,reason:t,force:i=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!i){if(e.renderTasks.size>0)return;if(t instanceof Q5){let n=zy;t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n);return}}if(e.streamReader.cancel(new gr(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[n,a]of this._intentStates)if(a===e){this._intentStates.delete(n);break}this.cleanup()}}}get stats(){return this._stats}}Fn=new WeakMap,zi=new WeakMap,Gn=new WeakSet,Mr=function(e=!1){if(m(this,ho,mg).call(this),!r(this,zi)||this.destroyed)return!1;if(e)return b(this,Fn,setTimeout(()=>{b(this,Fn,null),m(this,Gn,Mr).call(this,!1)},Qy)),!1;for(const{renderTasks:t,operatorList:i}of this._intentStates.values())if(t.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),b(this,zi,!1),!0},ho=new WeakSet,mg=function(){r(this,Fn)&&(clearTimeout(r(this,Fn)),b(this,Fn,null))};var ss,_p;class $y{constructor(){g(this,ss,new Set);g(this,_p,Promise.resolve())}postMessage(e,t){const i={data:structuredClone(e,t?{transfer:t}:null)};r(this,_p).then(()=>{for(const n of r(this,ss))n.call(this,i)})}addEventListener(e,t){r(this,ss).add(t)}removeEventListener(e,t){r(this,ss).delete(t)}terminate(){r(this,ss).clear()}}ss=new WeakMap,_p=new WeakMap;const Ei={isWorkerDisabled:!1,fakeWorkerId:0};Ke&&(Ei.isWorkerDisabled=!0,rr.workerSrc||(rr.workerSrc="./pdf.worker.mjs")),Ei.isSameOrigin=function(l,e){let t;try{if(t=new URL(l),!t.origin||t.origin==="null")return!1}catch{return!1}const i=new URL(e,t);return t.origin===i.origin},Ei.createCDNWrapper=function(l){const e=`await import("${l}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};var _e,rs,co,fg,uo,wg;let bg=(_e=class{constructor({name:e=null,port:t=null,verbosity:i=Bx()}={}){g(this,co);var n;if(this.name=e,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,t){if((n=r(_e,rs))!=null&&n.has(t))throw new Error("Cannot use more than one PDFWorker per port.");(r(_e,rs)||b(_e,rs,new WeakMap)).set(t,this),this._initializeFromPort(t);return}this._initialize()}get promise(){return Ke?Promise.all([Mi.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new Ol("main","worker",e),this._messageHandler.on("ready",function(){}),m(this,co,fg).call(this)}_initialize(){if(Ei.isWorkerDisabled||r(_e,uo,wg)){this._setupFakeWorker();return}let{workerSrc:e}=_e;try{Ei.isSameOrigin(window.location.href,e)||(e=Ei.createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),i=new Ol("main","worker",t),n=()=>{a.abort(),i.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},a=new AbortController;t.addEventListener("error",()=>{this._webWorker||n()},{signal:a.signal}),i.on("test",o=>{if(a.abort(),this.destroyed||!o){n();return}this._messageHandler=i,this._port=t,this._webWorker=t,m(this,co,fg).call(this)}),i.on("ready",o=>{if(a.abort(),this.destroyed){n();return}try{s()}catch{this._setupFakeWorker()}});const s=()=>{const o=new Uint8Array;i.send("test",o,[o.buffer])};s();return}catch{k1("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Ei.isWorkerDisabled||(Z("Setting up fake worker."),Ei.isWorkerDisabled=!0),_e._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const t=new $y;this._port=t;const i=`fake${Ei.fakeWorkerId++}`,n=new Ol(i+"_worker",i,t);e.setup(n,t),this._messageHandler=new Ol(i,i+"_worker",t),m(this,co,fg).call(this)}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){var e;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(e=r(_e,rs))==null||e.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){var i;if(!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const t=(i=r(this,rs))==null?void 0:i.get(e.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new _e(e)}static get workerSrc(){if(rr.workerSrc)return rr.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return q(this,"_setupFakeWorkerGlobal",(async()=>r(this,uo,wg)?r(this,uo,wg):(await Sr(()=>import(this.workerSrc),__vite__mapDeps([]),import.meta.url)).WorkerMessageHandler)())}},rs=new WeakMap,co=new WeakSet,fg=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},uo=new WeakSet,wg=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},g(_e,uo),g(_e,rs,void 0),_e);var Qi,si,go,po,ri,os,Wl;class e3{constructor(e,t,i,n,a){g(this,os);g(this,Qi,new Map);g(this,si,new Map);g(this,go,new Map);g(this,po,new Map);g(this,ri,null);this.messageHandler=e,this.loadingTask=t,this.commonObjs=new g4,this.fontLoader=new ey({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return q(this,"annotationStorage",new Y5)}getRenderingIntent(e,t=vn.ENABLE,i=null,n=!1,a=!1){let s=bt.DISPLAY,o=_m;switch(e){case"any":s=bt.ANY;break;case"display":break;case"print":s=bt.PRINT;break;default:Z(`getRenderingIntent - invalid intent: ${e}`)}const d=s&bt.PRINT&&i instanceof J9?i:this.annotationStorage;switch(t){case vn.DISABLE:s+=bt.ANNOTATIONS_DISABLE;break;case vn.ENABLE:break;case vn.ENABLE_FORMS:s+=bt.ANNOTATIONS_FORMS;break;case vn.ENABLE_STORAGE:s+=bt.ANNOTATIONS_STORAGE,o=d.serializable;break;default:Z(`getRenderingIntent - invalid annotationMode: ${t}`)}n&&(s+=bt.IS_EDITING),a&&(s+=bt.OPLIST);const{ids:h,hash:c}=d.modifiedIds,u=[s,o.hash,c];return{renderingIntent:s,cacheKey:u.join("_"),annotationStorageSerializable:o,modifiedIds:h}}destroy(){var i;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(i=r(this,ri))==null||i.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of r(this,si).values())e.push(n._destroy());r(this,si).clear(),r(this,go).clear(),r(this,po).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{var n;this.commonObjs.clear(),this.fontLoader.clear(),r(this,Qi).clear(),this.filterFactory.destroy(),sb.cleanup(),(n=this._networkStream)==null||n.cancelAllRequests(new gr("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(i,n)=>{Ie(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=a=>{this._lastProgress={loaded:a.loaded,total:a.total}},n.onPull=()=>{this._fullReader.read().then(function({value:a,done:s}){if(s){n.close();return}Ie(a instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{n.error(a)})},n.onCancel=a=>{this._fullReader.cancel(a),n.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",i=>{const n=Promise.withResolvers(),a=this._fullReader;return a.headersReady.then(()=>{var s;(!a.isStreamingSupported||!a.isRangeSupported)&&(this._lastProgress&&((s=t.onProgress)==null||s.call(t,this._lastProgress)),a.onProgress=o=>{var d;(d=t.onProgress)==null||d.call(t,{loaded:o.loaded,total:o.total})}),n.resolve({isStreamingSupported:a.isStreamingSupported,isRangeSupported:a.isRangeSupported,contentLength:a.contentLength})},n.reject),n.promise}),e.on("GetRangeReader",(i,n)=>{Ie(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const a=this._networkStream.getRangeReader(i.begin,i.end);if(!a){n.close();return}n.onPull=()=>{a.read().then(function({value:s,done:o}){if(o){n.close();return}Ie(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),n.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{n.error(s)})},n.onCancel=s=>{a.cancel(s),n.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,t._capability.resolve(new Jy(i,this))}),e.on("DocException",function(i){let n;switch(i.name){case"PasswordException":n=new Tm(i.message,i.code);break;case"InvalidPDFException":n=new w9(i.message);break;case"MissingPDFException":n=new ur(i.message);break;case"UnexpectedResponseException":n=new O1(i.message,i.status);break;case"UnknownErrorException":n=new Nm(i.message,i.details);break;default:te("DocException - expected a valid Error.")}t._capability.reject(n)}),e.on("PasswordRequest",i=>{if(b(this,ri,Promise.withResolvers()),t.onPassword){const n=a=>{a instanceof Error?r(this,ri).reject(a):r(this,ri).resolve({password:a})};try{t.onPassword(n,i.code)}catch(a){r(this,ri).reject(a)}}else r(this,ri).reject(new Tm(i.message,i.code));return r(this,ri).promise}),e.on("DataLoaded",i=>{var n;(n=t.onProgress)==null||n.call(t,{loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),e.on("StartRenderPage",i=>{if(this.destroyed)return;r(this,si).get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),e.on("commonobj",([i,n,a])=>{var s;if(this.destroyed||this.commonObjs.has(i))return null;switch(n){case"Font":const{disableFontFace:o,fontExtraProperties:d,pdfBug:h}=this._params;if("error"in a){const f=a.error;Z(`Error during font loading: ${f}`),this.commonObjs.resolve(i,f);break}const c=h&&((s=globalThis.FontInspector)!=null&&s.enabled)?(f,w)=>globalThis.FontInspector.fontAdded(f,w):null,u=new ty(a,{disableFontFace:o,inspectFont:c});this.fontLoader.bind(u).catch(()=>e.sendWithPromise("FontFallback",{id:i})).finally(()=>{!d&&u.data&&(u.data=null),this.commonObjs.resolve(i,u)});break;case"CopyLocalImage":const{imageRef:p}=a;Ie(p,"The imageRef must be defined.");for(const f of r(this,si).values())for(const[,w]of f.objs)if((w==null?void 0:w.ref)===p)return w.dataLen?(this.commonObjs.resolve(i,structuredClone(w)),w.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,a);break;default:throw new Error(`Got unknown common object type ${n}`)}return null}),e.on("obj",([i,n,a,s])=>{var d;if(this.destroyed)return;const o=r(this,si).get(n);if(!o.objs.has(i)){if(o._intentStates.size===0){(d=s==null?void 0:s.bitmap)==null||d.close();return}switch(a){case"Image":o.objs.resolve(i,s),(s==null?void 0:s.dataLen)>Tx&&(o._maybeCleanupAfterRender=!0);break;case"Pattern":o.objs.resolve(i,s);break;default:throw new Error(`Got unknown object type ${a}`)}}}),e.on("DocProgress",i=>{var n;this.destroyed||(n=t.onProgress)==null||n.call(t,{loaded:i.loaded,total:i.total})}),e.on("FetchBuiltInCMap",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(i):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),e.on("FetchStandardFontData",i=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(i):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var i;this.annotationStorage.size<=0&&Z("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:((i=this._fullReader)==null?void 0:i.filename)??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,i=r(this,go).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");a.refStr&&r(this,po).set(a.refStr,e);const s=new _y(t,a,this,this._params.pdfBug);return r(this,si).set(t,s),s});return r(this,go).set(t,n),n}getPageIndex(e){return F2(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return m(this,os,Wl).call(this,"GetFieldObjects")}hasJSActions(){return m(this,os,Wl).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return m(this,os,Wl).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return m(this,os,Wl).call(this,"GetOptionalContentConfig").then(t=>new yy(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=r(this,Qi).get(e);if(t)return t;const i=this.messageHandler.sendWithPromise(e,null).then(n=>{var a,s;return{info:n[0],metadata:n[1]?new Ay(n[1]):null,contentDispositionFilename:((a=this._fullReader)==null?void 0:a.filename)??null,contentLength:((s=this._fullReader)==null?void 0:s.contentLength)??null}});return r(this,Qi).set(e,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of r(this,si).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),r(this,Qi).clear(),this.filterFactory.destroy(!0),sb.cleanup()}}cachedPageNumber(e){if(!F2(e))return null;const t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return r(this,po).get(t)??null}}Qi=new WeakMap,si=new WeakMap,go=new WeakMap,po=new WeakMap,ri=new WeakMap,os=new WeakSet,Wl=function(e,t=null){const i=r(this,Qi).get(e);if(i)return i;const n=this.messageHandler.sendWithPromise(e,t);return r(this,Qi).set(e,n),n};const Vu=Symbol("INITIAL_DATA");var Gt,vh,lb;class g4{constructor(){g(this,vh);g(this,Gt,Object.create(null))}get(e,t=null){if(t){const n=m(this,vh,lb).call(this,e);return n.promise.then(()=>t(n.data)),null}const i=r(this,Gt)[e];if(!i||i.data===Vu)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return i.data}has(e){const t=r(this,Gt)[e];return!!t&&t.data!==Vu}resolve(e,t=null){const i=m(this,vh,lb).call(this,e);i.data=t,i.resolve()}clear(){var e;for(const t in r(this,Gt)){const{data:i}=r(this,Gt)[t];(e=i==null?void 0:i.bitmap)==null||e.close()}b(this,Gt,Object.create(null))}*[Symbol.iterator](){for(const e in r(this,Gt)){const{data:t}=r(this,Gt)[e];t!==Vu&&(yield[e,t])}}}Gt=new WeakMap,vh=new WeakSet,lb=function(e){var t;return(t=r(this,Gt))[e]||(t[e]={...Promise.withResolvers(),data:Vu})};var kn;class t3{constructor(e){g(this,kn,null);b(this,kn,e),this.onContinue=null}get promise(){return r(this,kn).capability.promise}cancel(e=0){r(this,kn).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=r(this,kn).operatorList;if(!e)return!1;const{annotationCanvasMap:t}=r(this,kn);return e.form||e.canvas&&(t==null?void 0:t.size)>0}}kn=new WeakMap;var On,ls;const Ta=class Ta{constructor({callback:e,params:t,objs:i,commonObjs:n,annotationCanvasMap:a,operatorList:s,pageIndex:o,canvasFactory:d,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:u=!1,pageColors:p=null}){g(this,On,null);this.callback=e,this.params=t,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=o,this.canvasFactory=d,this.filterFactory=h,this._pdfBug=u,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=c===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new t3(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){var o,d;if(this.cancelled)return;if(this._canvas){if(r(Ta,ls).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");r(Ta,ls).add(this._canvas)}this._pdfBug&&((o=globalThis.StepperManager)!=null&&o.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:n,transform:a,background:s}=this.params;this.gfx=new Pr(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:n,transparency:e,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,(d=this.graphicsReadyCallback)==null||d.call(this)}cancel(e=null,t=0){var i;this.running=!1,this.cancelled=!0,(i=this.gfx)==null||i.endDrawing(),r(this,On)&&(window.cancelAnimationFrame(r(this,On)),b(this,On,null)),r(Ta,ls).delete(this._canvas),this.callback(e||new Q5(`Rendering cancelled, page ${this._pageIndex+1}`,t))}operatorListChanged(){var e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.stepper)==null||e.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?b(this,On,window.requestAnimationFrame(()=>{b(this,On,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),r(Ta,ls).delete(this._canvas),this.callback())))}};On=new WeakMap,ls=new WeakMap,g(Ta,ls,new WeakSet);let db=Ta;const i3="4.5.136",n3="3a21f03b0";function G2(l){return Math.floor(Math.max(0,Math.min(1,l))*255).toString(16).padStart(2,"0")}function Pl(l){return Math.max(0,Math.min(255,255*l))}class k2{static CMYK_G([e,t,i,n]){return["G",1-Math.min(1,.3*e+.59*i+.11*t+n)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=Pl(e),[e,e,e]}static G_HTML([e]){const t=G2(e);return`#${t}${t}${t}`}static RGB_G([e,t,i]){return["G",.3*e+.59*t+.11*i]}static RGB_rgb(e){return e.map(Pl)}static RGB_HTML(e){return`#${e.map(G2).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,i,n]){return["RGB",1-Math.min(1,e+n),1-Math.min(1,i+n),1-Math.min(1,t+n)]}static CMYK_rgb([e,t,i,n]){return[Pl(1-Math.min(1,e+n)),Pl(1-Math.min(1,i+n)),Pl(1-Math.min(1,t+n))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,i]){const n=1-e,a=1-t,s=1-i,o=Math.min(n,a,s);return["CMYK",n,a,s,o]}}let p4=class{static setupStorage(e,t,i,n,a){const s=n.getValue(t,{value:null});switch(i.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),a==="print")break;e.addEventListener("input",o=>{n.setValue(t,{value:o.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(s.value===i.attributes.xfaOn?e.setAttribute("checked",!0):s.value===i.attributes.xfaOff&&e.removeAttribute("checked"),a==="print")break;e.addEventListener("change",o=>{n.setValue(t,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),a==="print")break;e.addEventListener("input",o=>{n.setValue(t,{value:o.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(const o of i.children)o.attributes.value===s.value?o.attributes.selected=!0:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{const d=o.target.options,h=d.selectedIndex===-1?"":d[d.selectedIndex].value;n.setValue(t,{value:h})});break}}static setAttributes({html:e,element:t,storage:i=null,intent:n,linkService:a}){const{attributes:s}=t,o=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${n}`);for(const[d,h]of Object.entries(s))if(h!=null)switch(d){case"class":h.length&&e.setAttribute(d,h.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",h);break;case"style":Object.assign(e.style,h);break;case"textContent":e.textContent=h;break;default:(!o||d!=="href"&&d!=="newWindow")&&e.setAttribute(d,h)}o&&a.addLinkAttributes(e,s.href,s.newWindow),i&&s.dataId&&this.setupStorage(e,s.dataId,t,i)}static render(e){var u,p;const t=e.annotationStorage,i=e.linkService,n=e.xfaHtml,a=e.intent||"display",s=document.createElement(n.name);n.attributes&&this.setAttributes({html:s,element:n,intent:a,linkService:i});const o=a!=="richText",d=e.div;if(d.append(s),e.viewport){const f=`matrix(${e.viewport.transform.join(",")})`;d.style.transform=f}o&&d.setAttribute("class","xfaLayer xfaFont");const h=[];if(n.children.length===0){if(n.value){const f=document.createTextNode(n.value);s.append(f),o&&hd.shouldBuildText(n.name)&&h.push(f)}return{textDivs:h}}const c=[[n,-1,s]];for(;c.length>0;){const[f,w,A]=c.at(-1);if(w+1===f.children.length){c.pop();continue}const y=f.children[++c.at(-1)[1]];if(y===null)continue;const{name:x}=y;if(x==="#text"){const v=document.createTextNode(y.value);h.push(v),A.append(v);continue}const M=(u=y==null?void 0:y.attributes)!=null&&u.xmlns?document.createElementNS(y.attributes.xmlns,x):document.createElement(x);if(A.append(M),y.attributes&&this.setAttributes({html:M,element:y,storage:t,intent:a,linkService:i}),((p=y.children)==null?void 0:p.length)>0)c.push([y,-1,M]);else if(y.value){const v=document.createTextNode(y.value);o&&hd.shouldBuildText(x)&&h.push(v),M.append(v)}}for(const f of d.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))f.setAttribute("readOnly",!0);return{textDivs:h}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}};const Ru=1e3,a3=9,cr=new WeakSet;function pn(l){return{width:l[2]-l[0],height:l[3]-l[1]}}class s3{static create(e){switch(e.data.annotationType){case we.LINK:return new m4(e);case we.TEXT:return new r3(e);case we.WIDGET:switch(e.data.fieldType){case"Tx":return new o3(e);case"Btn":return e.data.radioButton?new w4(e):e.data.checkBox?new d3(e):new h3(e);case"Ch":return new c3(e);case"Sig":return new l3(e)}return new pr(e);case we.POPUP:return new cb(e);case we.FREETEXT:return new v4(e);case we.LINE:return new g3(e);case we.SQUARE:return new p3(e);case we.CIRCLE:return new m3(e);case we.POLYLINE:return new D4(e);case we.CARET:return new f3(e);case we.INK:return new I4(e);case we.POLYGON:return new b3(e);case we.HIGHLIGHT:return new w3(e);case we.UNDERLINE:return new A3(e);case we.SQUIGGLY:return new x3(e);case we.STRIKEOUT:return new y3(e);case we.STAMP:return new C4(e);case we.FILEATTACHMENT:return new M3(e);default:return new ge(e)}}}var ds,mo,bo,Dh,hb;const r2=class r2{constructor(e,{isRenderable:t=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}={}){g(this,Dh);g(this,ds,null);g(this,mo,!1);g(this,bo,null);this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:t,richText:i}){return!!(e!=null&&e.str||t!=null&&t.str||i!=null&&i.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return r2._hasPopupData(this.data)}updateEdited(e){var i;if(!this.container)return;r(this,ds)||b(this,ds,{rect:this.data.rect.slice(0)});const{rect:t}=e;t&&m(this,Dh,hb).call(this,t),(i=r(this,bo))==null||i.popup.updateEdited(e)}resetEdited(){var e;r(this,ds)&&(m(this,Dh,hb).call(this,r(this,ds).rect),(e=r(this,bo))==null||e.popup.resetEdited(),b(this,ds,null))}_createContainer(e){const{data:t,parent:{page:i,viewport:n}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",t.id),this instanceof pr||(a.tabIndex=Ru);const{style:s}=a;if(s.zIndex=this.parent.zIndex++,t.popupRef&&a.setAttribute("aria-haspopup","dialog"),t.alternativeText&&(a.title=t.alternativeText),t.noRotate&&a.classList.add("norotate"),!t.rect||this instanceof cb){const{rotation:A}=t;return!t.hasOwnCanvas&&A!==0&&this.setRotation(A,a),a}const{width:o,height:d}=pn(t.rect);if(!e&&t.borderStyle.width>0){s.borderWidth=`${t.borderStyle.width}px`;const A=t.borderStyle.horizontalCornerRadius,y=t.borderStyle.verticalCornerRadius;if(A>0||y>0){const M=`calc(${A}px * var(--scale-factor)) / calc(${y}px * var(--scale-factor))`;s.borderRadius=M}else if(this instanceof w4){const M=`calc(${o}px * var(--scale-factor)) / calc(${d}px * var(--scale-factor))`;s.borderRadius=M}switch(t.borderStyle.style){case Tl.SOLID:s.borderStyle="solid";break;case Tl.DASHED:s.borderStyle="dashed";break;case Tl.BEVELED:Z("Unimplemented border style: beveled");break;case Tl.INSET:Z("Unimplemented border style: inset");break;case Tl.UNDERLINE:s.borderBottomStyle="solid";break}const x=t.borderColor||null;x?(b(this,mo,!0),s.borderColor=F.makeHexColor(x[0]|0,x[1]|0,x[2]|0)):s.borderWidth=0}const h=F.normalizeRect([t.rect[0],i.view[3]-t.rect[1]+i.view[1],t.rect[2],i.view[3]-t.rect[3]+i.view[1]]),{pageWidth:c,pageHeight:u,pageX:p,pageY:f}=n.rawDims;s.left=`${100*(h[0]-p)/c}%`,s.top=`${100*(h[1]-f)/u}%`;const{rotation:w}=t;return t.hasOwnCanvas||w===0?(s.width=`${100*o/c}%`,s.height=`${100*d/u}%`):this.setRotation(w,a),a}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:a,height:s}=pn(this.data.rect);let o,d;e%180===0?(o=100*a/i,d=100*s/n):(o=100*s/i,d=100*a/n),t.style.width=`${o}%`,t.style.height=`${d}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(t,i,n)=>{const a=n.detail[t],s=a[0],o=a.slice(1);n.target.style[i]=k2[`${s}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[i]:k2[`${s}_rgb`](o)})};return q(this,"_commonActions",{display:t=>{const{display:i}=t.detail,n=i%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:i===1||i===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:i}=t.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{const i=t.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(e,t){const i=this._commonActions;for(const n of Object.keys(t.detail)){const a=e[n]||i[n];a==null||a(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const i=this._commonActions;for(const[n,a]of Object.entries(t)){const s=i[n];if(s){const o={detail:{[n]:a},target:e};s(o),delete t[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,i,n,a]=this.data.rect.map(A=>Math.fround(A));if(e.length===8){const[A,y,x,M]=e.subarray(2,6);if(n===A&&a===y&&t===x&&i===M)return}const{style:s}=this.container;let o;if(r(this,mo)){const{borderColor:A,borderWidth:y}=s;s.borderWidth=0,o=["url('data:image/svg+xml;utf8,",'',``],this.container.classList.add("hasBorder")}const d=n-t,h=a-i,{svgFactory:c}=this,u=c.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0);const p=c.createElement("defs");u.append(p);const f=c.createElement("clipPath"),w=`clippath_${this.data.id}`;f.setAttribute("id",w),f.setAttribute("clipPathUnits","objectBoundingBox"),p.append(f);for(let A=2,y=e.length;A`)}r(this,mo)&&(o.push("')"),s.backgroundImage=o.join("")),this.container.append(u),this.container.style.clipPath=`url(#${w})`}_createPopup(){const{container:e,data:t}=this;e.setAttribute("aria-haspopup","dialog");const i=b(this,bo,new cb({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){te("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const i=[];if(this._fieldObjects){const n=this._fieldObjects[e];if(n)for(const{page:a,id:s,exportValues:o}of n){if(a===-1||s===t)continue;const d=typeof o=="string"?o:null,h=document.querySelector(`[data-element-id="${s}"]`);if(h&&!cr.has(h)){Z(`_getElementsByName - element not allowed: ${s}`);continue}i.push({id:s,exportValue:d,domElement:h})}return i}for(const n of document.getElementsByName(e)){const{exportValue:a}=n,s=n.getAttribute("data-element-id");s!==t&&cr.has(n)&&i.push({id:s,exportValue:a,domElement:n})}return i}show(){var e;this.container&&(this.container.hidden=!1),(e=this.popup)==null||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),(e=this.popup)==null||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{var i;(i=this.linkService.eventBus)==null||i.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})})}};ds=new WeakMap,mo=new WeakMap,bo=new WeakMap,Dh=new WeakSet,hb=function(e){const{container:{style:t},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:a,pageHeight:s,pageX:o,pageY:d}}}}=this;i==null||i.splice(0,4,...e);const{width:h,height:c}=pn(e);t.left=`${100*(e[0]-o)/a}%`,t.top=`${100*(s-e[3]+d)/s}%`,n===0?(t.width=`${100*h/a}%`,t.height=`${100*c/s}%`):this.setRotation(n)};let ge=r2;var Vi,xa,$p,b4,e0,f4;class m4 extends ge{constructor(t,i=null){super(t,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0});g(this,Vi);g(this,$p);g(this,e0);this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:i}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let a=!1;return t.url?(i.addLinkAttributes(n,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(n,t.action),a=!0):t.attachment?(m(this,$p,b4).call(this,n,t.attachment,t.attachmentDest),a=!0):t.setOCGState?(m(this,e0,f4).call(this,n,t.setOCGState),a=!0):t.dest?(this._bindLink(n,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,t),a=!0),t.resetForm?(this._bindResetFormAction(n,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(n,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(n),this.container}_bindLink(t,i){t.href=this.linkService.getDestinationHash(i),t.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&m(this,Vi,xa).call(this)}_bindNamedAction(t,i){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(i),!1),m(this,Vi,xa).call(this)}_bindJSAction(t,i){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(i.actions)){const s=n.get(a);s&&(t[s]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:a}}),!1})}t.onclick||(t.onclick=()=>!1),m(this,Vi,xa).call(this)}_bindResetFormAction(t,i){const n=t.onclick;if(n||(t.href=this.linkService.getAnchorUrl("")),m(this,Vi,xa).call(this),!this._fieldObjects){Z('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(t.onclick=()=>!1);return}t.onclick=()=>{var u;n==null||n();const{fields:a,refs:s,include:o}=i,d=[];if(a.length!==0||s.length!==0){const p=new Set(s);for(const f of a){const w=this._fieldObjects[f]||[];for(const{id:A}of w)p.add(A)}for(const f of Object.values(this._fieldObjects))for(const w of f)p.has(w.id)===o&&d.push(w)}else for(const p of Object.values(this._fieldObjects))d.push(...p);const h=this.annotationStorage,c=[];for(const p of d){const{id:f}=p;switch(c.push(f),p.type){case"text":{const A=p.defaultValue||"";h.setValue(f,{value:A});break}case"checkbox":case"radiobutton":{const A=p.defaultValue===p.exportValues;h.setValue(f,{value:A});break}case"combobox":case"listbox":{const A=p.defaultValue||"";h.setValue(f,{value:A});break}default:continue}const w=document.querySelector(`[data-element-id="${f}"]`);if(w){if(!cr.has(w)){Z(`_bindResetFormAction - element not allowed: ${f}`);continue}}else continue;w.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((u=this.linkService.eventBus)==null||u.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}})),!1}}}Vi=new WeakSet,xa=function(){this.container.setAttribute("data-internal-link","")},$p=new WeakSet,b4=function(t,i,n=null){t.href=this.linkService.getAnchorUrl(""),i.description&&(t.title=i.description),t.onclick=()=>{var a;return(a=this.downloadManager)==null||a.openOrDownloadData(i.content,i.filename,n),!1},m(this,Vi,xa).call(this)},e0=new WeakSet,f4=function(t,i){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(i),!1),m(this,Vi,xa).call(this)};class r3 extends ge{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class pr extends ge{render(){return this.container}showElementAndHideCanvas(e){var t;this.data.hasOwnCanvas&&(((t=e.previousSibling)==null?void 0:t.nodeName)==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return at.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,i,n,a){i.includes("mouse")?e.addEventListener(i,s=>{var o;(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(i,s=>{var o;if(i==="blur"){if(!t.focused||!s.relatedTarget)return;t.focused=!1}else if(i==="focus"){if(t.focused)return;t.focused=!0}a&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:a(s)}}))})}_setEventListeners(e,t,i,n){var a,s,o;for(const[d,h]of i)(h==="Action"||(a=this.data.actions)!=null&&a[h])&&((h==="Focus"||h==="Blur")&&(t||(t={focused:!1})),this._setEventListener(e,t,d,h,n),h==="Focus"&&!((s=this.data.actions)!=null&&s.Blur)?this._setEventListener(e,t,"blur","Blur",null):h==="Blur"&&!((o=this.data.actions)!=null&&o.Focus)&&this._setEventListener(e,t,"focus","Focus",null))}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":F.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||a3,a=e.style;let s;const o=2,d=h=>Math.round(10*h)/10;if(this.data.multiLine){const h=Math.abs(this.data.rect[3]-this.data.rect[1]-o),c=Math.round(h/(_1*n))||1,u=h/c;s=Math.min(n,d(u/_1))}else{const h=Math.abs(this.data.rect[3]-this.data.rect[1]-o);s=Math.min(n,d(h/_1))}a.fontSize=`calc(${s}px * var(--scale-factor))`,a.color=F.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(a.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class o3 extends pr{constructor(e){const t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,i,n){const a=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[t]=i),a.setValue(s.id,{[n]:i})}render(){var n,a;const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const s=e.getValue(t,{value:this.data.fieldValue});let o=s.value||"";const d=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;d&&o.length>d&&(o=o.slice(0,d));let h=s.formattedValue||((n=this.data.textContent)==null?void 0:n.join(` `))||null;h&&this.data.comb&&(h=h.replaceAll(/\s+/g,""));const c={userValue:o,formattedValue:h,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=h??o,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",h??o),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),cr.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Ru,this._setRequired(i,this.data.required),d&&(i.maxLength=d),i.addEventListener("input",p=>{e.setValue(t,{value:p.target.value}),this.setPropertyOnSiblings(i,"value",p.target.value,"value"),c.formattedValue=null}),i.addEventListener("resetform",p=>{const f=this.data.defaultFieldValue??"";i.value=c.userValue=f,c.formattedValue=null});let u=p=>{const{formattedValue:f}=c;f!=null&&(p.target.value=f),p.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",f=>{var A;if(c.focused)return;const{target:w}=f;c.userValue&&(w.value=c.userValue),c.lastCommittedValue=w.value,c.commitKey=1,(A=this.data.actions)!=null&&A.Focus||(c.focused=!0)}),i.addEventListener("updatefromsandbox",f=>{this.showElementAndHideCanvas(f.target);const w={value(A){c.userValue=A.detail.value??"",e.setValue(t,{value:c.userValue.toString()}),A.target.value=c.userValue},formattedValue(A){const{formattedValue:y}=A.detail;c.formattedValue=y,y!=null&&A.target!==document.activeElement&&(A.target.value=y),e.setValue(t,{formattedValue:y})},selRange(A){A.target.setSelectionRange(...A.detail.selRange)},charLimit:A=>{var v;const{charLimit:y}=A.detail,{target:x}=A;if(y===0){x.removeAttribute("maxLength");return}x.setAttribute("maxLength",y);let M=c.userValue;!M||M.length<=y||(M=M.slice(0,y),x.value=c.userValue=M,e.setValue(t,{value:M}),(v=this.linkService.eventBus)==null||v.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:M,willCommit:!0,commitKey:1,selStart:x.selectionStart,selEnd:x.selectionEnd}}))}};this._dispatchEventFromSandbox(w,f)}),i.addEventListener("keydown",f=>{var y;c.commitKey=1;let w=-1;if(f.key==="Escape"?w=0:f.key==="Enter"&&!this.data.multiLine?w=2:f.key==="Tab"&&(c.commitKey=3),w===-1)return;const{value:A}=f.target;c.lastCommittedValue!==A&&(c.lastCommittedValue=A,c.userValue=A,(y=this.linkService.eventBus)==null||y.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:A,willCommit:!0,commitKey:w,selStart:f.target.selectionStart,selEnd:f.target.selectionEnd}}))});const p=u;u=null,i.addEventListener("blur",f=>{var A,y;if(!c.focused||!f.relatedTarget)return;(A=this.data.actions)!=null&&A.Blur||(c.focused=!1);const{value:w}=f.target;c.userValue=w,c.lastCommittedValue!==w&&((y=this.linkService.eventBus)==null||y.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:w,willCommit:!0,commitKey:c.commitKey,selStart:f.target.selectionStart,selEnd:f.target.selectionEnd}})),p(f)}),(a=this.data.actions)!=null&&a.Keystroke&&i.addEventListener("beforeinput",f=>{var S;c.lastCommittedValue=null;const{data:w,target:A}=f,{value:y,selectionStart:x,selectionEnd:M}=A;let v=x,I=M;switch(f.inputType){case"deleteWordBackward":{const D=y.substring(0,x).match(/\w*[^\w]*$/);D&&(v-=D[0].length);break}case"deleteWordForward":{const D=y.substring(x).match(/^[^\w]*\w*/);D&&(I+=D[0].length);break}case"deleteContentBackward":x===M&&(v-=1);break;case"deleteContentForward":x===M&&(I+=1);break}f.preventDefault(),(S=this.linkService.eventBus)==null||S.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:y,change:w||"",willCommit:!1,selStart:v,selEnd:I}})}),this._setEventListeners(i,c,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],f=>f.target.value)}if(u&&i.addEventListener("blur",u),this.data.comb){const f=(this.data.rect[2]-this.data.rect[0])/d;i.classList.add("comb"),i.style.letterSpacing=`calc(${f}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class l3 extends pr{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class d3 extends pr{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,i=t.id;let n=e.getValue(i,{value:t.exportValue===t.fieldValue}).value;typeof n=="string"&&(n=n!=="Off",e.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const a=document.createElement("input");return cr.add(a),a.setAttribute("data-element-id",i),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=t.fieldName,n&&a.setAttribute("checked",!0),a.setAttribute("exportValue",t.exportValue),a.tabIndex=Ru,a.addEventListener("change",s=>{const{name:o,checked:d}=s.target;for(const h of this._getElementsByName(o,i)){const c=d&&h.exportValue===t.exportValue;h.domElement&&(h.domElement.checked=c),e.setValue(h.id,{value:c})}e.setValue(i,{value:d})}),a.addEventListener("resetform",s=>{const o=t.defaultFieldValue||"Off";s.target.checked=o===t.exportValue}),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",s=>{const o={value(d){d.target.checked=d.detail.value!=="Off",e.setValue(i,{value:d.target.checked})}};this._dispatchEventFromSandbox(o,s)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class w4 extends pr{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,i=t.id;let n=e.getValue(i,{value:t.fieldValue===t.buttonValue}).value;if(typeof n=="string"&&(n=n!==t.buttonValue,e.setValue(i,{value:n})),n)for(const s of this._getElementsByName(t.fieldName,i))e.setValue(s.id,{value:!1});const a=document.createElement("input");if(cr.add(a),a.setAttribute("data-element-id",i),a.disabled=t.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=t.fieldName,n&&a.setAttribute("checked",!0),a.tabIndex=Ru,a.addEventListener("change",s=>{const{name:o,checked:d}=s.target;for(const h of this._getElementsByName(o,i))e.setValue(h.id,{value:!1});e.setValue(i,{value:d})}),a.addEventListener("resetform",s=>{const o=t.defaultFieldValue;s.target.checked=o!=null&&o===t.buttonValue}),this.enableScripting&&this.hasJSActions){const s=t.buttonValue;a.addEventListener("updatefromsandbox",o=>{const d={value:h=>{const c=s===h.detail.value;for(const u of this._getElementsByName(h.target.name)){const p=c&&u.id===i;u.domElement&&(u.domElement.checked=p),e.setValue(u.id,{value:p})}}};this._dispatchEventFromSandbox(d,o)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class h3 extends m4{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),e}}class c3 extends pr{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,i=e.getValue(t,{value:this.data.fieldValue}),n=document.createElement("select");cr.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=Ru;let a=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",c=>{const u=this.data.defaultFieldValue;for(const p of n.options)p.selected=p.value===u});for(const c of this.data.options){const u=document.createElement("option");u.textContent=c.displayValue,u.value=c.exportValue,i.value.includes(c.exportValue)&&(u.setAttribute("selected",!0),a=!1),n.append(u)}let s=null;if(a){const c=document.createElement("option");c.value=" ",c.setAttribute("hidden",!0),c.setAttribute("selected",!0),n.prepend(c),s=()=>{c.remove(),n.removeEventListener("input",s),s=null},n.addEventListener("input",s)}const o=c=>{const u=c?"value":"textContent",{options:p,multiple:f}=n;return f?Array.prototype.filter.call(p,w=>w.selected).map(w=>w[u]):p.selectedIndex===-1?null:p[p.selectedIndex][u]};let d=o(!1);const h=c=>{const u=c.target.options;return Array.prototype.map.call(u,p=>({displayValue:p.textContent,exportValue:p.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",c=>{const u={value(p){s==null||s();const f=p.detail.value,w=new Set(Array.isArray(f)?f:[f]);for(const A of n.options)A.selected=w.has(A.value);e.setValue(t,{value:o(!0)}),d=o(!1)},multipleSelection(p){n.multiple=!0},remove(p){const f=n.options,w=p.detail.remove;f[w].selected=!1,n.remove(w),f.length>0&&Array.prototype.findIndex.call(f,y=>y.selected)===-1&&(f[0].selected=!0),e.setValue(t,{value:o(!0),items:h(p)}),d=o(!1)},clear(p){for(;n.length!==0;)n.remove(0);e.setValue(t,{value:null,items:[]}),d=o(!1)},insert(p){const{index:f,displayValue:w,exportValue:A}=p.detail.insert,y=n.children[f],x=document.createElement("option");x.textContent=w,x.value=A,y?y.before(x):n.append(x),e.setValue(t,{value:o(!0),items:h(p)}),d=o(!1)},items(p){const{items:f}=p.detail;for(;n.length!==0;)n.remove(0);for(const w of f){const{displayValue:A,exportValue:y}=w,x=document.createElement("option");x.textContent=A,x.value=y,n.append(x)}n.options.length>0&&(n.options[0].selected=!0),e.setValue(t,{value:o(!0),items:h(p)}),d=o(!1)},indices(p){const f=new Set(p.detail.indices);for(const w of p.target.options)w.selected=f.has(w.index);e.setValue(t,{value:o(!0)}),d=o(!1)},editable(p){p.target.disabled=!p.detail.editable}};this._dispatchEventFromSandbox(u,c)}),n.addEventListener("input",c=>{var f;const u=o(!0),p=o(!1);e.setValue(t,{value:u}),c.preventDefault(),(f=this.linkService.eventBus)==null||f.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:d,change:p,changeEx:u,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],c=>c.target.value)):n.addEventListener("input",function(c){e.setValue(t,{value:o(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class cb extends ge{constructor(e){const{data:t,elements:i}=e;super(e,{isRenderable:ge._hasPopupData(t)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new u3({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(const i of this.elements)i.popup=e,t.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",t.map(i=>`${x9}${i}`).join(",")),this.container}}var fo,t0,i0,wo,hs,de,Zi,cs,Ih,Ch,Ao,Yi,kt,Ki,Sh,Hi,Th,us,gs,xo,Ag,Nh,ub,n0,A4,a0,x4,s0,y4,r0,M4,yo,xg,Mo,yg,Ph,gb;class u3{constructor({container:e,color:t,elements:i,titleObj:n,modificationDate:a,contentsObj:s,richText:o,parent:d,rect:h,parentRect:c,open:u}){g(this,xo);g(this,Nh);g(this,n0);g(this,a0);g(this,s0);g(this,r0);g(this,yo);g(this,Mo);g(this,Ph);g(this,fo,m(this,s0,y4).bind(this));g(this,t0,m(this,Ph,gb).bind(this));g(this,i0,m(this,Mo,yg).bind(this));g(this,wo,m(this,yo,xg).bind(this));g(this,hs,null);g(this,de,null);g(this,Zi,null);g(this,cs,null);g(this,Ih,null);g(this,Ch,null);g(this,Ao,null);g(this,Yi,!1);g(this,kt,null);g(this,Ki,null);g(this,Sh,null);g(this,Hi,null);g(this,Th,null);g(this,us,null);g(this,gs,!1);var p;b(this,de,e),b(this,Th,n),b(this,Zi,s),b(this,Hi,o),b(this,Ch,d),b(this,hs,t),b(this,Sh,h),b(this,Ao,c),b(this,Ih,i),b(this,cs,D9.toDateObject(a)),this.trigger=i.flatMap(f=>f.getElementsToTriggerPopup());for(const f of this.trigger)f.addEventListener("click",r(this,wo)),f.addEventListener("mouseenter",r(this,i0)),f.addEventListener("mouseleave",r(this,t0)),f.classList.add("popupTriggerArea");for(const f of i)(p=f.container)==null||p.addEventListener("keydown",r(this,fo));r(this,de).hidden=!0,u&&m(this,yo,xg).call(this)}render(){if(r(this,kt))return;const e=b(this,kt,document.createElement("div"));if(e.className="popup",r(this,hs)){const a=e.style.outlineColor=F.makeHexColor(...r(this,hs));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${a} 30%, white)`:e.style.backgroundColor=F.makeHexColor(...r(this,hs).map(o=>Math.floor(.7*(255-o)+o)))}const t=document.createElement("span");t.className="header";const i=document.createElement("h1");if(t.append(i),{dir:i.dir,str:i.textContent}=r(this,Th),e.append(t),r(this,cs)){const a=document.createElement("span");a.classList.add("popupDate"),a.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),a.setAttribute("data-l10n-args",JSON.stringify({date:r(this,cs).toLocaleDateString(),time:r(this,cs).toLocaleTimeString()})),t.append(a)}const n=r(this,xo,Ag);if(n)p4.render({xfaHtml:n,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const a=this._formatContents(r(this,Zi));e.append(a)}r(this,de).append(e)}_formatContents({str:e,dir:t}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=t;const n=e.split(/(?:\r\n?|\n)/);for(let a=0,s=n.length;a{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",i=>{this._isPagesLoaded=!!i.pagesCount},{once:!0})})}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:i=!1}){if(!e||typeof e!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();const n=this._fingerprint!==""&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=i===!0,this._initialized=!0,m(this,g1,Zw).call(this);const a=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=mm(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!m(this,Vs,Jl).call(this,a,!0)||t){const{hash:o,page:d,rotation:h}=m(this,Yc,t5).call(this,!0);if(!o||n||t){m(this,Yt,Si).call(this,null,!0);return}m(this,Yt,Si).call(this,{hash:o,page:d,rotation:h},!0);return}const s=a.destination;m(this,ll,kg).call(this,s,a.uid,!0),s.rotation!==void 0&&(this._initialRotation=s.rotation),s.dest?(this._initialBookmark=JSON.stringify(s.dest),this._destination.page=null):s.hash?this._initialBookmark=s.hash:s.page&&(this._initialBookmark=`page=${s.page}`)}reset(){this._initialized&&(m(this,Kc,i5).call(this),this._initialized=!1,m(this,p1,Yw).call(this)),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:i}){if(!this._initialized)return;if(e&&typeof e!="string"){console.error(`PDFHistory.push: "${e}" is not a valid namedDest parameter.`);return}else if(Array.isArray(t)){if(!m(this,ol,Gg).call(this,i)&&(i!==null||this._destination)){console.error(`PDFHistory.push: "${i}" is not a valid pageNumber parameter.`);return}}else{console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);return}const n=e||JSON.stringify(t);if(!n)return;let a=!1;if(this._destination&&(_7(this._destination.hash,n)||$7(this._destination.dest,t))){if(this._destination.page)return;a=!0}this._popStateInProgress&&!a||(m(this,Yt,Si).call(this,{dest:t,hash:n,page:i,rotation:this.linkService.rotation},a),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(e){var t;if(this._initialized){if(!m(this,ol,Gg).call(this,e)){console.error(`PDFHistory.pushPage: "${e}" is not a valid page number.`);return}((t=this._destination)==null?void 0:t.page)!==e&&(this._popStateInProgress||(m(this,Yt,Si).call(this,{dest:null,hash:`page=${e}`,page:e,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||m(this,rl,Fg).call(this)}back(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;m(this,Vs,Jl).call(this,e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;const e=window.history.state;m(this,Vs,Jl).call(this,e)&&e.uid0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}}ia=new WeakMap,Yt=new WeakSet,Si=function(e,t=!1){const i=t||!this._destination,n={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:e};m(this,ll,kg).call(this,e,n.uid);let a;if(this._updateUrl&&(e!=null&&e.hash)){const s=document.location.href.split("#",1)[0];s.startsWith("file://")||(a=`${s}#${e.hash}`)}i?window.history.replaceState(n,"",a):window.history.pushState(n,"",a)},rl=new WeakSet,Fg=function(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination){m(this,Yt,Si).call(this,t);return}if(this._destination.temporary){m(this,Yt,Si).call(this,t,!0);return}if(this._destination.hash===t.hash||!this._destination.page&&this._numPositionUpdates<=q7)return;let i=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(this._destination.dest!==void 0||!this._destination.first)return;i=!0}m(this,Yt,Si).call(this,t,i)},ol=new WeakSet,Gg=function(e){return Number.isInteger(e)&&e>0&&e<=this.linkService.pagesCount},Vs=new WeakSet,Jl=function(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint)if(t){if(typeof e.fingerprint!="string"||e.fingerprint.length!==this._fingerprint.length)return!1;const[i]=performance.getEntriesByType("navigation");if((i==null?void 0:i.type)!=="reload")return!1}else return!1;return!(!Number.isInteger(e.uid)||e.uid<0||e.destination===null||typeof e.destination!="object")},ll=new WeakSet,kg=function(e,t,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&(e!=null&&e.temporary)&&delete e.temporary,this._destination=e,this._uid=t,this._maxUid=Math.max(this._maxUid,t),this._numPositionUpdates=0},Yc=new WeakSet,t5=function(e=!1){const t=unescape(mm()).substring(1),i=H1(t),n=i.get("nameddest")||"";let a=i.get("page")|0;return(!m(this,ol,Gg).call(this,a)||e&&n.length>0)&&(a=null),{hash:t,page:a,rotation:this.linkService.rotation}},c1=new WeakSet,Qw=function({location:e}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},!this._popStateInProgress&&(this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||m(this,rl,Fg).call(this,!0),this._updateViewareaTimeout=null},X7))},u1=new WeakSet,Vw=function({state:e}){const t=mm(),i=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;const{hash:a,page:s,rotation:o}=m(this,Yc,t5).call(this);m(this,Yt,Si).call(this,{hash:a,page:s,rotation:o},!0);return}if(!m(this,Vs,Jl).call(this,e))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,t7({target:window,name:"hashchange",delay:H7}).then(()=>{this._blockHashChange--}));const n=e.destination;m(this,ll,kg).call(this,n,e.uid,!0),Mw(n.rotation)&&(this.linkService.rotation=n.rotation),n.dest?this.linkService.goToDestination(n.dest):n.hash?this.linkService.setHash(n.hash):n.page&&(this.linkService.page=n.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})},Kc=new WeakSet,i5=function(){(!this._destination||this._destination.temporary)&&m(this,rl,Fg).call(this)},g1=new WeakSet,Zw=function(){if(r(this,ia))return;b(this,ia,new AbortController);const{signal:e}=r(this,ia);this.eventBus._on("updateviewarea",m(this,c1,Qw).bind(this),{signal:e}),window.addEventListener("popstate",m(this,u1,Vw).bind(this),{signal:e}),window.addEventListener("pagehide",m(this,Kc,i5).bind(this),{signal:e})},p1=new WeakSet,Yw=function(){var e;(e=r(this,ia))==null||e.abort(),b(this,ia,null)};function _7(l,e){return typeof l!="string"||typeof e!="string"?!1:l===e||H1(l).get("nameddest")===e}function $7(l,e){function t(i,n){if(typeof i!=typeof n||Array.isArray(i)||Array.isArray(n))return!1;if(i!==null&&typeof i=="object"&&n!==null){if(Object.keys(i).length!==Object.keys(n).length)return!1;for(const a in i)if(!t(i[a],n[a]))return!1;return!0}return i===n||Number.isNaN(i)&&Number.isNaN(n)}if(!(Array.isArray(l)&&Array.isArray(e))||l.length!==e.length)return!1;for(let i=0,n=l.length;i1;(function(){(n||i)&&np.set("maxCanvasPixels",5242880)})(),function(){i&&np.set("useSystemFonts",!1)}()}const E={BROWSER:1,VIEWER:2,API:4,WORKER:8,EVENT_DISPATCH:16,PREFERENCE:128},n5={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},ma={allowedGlobalEvents:{value:null,kind:E.BROWSER},canvasMaxAreaInBytes:{value:-1,kind:E.BROWSER+E.API},isInAutomation:{value:!1,kind:E.BROWSER},localeProperties:{value:{lang:navigator.language||"en-US"},kind:E.BROWSER},nimbusDataStr:{value:"",kind:E.BROWSER},supportsCaretBrowsingMode:{value:!1,kind:E.BROWSER},supportsDocumentFonts:{value:!0,kind:E.BROWSER},supportsIntegratedFind:{value:!1,kind:E.BROWSER},supportsMouseWheelZoomCtrlKey:{value:!0,kind:E.BROWSER},supportsMouseWheelZoomMetaKey:{value:!0,kind:E.BROWSER},supportsPinchToZoom:{value:!0,kind:E.BROWSER},toolbarDensity:{value:0,kind:E.BROWSER+E.EVENT_DISPATCH},altTextLearnMoreUrl:{value:"",kind:E.VIEWER+E.PREFERENCE},annotationEditorMode:{value:0,kind:E.VIEWER+E.PREFERENCE},annotationMode:{value:2,kind:E.VIEWER+E.PREFERENCE},cursorToolOnLoad:{value:0,kind:E.VIEWER+E.PREFERENCE},debuggerSrc:{value:"./debugger.mjs",kind:E.VIEWER},defaultZoomDelay:{value:400,kind:E.VIEWER+E.PREFERENCE},defaultZoomValue:{value:"",kind:E.VIEWER+E.PREFERENCE},disableHistory:{value:!1,kind:E.VIEWER},disablePageLabels:{value:!1,kind:E.VIEWER+E.PREFERENCE},enableAltText:{value:!1,kind:E.VIEWER+E.PREFERENCE},enableGuessAltText:{value:!0,kind:E.VIEWER+E.PREFERENCE},enableHighlightEditor:{value:!1,kind:E.VIEWER+E.PREFERENCE},enableHighlightFloatingButton:{value:!1,kind:E.VIEWER+E.PREFERENCE},enablePermissions:{value:!1,kind:E.VIEWER+E.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:E.VIEWER+E.PREFERENCE},enableScripting:{value:!0,kind:E.VIEWER+E.PREFERENCE},enableUpdatedAddImage:{value:!1,kind:E.VIEWER+E.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:E.VIEWER},externalLinkTarget:{value:0,kind:E.VIEWER+E.PREFERENCE},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",kind:E.VIEWER+E.PREFERENCE},historyUpdateUrl:{value:!1,kind:E.VIEWER+E.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:E.VIEWER+E.PREFERENCE},imageResourcesPath:{value:"./images/",kind:E.VIEWER},maxCanvasPixels:{value:2**25,kind:E.VIEWER},forcePageColors:{value:!1,kind:E.VIEWER+E.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:E.VIEWER+E.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:E.VIEWER+E.PREFERENCE},pdfBugEnabled:{value:!1,kind:E.VIEWER+E.PREFERENCE},printResolution:{value:150,kind:E.VIEWER},sidebarViewOnLoad:{value:-1,kind:E.VIEWER+E.PREFERENCE},scrollModeOnLoad:{value:-1,kind:E.VIEWER+E.PREFERENCE},spreadModeOnLoad:{value:-1,kind:E.VIEWER+E.PREFERENCE},textLayerMode:{value:1,kind:E.VIEWER+E.PREFERENCE},viewOnLoad:{value:0,kind:E.VIEWER+E.PREFERENCE},cMapPacked:{value:!0,kind:E.API},cMapUrl:{value:"../web/cmaps/",kind:E.API},disableAutoFetch:{value:!1,kind:E.API+E.PREFERENCE},disableFontFace:{value:!1,kind:E.API+E.PREFERENCE},disableRange:{value:!1,kind:E.API+E.PREFERENCE},disableStream:{value:!1,kind:E.API+E.PREFERENCE},docBaseUrl:{value:"",kind:E.API},enableHWA:{value:!0,kind:E.API+E.VIEWER+E.PREFERENCE},enableXfa:{value:!0,kind:E.API+E.PREFERENCE},fontExtraProperties:{value:!1,kind:E.API},isEvalSupported:{value:!0,kind:E.API},isOffscreenCanvasSupported:{value:!0,kind:E.API},maxImageSize:{value:-1,kind:E.API},pdfBug:{value:!1,kind:E.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:E.API},useSystemFonts:{value:void 0,kind:E.API,type:n5.BOOLEAN+n5.UNDEFINED},verbosity:{value:1,kind:E.API},workerPort:{value:null,kind:E.WORKER},workerSrc:{value:"../build/pdf.worker.mjs",kind:E.WORKER}};ma.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:E.VIEWER},ma.sandboxBundleSrc={value:"../build/pdf.sandbox.mjs",kind:E.VIEWER},ma.viewerCssTheme={value:0,kind:E.VIEWER+E.PREFERENCE};ma.disablePreferences={value:!1,kind:E.VIEWER};const Sa=new Map;for(const[l,e]of np)Sa.set(l,e);class ap{constructor(){throw new Error("Cannot initialize AppOptions.")}static get(e){var t;return Sa.has(e)?Sa.get(e):(t=ma[e])==null?void 0:t.value}static getAll(e=null,t=!1){const i=Object.create(null);for(const n in ma){const a=ma[n];e&&!(e&a.kind)||(i[n]=!t&&Sa.has(n)?Sa.get(n):a.value)}return i}static set(e,t){this.setAll({[e]:t})}static setAll(e,t=!1){let i;for(const n in e){const a=ma[n],s=e[n];if(!a||!(typeof s==typeof a.value||n5[(typeof s).toUpperCase()]&a.type))continue;const{kind:o}=a;t&&!(o&E.BROWSER||o&E.PREFERENCE)||(this.eventBus&&o&E.EVENT_DISPATCH&&(i||(i=new Map)).set(n,s),Sa.set(n,s))}if(i)for(const[n,a]of i)this.eventBus.dispatch(n.toLowerCase(),{source:this,value:a})}}U(ap,"eventBus");ap._checkDisablePreferences=()=>{if(ap.get("disablePreferences"))return!0;for(const[l]of Sa)if(!np.has(l)){console.warn('The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.');break}return!1};var bi;class t6{constructor(e){g(this,bi,null);this.pageIndex=e.pageIndex}async render(e="display"){e!=="display"||r(this,bi)||this._cancelled||b(this,bi,new H8({pageIndex:this.pageIndex}))}cancel(){this._cancelled=!0,r(this,bi)&&(r(this,bi).destroy(),b(this,bi,null))}setParent(e){var t;(t=r(this,bi))==null||t.setParent(e)}getDrawLayer(){return r(this,bi)}}bi=new WeakMap;const Sf={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},i6=/^H(\d+)$/;var Dt,_c,a5,$c,s5;class Kw{constructor(){g(this,_c);g(this,$c);g(this,Dt,void 0)}get renderingDone(){return r(this,Dt)!==void 0}render(e){if(r(this,Dt)!==void 0)return r(this,Dt);const t=m(this,$c,s5).call(this,e);return t==null||t.classList.add("structTree"),b(this,Dt,t)}hide(){r(this,Dt)&&!r(this,Dt).hidden&&(r(this,Dt).hidden=!0)}show(){var e;(e=r(this,Dt))!=null&&e.hidden&&(r(this,Dt).hidden=!1)}}Dt=new WeakMap,_c=new WeakSet,a5=function(e,t){const{alt:i,id:n,lang:a}=e;i!==void 0&&t.setAttribute("aria-label",$g(i)),n!==void 0&&t.setAttribute("aria-owns",n),a!==void 0&&t.setAttribute("lang",$g(a,!0))},$c=new WeakSet,s5=function(e){if(!e)return null;const t=document.createElement("span");if("role"in e){const{role:i}=e,n=i.match(i6);n?(t.setAttribute("role","heading"),t.setAttribute("aria-level",n[1])):Sf[i]&&t.setAttribute("role",Sf[i])}if(m(this,_c,a5).call(this,e,t),e.children)if(e.children.length===1&&"id"in e.children[0])m(this,_c,a5).call(this,e.children[0],t);else for(const i of e.children)t.append(m(this,$c,s5).call(this,i));return t};var on,It,ln,na,hl,Og,eu,o5;const Nr=class Nr{constructor(){g(this,eu);g(this,on,!1);g(this,It,null);g(this,ln,new Map);g(this,na,new Map)}setTextMapping(e){b(this,It,e)}enable(){if(r(this,on))throw new Error("TextAccessibilityManager is already enabled.");if(!r(this,It))throw new Error("Text divs and strings have not been set.");if(b(this,on,!0),b(this,It,r(this,It).slice()),r(this,It).sort(m(Nr,hl,Og)),r(this,ln).size>0){const e=r(this,It);for(const[t,i]of r(this,ln)){if(!document.getElementById(t)){r(this,ln).delete(t);continue}m(this,eu,o5).call(this,t,e[i])}}for(const[e,t]of r(this,na))this.addPointerInTextLayer(e,t);r(this,na).clear()}disable(){r(this,on)&&(r(this,na).clear(),b(this,It,null),b(this,on,!1))}removePointerInTextLayer(e){if(!r(this,on)){r(this,na).delete(e);return}const t=r(this,It);if(!t||t.length===0)return;const{id:i}=e,n=r(this,ln).get(i);if(n===void 0)return;const a=t[n];r(this,ln).delete(i);let s=a.getAttribute("aria-owns");s!=null&&s.includes(i)&&(s=s.split(" ").filter(o=>o!==i).join(" "),s?a.setAttribute("aria-owns",s):(a.removeAttribute("aria-owns"),a.setAttribute("role","presentation")))}addPointerInTextLayer(e,t){const{id:i}=e;if(!i)return null;if(!r(this,on))return r(this,na).set(e,t),null;t&&this.removePointerInTextLayer(e);const n=r(this,It);if(!n||n.length===0)return null;const a=ud(n,h=>{var c;return m(c=Nr,hl,Og).call(c,e,h)<0}),s=Math.max(0,a-1),o=n[s];m(this,eu,o5).call(this,i,o),r(this,ln).set(i,s);const d=o.parentNode;return d!=null&&d.classList.contains("markedContent")?d.id:null}moveElementInDOM(e,t,i,n){const a=this.addPointerInTextLayer(i,n);if(!e.hasChildNodes())return e.append(t),a;const s=Array.from(e.childNodes).filter(h=>h!==t);if(s.length===0)return a;const o=i||t,d=ud(s,h=>{var c;return m(c=Nr,hl,Og).call(c,o,h)<0});return d===0?s[0].before(t):s[d-1].after(t),a}};on=new WeakMap,It=new WeakMap,ln=new WeakMap,na=new WeakMap,hl=new WeakSet,Og=function(e,t){const i=e.getBoundingClientRect(),n=t.getBoundingClientRect();if(i.width===0&&i.height===0)return 1;if(n.width===0&&n.height===0)return-1;const a=i.y,s=i.y+i.height,o=i.y+i.height/2,d=n.y,h=n.y+n.height,c=n.y+n.height/2;if(o<=d&&c>=s)return-1;if(c<=a&&o>=h)return 1;const u=i.x+i.width/2,p=n.x+n.width/2;return u-p},eu=new WeakSet,o5=function(e,t){const i=t.getAttribute("aria-owns");i!=null&&i.includes(e)||t.setAttribute("aria-owns",i?`${i} ${e}`:e),t.removeAttribute("role")},g(Nr,hl);let r5=Nr;var aa;class n6{constructor({findController:e,eventBus:t,pageIndex:i}){g(this,aa,null);this.findController=e,this.matches=[],this.eventBus=t,this.pageIdx=i,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(e,t){this.textDivs=e,this.textContentItemsStr=t}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,r(this,aa)||(b(this,aa,new AbortController),this.eventBus._on("updatetextlayermatches",e=>{(e.pageIndex===this.pageIdx||e.pageIndex===-1)&&this._updateMatches()},{signal:r(this,aa).signal})),this._updateMatches()}disable(){var e;this.enabled&&(this.enabled=!1,(e=r(this,aa))==null||e.abort(),b(this,aa,null),this._updateMatches(!0))}_convertMatches(e,t){if(!e)return[];const{textContentItemsStr:i}=this;let n=0,a=0;const s=i.length-1,o=[];for(let d=0,h=e.length;d=a+i[n].length;)a+=i[n].length,n++;n===i.length&&console.error("Could not find a matching mapping");const u={begin:{divIdx:n,offset:c-a}};for(c+=t[d];n!==s&&c>a+i[n].length;)a+=i[n].length,n++;u.end={divIdx:n,offset:c-a},o.push(u)}return o}_renderMatches(e){if(e.length===0)return;const{findController:t,pageIdx:i}=this,{textContentItemsStr:n,textDivs:a}=this,s=i===t.selected.pageIdx,o=t.selected.matchIdx,d=t.state.highlightAll;let h=null;const c={divIdx:-1,offset:void 0};function u(x,M){const v=x.divIdx;return a[v].textContent="",p(v,0,x.offset,M)}function p(x,M,v,I){let S=a[x];if(S.nodeType===Node.TEXT_NODE){const P=document.createElement("span");S.before(P),P.append(S),a[x]=P,S=P}const D=n[x].substring(M,v),T=document.createTextNode(D);if(I){const P=document.createElement("span");return P.className=`${I} appended`,P.append(T),S.append(P),I.includes("selected")?P.offsetLeft:0}return S.append(T),0}let f=o,w=f+1;if(d)f=0,w=e.length;else if(!s)return;let A=-1,y=-1;for(let x=f;x{e.classList.add("active")}),t.addEventListener("copy",n=>{if(!r(this,tu)){const a=document.getSelection();n.clipboardData.setData("text/plain",$g(J8(a.toString())))}n.preventDefault(),n.stopPropagation()}),r(Pi,Ct).set(t,e),m(i=Pi,f1,Xw).call(i)},b1=new WeakSet,qw=function(e){var t;r(this,Ct).delete(e),r(this,Ct).size===0&&((t=r(this,sa))==null||t.abort(),b(this,sa,null))},f1=new WeakSet,Xw=function(){if(r(this,sa))return;b(this,sa,new AbortController);const{signal:e}=r(this,sa),t=(a,s)=>{s.append(a),a.style.width="",a.style.height="",a.classList.remove("active")};document.addEventListener("pointerup",()=>{r(this,Ct).forEach(t)},{signal:e});var i,n;document.addEventListener("selectionchange",()=>{const a=document.getSelection();if(a.rangeCount===0){r(this,Ct).forEach(t);return}const s=new Set;for(let p=0;p{s===this._optionalContentConfigPromise&&(r(this,dn).initialOptionalContent=o.hasInitialVisibility)}),e.l10n||this.l10n.translate(this.div)}}get renderingState(){return r(this,cl)}set renderingState(e){if(e!==r(this,cl))switch(b(this,cl,e),r(this,oa)&&(clearTimeout(r(this,oa)),b(this,oa,null)),e){case he.PAUSED:this.div.classList.remove("loading");break;case he.RUNNING:this.div.classList.add("loadingIcon"),b(this,oa,setTimeout(()=>{this.div.classList.add("loading"),b(this,oa,null)},0));break;case he.INITIAL:case he.FINISHED:this.div.classList.remove("loadingIcon","loading");break}}setPdfPage(e){var i,n,a,s;this._isStandalone&&(((i=this.pageColors)==null?void 0:i.foreground)==="CanvasText"||((n=this.pageColors)==null?void 0:n.background)==="Canvas")&&((a=this._container)==null||a.style.setProperty("--hcm-highlight-filter",e.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),(s=this._container)==null||s.style.setProperty("--hcm-highlight-selected-filter",e.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","Highlight"))),this.pdfPage=e,this.pdfPageRotate=e.rotate;const t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*Ri.PDF_TO_CSS_UNITS,rotation:t}),m(this,gl,Wg).call(this),this.reset()}destroy(){var e;this.reset(),(e=this.pdfPage)==null||e.cleanup()}hasEditableAnnotations(){var e;return!!((e=this.annotationLayer)!=null&&e.hasEditableAnnotations())}get _textHighlighter(){return tp(this,"_textHighlighter",new n6({pageIndex:this.id-1,eventBus:this.eventBus,findController:r(this,ra).findController}))}_resetZoomLayer(e=!1){if(!this.zoomLayer)return;const t=this.zoomLayer.firstChild;r(this,qs).delete(t),t.width=0,t.height=0,e&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:e=!1,keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:n=!1,keepTextLayer:a=!1}={}){var f,w,A,y,x;this.cancelRendering({keepAnnotationLayer:t,keepAnnotationEditorLayer:i,keepXfaLayer:n,keepTextLayer:a}),this.renderingState=he.INITIAL;const s=this.div,o=s.childNodes,d=e&&this.zoomLayer||null,h=t&&((f=this.annotationLayer)==null?void 0:f.div)||null,c=i&&((w=this.annotationEditorLayer)==null?void 0:w.div)||null,u=n&&((A=this.xfaLayer)==null?void 0:A.div)||null,p=a&&((y=this.textLayer)==null?void 0:y.div)||null;for(let M=o.length-1;M>=0;M--){const v=o[M];switch(v){case d:case h:case c:case u:case p:continue}v.remove();const I=r(this,la).indexOf(v);I>=0&&(r(this,la)[I]=null)}s.removeAttribute("data-loaded"),h&&this.annotationLayer.hide(),c&&this.annotationEditorLayer.hide(),u&&this.xfaLayer.hide(),p&&this.textLayer.hide(),(x=this.structTreeLayer)==null||x.hide(),d||(this.canvas&&(r(this,qs).delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer())}toggleEditingMode(e){this.hasEditableAnnotations()&&(b(this,au,e),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0}))}update({scale:e=0,rotation:t=null,optionalContentConfigPromise:i=null,drawingDelay:n=-1}){var s;this.scale=e||this.scale,typeof t=="number"&&(this.rotation=t),i instanceof Promise&&(this._optionalContentConfigPromise=i,i.then(o=>{i===this._optionalContentConfigPromise&&(r(this,dn).initialOptionalContent=o.hasInitialVisibility)})),r(this,dn).directDrawing=!0;const a=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*Ri.PDF_TO_CSS_UNITS,rotation:a}),m(this,gl,Wg).call(this),this._isStandalone&&((s=this._container)==null||s.style.setProperty("--scale-factor",this.viewport.scale)),this.canvas){let o=!1;if(r(this,Ks)){if(this.maxCanvasPixels===0)o=!0;else if(this.maxCanvasPixels>0){const{width:h,height:c}=this.viewport,{sx:u,sy:p}=this.outputScale;o=(Math.floor(h)*u|0)*(Math.floor(c)*p|0)>this.maxCanvasPixels}}const d=n>=0&&n<1e3;if(d||o){if(d&&!o&&this.renderingState!==he.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:n}),this.renderingState=he.FINISHED,r(this,dn).directDrawing=!1),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!d,hideTextLayer:d}),d)return;this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:r(this,Hs)});return}!this.zoomLayer&&!this.canvas.hidden&&(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:i=!1,keepTextLayer:n=!1,cancelExtraDelay:a=0}={}){var s;this.renderTask&&(this.renderTask.cancel(a),this.renderTask=null),this.resume=null,this.textLayer&&(!n||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationLayer&&(!e||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.annotationEditorLayer&&(!t||!this.annotationEditorLayer.div)&&(this.drawLayer&&(this.drawLayer.cancel(),this.drawLayer=null),this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!i||!this.xfaLayer.div)&&(this.xfaLayer.cancel(),this.xfaLayer=null,(s=this._textHighlighter)==null||s.disable())}cssTransform({target:e,redrawAnnotationLayer:t=!1,redrawAnnotationEditorLayer:i=!1,redrawXfaLayer:n=!1,redrawTextLayer:a=!1,hideTextLayer:s=!1}){var d;if(!e.hasAttribute("zooming")){e.setAttribute("zooming",!0);const{style:h}=e;h.width=h.height=""}const o=r(this,qs).get(e);if(this.viewport!==o){const h=this.viewport.rotation-o.rotation,c=Math.abs(h);let u=1,p=1;if(c===90||c===270){const{width:f,height:w}=this.viewport;u=w/f,p=f/w}e.style.transform=`rotate(${h}deg) scale(${u}, ${p})`}t&&this.annotationLayer&&m(this,ru,l5).call(this),i&&this.annotationEditorLayer&&(this.drawLayer&&m(this,lu,h5).call(this),m(this,ou,d5).call(this)),n&&this.xfaLayer&&m(this,du,c5).call(this),this.textLayer&&(s?(this.textLayer.hide(),(d=this.structTreeLayer)==null||d.hide()):a&&m(this,hu,u5).call(this))}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}async draw(){this.renderingState!==he.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());const{div:e,l10n:t,pageColors:i,pdfPage:n,viewport:a}=this;if(!n)throw this.renderingState=he.FINISHED,new Error("pdfPage is not loaded");this.renderingState=he.RUNNING;const s=document.createElement("div");if(s.classList.add("canvasWrapper"),m(this,da,Cr).call(this,s,"canvasWrapper"),!this.textLayer&&r(this,ul)!==yi.DISABLE&&!n.isPureXfa&&(this._accessibilityManager||(this._accessibilityManager=new r5),this.textLayer=new sp({pdfPage:n,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:r(this,ul)===yi.ENABLE_PERMISSIONS,onAppend:D=>{this.l10n.pause(),m(this,da,Cr).call(this,D,"textLayer"),this.l10n.resume()}})),!this.annotationLayer&&r(this,Ys)!==un.DISABLE){const{annotationStorage:D,annotationEditorUIManager:T,downloadManager:P,enableScripting:C,fieldObjectsPromise:N,hasJSActionsPromise:R,linkService:L}=r(this,ra);this._annotationCanvasMap||(this._annotationCanvasMap=new Map),this.annotationLayer=new Rw({pdfPage:n,annotationStorage:D,imageResourcesPath:this.imageResourcesPath,renderForms:r(this,Ys)===un.ENABLE_FORMS,linkService:L,downloadManager:P,enableScripting:C,hasJSActionsPromise:R,fieldObjectsPromise:N,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:T,onAppend:k=>{m(this,da,Cr).call(this,k,"annotationLayer")}})}const o=D=>{if(p==null||p(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)){this.renderingState=he.PAUSED,this.resume=()=>{this.renderingState=he.RUNNING,D()};return}D()},{width:d,height:h}=a,c=document.createElement("canvas");c.setAttribute("role","presentation"),c.hidden=!0;const u=!!(i!=null&&i.background&&(i!=null&&i.foreground));let p=D=>{(!u||D)&&(c.hidden=!1,p=null)};s.append(c),this.canvas=c;const f=c.getContext("2d",{alpha:!1,willReadFrequently:!r(this,nu)}),w=this.outputScale=new h8;if(this.maxCanvasPixels===0){const D=1/this.scale;w.sx*=D,w.sy*=D,b(this,Ks,!0)}else if(this.maxCanvasPixels>0){const D=d*h,T=Math.sqrt(this.maxCanvasPixels/D);w.sx>T||w.sy>T?(w.sx=T,w.sy=T,b(this,Ks,!0)):b(this,Ks,!1)}const A=ef(w.sx),y=ef(w.sy);c.width=qu(d*w.sx,A[0]),c.height=qu(h*w.sy,y[0]);const{style:x}=c;x.width=qu(d,A[1])+"px",x.height=qu(h,y[1])+"px",r(this,qs).set(c,a);const M=w.scaled?[w.sx,0,0,w.sy,0,0]:null,v={canvasContext:f,transform:M,viewport:a,annotationMode:r(this,Ys),optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:i,isEditing:r(this,au)},I=this.renderTask=n.render(v);I.onContinue=o;const S=I.promise.then(async()=>{var T;p==null||p(!0),await m(this,cu,g5).call(this,I),m(this,hu,u5).call(this),this.annotationLayer&&await m(this,ru,l5).call(this);const{annotationEditorUIManager:D}=r(this,ra);D&&(this.drawLayer||(this.drawLayer=new t6({pageIndex:this.id})),await m(this,lu,h5).call(this),this.drawLayer.setParent(s),this.annotationEditorLayer||(this.annotationEditorLayer=new e6({uiManager:D,pdfPage:n,l10n:t,accessibilityManager:this._accessibilityManager,annotationLayer:(T=this.annotationLayer)==null?void 0:T.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:P=>{m(this,da,Cr).call(this,P,"annotationEditorLayer")}})),m(this,ou,d5).call(this))},D=>(D instanceof qb||p==null||p(!0),m(this,cu,g5).call(this,I,D)));if(n.isPureXfa){if(!this.xfaLayer){const{annotationStorage:D,linkService:T}=r(this,ra);this.xfaLayer=new Jw({pdfPage:n,annotationStorage:D,linkService:T})}m(this,du,c5).call(this)}return e.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),S}setPageLabel(e){this.pageLabel=typeof e=="string"?e:null,this.div.setAttribute("data-l10n-args",JSON.stringify({page:this.pageLabel??this.id})),this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){const{directDrawing:e,initialOptionalContent:t,regularAnnotations:i}=r(this,dn);return e&&t&&i?this.canvas:null}}Ys=new WeakMap,nu=new WeakMap,Ks=new WeakMap,au=new WeakMap,ra=new WeakMap,oa=new WeakMap,su=new WeakMap,Hs=new WeakMap,cl=new WeakMap,ul=new WeakMap,dn=new WeakMap,qs=new WeakMap,la=new WeakMap,da=new WeakSet,Cr=function(e,t){const i=s6.get(t),n=r(this,la)[i];if(r(this,la)[i]=e,n){n.replaceWith(e);return}for(let a=i-1;a>=0;a--){const s=r(this,la)[a];if(s){s.after(e);return}}this.div.prepend(e)},gl=new WeakSet,Wg=function(){const{viewport:e}=this;if(this.pdfPage){if(r(this,su)===e.rotation)return;b(this,su,e.rotation)}_8(this.div,e,!0,!1)},Xs=new WeakSet,_l=function(e,t){this.eventBus.dispatch(e,{source:this,pageNumber:this.id,error:t})},ru=new WeakSet,l5=async function(){let e=null;try{await this.annotationLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationLayer: "${t}".`),e=t}finally{m(this,Xs,_l).call(this,"annotationlayerrendered",e)}},ou=new WeakSet,d5=async function(){let e=null;try{await this.annotationEditorLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationEditorLayer: "${t}".`),e=t}finally{m(this,Xs,_l).call(this,"annotationeditorlayerrendered",e)}},lu=new WeakSet,h5=async function(){try{await this.drawLayer.render("display")}catch(e){console.error(`#renderDrawLayer: "${e}".`)}},du=new WeakSet,c5=async function(){var t;let e=null;try{const i=await this.xfaLayer.render(this.viewport,"display");i!=null&&i.textDivs&&this._textHighlighter&&m(this,A1,eA).call(this,i.textDivs)}catch(i){console.error(`#renderXfaLayer: "${i}".`),e=i}finally{(t=this.xfaLayer)!=null&&t.div&&(this.l10n.pause(),m(this,da,Cr).call(this,this.xfaLayer.div,"xfaLayer"),this.l10n.resume()),m(this,Xs,_l).call(this,"xfalayerrendered",e)}},hu=new WeakSet,u5=async function(){if(!this.textLayer)return;let e=null;try{await this.textLayer.render(this.viewport)}catch(t){if(t instanceof Q8)return;console.error(`#renderTextLayer: "${t}".`),e=t}m(this,Xs,_l).call(this,"textlayerrendered",e),m(this,w1,$w).call(this)},w1=new WeakSet,$w=async function(){var i,n,a;if(!this.textLayer)return;this.structTreeLayer||(this.structTreeLayer=new Kw);const e=await(this.structTreeLayer.renderingDone?null:this.pdfPage.getStructTree()),t=(i=this.structTreeLayer)==null?void 0:i.render(e);t&&(this.l10n.pause(),(n=this.canvas)==null||n.append(t),this.l10n.resume()),(a=this.structTreeLayer)==null||a.show()},A1=new WeakSet,eA=async function(e){const t=await this.pdfPage.getTextContent(),i=[];for(const n of t.items)i.push(n.str);this._textHighlighter.setTextMapping(e,i),this._textHighlighter.enable()},cu=new WeakSet,g5=async function(e,t=null){if(e===this.renderTask&&(this.renderTask=null),t instanceof qb){b(this,Hs,null);return}if(b(this,Hs,t),this.renderingState=he.FINISHED,this._resetZoomLayer(!0),r(this,dn).regularAnnotations=!e.separateAnnots,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:r(this,Hs)}),t)throw t};async function r6(l){const e="",t=e.split("#",1)[0];let{info:i,metadata:n,contentDispositionFilename:a,contentLength:s}=await l.getMetadata();if(!s){const{length:o}=await l.getDownloadInfo();s=o}return{...i,baseURL:t,filesize:s,filename:a||q8(e),metadata:n==null?void 0:n.getRaw(),authors:n==null?void 0:n.get("dc:creator"),numPages:l.numPages,URL:e}}class o6{constructor(e){this._ready=new Promise((t,i)=>{Sr(()=>import(e),__vite__mapDeps([]),import.meta.url).then(a=>{t(a.QuickJSSandbox())}).catch(i)})}async createSandbox(e){(await this._ready).create(e)}async dispatchEventInSandbox(e){const t=await this._ready;setTimeout(()=>t.dispatchEvent(e),0)}async destroySandbox(){(await this._ready).nukeSandbox()}}var wi,Js,uu,_s,$s,gu,Je,hn,pl,ve,St,x1,tA,ml,zg,pu,p5,y1,iA,er,$l;class l6{constructor({eventBus:e,externalServices:t=null,docProperties:i=null}){g(this,x1);g(this,ml);g(this,pu);g(this,y1);g(this,er);g(this,wi,null);g(this,Js,null);g(this,uu,null);g(this,_s,null);g(this,$s,null);g(this,gu,null);g(this,Je,null);g(this,hn,null);g(this,pl,!1);g(this,ve,null);g(this,St,null);b(this,$s,e),b(this,gu,t),b(this,uu,i)}setViewer(e){b(this,hn,e)}async setDocument(e){var o;if(r(this,Je)&&await m(this,er,$l).call(this),b(this,Je,e),!e)return;const[t,i,n]=await Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(!t&&!n){await m(this,er,$l).call(this);return}if(e!==r(this,Je))return;try{b(this,ve,m(this,y1,iA).call(this))}catch(d){console.error(`setDocument: "${d.message}".`),await m(this,er,$l).call(this);return}const a=r(this,$s);b(this,_s,new AbortController);const{signal:s}=r(this,_s);a._on("updatefromsandbox",d=>{(d==null?void 0:d.source)===window&&m(this,x1,tA).call(this,d.detail)},{signal:s}),a._on("dispatcheventinsandbox",d=>{var h;(h=r(this,ve))==null||h.dispatchEventInSandbox(d.detail)},{signal:s}),a._on("pagechanging",({pageNumber:d,previous:h})=>{d!==h&&(m(this,pu,p5).call(this,h),m(this,ml,zg).call(this,d))},{signal:s}),a._on("pagerendered",({pageNumber:d})=>{this._pageOpenPending.has(d)&&d===r(this,hn).currentPageNumber&&m(this,ml,zg).call(this,d)},{signal:s}),a._on("pagesdestroy",async()=>{var d,h;await m(this,pu,p5).call(this,r(this,hn).currentPageNumber),await((d=r(this,ve))==null?void 0:d.dispatchEventInSandbox({id:"doc",name:"WillClose"})),(h=r(this,wi))==null||h.resolve()},{signal:s});try{const d=await r(this,uu).call(this,e);if(e!==r(this,Je))return;await r(this,ve).createSandbox({objects:t,calculationOrder:i,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:{...d,actions:n}}),a.dispatch("sandboxcreated",{source:this})}catch(d){console.error(`setDocument: "${d.message}".`),await m(this,er,$l).call(this);return}await((o=r(this,ve))==null?void 0:o.dispatchEventInSandbox({id:"doc",name:"Open"})),await m(this,ml,zg).call(this,r(this,hn).currentPageNumber,!0),Promise.resolve().then(()=>{e===r(this,Je)&&b(this,pl,!0)})}async dispatchWillSave(){var e;return(e=r(this,ve))==null?void 0:e.dispatchEventInSandbox({id:"doc",name:"WillSave"})}async dispatchDidSave(){var e;return(e=r(this,ve))==null?void 0:e.dispatchEventInSandbox({id:"doc",name:"DidSave"})}async dispatchWillPrint(){var e;if(r(this,ve)){await((e=r(this,St))==null?void 0:e.promise),b(this,St,Promise.withResolvers());try{await r(this,ve).dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(t){throw r(this,St).resolve(),b(this,St,null),t}await r(this,St).promise}}async dispatchDidPrint(){var e;return(e=r(this,ve))==null?void 0:e.dispatchEventInSandbox({id:"doc",name:"DidPrint"})}get destroyPromise(){var e;return((e=r(this,Js))==null?void 0:e.promise)||null}get ready(){return r(this,pl)}get _pageOpenPending(){return tp(this,"_pageOpenPending",new Set)}get _visitedPages(){return tp(this,"_visitedPages",new Map)}}wi=new WeakMap,Js=new WeakMap,uu=new WeakMap,_s=new WeakMap,$s=new WeakMap,gu=new WeakMap,Je=new WeakMap,hn=new WeakMap,pl=new WeakMap,ve=new WeakMap,St=new WeakMap,x1=new WeakSet,tA=async function(e){var h,c;const t=r(this,hn),i=t.isInPresentationMode||t.isChangingPresentationMode,{id:n,siblings:a,command:s,value:o}=e;if(!n){switch(s){case"clear":console.clear();break;case"error":console.error(o);break;case"layout":if(!i){const u=A8(o);t.spreadMode=u.spreadMode}break;case"page-num":t.currentPageNumber=o+1;break;case"print":await t.pagesPromise,r(this,$s).dispatch("print",{source:this});break;case"println":console.log(o);break;case"zoom":i||(t.currentScaleValue=o);break;case"SaveAs":r(this,$s).dispatch("download",{source:this});break;case"FirstPage":t.currentPageNumber=1;break;case"LastPage":t.currentPageNumber=t.pagesCount;break;case"NextPage":t.nextPage();break;case"PrevPage":t.previousPage();break;case"ZoomViewIn":i||t.increaseScale();break;case"ZoomViewOut":i||t.decreaseScale();break;case"WillPrintFinished":(h=r(this,St))==null||h.resolve(),b(this,St,null);break}return}if(i&&e.focus)return;delete e.id,delete e.siblings;const d=a?[n,...a]:[n];for(const u of d){const p=document.querySelector(`[data-element-id="${u}"]`);p?p.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:e})):(c=r(this,Je))==null||c.annotationStorage.setValue(u,e)}},ml=new WeakSet,zg=async function(e,t=!1){const i=r(this,Je),n=this._visitedPages;if(t&&b(this,wi,Promise.withResolvers()),!r(this,wi))return;const a=r(this,hn).getPageView(e-1);if((a==null?void 0:a.renderingState)!==he.FINISHED){this._pageOpenPending.add(e);return}this._pageOpenPending.delete(e);const s=(async()=>{var d,h;const o=await(n.has(e)?null:(d=a.pdfPage)==null?void 0:d.getJSActions());i===r(this,Je)&&await((h=r(this,ve))==null?void 0:h.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:e,actions:o}))})();n.set(e,s)},pu=new WeakSet,p5=async function(e){var a;const t=r(this,Je),i=this._visitedPages;if(!r(this,wi)||this._pageOpenPending.has(e))return;const n=i.get(e);n&&(i.set(e,null),await n,t===r(this,Je)&&await((a=r(this,ve))==null?void 0:a.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:e})))},y1=new WeakSet,iA=function(){if(b(this,Js,Promise.withResolvers()),r(this,ve))throw new Error("#initScripting: Scripting already exists.");return r(this,gu).createScripting()},er=new WeakSet,$l=async function(){var e,t,i,n;if(!r(this,ve)){b(this,Je,null),(e=r(this,Js))==null||e.resolve();return}r(this,wi)&&(await Promise.race([r(this,wi).promise,new Promise(a=>{setTimeout(a,1e3)})]).catch(()=>{}),b(this,wi,null)),b(this,Je,null);try{await r(this,ve).destroySandbox()}catch{}(t=r(this,St))==null||t.reject(new Error("Scripting destroyed.")),b(this,St,null),(i=r(this,_s))==null||i.abort(),b(this,_s,null),this._pageOpenPending.clear(),this._visitedPages.clear(),b(this,ve,null),b(this,pl,!1),(n=r(this,Js))==null||n.resolve()};class d6 extends l6{constructor(e){e.externalServices||window.addEventListener("updatefromsandbox",t=>{e.eventBus.dispatch("updatefromsandbox",{source:window,detail:t.detail})}),e.externalServices||(e.externalServices={createScripting:()=>new o6(e.sandboxBundleSrc)}),e.docProperties||(e.docProperties=t=>r6(t)),super(e)}}const h6=3e4;class c6{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}renderHighestPriority(e){var t;this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(e)&&(this.isThumbnailViewEnabled&&((t=this.pdfThumbnailViewer)!=null&&t.forceRendering())||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),h6)))}getHighestPriority(e,t,i,n=!1){const a=e.views,s=a.length;if(s===0)return null;for(let u=0;us){const u=e.ids;for(let p=1,f=d-o;p{this.renderHighestPriority()}).catch(t=>{t instanceof qb||console.error(`renderView: "${t}"`)});break}return!0}}const Tf=10,$u={FORCE_SCROLL_MODE_PAGE:1e4,FORCE_LAZY_PAGE_INIT:5e3,PAUSE_EAGER_PAGE_INIT:250};function Nf(l){return Object.values(Pt).includes(l)&&l!==Pt.DISABLE}var cn,tr,mu,m5;class u6{constructor(e){g(this,mu);g(this,cn,new Set);g(this,tr,0);b(this,tr,e)}push(e){const t=r(this,cn);t.has(e)&&t.delete(e),t.add(e),t.size>r(this,tr)&&m(this,mu,m5).call(this)}resize(e,t=null){b(this,tr,e);const i=r(this,cn);if(t){const n=i.size;let a=1;for(const s of i)if(t.has(s.id)&&(i.delete(s),i.add(s)),++a>n)break}for(;i.size>r(this,tr);)m(this,mu,m5).call(this)}has(e){return r(this,cn).has(e)}[Symbol.iterator](){return r(this,cn).keys()}}cn=new WeakMap,tr=new WeakMap,mu=new WeakSet,m5=function(){const e=r(this,cn).keys().next().value;e==null||e.destroy(),r(this,cn).delete(e)};var ha,bu,fu,Ai,Ze,ir,wu,Au,xu,yu,Mu,ca,vu,ua,nr,bl,ga,fl,Du,wl,ar,pa,Al,M1,aA,v1,sA,D1,rA,sr,ed,xl,Qg,I1,oA,Iu,b5,C1,lA,xi,Mn,Cu,f5,S1,dA,T1,hA,N1,cA,Su,w5,P1,uA,yl,Vg;class nA{constructor(e){g(this,M1);g(this,v1);g(this,D1);g(this,sr);g(this,xl);g(this,I1);g(this,Iu);g(this,C1);g(this,xi);g(this,Cu);g(this,S1);g(this,T1);g(this,N1);g(this,Su);g(this,P1);g(this,yl);g(this,ha,null);g(this,bu,null);g(this,fu,null);g(this,Ai,Pt.NONE);g(this,Ze,null);g(this,ir,un.ENABLE_FORMS);g(this,wu,null);g(this,Au,!1);g(this,xu,!1);g(this,yu,!1);g(this,Mu,!1);g(this,ca,null);g(this,vu,null);g(this,ua,null);g(this,nr,null);g(this,bl,!1);g(this,ga,null);g(this,fl,!1);g(this,Du,0);g(this,wl,new ResizeObserver(m(this,P1,uA).bind(this)));g(this,ar,null);g(this,pa,null);g(this,Al,yi.ENABLE);var n,a;const t="4.5.136";if(hf!==t)throw new Error(`The API version "${hf}" does not match the Viewer version "${t}".`);if(this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,((n=this.container)==null?void 0:n.tagName)!=="DIV"||((a=this.viewer)==null?void 0:a.tagName)!=="DIV")throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!=="absolute")throw new Error("The `container` must be absolutely positioned.");r(this,wl).observe(this.container),this.eventBus=e.eventBus,this.linkService=e.linkService||new X5,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,b(this,bu,e.altTextManager||null),this.findController&&(this.findController.onIsPageVisible=s=>this._getVisiblePages().ids.has(s)),this._scriptingManager=e.scriptingManager||null,b(this,Al,e.textLayerMode??yi.ENABLE),b(this,ir,e.annotationMode??un.ENABLE_FORMS),b(this,Ai,e.annotationEditorMode??Pt.NONE),b(this,fu,e.annotationEditorHighlightColors||null),b(this,xu,e.enableHighlightFloatingButton===!0),b(this,Mu,e.enableUpdatedAddImage===!0),this.imageResourcesPath=e.imageResourcesPath||"",this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.removePageBorders=e.removePageBorders||!1,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n,this.l10n||(this.l10n=new Il),b(this,yu,e.enablePermissions||!1),this.pageColors=e.pageColors||null,b(this,vu,e.mlManager||null),b(this,Au,e.enableHWA||!1),this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new c6,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue;const{abortSignal:i}=e;i==null||i.addEventListener("abort",()=>{r(this,wl).disconnect(),b(this,wl,null)},{once:!0}),this.scroll=c8(this.container,this._scrollUpdate.bind(this),i),this.presentationModeState=Br.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),m(this,Su,w5).call(this),this.eventBus._on("thumbnailrendered",({pageNumber:s,pdfPage:o})=>{const d=this._pages[s-1];r(this,ha).has(d)||o==null||o.cleanup()}),e.l10n||this.l10n.translate(this.container)}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}getCachedPageViews(){return new Set(r(this,ha))}get pageViewsReady(){return this._pages.every(e=>e==null?void 0:e.pdfPage)}get renderForms(){return r(this,ir)===un.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(e,!0)||console.error(`currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){var n;if(this._currentPageNumber===e)return t&&m(this,Cu,f5).call(this),!0;if(!(0=0&&(t=i+1)}this._setCurrentPageNumber(t,!0)||console.error(`currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==lm?this._currentScale:xw}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&m(this,xi,Mn).call(this,e,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&m(this,xi,Mn).call(this,e,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!Mw(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(e%=360,e<0&&(e+=360),this._pagesRotation===e))return;this._pagesRotation=e;const t=this._currentPageNumber;this.refresh(!0,{rotation:e}),this._currentScaleValue&&m(this,xi,Mn).call(this,this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:e,pageNumber:t}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _layerProperties(){const e=this;return tp(this,"_layerProperties",{get annotationEditorUIManager(){return r(e,Ze)},get annotationStorage(){var t;return(t=e.pdfDocument)==null?void 0:t.annotationStorage},get downloadManager(){return e.downloadManager},get enableScripting(){return!!e._scriptingManager},get fieldObjectsPromise(){var t;return(t=e.pdfDocument)==null?void 0:t.getFieldObjects()},get findController(){return e.findController},get hasJSActionsPromise(){var t;return(t=e.pdfDocument)==null?void 0:t.hasJSActions()},get linkService(){return e.linkService}})}async getAllText(){const e=[],t=[];for(let i=1,n=this.pdfDocument.numPages;i<=n;++i){if(r(this,fl))return null;t.length=0;const a=await this.pdfDocument.getPage(i),{items:s}=await a.getTextContent();for(const o of s)o.str&&t.push(o.str),o.hasEOL&&t.push(` `);e.push($g(t.join("")))}return e.join(` -`)}setDocument(e){var p,f;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(p=this.findController)==null||p.setDocument(null),(f=this._scriptingManager)==null||f.setDocument(null),r(this,Ze)&&(r(this,Ze).destroy(),b(this,Ze,null))),this.pdfDocument=e,!e)return;const t=e.numPages,i=e.getPage(1),n=e.getOptionalContentConfig({intent:"display"}),a=r(this,yu)?e.getPermissions():Promise.resolve(),{eventBus:s,pageColors:o,viewer:d}=this;b(this,ca,new AbortController);const{signal:h}=r(this,ca);if(t>$u.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const w=this._scrollMode=H.PAGE;s.dispatch("scrollmodechanged",{source:this,mode:w})}this._pagesCapability.promise.then(()=>{s.dispatch("pagesloaded",{source:this,pagesCount:t})},()=>{});const c=w=>{const A=this._pages[w.pageNumber-1];A&&r(this,ha).push(A)};s._on("pagerender",c,{signal:h});const u=w=>{w.cssTransform||(this._onePageRenderedCapability.resolve({timestamp:w.timestamp}),s._off("pagerendered",u))};s._on("pagerendered",u,{signal:h}),Promise.all([i,a]).then(([w,A])=>{var D;if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(w),this._optionalContentConfigPromise=n;const{annotationEditorMode:y,annotationMode:x,textLayerMode:M}=m(this,M1,aA).call(this,A);if(M!==yi.DISABLE){const T=b(this,ga,document.createElement("div"));T.id="hiddenCopyElement",d.before(T)}if(y!==Pt.DISABLE){const T=y;e.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):Nf(T)?(b(this,Ze,new Z8(this.container,d,r(this,bu),s,e,o,r(this,fu),r(this,xu),r(this,Mu),r(this,vu))),s.dispatch("annotationeditoruimanager",{source:this,uiManager:r(this,Ze)}),T!==Pt.NONE&&r(this,Ze).updateMode(T)):console.error(`Invalid AnnotationEditor mode: ${T}`)}const v=this._scrollMode===H.PAGE?null:d,I=this.currentScale,S=w.getViewport({scale:I*Ri.PDF_TO_CSS_UNITS});d.style.setProperty("--scale-factor",S.scale),((o==null?void 0:o.foreground)==="CanvasText"||(o==null?void 0:o.background)==="Canvas")&&(d.style.setProperty("--hcm-highlight-filter",e.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),d.style.setProperty("--hcm-highlight-selected-filter",e.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let T=1;T<=t;++T){const P=new _w({container:v,eventBus:s,id:T,scale:I,defaultViewport:S.clone(),optionalContentConfigPromise:n,renderingQueue:this.renderingQueue,textLayerMode:M,annotationMode:x,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,pageColors:o,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:r(this,Au)});this._pages.push(P)}(D=this._pages[0])==null||D.setPdfPage(w),this._scrollMode===H.PAGE?m(this,sr,ed).call(this):this._spreadMode!==Ye.NONE&&this._updateSpreadMode(),m(this,v1,sA).call(this,h).then(async()=>{var P,C;if(e!==this.pdfDocument)return;if((P=this.findController)==null||P.setDocument(e),(C=this._scriptingManager)==null||C.setDocument(e),r(this,ga)&&document.addEventListener("copy",m(this,D1,rA).bind(this,M),{signal:h}),r(this,Ze)&&s.dispatch("annotationeditormodechanged",{source:this,mode:r(this,Ai)}),e.loadingParams.disableAutoFetch||t>$u.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let T=t-1;if(T<=0){this._pagesCapability.resolve();return}for(let N=2;N<=t;++N){const R=e.getPage(N).then(L=>{const k=this._pages[N-1];k.pdfPage||k.setPdfPage(L),--T===0&&this._pagesCapability.resolve()},L=>{console.error(`Unable to get page ${N} to initialize viewer`,L),--T===0&&this._pagesCapability.resolve()});N%$u.PAUSE_EAGER_PAGE_INIT===0&&await R}}),s.dispatch("pagesinit",{source:this}),e.getMetadata().then(({info:T})=>{e===this.pdfDocument&&T.Language&&(d.lang=T.Language)}),this.defaultRenderingQueue&&this.update()}).catch(w=>{console.error("Unable to initialize viewer",w),this._pagesCapability.reject(w)})}setPageLabels(e){var t;if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let i=0,n=this._pages.length;ithis.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const e=this._scrollMode===H.PAGE?r(this,ar).pages:this._pages,t=this._scrollMode===H.HORIZONTAL,i=t&&this._isContainerRtl;return g8({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:i})}cleanup(){for(const e of this._pages)e.renderingState!==he.FINISHED&&e.reset()}_cancelRendering(){for(const e of this._pages)e.cancelRendering()}forceRendering(e){const t=e||this._getVisiblePages(),i=m(this,N1,cA).call(this,t),n=this._spreadMode!==Ye.NONE&&this._scrollMode!==H.HORIZONTAL,a=this.renderingQueue.getHighestPriority(t,this._pages,i,n);return a?(m(this,T1,hA).call(this,a).then(()=>{this.renderingQueue.renderView(a)}),!0):!1}get hasEqualPageSizes(){const e=this._pages[0];for(let t=1,i=this._pages.length;t{const i=t.pdfPage.getViewport({scale:1}),n=tf(i);if(e===void 0)e=n;else if(this.enablePrintAutoRotate&&n!==e)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(e){if(!(e instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${e}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=e,this.refresh(!1,{optionalContentConfigPromise:e}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e}))}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!p8(e))throw new Error(`Invalid scroll mode: ${e}`);this.pagesCount>$u.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=e,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(e=null){const t=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",t===H.HORIZONTAL),i.classList.toggle("scrollWrapped",t===H.WRAPPED),!(!this.pdfDocument||!e)&&(t===H.PAGE?m(this,sr,ed).call(this):this._previousScrollMode===H.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&m(this,xi,Mn).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!m8(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;const t=this.viewer,i=this._pages;if(this._scrollMode===H.PAGE)m(this,sr,ed).call(this);else if(t.textContent="",this._spreadMode===Ye.NONE)for(const n of this._pages)t.append(n.div);else{const n=this._spreadMode-1;let a=null;for(let s=0,o=i.length;s=h;d--){const c=a[d],u=a[d+1]-1;if(cu)return u-e}if(t){const d=a[0];if(de)return d-e+1}break}break}case H.HORIZONTAL:break;case H.PAGE:case H.VERTICAL:{if(this._spreadMode===Ye.NONE)break;const i=this._spreadMode-1;if(t&&e%2!==i)break;if(!t&&e%2===i)break;const{views:n}=this._getVisiblePages(),a=t?e-1:e+1;for(const{id:s,percent:o,widthPercent:d}of n)if(s===a){if(o>0&&d===100)return 2;break}break}}return 1}nextPage(){const e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;const i=this._getPageAdvance(e,!1)||1;return this.currentPageNumber=Math.min(e+i,t),!0}previousPage(){const e=this._currentPageNumber;if(e<=1)return!1;const t=this._getPageAdvance(e,!0)||1;return this.currentPageNumber=Math.max(e-t,1),!0}updateScale({drawingDelay:e,scaleFactor:t=null,steps:i=null,origin:n}){if(i===null&&t===null)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let a=this._currentScale;if(t>0&&t!==1)a=Math.round(a*t*100)/100;else if(i){const s=i>0?X2:1/X2,o=i>0?Math.ceil:Math.floor;i=Math.abs(i);do a=o((a*s).toFixed(2)*10)/10;while(--i>0)}a=Math.max(o8,Math.min(l8,a)),m(this,xi,Mn).call(this,a,{noScroll:!1,drawingDelay:e,origin:n})}increaseScale(e={}){this.updateScale({...e,steps:e.steps??1})}decreaseScale(e={}){this.updateScale({...e,steps:-(e.steps??1)})}get containerTopLeft(){return r(this,wu)||b(this,wu,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return r(this,Ze)?r(this,Ai):Pt.DISABLE}set annotationEditorMode({mode:e,editId:t=null,isFromKeyboard:i=!1}){if(!r(this,Ze))throw new Error("The AnnotationEditor is not enabled.");if(r(this,Ai)===e)return;if(!Nf(e))throw new Error(`Invalid AnnotationEditor mode: ${e}`);if(!this.pdfDocument)return;const{eventBus:n}=this,a=()=>{m(this,yl,Vg).call(this),b(this,Ai,e),r(this,Ze).updateMode(e,t,i),n.dispatch("annotationeditormodechanged",{source:this,mode:e})};if(e===Pt.NONE||r(this,Ai)===Pt.NONE){const s=e!==Pt.NONE;s||this.pdfDocument.annotationStorage.resetModifiedIds();for(const d of this._pages)d.toggleEditingMode(s);const o=m(this,S1,dA).call(this);if(s&&o){m(this,yl,Vg).call(this),b(this,ua,({pageNumber:h})=>{o.delete(h),o.size===0&&b(this,nr,setTimeout(a,0))});const{signal:d}=r(this,ca);n._on("pagerendered",r(this,ua),{signal:d});return}}a()}set annotationEditorParams({type:e,value:t}){if(!r(this,Ze))throw new Error("The AnnotationEditor is not enabled.");r(this,Ze).updateParams(e,t)}refresh(e=!1,t=Object.create(null)){if(this.pdfDocument){for(const i of this._pages)i.update(t);r(this,pa)!==null&&(clearTimeout(r(this,pa)),b(this,pa,null)),e||this.update()}}}ha=new WeakMap,bu=new WeakMap,fu=new WeakMap,Ai=new WeakMap,Ze=new WeakMap,ir=new WeakMap,wu=new WeakMap,Au=new WeakMap,xu=new WeakMap,yu=new WeakMap,Mu=new WeakMap,ca=new WeakMap,vu=new WeakMap,ua=new WeakMap,nr=new WeakMap,bl=new WeakMap,ga=new WeakMap,fl=new WeakMap,Du=new WeakMap,wl=new WeakMap,ar=new WeakMap,pa=new WeakMap,Al=new WeakMap,M1=new WeakSet,aA=function(e){const t={annotationEditorMode:r(this,Ai),annotationMode:r(this,ir),textLayerMode:r(this,Al)};return e&&(!e.includes(Ju.COPY)&&r(this,Al)===yi.ENABLE&&(t.textLayerMode=yi.ENABLE_PERMISSIONS),e.includes(Ju.MODIFY_CONTENTS)||(t.annotationEditorMode=Pt.DISABLE),!e.includes(Ju.MODIFY_ANNOTATIONS)&&!e.includes(Ju.FILL_INTERACTIVE_FORMS)&&r(this,ir)===un.ENABLE_FORMS&&(t.annotationMode=un.ENABLE)),t},v1=new WeakSet,sA=async function(e){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;const t=Promise.withResolvers();function i(){document.visibilityState==="hidden"&&t.resolve()}document.addEventListener("visibilitychange",i,{signal:e}),await Promise.race([this._onePageRenderedCapability.promise,t.promise]),document.removeEventListener("visibilitychange",i)},D1=new WeakSet,rA=function(e,t){const i=document.getSelection(),{focusNode:n,anchorNode:a}=i;if(a&&n&&i.containsNode(r(this,ga))){if(r(this,bl)||e===yi.ENABLE_PERMISSIONS){t.preventDefault(),t.stopPropagation();return}b(this,bl,!0);const{classList:s}=this.viewer;s.add("copyAll");const o=new AbortController;window.addEventListener("keydown",d=>b(this,fl,d.key==="Escape"),{signal:o.signal}),this.getAllText().then(async d=>{d!==null&&await navigator.clipboard.writeText(d)}).catch(d=>{console.warn(`Something goes wrong when extracting the text: ${d.message}`)}).finally(()=>{b(this,bl,!1),b(this,fl,!1),o.abort(),s.remove("copyAll")}),t.preventDefault(),t.stopPropagation()}},sr=new WeakSet,ed=function(){if(this._scrollMode!==H.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const e=this._currentPageNumber,t=r(this,ar),i=this.viewer;if(i.textContent="",t.pages.length=0,this._spreadMode===Ye.NONE&&!this.isInPresentationMode){const n=this._pages[e-1];i.append(n.div),t.pages.push(n)}else{const n=new Set,a=this._spreadMode-1;a===-1?n.add(e-1):e%2!==a?(n.add(e-1),n.add(e)):(n.add(e-2),n.add(e-1));const s=document.createElement("div");if(s.className="spread",this.isInPresentationMode){const o=document.createElement("div");o.className="dummyPage",s.append(o)}for(const o of n){const d=this._pages[o];d&&(s.append(d.div),t.pages.push(d))}i.append(s)}t.scrollDown=e>=t.previousPageNumber,t.previousPageNumber=e},xl=new WeakSet,Qg=function(e,t=null){const{div:i,id:n}=e;if(this._currentPageNumber!==n&&this._setCurrentPageNumber(n),this._scrollMode===H.PAGE&&(m(this,sr,ed).call(this),this.update()),!t&&!this.isInPresentationMode){const a=i.offsetLeft+i.clientLeft,s=a+i.clientWidth,{scrollLeft:o,clientWidth:d}=this.container;(this._scrollMode===H.HORIZONTAL||ao+d)&&(t={left:0,top:0})}yw(i,t),!this._currentScaleValue&&this._location&&(this._location=null)},I1=new WeakSet,oA=function(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15},Iu=new WeakSet,b5=function(e,t,{noScroll:i=!1,preset:n=!1,drawingDelay:a=-1,origin:s=null}){if(this._currentScaleValue=t.toString(),m(this,I1,oA).call(this,e)){n&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t});return}this.viewer.style.setProperty("--scale-factor",e*Ri.PDF_TO_CSS_UNITS);const o=a>=0&&a<1e3;this.refresh(!0,{scale:e,drawingDelay:o?a:-1}),o&&b(this,pa,setTimeout(()=>{b(this,pa,null),this.refresh()},a));const d=this._currentScale;if(this._currentScale=e,!i){let h=this._currentPageNumber,c;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(h=this._location.pageNumber,c=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:h,destArray:c,allowNegativeOffset:!0}),Array.isArray(s)){const u=e/d-1,[p,f]=this.containerTopLeft;this.container.scrollLeft+=(s[0]-f)*u,this.container.scrollTop+=(s[1]-p)*u}}this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:n?t:void 0}),this.defaultRenderingQueue&&this.update()},C1=new WeakSet,lA=function(){return this._spreadMode!==Ye.NONE&&this._scrollMode!==H.HORIZONTAL?2:1},xi=new WeakSet,Mn=function(e,t){let i=parseFloat(e);if(i>0)t.preset=!1,m(this,Iu,b5).call(this,i,e,t);else{const n=this._pages[this._currentPageNumber-1];if(!n)return;let a=J2,s=_2;this.isInPresentationMode?(a=s=4,this._spreadMode!==Ye.NONE&&(a*=2)):this.removePageBorders?a=s=0:this._scrollMode===H.HORIZONTAL&&([a,s]=[s,a]);const o=(this.container.clientWidth-a)/n.width*n.scale/r(this,C1,lA),d=(this.container.clientHeight-s)/n.height*n.scale;switch(e){case"page-actual":i=1;break;case"page-width":i=o;break;case"page-height":i=d;break;case"page-fit":i=Math.min(o,d);break;case"auto":const h=tf(n)?o:Math.min(d,o);i=Math.min(d8,h);break;default:console.error(`#setScale: "${e}" is an unknown zoom value.`);return}t.preset=!0,m(this,Iu,b5).call(this,i,e,t)}},Cu=new WeakSet,f5=function(){const e=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&m(this,xi,Mn).call(this,this._currentScaleValue,{noScroll:!0}),m(this,xl,Qg).call(this,e)},S1=new WeakSet,dA=function(){const e=this._getVisiblePages(),t=[],{ids:i,views:n}=e;for(const a of n){const{view:s}=a;if(!s.hasEditableAnnotations()){i.delete(s.id);continue}t.push(a)}return t.length===0?null:(this.renderingQueue.renderHighestPriority({first:t[0],last:t.at(-1),views:t,ids:i}),i)},T1=new WeakSet,hA=async function(e){if(e.pdfPage)return e.pdfPage;try{const t=await this.pdfDocument.getPage(e.id);return e.pdfPage||e.setPdfPage(t),t}catch(t){return console.error("Unable to get page for page view",t),null}},N1=new WeakSet,cA=function(e){var t,i;if(((t=e.first)==null?void 0:t.id)===1)return!0;if(((i=e.last)==null?void 0:i.id)===this.pagesCount)return!1;switch(this._scrollMode){case H.PAGE:return r(this,ar).scrollDown;case H.HORIZONTAL:return this.scroll.right}return this.scroll.down},Su=new WeakSet,w5=function(e=this.container.clientHeight){e!==r(this,Du)&&(b(this,Du,e),b8.setProperty("--viewer-container-height",`${e}px`))},P1=new WeakSet,uA=function(e){for(const t of e)if(t.target===this.container){m(this,Su,w5).call(this,Math.floor(t.borderBoxSize[0].blockSize)),b(this,wu,null);break}},yl=new WeakSet,Vg=function(){r(this,ua)&&(this.eventBus._off("pagerendered",r(this,ua)),b(this,ua,null)),r(this,nr)!==null&&(clearTimeout(r(this,nr)),b(this,nr,null))};class g6 extends nA{_resetView(){super._resetView(),this._scrollMode=H.PAGE,this._spreadMode=Ye.NONE}set scrollMode(e){}_updateScrollMode(){}set spreadMode(e){}_updateSpreadMode(){}}le.AnnotationLayerBuilder;le.DownloadManager;le.EventBus;le.FindState;le.GenericL10n;le.LinkTarget;le.PDFFindController;le.PDFHistory;le.PDFLinkService;le.PDFPageView;le.PDFScriptingManager;le.PDFSinglePageViewer;le.PDFViewer;le.ProgressBar;le.RenderingStates;le.ScrollMode;le.SimpleLinkService;le.SpreadMode;le.StructTreeLayerBuilder;var p6=le.TextLayerBuilder;le.XfaLayerBuilder;le.parseQueryString;const A5=({className:l,loadedPage:e,scale:t=1,setRenderedText:i=()=>{}})=>{var d,h;const n=B.useRef(null),a=n.current,s=Rr(B.useCallback(async()=>{if(e){const c=e.getViewport({scale:t});return{textContent:await e.getTextContent(),viewport:c,page:e.pageNumber,scale:t}}return null},[e,t])),o=Rr(B.useCallback(async c=>{if(a&&s){const{textContent:u,viewport:p,page:f}=s;let w;const A=new p6({pdfPage:e,onAppend:y=>{a.append(y),w=y.children;const x=u.items;if((w==null?void 0:w.length)>0&&(x==null?void 0:x.length)>0){const[M,v]=m6(w,x);b6(M,v,t)}}});return c.addEventListener("abort",()=>A.cancel()),a.innerHTML="",await A.render(p,u),{textContent:u,viewport:p,page:f,textDivs:w}}},[e,s,t,a]));return B.useEffect(()=>{o!==void 0&&i(o)},[o,i]),j.jsx("div",{className:Ml(l,"textLayerWrapper"),ref:n,style:{width:`${((d=s==null?void 0:s.viewport)==null?void 0:d.width)??0}px`,height:`${((h=s==null?void 0:s.viewport)==null?void 0:h.height)??0}px`}})};function m6(l,e){const t=Array.from(l).filter(n=>n.tagName!=="BR"),i=e.filter(n=>!(n.str.length===0&&n.width===0&&n.height===0));return[t,i]}function b6(l,e,t){const i=/scaleX\(([\d.]+)\)/,n=/scaleY\(([\d.]+)\)/;for(let a=0;a {}"},description:"Callback for text layer info",name:"setRenderedText",required:!1,type:{name:"((info: PdfRenderedText | null) => any)"}}}}}catch{}function f6(l){let e;return typeof l=="string"||l instanceof ArrayBuffer||ArrayBuffer.isView(l)?e={data:l}:e=l,e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data)?structuredClone(e):e}const rp=B.forwardRef(({className:l,file:e,page:t,scale:i,document:n,textLayerClassName:a,disableTextLayer:s=!1,setPageCount:o,setLoading:d,setHideToolbarControls:h,setRenderedText:c,setIsPdfRenderError:u,pdfWorkerUrl:p,children:f,...w},A)=>{const y=B.useRef(null),{node:x,setRef:M}=N3();B.useImperativeHandle(A,()=>x,[x]);const[v,I]=B.useState(null);B.useEffect(()=>{p&&M6(p)},[p]);const S=Rr(B.useCallback(async()=>{try{var R=e?await A6(e):null;return R}catch(L){return u==null||u(!0),console.error(`Failed to load pdf file: ${L}`),null}},[e,u])),D=Rr(B.useCallback(async()=>{try{return S&&t>0?await x6(S,t):null}catch(R){return console.error(`Failed to load pdf page ${t}: ${R}`),null}},[S,t])),{width:T}=a8(x);B.useEffect(()=>{I(v6(D,i,T))},[D,i,T]),Rr(B.useCallback(async R=>{if(D&&!D.then&&v){const L=y6(D,y.current,v);R.addEventListener("abort",()=>L==null?void 0:L.cancel()),await(L==null?void 0:L.promise),d(!1)}},[v,D,d]));const P=w6({loadedFile:S,document:n});B.useEffect(()=>{o&&P!==null&&o(P)},[P,o]),B.useEffect(()=>{h&&h(!1)},[h]);const C=(v==null?void 0:v.fitToWidthRatio)||1,N=`${Tt.prefix}--document-preview-pdf-viewer`;return j.jsx("div",{ref:M,className:Ml(N,l),...w,children:j.jsxs("div",{className:`${N}__wrapper`,children:[j.jsx("canvas",{ref:y,className:`${N}__canvas`,style:{width:`${(v==null?void 0:v.width)??0}px`,height:`${(v==null?void 0:v.height)??0}px`},width:v==null?void 0:v.canvasWidth,height:v==null?void 0:v.canvasHeight}),!s&&j.jsx(A5,{className:Ml(`${N}__text`,a),loadedPage:D,scale:i*C,setRenderedText:c}),typeof f=="function"?f({fitToWidthRatio:C}):f]})})});rp.defaultProps={page:1,scale:1};function w6({loadedFile:l,document:e}){const t=B.useMemo(()=>{const n=j5(e);if(n){const a=n.text_mappings.length-1;return(n==null?void 0:n.text_mappings[a].page.page_number)??1}return 0},[e]);return B.useMemo(()=>l&&l.numPages>0?l.numPages:t>0?t:null,[l,t])}function A6(l){const e=f6(l);return T3(e).promise}function x6(l,e){return l.getPage(e)}function y6(l,e,t){const i=e.getContext("2d");return i?(i.resetTransform(),l.render({canvasContext:i,viewport:t.viewport})):null}let Pf=null;function M6(l){if(l&&l!==Pf&&typeof Worker<"u"){const e=new Worker(l,{type:"module"});s8({workerPort:e}),Pf=l}}function v6(l,e,t){if(l){const i=t*e,n=l.view[2]-l.view[0],a=t/n,s=window.devicePixelRatio??1,o=l.getViewport({scale:e*a*s}),{width:d,height:h}=o,c=h/d,u=i*c;return{width:i,height:u,canvasWidth:d,canvasHeight:h,fitToWidthRatio:a,viewport:o}}return null}try{rp.displayName="PdfViewer",rp.__docgenInfo={description:"",displayName:"PdfViewer",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},file:{defaultValue:null,description:'PDF file data as a "binary" string (array buffer) or PDFSource',name:"file",required:!0,type:{name:"DocumentFile"}},document:{defaultValue:null,description:"Optionally takes a query result document for page count calculation",name:"document",required:!1,type:{name:"QueryResult | null"}},textLayerClassName:{defaultValue:null,description:"Text layer class name",name:"textLayerClassName",required:!1,type:{name:"string"}},disableTextLayer:{defaultValue:{value:"false"},description:"Disable the text layer overlay (defaults to `false`)",name:"disableTextLayer",required:!1,type:{name:"boolean"}},setPageCount:{defaultValue:null,description:"Callback invoked with page count, once `file` has been parsed",name:"setPageCount",required:!1,type:{name:"((count: number) => void)"}},setLoading:{defaultValue:null,description:"Check if document is loading",name:"setLoading",required:!0,type:{name:"(loading: boolean) => void"}},setHideToolbarControls:{defaultValue:null,description:"Callback which is invoked with whether to enable/disable toolbar controls",name:"setHideToolbarControls",required:!1,type:{name:"((disabled: boolean) => void)"}},setRenderedText:{defaultValue:null,description:"Callback for text layer info",name:"setRenderedText",required:!1,type:{name:"((info: PdfRenderedText | null) => any)"}},setIsPdfRenderError:{defaultValue:null,description:"Callback any errors on render",name:"setIsPdfRenderError",required:!1,type:{name:"((isError: boolean) => void)"}},pdfWorkerUrl:{defaultValue:null,description:"URL of hosted PDF worker",name:"pdfWorkerUrl",required:!1,type:{name:"string"}},page:{defaultValue:{value:"1"},description:"Page number, starting at 1",name:"page",required:!1,type:{name:"number"}},scale:{defaultValue:{value:"1"},description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!1,type:{name:"number"}}}}}catch{}var D6=zA;function I6(l,e,t){for(var i=-1,n=l.length;++i"",regexString:"\0"},L6={normal:l=>" ",regexString:"\\s+"},j6={normal:l=>'"',regexString:`[${["«","»","“","”","„","‟","❝","❞","⹂","〝","〞","〟","""].join("")}]`},F6={normal:l=>"'",regexString:`[${["‹","›","’","❮","❯","‘","‚","‛","❛","❜","❟"].join("")}]`},G6={normal:l=>"_",regexString:"[\uD800-\uDBFF][\uDC00-\uDFFF]"},J5={normal:l=>"",regexString:"[̀-ͯ]"},k6=new RegExp(J5.regexString,"g");function pA(l,e=!1){const t=l.normalize("NFD").replace(k6,J5.normal).normalize("NFC");return e&&t.length!==l.length?t.substring(0,l.length).padEnd(l.length," "):t}const _5=[U6,L6,j6,F6,G6,J5].map(l=>({...l,regex:new RegExp(l.regexString,"g")})),O6=new RegExp(_5.map(l=>`(${l.regexString})`).join("|"),"g");function W6(l){const e=_5.reduce((t,i)=>t.replace(i.regex,n=>i.normal(n)),l);return pA(e)}class op{constructor(e){U(this,"rawText");U(this,"normalizedText");U(this,"normalizationMappings");this.rawText=e;let t="";const i=d=>{t+=pA(d,!0)},n=[],a=O6;let s=0,o=a.exec(this.rawText);for(;o!=null;){const d=o[0];let h=o[0];for(let u=0;us){const u=this.rawText.substring(s,o.index);if(c){const p=[s,o.index],f=[t.length,t.length+u.length];n.push({rawSpan:p,normalizedSpan:f}),i(u),s+=u.length}}if(c){const u=h,p=[o.index,o.index+o[0].length],f=[t.length,t.length+u.length];n.push({rawSpan:p,normalizedSpan:f}),i(u),s=a.lastIndex}o=a.exec(this.rawText)}if(s{if(a<0)return a;const s=this.normalizationMappings.findIndex(({rawSpan:d})=>a=0){const{rawSpan:d,normalizedSpan:h}=this.normalizationMappings[s];return Ef(a,{from:d,to:h})}const o=this.normalizationMappings[this.normalizationMappings.length-1];return a-o.rawSpan[oe]+o.normalizedSpan[oe]};return[n(t),n(i)]}toRaw(e){const[t,i]=e,n=a=>{if(a<0)return a;const s=this.normalizationMappings.findIndex(({normalizedSpan:d})=>a=0){const{rawSpan:d,normalizedSpan:h}=this.normalizationMappings[s];return Ef(a,{from:h,to:d})}const o=this.normalizationMappings[this.normalizationMappings.length-1];return a-o.normalizedSpan[oe]+o.rawSpan[oe]};return[n(t),n(i)]}normalize(e){return W6(e)}isBlank(e){return e.length===0||e.trim().length===0||!!e.match(/^\s*$/)}}function Ef(l,{from:e,to:t}){return wt(e)===wt(t)?t[se]+(l-e[se]):t[se]+Math.round((l-e[se])*(wt(t)/wt(e)))}function z6(l){const e=i=>wt(i.normalizedSpan)===wt(i.rawSpan),t=(i,n)=>n.normalizedSpan[se]-i.normalizedSpan[se]===n.rawSpan[se]-i.rawSpan[se];return l.reduce((i,n)=>{const a=i.length>0?i[i.length-1]:null;return e(n)&&a&&e(a)&&t(a,n)?(a.normalizedSpan[oe]=n.normalizedSpan[oe],a.rawSpan[oe]=n.rawSpan[oe],i):(i.push(n),i)},[])}function x5(l,e,t,i){if(e-l<1)return null;const n=i?l+Math.floor((e-l)/2):e-1,a=t(n);if(a!=null)if(e-(n+1)>0){const s=x5(n+1,e,t,!0);return s||{index:n,value:a}}else return{index:n,value:a};else if(n-l>0){const s=x5(l,n,t,!0);return s||null}else return null}const Q6=3;class V6{constructor(e){U(this,"fieldText");U(this,"remainingSpans");U(this,"history",[0]);this.fieldText=e,this.remainingSpans=[[0,e.length]]}getMatches(e,t={}){const{minLength:i=1,maxLength:n=e.length,searchSpan:a}=t,s=x5(i,n+1,o=>{const d=o,h=e.substring(0,d),c=[];for(const u of this.remainingSpans){const p=a?bn(a,u):u;if(wt(p)<=0)continue;const[f,w]=p,A=this.fieldText.slice(f,w),y=A.indexOf(h);if(y>=0){const x=f+y,M=x+h.length,v=this.history.map(S=>{const D=x-S;return D>=0?D:Number.MAX_SAFE_INTEGER}),I=u[0]{const D=bn([M,this.fieldText.length],S);return k5(this.fieldText,D)}).join("")})}}return c.length>0?c:null});return s?s.value:[]}consume(e){const t=[];this.remainingSpans.forEach(n=>{L1(e,n)?(n[se]!(y2(e,n)||!this.remainingSpans.some(a=>y2(a,n))));this.history=i.slice(0,Q6)}}const bm=Tu("pdf:mapping:MappingSourceTextProvider");function Rl(...l){bm==null||bm.apply(null,l)}class Z6{constructor(e){U(this,"cell");U(this,"normalizer");U(this,"provider");this.cell=e,this.normalizer=new op(e.text),this.provider=new V6(this.normalizer.normalizedText)}getMatch(e,t={}){const{minLength:i=1,searchSpan:n}=t,a=this.normalizer.normalize(e),s=n&&this.normalizer.toNormalized(n);Rl('getMatch "%s", normalized "%s", minLength = %d',e,a,i);const o=this.provider.getMatches(a,{minLength:i,searchSpan:s});Rl("normalized matches: %o",o);const d=gA(o,p=>p.minHistoryDistance);if(!d)return Rl("getMatch result: null"),null;const h=this.normalizer.toRaw(d.span),c=this.normalizer.toRaw([d.span[se]-d.skipText.length,d.span[se]]),u={span:h,skipText:k5(this.cell.text,c),score:wt(h)-d.minHistoryDistance,approxLenAfterEnd:d.textAfterEnd.length};return Rl("getMatch result: %o",u),u}consume(e){const t=this.normalizer.toNormalized(e);this.provider.consume(t),Rl("text span consumed %o",e)}isBlank(e){return this.normalizer.isBlank(e)}}function Y6(l,e,t){const i=bn([0,e],t);if(e===0||wt(i)<=0)return[l[0],l[1],l[0],l[3]];const[n,a]=t,[s,o,d,h]=l,c=d-s,u=s+c/e*n,p=s+c/e*a;return[u,o,p,h]}function mA(l,e){const[i,n,a,s]=l,[o,d,h,c]=e,u=s-n,p=c-d;if(!(u*.8i.text),nextCellIndex:this.cursor}}consume(e){const t=[];if(e<=0)return t;let i=e;const n=[...this.cells];for(;i>0&&this.cursor0){const o=new op(s);return this.current={nextCellIndex:i,normalizer:o,leadingSpaces:a},!0}this.cellProvider.skip()}return this.current=null,!1}getNextInfo(){return{text:this.current.normalizer.normalizedText,index:this.current.nextCellIndex}}consume(e){const t=this.current.normalizer.toRaw([0,e]),i=this.current.leadingSpaces+t[oe];return this.current=null,this.cellProvider.consume(i)}skip(){this.current=null,this.cellProvider.skip()}rewind(){this.current=null,this.cellProvider.rewind()}}var q6=QA,X6=MA(),J6=Object.prototype,_6=J6.hasOwnProperty,$6=X6(function(l,e,t){_6.call(l,t)?l[t].push(e):q6(l,t,[e])}),eM=$6;const tM=S5(eM),fm=Tu("pdf:mapping:TextBoxMapping");function Ia(...l){fm==null||fm.apply(null,l)}class iM{constructor(e){U(this,"mappingEntryMap");this.mappingEntryMap=tM(e,t=>t.text.cell.id),Object.values(this.mappingEntryMap).forEach(t=>{t.sort((i,n)=>Cx(i.text.span,n.text.span))}),Ia("TextBoxMapping created"),Ia(this)}getEntries(e,t){return(this.mappingEntryMap[e.id]||[]).filter(i=>L1(i.text.span,t))}apply(e,t){const i=t||[0,e.text.length],{cell:n,span:a}=e.getNormalized(),s=a?Ix(a,i):i;Ia("applying TextBoxMapping"),Ia(e,i);const d=this.getEntries(n,s).map(h=>{if(h.box){let c;if(aM(h.text.cell,h.text.span,e,s))c=Im(h.text.span,s);else{const u=new op(h.text.cell.text),p=Im(u.toNormalized(h.text.span),u.toNormalized(s));c=new op(h.box.cell.text).toRaw(p)}return{cell:h.box.cell.getPartial(c),sourceSpan:bn(h.text.span,s)}}else return{cell:null,sourceSpan:h.text.span}});return Ia("applying TextBoxMapping - result"),Ia(d),d}}class nM{constructor(){U(this,"mappingEntries",[])}addMapping(e,t){this.mappingEntries.push({text:e,box:t}),Ia(">> added a new mapping entry (%o) => (cell: %o)",e,e,t==null?void 0:t.cell)}toTextBoxMapping(){return new iM(this.mappingEntries)}}function aM(l,e,t,i){const n=l.text.substring(...e),a=t.text.substring(...i);return n===a}const wm=Tu("pdf:mapping:getTextBoxMapping");function dr(...l){wm==null||wm.apply(null,l)}function Rf(l,e){dr("getTextBoxMapping: enter");const t=new sM(e),i=new $5(l,e),n=new nM;for(const a of[27,9,3,1])dr("getTextBoxMapping: processText with minMatchLength: %d",a),t.processText((s,o,d)=>{if(o.length{const p=h.markSourceAsMapped(u.text);p&&n.addMapping({cell:h.cell,span:p},{cell:u})}),h.markAsMapped())});return n.toTextBoxMapping()}class sM{constructor(e){U(this,"targetProvider");this.targetProvider=new H6(e.cells)}processText(e){for(;this.targetProvider.hasNext();){const{index:t,text:i}=this.targetProvider.getNextInfo();dr("> find match at index %d, text: %s",t,i);let n=!1;e(t,i,s=>{if(s>0){n=!0;const o=this.targetProvider.consume(s);return dr("> raw target cells for matched length: %d",s),dr(o),o.map(d=>d.trim()).filter(d=>d.text.length>0)}return[]}),n||this.targetProvider.skip()}this.targetProvider.rewind()}}class $5{constructor(e,t){U(this,"sourceProviders");U(this,"targetIndexToSources");this.sourceProviders=e.cells.map(i=>new Z6(i)),this.targetIndexToSources=t.cells.map(i=>{const n=e.cells.map((a,s)=>G5(a.bbox,i.bbox)?{cell:a,provider:this.sourceProviders[s]}:null).filter(U1);return n.some(({cell:a})=>a.isInHtmlBbox)?n.filter(({cell:a})=>a.isInHtmlBbox):n})}findMatch(e,t,i=1){const n=this.targetIndexToSources[e],a=$5.findBestMatch(n,t,i);if(dr("> source cell(s) matched: %o",a),!(a!=null&&a.match)||wt(a.match.span){const c=d.getMatch(h,{searchSpan:o});return c!=null&&c.span&&d.consume(c.span),dr(">> target cell %o to source %o",h,c),c==null?void 0:c.span},markAsMapped:()=>{d.consume(o)}}}static findBestMatch(e,t,i){const n=e.map(d=>{const h=d.provider.getMatch(t,{minLength:i});return{...d,match:h}});let a=0;const s=n.map(d=>{const{match:h}=d,c=h?a+h.skipText.length-wt(h.span):Number.MAX_SAFE_INTEGER;return a+=(h==null?void 0:h.approxLenAfterEnd)??0,{...d,cost:c}});return gA(s,d=>d.cost)}}class e2{constructor({parent:e,id:t,pageNum:i,bbox:n,text:a}){U(this,"parent");U(this,"id");U(this,"pageNum");U(this,"bbox");U(this,"text");this.parent=e,this.id=t,this.pageNum=i,this.bbox=n,this.text=a}getPartial(e){return new t2(this,e)}getNormalized(){return{cell:this}}getBboxForTextSpan(e,t){return t!=null&&t.useRatio?Y6(this.bbox,this.text.length,e):null}trim(){return bA(this)}}class t2{constructor(e,t){U(this,"base");U(this,"span");this.base=e,this.span=bn([0,e.text.length],t)}get text(){return k5(this.base.text,this.span)}getPartial(e){const t=bn(this.span,j1(e,this.span[se]));return new t2(this.base,t)}getNormalized(){return{cell:this.base,span:this.span}}trim(){return bA(this)}}function bA(l){const e=l.text,t=e.match(/^\s*/)[0].length,i=e.match(/\s*$/)[0].length;return t===0&&i===0?l:e.length>t+i?l.getPartial([t,e.length-i]):l.getPartial([0,0])}class rM{constructor(e,t){U(this,"bboxInfo");U(this,"cells");var i;this.bboxInfo=e,this.cells=((i=e.bboxes)==null?void 0:i.filter(n=>n.page===t).map((n,a)=>new oM(this,a,n)))??[]}cellAt(e){return this.cells[e]}installStyle(){this.bboxInfo.styles}}class oM extends e2{constructor(t,i,n){const a=i,s=n.page,o=[n.left,n.top,n.right,n.bottom],d=RA(n.innerTextSource??"");super({parent:t,id:a,pageNum:s,bbox:o,text:d});U(this,"processedBbox");this.processedBbox=n}getBboxForTextSpan(t,i){return this.processedBbox!=null,super.getBboxForTextSpan(t,i)}}const Am=Tu("pdf:textLayout:dom");function Aa(...l){Am==null||Am.apply(null,l)}function lM(l,e,t,i){var s;if(!(t.firstChild instanceof Text)||!(t.lastChild instanceof Text))return Aa("unexpected. span dont have text node"),null;const n=e[se],a=Math.min(l.text.length,e[oe]);try{const{textNode:o,textOffset:d}=n>0?l2(t,n):{textNode:t.firstChild,textOffset:0},{textNode:h,textOffset:c}=a>0?l2(t,a):{textNode:t.lastChild,textOffset:t.lastChild.length};Aa("finding text node for: ",l.text),Aa(" textContent: ",o.textContent),Aa(" beginOffset: ",d),Aa(" textContent: ",h.textContent),Aa(" endOffset: ",c);let[u,p,f,w]=l.bbox;const A=(s=t.parentElement)==null?void 0:s.getBoundingClientRect();return BA(o,d,h,c,y=>{u=(y.left-A.left)/i,f=u+y.width/i}),[u,p,f,w]}catch(o){Aa("Caught exception on calculating bbox from DOM: ",o)}return null}class dM{constructor(e,t,i){U(this,"textContentInfo");U(this,"cells");U(this,"divs");this.textContentInfo=e;const n=e.textContent.items;this.cells=n.map((a,s)=>{var h;const o=cM(a,this.viewport);let d=!1;return(h=i==null?void 0:i.bboxes)!=null&&h.length&&(d=i.bboxes.some(c=>G5(o,[c.left,c.top,c.right,c.bottom]))),new hM(this,s,a,t,o,d)})}get viewport(){return this.textContentInfo.viewport}cellAt(e){return this.cells[e]}setDivs(e){this.divs=e}divAt(e){var t;return(t=this.divs)==null?void 0:t[e]}}class hM extends e2{constructor(t,i,n,a,s,o){const d=i,h=n.str;super({parent:t,id:d,pageNum:a,bbox:s,text:h});U(this,"isInHtmlBbox");this.isInHtmlBbox=o}getBboxForTextSpan(t,i){const n=this.parent.divAt(this.id);if(n&&n.parentNode){const a=this.parent.viewport.scale,s=lM(this,t,n,a);if(s)return s}return super.getBboxForTextSpan(t,i)}}function cM(l,e){const{transform:t}=l,i=e,n=i.rotation%180!==0,[a,,s,o,d,h]=t,[c,u,,p]=i.viewBox,f=n?d+s+u:p-(h+o),w=n?h-c:d-c,A=f+a,y=a*.2;return[w,f+y,w+l.width,A+y]}function uM(l,e,t,i){let n;const a=l[e];if(!Array.isArray(a)&&!t?n=a:n=a==null?void 0:a[t??0],e==="table"&&typeof n=="object"&&typeof(n==null?void 0:n.table_text)=="string")return n.table_text;if(typeof n=="string")return i?Array.isArray(i)?n.substring(i[0],i[1]):n.substring(i.begin,i.end):n}async function gM(l,e={}){const t=l.html,i=j5(l)??void 0,n=await r9({...l,docHtml:t},{sections:!0,bbox:!0,bboxInnerText:!0,...e});if(!n.bboxes)throw Error("Unexpected result from processDoc");return{processedDoc:n,textMappings:i}}class pM{constructor(e,t){U(this,"cells");const{textMappings:i,document:n}=e;this.cells=i.text_mappings.filter(a=>a.page.page_number===t).map((a,s)=>new mM(this,s,n,a))}cellAt(e){return this.cells[e]}getHighlight(e){const t=[e.location.begin,e.location.end];return this.cells.filter(n=>{const{cellField:a}=n;return a.name===e.field&&a.index===e.fieldIndex&&L1(a.span,t)}).map(n=>{const{cellField:a}=n,s=bn(a.span,t);if(Dm(t,a.span))return{cell:n,sourceSpan:s};const o=Im(a.span,s);return{cell:n.getPartial(o),sourceSpan:s}})}}class mM extends e2{constructor(t,i,n,a){const s=i,o=a.page.page_number,d=a.page.bbox,h=uM(n,a.field.name,a.field.index,a.field.span)??"";super({parent:t,id:s,pageNum:o,bbox:d,text:h});U(this,"cellField");this.cellField=a.field}}const xm=Tu("pdf:Highlighter");function Bl(...l){xm==null||xm.apply(null,l)}class lp{constructor({document:e,textMappings:t,pageNum:i,htmlBboxInfo:n,pdfTextContentInfo:a}){U(this,"pageNum");U(this,"textMappingsLayout");U(this,"pdfTextContentLayout",null);U(this,"textToHtmlBboxMappings",null);U(this,"textToPdfTextItemMappings",null);this.pageNum=i,this.textMappingsLayout=new pM({document:e,textMappings:t},i),n&&this.setHtmlBboxInfo(n),a&&this.setTextContentItems(a.textContent,a.viewport,a.spans,n)}setHtmlBboxInfo(e){const t=new rM(e,this.pageNum);this.textToHtmlBboxMappings=Rf(this.textMappingsLayout,t)}setTextContentItems(e,t,i,n){this.pdfTextContentLayout=new dM({textContent:e,viewport:t},this.pageNum,n),this.textToPdfTextItemMappings=Rf(this.textMappingsLayout,this.pdfTextContentLayout),this.setTextContentDivs(i)}setTextContentDivs(e){var t;(t=this.pdfTextContentLayout)==null||t.setDivs(e)}getHighlight(e){Bl("getHighlight: %o",e);const{id:t,field:i,fieldIndex:n,location:a,className:s,facetId:o,value:d,...h}=e,c=this.getHighlightTextMappingResult({field:i,fieldIndex:n,location:a});Bl("getHighlight - items: %o",c);const u=c.map((p,f)=>{var y;const{cell:w,span:A}=((y=p.cell)==null?void 0:y.getNormalized())||{};if(w){let x=w.bbox;return A&&(x=w.getBboxForTextSpan(A)||w.getBboxForTextSpan(A,{useRatio:!0})||w.bbox),Bl("getHighlight - cell(%i): %o",p.cell),Bl(" box: %o",x),{bbox:x,isStart:f===0,isEnd:f===c.length-1}}return Bl("getHighlight - cell(%i) is not mapped. source span: %o",p.sourceSpan),null}).filter(U1);return{highlightId:lp.getId(e),boxes:lp.optimizeHighlightBoxes(u),className:s,facetId:o,value:d,...h}}getHighlightTextMappingResult(e){let t=this.textMappingsLayout.getHighlight(e);const i=(s,o,d,h)=>F5(s,c=>{if(c.cell){const{cell:u}=c.cell.getNormalized();if(u.parent===d){const p=o.apply(c.cell);return p.length===0&&(h!=null&&h.retainUnmapped)?[c]:p.map(({cell:f,sourceSpan:w})=>({cell:f,sourceSpan:j1(w,c.sourceSpan[se])}))}return c}return[]}),{textToPdfTextItemMappings:n,textToHtmlBboxMappings:a}=this;return n&&(t=i(t,n,this.textMappingsLayout,{retainUnmapped:!0})),a&&(t=i(t,a,this.textMappingsLayout)),t}static optimizeHighlightBoxes(e){return e.reduce((t,i)=>{const n=t.length===0?null:t[t.length-1];if(n&&mA(n.bbox,i.bbox)){const[a,s,o,d]=n.bbox,[h,c,u,p]=i.bbox;n.bbox=[Math.min(a,h),Math.min(s,c),Math.max(o,u),Math.max(d,p)]}else t.push(i);return t},[])}static getId(e){return e.id?e.id:`${e.field}[${e.fieldIndex}]___${e.location.begin}_${e.location.end}`}}const Ur="highlight";function Bf(l,e){let t=!1,i=0;for(;!t&&i({page:o,bbox:[i,a,n,s]}))}]}function wM(l,e){return l.map(t=>{const i=t.bboxes.filter(n=>n.page===e).map((n,a,s)=>({bbox:n.bbox,isStart:a===0,isEnd:a===s.length-1}));return i.length>0?{highlightId:t.id||`${i[0].bbox[0]}__${i[0].bbox[1]}`,className:t.className,boxes:i}:null}).filter(U1)}const y5=`${Tt.prefix}--document-preview-pdf-viewer-highlight`,Uf=`${Tt.prefix}--category`,Lf=`${Tt.prefix}--active`,AM=`${Tt.prefix}--overlap-highlight`,xM=`${Tt.prefix}--overlap-active-pass-through`,M5=({className:l,highlightClassName:e,activeHighlightClassName:t,document:i,parsedDocument:n,page:a,highlights:s,boxHighlights:o,activeIds:d,pdfRenderedText:h,scale:c,facetInfoMap:u={},overlapMeta:p=o9(),_useHtmlBbox:f=!0,_usePdfTextItem:w=!0})=>{const A=vM({document:i,textMappings:n==null?void 0:n.textMappings,processedDoc:f?n==null?void 0:n.processedDoc:void 0,pdfRenderedText:w&&h||void 0,pageNum:a,isReady:!!n&&!!s&&(!w||(h==null?void 0:h.page)===a)}),{textDivs:y}=h||{},x=B.useMemo(()=>o?wM(o,a):(A==null||A.setTextContentDivs(y),A?(s||[]).map(D=>A.getHighlight(D)):[]),[o,A,s,a,y]),[M,v]=B.useState(UA()),I=B.useCallback(D=>{v(D)},[v]),S=B.useRef(null);return DM(S,x,d),j.jsxs("div",{ref:S,className:Ml(y5,l),children:[j.jsx(LA,{parentDiv:S,tooltipAction:M}),x.map(D=>{const T=d==null?void 0:d.includes(D.highlightId);return j.jsx(yM,{className:e,activeClassName:t,shape:D,scale:c,active:T,onTooltipShow:I,facetInfoMap:u,overlapMeta:p},D.highlightId)})]})},yM=({className:l,activeClassName:e,shape:t,scale:i,onTooltipShow:n,facetInfoMap:a={},overlapMeta:s=o9(),active:o})=>{const d=B.useRef(null);if((t==null?void 0:t.boxes.length)===0)return null;const h=f=>{var I;const w=f.target,A=w.getAttribute("data-value")||"",y=((I=w.parentElement)==null?void 0:I.getAttribute("data-highlight-id"))||"",x=w.getAttribute("data-facetid")||"",M=d.current,v=jA(a,s,x,A,y);n({tooltipEvent:d2.ENTER,rectActiveElement:M==null?void 0:M.getBoundingClientRect(),...v&&{tooltipContent:v}})},c=()=>{n({tooltipEvent:d2.LEAVE})},u=s.fieldIdWithOverlap.has(t.highlightId);let p=[`${y5}__item`,l,t.className,o&&`${y5}__item--active`,o&&e];return t.facetId&&(u?p.push(AM,o&&Lf,o&&`${Uf}-${t.facetId} highlight`,o&&xM):p.push(`${Uf}-${t.facetId} highlight`,o&&Lf)),p=p.filter(f=>typeof f=="string"),j.jsx("div",{"data-highlight-id":t.highlightId,"data-testid":t.highlightId,children:t==null?void 0:t.boxes.map(f=>j.jsx("div",{className:p.join(" "),style:{...MM(f.bbox,i)},onMouseEnter:h,onMouseLeave:c,ref:d,"data-value":t.value||"","data-facetid":t.facetId||""},`${f.bbox[0].toFixed(2)}_${f.bbox[1].toFixed(2)}`))})};function MM(l,e,t=0){const[i,n,a,s]=l;return{left:`${(i-t)*e}px`,top:`${(n-t)*e}px`,width:`${(a-i+t)*e}px`,height:`${(s-n+t)*e}px`}}const vM=({document:l,textMappings:e,processedDoc:t,pdfRenderedText:i,pageNum:n,isReady:a})=>B.useMemo(()=>a&&l&&e?new lp({document:l,textMappings:e,pageNum:n,htmlBboxInfo:t&&{bboxes:t.bboxes,styles:t.styles},pdfTextContentInfo:i!=null&&i.textContent&&(i!=null&&i.viewport)?i:void 0}):null,[l,a,n,i,t,e]);function DM(l,e,t){B.useEffect(()=>{if(!l.current)return;const i=e.find(n=>(n==null?void 0:n.highlightId)&&(t==null?void 0:t.includes(n.highlightId)));if(i){let n=setTimeout(()=>{var o;n=null;const a=l.current;if(!a)return;const s=a==null?void 0:a.querySelector(`[data-highlight-id=${i.highlightId}]`);(o=s==null?void 0:s.firstElementChild)==null||o.scrollIntoView({block:"nearest",inline:"nearest"})},0);return()=>{n&&clearTimeout(n)}}},[t,l,e])}try{M5.displayName="PdfHighlight",M5.__docgenInfo={description:"Text highlight layer for PdfViewer",displayName:"PdfHighlight",props:{page:{defaultValue:null,description:"Page number, starting at 1",name:"page",required:!0,type:{name:"number"}},scale:{defaultValue:null,description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!0,type:{name:"number"}},highlightClassName:{defaultValue:null,description:"Class name to style each highlight",name:"highlightClassName",required:!1,type:{name:"string"}},activeHighlightClassName:{defaultValue:null,description:"Class name to style each active highlight",name:"activeHighlightClassName",required:!1,type:{name:"string"}},document:{defaultValue:null,description:"Document data returned by query",name:"document",required:!1,type:{name:"QueryResult"}},highlights:{defaultValue:null,description:"Highlight spans on fields in document",name:"highlights",required:!1,type:{name:"DocumentFieldHighlight[]"}},activeIds:{defaultValue:null,description:"Active highlight IDs",name:"activeIds",required:!1,type:{name:"string[]"}},setCurrentPage:{defaultValue:null,description:"callback to be notified page change by scrollIntoActiveId",name:"setCurrentPage",required:!1,type:{name:"((page: number) => any)"}},_useHtmlBbox:{defaultValue:{value:"true"},description:`Consider bboxes in HTML field to highlight. +`)}setDocument(e){var p,f;if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),(p=this.findController)==null||p.setDocument(null),(f=this._scriptingManager)==null||f.setDocument(null),r(this,Ze)&&(r(this,Ze).destroy(),b(this,Ze,null))),this.pdfDocument=e,!e)return;const t=e.numPages,i=e.getPage(1),n=e.getOptionalContentConfig({intent:"display"}),a=r(this,yu)?e.getPermissions():Promise.resolve(),{eventBus:s,pageColors:o,viewer:d}=this;b(this,ca,new AbortController);const{signal:h}=r(this,ca);if(t>$u.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");const w=this._scrollMode=H.PAGE;s.dispatch("scrollmodechanged",{source:this,mode:w})}this._pagesCapability.promise.then(()=>{s.dispatch("pagesloaded",{source:this,pagesCount:t})},()=>{});const c=w=>{const A=this._pages[w.pageNumber-1];A&&r(this,ha).push(A)};s._on("pagerender",c,{signal:h});const u=w=>{w.cssTransform||(this._onePageRenderedCapability.resolve({timestamp:w.timestamp}),s._off("pagerendered",u))};s._on("pagerendered",u,{signal:h}),Promise.all([i,a]).then(([w,A])=>{var D;if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(w),this._optionalContentConfigPromise=n;const{annotationEditorMode:y,annotationMode:x,textLayerMode:M}=m(this,M1,aA).call(this,A);if(M!==yi.DISABLE){const T=b(this,ga,document.createElement("div"));T.id="hiddenCopyElement",d.before(T)}if(y!==Pt.DISABLE){const T=y;e.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):Nf(T)?(b(this,Ze,new Z8(this.container,d,r(this,bu),s,e,o,r(this,fu),r(this,xu),r(this,Mu),r(this,vu))),s.dispatch("annotationeditoruimanager",{source:this,uiManager:r(this,Ze)}),T!==Pt.NONE&&r(this,Ze).updateMode(T)):console.error(`Invalid AnnotationEditor mode: ${T}`)}const v=this._scrollMode===H.PAGE?null:d,I=this.currentScale,S=w.getViewport({scale:I*Ri.PDF_TO_CSS_UNITS});d.style.setProperty("--scale-factor",S.scale),((o==null?void 0:o.foreground)==="CanvasText"||(o==null?void 0:o.background)==="Canvas")&&(d.style.setProperty("--hcm-highlight-filter",e.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),d.style.setProperty("--hcm-highlight-selected-filter",e.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let T=1;T<=t;++T){const P=new _w({container:v,eventBus:s,id:T,scale:I,defaultViewport:S.clone(),optionalContentConfigPromise:n,renderingQueue:this.renderingQueue,textLayerMode:M,annotationMode:x,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,pageColors:o,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:r(this,Au)});this._pages.push(P)}(D=this._pages[0])==null||D.setPdfPage(w),this._scrollMode===H.PAGE?m(this,sr,ed).call(this):this._spreadMode!==Ye.NONE&&this._updateSpreadMode(),m(this,v1,sA).call(this,h).then(async()=>{var P,C;if(e!==this.pdfDocument)return;if((P=this.findController)==null||P.setDocument(e),(C=this._scriptingManager)==null||C.setDocument(e),r(this,ga)&&document.addEventListener("copy",m(this,D1,rA).bind(this,M),{signal:h}),r(this,Ze)&&s.dispatch("annotationeditormodechanged",{source:this,mode:r(this,Ai)}),e.loadingParams.disableAutoFetch||t>$u.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let T=t-1;if(T<=0){this._pagesCapability.resolve();return}for(let N=2;N<=t;++N){const R=e.getPage(N).then(L=>{const k=this._pages[N-1];k.pdfPage||k.setPdfPage(L),--T===0&&this._pagesCapability.resolve()},L=>{console.error(`Unable to get page ${N} to initialize viewer`,L),--T===0&&this._pagesCapability.resolve()});N%$u.PAUSE_EAGER_PAGE_INIT===0&&await R}}),s.dispatch("pagesinit",{source:this}),e.getMetadata().then(({info:T})=>{e===this.pdfDocument&&T.Language&&(d.lang=T.Language)}),this.defaultRenderingQueue&&this.update()}).catch(w=>{console.error("Unable to initialize viewer",w),this._pagesCapability.reject(w)})}setPageLabels(e){var t;if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let i=0,n=this._pages.length;ithis.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){const e=this._scrollMode===H.PAGE?r(this,ar).pages:this._pages,t=this._scrollMode===H.HORIZONTAL,i=t&&this._isContainerRtl;return g8({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:i})}cleanup(){for(const e of this._pages)e.renderingState!==he.FINISHED&&e.reset()}_cancelRendering(){for(const e of this._pages)e.cancelRendering()}forceRendering(e){const t=e||this._getVisiblePages(),i=m(this,N1,cA).call(this,t),n=this._spreadMode!==Ye.NONE&&this._scrollMode!==H.HORIZONTAL,a=this.renderingQueue.getHighestPriority(t,this._pages,i,n);return a?(m(this,T1,hA).call(this,a).then(()=>{this.renderingQueue.renderView(a)}),!0):!1}get hasEqualPageSizes(){const e=this._pages[0];for(let t=1,i=this._pages.length;t{const i=t.pdfPage.getViewport({scale:1}),n=tf(i);if(e===void 0)e=n;else if(this.enablePrintAutoRotate&&n!==e)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(e){if(!(e instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${e}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=e,this.refresh(!1,{optionalContentConfigPromise:e}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e}))}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!p8(e))throw new Error(`Invalid scroll mode: ${e}`);this.pagesCount>$u.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=e,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(e=null){const t=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",t===H.HORIZONTAL),i.classList.toggle("scrollWrapped",t===H.WRAPPED),!(!this.pdfDocument||!e)&&(t===H.PAGE?m(this,sr,ed).call(this):this._previousScrollMode===H.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&m(this,xi,Mn).call(this,this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!m8(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;const t=this.viewer,i=this._pages;if(this._scrollMode===H.PAGE)m(this,sr,ed).call(this);else if(t.textContent="",this._spreadMode===Ye.NONE)for(const n of this._pages)t.append(n.div);else{const n=this._spreadMode-1;let a=null;for(let s=0,o=i.length;s=h;d--){const c=a[d],u=a[d+1]-1;if(cu)return u-e}if(t){const d=a[0];if(de)return d-e+1}break}break}case H.HORIZONTAL:break;case H.PAGE:case H.VERTICAL:{if(this._spreadMode===Ye.NONE)break;const i=this._spreadMode-1;if(t&&e%2!==i)break;if(!t&&e%2===i)break;const{views:n}=this._getVisiblePages(),a=t?e-1:e+1;for(const{id:s,percent:o,widthPercent:d}of n)if(s===a){if(o>0&&d===100)return 2;break}break}}return 1}nextPage(){const e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;const i=this._getPageAdvance(e,!1)||1;return this.currentPageNumber=Math.min(e+i,t),!0}previousPage(){const e=this._currentPageNumber;if(e<=1)return!1;const t=this._getPageAdvance(e,!0)||1;return this.currentPageNumber=Math.max(e-t,1),!0}updateScale({drawingDelay:e,scaleFactor:t=null,steps:i=null,origin:n}){if(i===null&&t===null)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let a=this._currentScale;if(t>0&&t!==1)a=Math.round(a*t*100)/100;else if(i){const s=i>0?X2:1/X2,o=i>0?Math.ceil:Math.floor;i=Math.abs(i);do a=o((a*s).toFixed(2)*10)/10;while(--i>0)}a=Math.max(o8,Math.min(l8,a)),m(this,xi,Mn).call(this,a,{noScroll:!1,drawingDelay:e,origin:n})}increaseScale(e={}){this.updateScale({...e,steps:e.steps??1})}decreaseScale(e={}){this.updateScale({...e,steps:-(e.steps??1)})}get containerTopLeft(){return r(this,wu)||b(this,wu,[this.container.offsetTop,this.container.offsetLeft])}get annotationEditorMode(){return r(this,Ze)?r(this,Ai):Pt.DISABLE}set annotationEditorMode({mode:e,editId:t=null,isFromKeyboard:i=!1}){if(!r(this,Ze))throw new Error("The AnnotationEditor is not enabled.");if(r(this,Ai)===e)return;if(!Nf(e))throw new Error(`Invalid AnnotationEditor mode: ${e}`);if(!this.pdfDocument)return;const{eventBus:n}=this,a=()=>{m(this,yl,Vg).call(this),b(this,Ai,e),r(this,Ze).updateMode(e,t,i),n.dispatch("annotationeditormodechanged",{source:this,mode:e})};if(e===Pt.NONE||r(this,Ai)===Pt.NONE){const s=e!==Pt.NONE;s||this.pdfDocument.annotationStorage.resetModifiedIds();for(const d of this._pages)d.toggleEditingMode(s);const o=m(this,S1,dA).call(this);if(s&&o){m(this,yl,Vg).call(this),b(this,ua,({pageNumber:h})=>{o.delete(h),o.size===0&&b(this,nr,setTimeout(a,0))});const{signal:d}=r(this,ca);n._on("pagerendered",r(this,ua),{signal:d});return}}a()}set annotationEditorParams({type:e,value:t}){if(!r(this,Ze))throw new Error("The AnnotationEditor is not enabled.");r(this,Ze).updateParams(e,t)}refresh(e=!1,t=Object.create(null)){if(this.pdfDocument){for(const i of this._pages)i.update(t);r(this,pa)!==null&&(clearTimeout(r(this,pa)),b(this,pa,null)),e||this.update()}}}ha=new WeakMap,bu=new WeakMap,fu=new WeakMap,Ai=new WeakMap,Ze=new WeakMap,ir=new WeakMap,wu=new WeakMap,Au=new WeakMap,xu=new WeakMap,yu=new WeakMap,Mu=new WeakMap,ca=new WeakMap,vu=new WeakMap,ua=new WeakMap,nr=new WeakMap,bl=new WeakMap,ga=new WeakMap,fl=new WeakMap,Du=new WeakMap,wl=new WeakMap,ar=new WeakMap,pa=new WeakMap,Al=new WeakMap,M1=new WeakSet,aA=function(e){const t={annotationEditorMode:r(this,Ai),annotationMode:r(this,ir),textLayerMode:r(this,Al)};return e&&(!e.includes(Ju.COPY)&&r(this,Al)===yi.ENABLE&&(t.textLayerMode=yi.ENABLE_PERMISSIONS),e.includes(Ju.MODIFY_CONTENTS)||(t.annotationEditorMode=Pt.DISABLE),!e.includes(Ju.MODIFY_ANNOTATIONS)&&!e.includes(Ju.FILL_INTERACTIVE_FORMS)&&r(this,ir)===un.ENABLE_FORMS&&(t.annotationMode=un.ENABLE)),t},v1=new WeakSet,sA=async function(e){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;const t=Promise.withResolvers();function i(){document.visibilityState==="hidden"&&t.resolve()}document.addEventListener("visibilitychange",i,{signal:e}),await Promise.race([this._onePageRenderedCapability.promise,t.promise]),document.removeEventListener("visibilitychange",i)},D1=new WeakSet,rA=function(e,t){const i=document.getSelection(),{focusNode:n,anchorNode:a}=i;if(a&&n&&i.containsNode(r(this,ga))){if(r(this,bl)||e===yi.ENABLE_PERMISSIONS){t.preventDefault(),t.stopPropagation();return}b(this,bl,!0);const{classList:s}=this.viewer;s.add("copyAll");const o=new AbortController;window.addEventListener("keydown",d=>b(this,fl,d.key==="Escape"),{signal:o.signal}),this.getAllText().then(async d=>{d!==null&&await navigator.clipboard.writeText(d)}).catch(d=>{console.warn(`Something goes wrong when extracting the text: ${d.message}`)}).finally(()=>{b(this,bl,!1),b(this,fl,!1),o.abort(),s.remove("copyAll")}),t.preventDefault(),t.stopPropagation()}},sr=new WeakSet,ed=function(){if(this._scrollMode!==H.PAGE)throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");const e=this._currentPageNumber,t=r(this,ar),i=this.viewer;if(i.textContent="",t.pages.length=0,this._spreadMode===Ye.NONE&&!this.isInPresentationMode){const n=this._pages[e-1];i.append(n.div),t.pages.push(n)}else{const n=new Set,a=this._spreadMode-1;a===-1?n.add(e-1):e%2!==a?(n.add(e-1),n.add(e)):(n.add(e-2),n.add(e-1));const s=document.createElement("div");if(s.className="spread",this.isInPresentationMode){const o=document.createElement("div");o.className="dummyPage",s.append(o)}for(const o of n){const d=this._pages[o];d&&(s.append(d.div),t.pages.push(d))}i.append(s)}t.scrollDown=e>=t.previousPageNumber,t.previousPageNumber=e},xl=new WeakSet,Qg=function(e,t=null){const{div:i,id:n}=e;if(this._currentPageNumber!==n&&this._setCurrentPageNumber(n),this._scrollMode===H.PAGE&&(m(this,sr,ed).call(this),this.update()),!t&&!this.isInPresentationMode){const a=i.offsetLeft+i.clientLeft,s=a+i.clientWidth,{scrollLeft:o,clientWidth:d}=this.container;(this._scrollMode===H.HORIZONTAL||ao+d)&&(t={left:0,top:0})}yw(i,t),!this._currentScaleValue&&this._location&&(this._location=null)},I1=new WeakSet,oA=function(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15},Iu=new WeakSet,b5=function(e,t,{noScroll:i=!1,preset:n=!1,drawingDelay:a=-1,origin:s=null}){if(this._currentScaleValue=t.toString(),m(this,I1,oA).call(this,e)){n&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t});return}this.viewer.style.setProperty("--scale-factor",e*Ri.PDF_TO_CSS_UNITS);const o=a>=0&&a<1e3;this.refresh(!0,{scale:e,drawingDelay:o?a:-1}),o&&b(this,pa,setTimeout(()=>{b(this,pa,null),this.refresh()},a));const d=this._currentScale;if(this._currentScale=e,!i){let h=this._currentPageNumber,c;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(h=this._location.pageNumber,c=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:h,destArray:c,allowNegativeOffset:!0}),Array.isArray(s)){const u=e/d-1,[p,f]=this.containerTopLeft;this.container.scrollLeft+=(s[0]-f)*u,this.container.scrollTop+=(s[1]-p)*u}}this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:n?t:void 0}),this.defaultRenderingQueue&&this.update()},C1=new WeakSet,lA=function(){return this._spreadMode!==Ye.NONE&&this._scrollMode!==H.HORIZONTAL?2:1},xi=new WeakSet,Mn=function(e,t){let i=parseFloat(e);if(i>0)t.preset=!1,m(this,Iu,b5).call(this,i,e,t);else{const n=this._pages[this._currentPageNumber-1];if(!n)return;let a=J2,s=_2;this.isInPresentationMode?(a=s=4,this._spreadMode!==Ye.NONE&&(a*=2)):this.removePageBorders?a=s=0:this._scrollMode===H.HORIZONTAL&&([a,s]=[s,a]);const o=(this.container.clientWidth-a)/n.width*n.scale/r(this,C1,lA),d=(this.container.clientHeight-s)/n.height*n.scale;switch(e){case"page-actual":i=1;break;case"page-width":i=o;break;case"page-height":i=d;break;case"page-fit":i=Math.min(o,d);break;case"auto":const h=tf(n)?o:Math.min(d,o);i=Math.min(d8,h);break;default:console.error(`#setScale: "${e}" is an unknown zoom value.`);return}t.preset=!0,m(this,Iu,b5).call(this,i,e,t)}},Cu=new WeakSet,f5=function(){const e=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&m(this,xi,Mn).call(this,this._currentScaleValue,{noScroll:!0}),m(this,xl,Qg).call(this,e)},S1=new WeakSet,dA=function(){const e=this._getVisiblePages(),t=[],{ids:i,views:n}=e;for(const a of n){const{view:s}=a;if(!s.hasEditableAnnotations()){i.delete(s.id);continue}t.push(a)}return t.length===0?null:(this.renderingQueue.renderHighestPriority({first:t[0],last:t.at(-1),views:t,ids:i}),i)},T1=new WeakSet,hA=async function(e){if(e.pdfPage)return e.pdfPage;try{const t=await this.pdfDocument.getPage(e.id);return e.pdfPage||e.setPdfPage(t),t}catch(t){return console.error("Unable to get page for page view",t),null}},N1=new WeakSet,cA=function(e){var t,i;if(((t=e.first)==null?void 0:t.id)===1)return!0;if(((i=e.last)==null?void 0:i.id)===this.pagesCount)return!1;switch(this._scrollMode){case H.PAGE:return r(this,ar).scrollDown;case H.HORIZONTAL:return this.scroll.right}return this.scroll.down},Su=new WeakSet,w5=function(e=this.container.clientHeight){e!==r(this,Du)&&(b(this,Du,e),b8.setProperty("--viewer-container-height",`${e}px`))},P1=new WeakSet,uA=function(e){for(const t of e)if(t.target===this.container){m(this,Su,w5).call(this,Math.floor(t.borderBoxSize[0].blockSize)),b(this,wu,null);break}},yl=new WeakSet,Vg=function(){r(this,ua)&&(this.eventBus._off("pagerendered",r(this,ua)),b(this,ua,null)),r(this,nr)!==null&&(clearTimeout(r(this,nr)),b(this,nr,null))};class g6 extends nA{_resetView(){super._resetView(),this._scrollMode=H.PAGE,this._spreadMode=Ye.NONE}set scrollMode(e){}_updateScrollMode(){}set spreadMode(e){}_updateSpreadMode(){}}le.AnnotationLayerBuilder;le.DownloadManager;le.EventBus;le.FindState;le.GenericL10n;le.LinkTarget;le.PDFFindController;le.PDFHistory;le.PDFLinkService;le.PDFPageView;le.PDFScriptingManager;le.PDFSinglePageViewer;le.PDFViewer;le.ProgressBar;le.RenderingStates;le.ScrollMode;le.SimpleLinkService;le.SpreadMode;le.StructTreeLayerBuilder;var p6=le.TextLayerBuilder;le.XfaLayerBuilder;le.parseQueryString;const A5=({className:l,loadedPage:e,scale:t=1,setRenderedText:i=()=>{}})=>{var d,h;const n=B.useRef(null),a=n.current,s=Rr(B.useCallback(async()=>{if(e){const c=e.getViewport({scale:t});return{textContent:await e.getTextContent(),viewport:c,page:e.pageNumber,scale:t}}return null},[e,t])),o=Rr(B.useCallback(async c=>{if(a&&s){const{textContent:u,viewport:p,page:f}=s;let w;const A=new p6({pdfPage:e,onAppend:y=>{a.append(y),w=y.children;const x=u.items;if((w==null?void 0:w.length)>0&&(x==null?void 0:x.length)>0){const[M,v]=m6(w,x);b6(M,v,t),w=M,u.items=v}}});return c.addEventListener("abort",()=>A.cancel()),a.innerHTML="",await A.render(p,u),{textContent:u,viewport:p,page:f,textDivs:w}}},[e,s,t,a]));return B.useEffect(()=>{o!==void 0&&i(o)},[o,i]),j.jsx("div",{className:Ml(l,"textLayerWrapper"),ref:n,style:{width:`${((d=s==null?void 0:s.viewport)==null?void 0:d.width)??0}px`,height:`${((h=s==null?void 0:s.viewport)==null?void 0:h.height)??0}px`}})};function m6(l,e){const t=Array.from(l).filter(n=>n.tagName!=="BR"),i=e.filter(n=>!(n.str.length===0&&n.width===0&&n.height===0));return[t,i]}function b6(l,e,t){const i=/scaleX\(([\d.]+)\)/,n=/scaleY\(([\d.]+)\)/;for(let a=0;a {}"},description:"Callback for text layer info",name:"setRenderedText",required:!1,type:{name:"((info: PdfRenderedText | null) => any)"}}}}}catch{}function f6(l){let e;return typeof l=="string"||l instanceof ArrayBuffer||ArrayBuffer.isView(l)?e={data:l}:e=l,e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data)?structuredClone(e):e}const rp=B.forwardRef(({className:l,file:e,page:t,scale:i,document:n,textLayerClassName:a,disableTextLayer:s=!1,setPageCount:o,setLoading:d,setHideToolbarControls:h,setRenderedText:c,setIsPdfRenderError:u,pdfWorkerUrl:p,children:f,...w},A)=>{const y=B.useRef(null),{node:x,setRef:M}=N3();B.useImperativeHandle(A,()=>x,[x]);const[v,I]=B.useState(null);B.useEffect(()=>{p&&M6(p)},[p]);const S=Rr(B.useCallback(async()=>{try{var R=e?await A6(e):null;return R}catch(L){return u==null||u(!0),console.error(`Failed to load pdf file: ${L}`),null}},[e,u])),D=Rr(B.useCallback(async()=>{try{return S&&t>0?await x6(S,t):null}catch(R){return console.error(`Failed to load pdf page ${t}: ${R}`),null}},[S,t])),{width:T}=a8(x);B.useEffect(()=>{I(v6(D,i,T))},[D,i,T]),Rr(B.useCallback(async R=>{if(D&&!D.then&&v){const L=y6(D,y.current,v);R.addEventListener("abort",()=>L==null?void 0:L.cancel()),await(L==null?void 0:L.promise),d(!1)}},[v,D,d]));const P=w6({loadedFile:S,document:n});B.useEffect(()=>{o&&P!==null&&o(P)},[P,o]),B.useEffect(()=>{h&&h(!1)},[h]);const C=(v==null?void 0:v.fitToWidthRatio)||1,N=`${Tt.prefix}--document-preview-pdf-viewer`;return j.jsx("div",{ref:M,className:Ml(N,l),...w,children:j.jsxs("div",{className:`${N}__wrapper`,children:[j.jsx("canvas",{ref:y,className:`${N}__canvas`,style:{width:`${(v==null?void 0:v.width)??0}px`,height:`${(v==null?void 0:v.height)??0}px`},width:v==null?void 0:v.canvasWidth,height:v==null?void 0:v.canvasHeight}),!s&&j.jsx(A5,{className:Ml(`${N}__text`,a),loadedPage:D,scale:i*C,setRenderedText:c}),typeof f=="function"?f({fitToWidthRatio:C}):f]})})});rp.defaultProps={page:1,scale:1};function w6({loadedFile:l,document:e}){const t=B.useMemo(()=>{const n=j5(e);if(n){const a=n.text_mappings.length-1;return(n==null?void 0:n.text_mappings[a].page.page_number)??1}return 0},[e]);return B.useMemo(()=>l&&l.numPages>0?l.numPages:t>0?t:null,[l,t])}function A6(l){const e=f6(l);return T3(e).promise}function x6(l,e){return l.getPage(e)}function y6(l,e,t){const i=e.getContext("2d");return i?(i.resetTransform(),l.render({canvasContext:i,viewport:t.viewport})):null}let Pf=null;function M6(l){if(l&&l!==Pf&&typeof Worker<"u"){const e=new Worker(l,{type:"module"});s8({workerPort:e}),Pf=l}}function v6(l,e,t){if(l){const i=t*e,n=l.view[2]-l.view[0],a=t/n,s=window.devicePixelRatio??1,o=l.getViewport({scale:e*a*s}),{width:d,height:h}=o,c=h/d,u=i*c;return{width:i,height:u,canvasWidth:d,canvasHeight:h,fitToWidthRatio:a,viewport:o}}return null}try{rp.displayName="PdfViewer",rp.__docgenInfo={description:"",displayName:"PdfViewer",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},file:{defaultValue:null,description:'PDF file data as a "binary" string (array buffer) or PDFSource',name:"file",required:!0,type:{name:"DocumentFile"}},document:{defaultValue:null,description:"Optionally takes a query result document for page count calculation",name:"document",required:!1,type:{name:"QueryResult | null"}},textLayerClassName:{defaultValue:null,description:"Text layer class name",name:"textLayerClassName",required:!1,type:{name:"string"}},disableTextLayer:{defaultValue:{value:"false"},description:"Disable the text layer overlay (defaults to `false`)",name:"disableTextLayer",required:!1,type:{name:"boolean"}},setPageCount:{defaultValue:null,description:"Callback invoked with page count, once `file` has been parsed",name:"setPageCount",required:!1,type:{name:"((count: number) => void)"}},setLoading:{defaultValue:null,description:"Check if document is loading",name:"setLoading",required:!0,type:{name:"(loading: boolean) => void"}},setHideToolbarControls:{defaultValue:null,description:"Callback which is invoked with whether to enable/disable toolbar controls",name:"setHideToolbarControls",required:!1,type:{name:"((disabled: boolean) => void)"}},setRenderedText:{defaultValue:null,description:"Callback for text layer info",name:"setRenderedText",required:!1,type:{name:"((info: PdfRenderedText | null) => any)"}},setIsPdfRenderError:{defaultValue:null,description:"Callback any errors on render",name:"setIsPdfRenderError",required:!1,type:{name:"((isError: boolean) => void)"}},pdfWorkerUrl:{defaultValue:null,description:"URL of hosted PDF worker",name:"pdfWorkerUrl",required:!1,type:{name:"string"}},page:{defaultValue:{value:"1"},description:"Page number, starting at 1",name:"page",required:!1,type:{name:"number"}},scale:{defaultValue:{value:"1"},description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!1,type:{name:"number"}}}}}catch{}var D6=zA;function I6(l,e,t){for(var i=-1,n=l.length;++i"",regexString:"\0"},L6={normal:l=>" ",regexString:"\\s+"},j6={normal:l=>'"',regexString:`[${["«","»","“","”","„","‟","❝","❞","⹂","〝","〞","〟","""].join("")}]`},F6={normal:l=>"'",regexString:`[${["‹","›","’","❮","❯","‘","‚","‛","❛","❜","❟"].join("")}]`},G6={normal:l=>"_",regexString:"[\uD800-\uDBFF][\uDC00-\uDFFF]"},J5={normal:l=>"",regexString:"[̀-ͯ]"},k6=new RegExp(J5.regexString,"g");function pA(l,e=!1){const t=l.normalize("NFD").replace(k6,J5.normal).normalize("NFC");return e&&t.length!==l.length?t.substring(0,l.length).padEnd(l.length," "):t}const _5=[U6,L6,j6,F6,G6,J5].map(l=>({...l,regex:new RegExp(l.regexString,"g")})),O6=new RegExp(_5.map(l=>`(${l.regexString})`).join("|"),"g");function W6(l){const e=_5.reduce((t,i)=>t.replace(i.regex,n=>i.normal(n)),l);return pA(e)}class op{constructor(e){U(this,"rawText");U(this,"normalizedText");U(this,"normalizationMappings");this.rawText=e;let t="";const i=d=>{t+=pA(d,!0)},n=[],a=O6;let s=0,o=a.exec(this.rawText);for(;o!=null;){const d=o[0];let h=o[0];for(let u=0;us){const u=this.rawText.substring(s,o.index);if(c){const p=[s,o.index],f=[t.length,t.length+u.length];n.push({rawSpan:p,normalizedSpan:f}),i(u),s+=u.length}}if(c){const u=h,p=[o.index,o.index+o[0].length],f=[t.length,t.length+u.length];n.push({rawSpan:p,normalizedSpan:f}),i(u),s=a.lastIndex}o=a.exec(this.rawText)}if(s{if(a<0)return a;const s=this.normalizationMappings.findIndex(({rawSpan:d})=>a=0){const{rawSpan:d,normalizedSpan:h}=this.normalizationMappings[s];return Ef(a,{from:d,to:h})}const o=this.normalizationMappings[this.normalizationMappings.length-1];return a-o.rawSpan[oe]+o.normalizedSpan[oe]};return[n(t),n(i)]}toRaw(e){const[t,i]=e,n=a=>{if(a<0)return a;const s=this.normalizationMappings.findIndex(({normalizedSpan:d})=>a=0){const{rawSpan:d,normalizedSpan:h}=this.normalizationMappings[s];return Ef(a,{from:h,to:d})}const o=this.normalizationMappings[this.normalizationMappings.length-1];return a-o.normalizedSpan[oe]+o.rawSpan[oe]};return[n(t),n(i)]}normalize(e){return W6(e)}isBlank(e){return e.length===0||e.trim().length===0||!!e.match(/^\s*$/)}}function Ef(l,{from:e,to:t}){return wt(e)===wt(t)?t[se]+(l-e[se]):t[se]+Math.round((l-e[se])*(wt(t)/wt(e)))}function z6(l){const e=i=>wt(i.normalizedSpan)===wt(i.rawSpan),t=(i,n)=>n.normalizedSpan[se]-i.normalizedSpan[se]===n.rawSpan[se]-i.rawSpan[se];return l.reduce((i,n)=>{const a=i.length>0?i[i.length-1]:null;return e(n)&&a&&e(a)&&t(a,n)?(a.normalizedSpan[oe]=n.normalizedSpan[oe],a.rawSpan[oe]=n.rawSpan[oe],i):(i.push(n),i)},[])}function x5(l,e,t,i){if(e-l<1)return null;const n=i?l+Math.floor((e-l)/2):e-1,a=t(n);if(a!=null)if(e-(n+1)>0){const s=x5(n+1,e,t,!0);return s||{index:n,value:a}}else return{index:n,value:a};else if(n-l>0){const s=x5(l,n,t,!0);return s||null}else return null}const Q6=3;class V6{constructor(e){U(this,"fieldText");U(this,"remainingSpans");U(this,"history",[0]);this.fieldText=e,this.remainingSpans=[[0,e.length]]}getMatches(e,t={}){const{minLength:i=1,maxLength:n=e.length,searchSpan:a}=t,s=x5(i,n+1,o=>{const d=o,h=e.substring(0,d),c=[];for(const u of this.remainingSpans){const p=a?bn(a,u):u;if(wt(p)<=0)continue;const[f,w]=p,A=this.fieldText.slice(f,w),y=A.indexOf(h);if(y>=0){const x=f+y,M=x+h.length,v=this.history.map(S=>{const D=x-S;return D>=0?D:Number.MAX_SAFE_INTEGER}),I=u[0]{const D=bn([M,this.fieldText.length],S);return k5(this.fieldText,D)}).join("")})}}return c.length>0?c:null});return s?s.value:[]}consume(e){const t=[];this.remainingSpans.forEach(n=>{L1(e,n)?(n[se]!(y2(e,n)||!this.remainingSpans.some(a=>y2(a,n))));this.history=i.slice(0,Q6)}}const bm=Tu("pdf:mapping:MappingSourceTextProvider");function Rl(...l){bm==null||bm.apply(null,l)}class Z6{constructor(e){U(this,"cell");U(this,"normalizer");U(this,"provider");this.cell=e,this.normalizer=new op(e.text),this.provider=new V6(this.normalizer.normalizedText)}getMatch(e,t={}){const{minLength:i=1,searchSpan:n}=t,a=this.normalizer.normalize(e),s=n&&this.normalizer.toNormalized(n);Rl('getMatch "%s", normalized "%s", minLength = %d',e,a,i);const o=this.provider.getMatches(a,{minLength:i,searchSpan:s});Rl("normalized matches: %o",o);const d=gA(o,p=>p.minHistoryDistance);if(!d)return Rl("getMatch result: null"),null;const h=this.normalizer.toRaw(d.span),c=this.normalizer.toRaw([d.span[se]-d.skipText.length,d.span[se]]),u={span:h,skipText:k5(this.cell.text,c),score:wt(h)-d.minHistoryDistance,approxLenAfterEnd:d.textAfterEnd.length};return Rl("getMatch result: %o",u),u}consume(e){const t=this.normalizer.toNormalized(e);this.provider.consume(t),Rl("text span consumed %o",e)}isBlank(e){return this.normalizer.isBlank(e)}}function Y6(l,e,t){const i=bn([0,e],t);if(e===0||wt(i)<=0)return[l[0],l[1],l[0],l[3]];const[n,a]=t,[s,o,d,h]=l,c=d-s,u=s+c/e*n,p=s+c/e*a;return[u,o,p,h]}function mA(l,e){const[i,n,a,s]=l,[o,d,h,c]=e,u=s-n,p=c-d;if(!(u*.8i.text),nextCellIndex:this.cursor}}consume(e){const t=[];if(e<=0)return t;let i=e;const n=[...this.cells];for(;i>0&&this.cursor0){const o=new op(s);return this.current={nextCellIndex:i,normalizer:o,leadingSpaces:a},!0}this.cellProvider.skip()}return this.current=null,!1}getNextInfo(){return{text:this.current.normalizer.normalizedText,index:this.current.nextCellIndex}}consume(e){const t=this.current.normalizer.toRaw([0,e]),i=this.current.leadingSpaces+t[oe];return this.current=null,this.cellProvider.consume(i)}skip(){this.current=null,this.cellProvider.skip()}rewind(){this.current=null,this.cellProvider.rewind()}}var q6=QA,X6=MA(),J6=Object.prototype,_6=J6.hasOwnProperty,$6=X6(function(l,e,t){_6.call(l,t)?l[t].push(e):q6(l,t,[e])}),eM=$6;const tM=S5(eM),fm=Tu("pdf:mapping:TextBoxMapping");function Ia(...l){fm==null||fm.apply(null,l)}class iM{constructor(e){U(this,"mappingEntryMap");this.mappingEntryMap=tM(e,t=>t.text.cell.id),Object.values(this.mappingEntryMap).forEach(t=>{t.sort((i,n)=>Cx(i.text.span,n.text.span))}),Ia("TextBoxMapping created"),Ia(this)}getEntries(e,t){return(this.mappingEntryMap[e.id]||[]).filter(i=>L1(i.text.span,t))}apply(e,t){const i=t||[0,e.text.length],{cell:n,span:a}=e.getNormalized(),s=a?Ix(a,i):i;Ia("applying TextBoxMapping"),Ia(e,i);const d=this.getEntries(n,s).map(h=>{if(h.box){let c;if(aM(h.text.cell,h.text.span,e,s))c=Im(h.text.span,s);else{const u=new op(h.text.cell.text),p=Im(u.toNormalized(h.text.span),u.toNormalized(s));c=new op(h.box.cell.text).toRaw(p)}return{cell:h.box.cell.getPartial(c),sourceSpan:bn(h.text.span,s)}}else return{cell:null,sourceSpan:h.text.span}});return Ia("applying TextBoxMapping - result"),Ia(d),d}}class nM{constructor(){U(this,"mappingEntries",[])}addMapping(e,t){this.mappingEntries.push({text:e,box:t}),Ia(">> added a new mapping entry (%o) => (cell: %o)",e,e,t==null?void 0:t.cell)}toTextBoxMapping(){return new iM(this.mappingEntries)}}function aM(l,e,t,i){const n=l.text.substring(...e),a=t.text.substring(...i);return n===a}const wm=Tu("pdf:mapping:getTextBoxMapping");function dr(...l){wm==null||wm.apply(null,l)}function Rf(l,e){dr("getTextBoxMapping: enter");const t=new sM(e),i=new $5(l,e),n=new nM;for(const a of[27,9,3,1])dr("getTextBoxMapping: processText with minMatchLength: %d",a),t.processText((s,o,d)=>{if(o.length{const p=h.markSourceAsMapped(u.text);p&&n.addMapping({cell:h.cell,span:p},{cell:u})}),h.markAsMapped())});return n.toTextBoxMapping()}class sM{constructor(e){U(this,"targetProvider");this.targetProvider=new H6(e.cells)}processText(e){for(;this.targetProvider.hasNext();){const{index:t,text:i}=this.targetProvider.getNextInfo();dr("> find match at index %d, text: %s",t,i);let n=!1;e(t,i,s=>{if(s>0){n=!0;const o=this.targetProvider.consume(s);return dr("> raw target cells for matched length: %d",s),dr(o),o.map(d=>d.trim()).filter(d=>d.text.length>0)}return[]}),n||this.targetProvider.skip()}this.targetProvider.rewind()}}class $5{constructor(e,t){U(this,"sourceProviders");U(this,"targetIndexToSources");this.sourceProviders=e.cells.map(i=>new Z6(i)),this.targetIndexToSources=t.cells.map(i=>{const n=e.cells.map((a,s)=>G5(a.bbox,i.bbox)?{cell:a,provider:this.sourceProviders[s]}:null).filter(U1);return n.some(({cell:a})=>a.isInHtmlBbox)?n.filter(({cell:a})=>a.isInHtmlBbox):n})}findMatch(e,t,i=1){const n=this.targetIndexToSources[e],a=$5.findBestMatch(n,t,i);if(dr("> source cell(s) matched: %o",a),!(a!=null&&a.match)||wt(a.match.span){const c=d.getMatch(h,{searchSpan:o});return c!=null&&c.span&&d.consume(c.span),dr(">> target cell %o to source %o",h,c),c==null?void 0:c.span},markAsMapped:()=>{d.consume(o)}}}static findBestMatch(e,t,i){const n=e.map(d=>{const h=d.provider.getMatch(t,{minLength:i});return{...d,match:h}});let a=0;const s=n.map(d=>{const{match:h}=d,c=h?a+h.skipText.length-wt(h.span):Number.MAX_SAFE_INTEGER;return a+=(h==null?void 0:h.approxLenAfterEnd)??0,{...d,cost:c}});return gA(s,d=>d.cost)}}class e2{constructor({parent:e,id:t,pageNum:i,bbox:n,text:a}){U(this,"parent");U(this,"id");U(this,"pageNum");U(this,"bbox");U(this,"text");this.parent=e,this.id=t,this.pageNum=i,this.bbox=n,this.text=a}getPartial(e){return new t2(this,e)}getNormalized(){return{cell:this}}getBboxForTextSpan(e,t){return t!=null&&t.useRatio?Y6(this.bbox,this.text.length,e):null}trim(){return bA(this)}}class t2{constructor(e,t){U(this,"base");U(this,"span");this.base=e,this.span=bn([0,e.text.length],t)}get text(){return k5(this.base.text,this.span)}getPartial(e){const t=bn(this.span,j1(e,this.span[se]));return new t2(this.base,t)}getNormalized(){return{cell:this.base,span:this.span}}trim(){return bA(this)}}function bA(l){const e=l.text,t=e.match(/^\s*/)[0].length,i=e.match(/\s*$/)[0].length;return t===0&&i===0?l:e.length>t+i?l.getPartial([t,e.length-i]):l.getPartial([0,0])}class rM{constructor(e,t){U(this,"bboxInfo");U(this,"cells");var i;this.bboxInfo=e,this.cells=((i=e.bboxes)==null?void 0:i.filter(n=>n.page===t).map((n,a)=>new oM(this,a,n)))??[]}cellAt(e){return this.cells[e]}installStyle(){this.bboxInfo.styles}}class oM extends e2{constructor(t,i,n){const a=i,s=n.page,o=[n.left,n.top,n.right,n.bottom],d=RA(n.innerTextSource??"");super({parent:t,id:a,pageNum:s,bbox:o,text:d});U(this,"processedBbox");this.processedBbox=n}getBboxForTextSpan(t,i){return this.processedBbox!=null,super.getBboxForTextSpan(t,i)}}const Am=Tu("pdf:textLayout:dom");function Aa(...l){Am==null||Am.apply(null,l)}function lM(l,e,t,i){var s;if(!(t.firstChild instanceof Text)||!(t.lastChild instanceof Text))return Aa("unexpected. span dont have text node"),null;const n=e[se],a=Math.min(l.text.length,e[oe]);try{const{textNode:o,textOffset:d}=n>0?l2(t,n):{textNode:t.firstChild,textOffset:0},{textNode:h,textOffset:c}=a>0?l2(t,a):{textNode:t.lastChild,textOffset:t.lastChild.length};Aa("finding text node for: ",l.text),Aa(" textContent: ",o.textContent),Aa(" beginOffset: ",d),Aa(" textContent: ",h.textContent),Aa(" endOffset: ",c);let[u,p,f,w]=l.bbox;const A=(s=t.parentElement)==null?void 0:s.getBoundingClientRect();return BA(o,d,h,c,y=>{u=(y.left-A.left)/i,f=u+y.width/i}),[u,p,f,w]}catch(o){Aa("Caught exception on calculating bbox from DOM: ",o)}return null}class dM{constructor(e,t,i){U(this,"textContentInfo");U(this,"cells");U(this,"divs");this.textContentInfo=e;const n=e.textContent.items;this.cells=n.map((a,s)=>{var h;const o=cM(a,this.viewport);let d=!1;return(h=i==null?void 0:i.bboxes)!=null&&h.length&&(d=i.bboxes.some(c=>G5(o,[c.left,c.top,c.right,c.bottom]))),new hM(this,s,a,t,o,d)})}get viewport(){return this.textContentInfo.viewport}cellAt(e){return this.cells[e]}setDivs(e){this.divs=e}divAt(e){var t;return(t=this.divs)==null?void 0:t[e]}}class hM extends e2{constructor(t,i,n,a,s,o){const d=i,h=n.str;super({parent:t,id:d,pageNum:a,bbox:s,text:h});U(this,"isInHtmlBbox");this.isInHtmlBbox=o}getBboxForTextSpan(t,i){const n=this.parent.divAt(this.id);if(n&&n.parentNode){const a=this.parent.viewport.scale,s=lM(this,t,n,a);if(s)return s}return super.getBboxForTextSpan(t,i)}}function cM(l,e){const{transform:t}=l,i=e,n=i.rotation%180!==0,[a,,s,o,d,h]=t,[c,u,,p]=i.viewBox,f=n?d+s+u:p-(h+o),w=n?h-c:d-c,A=f+a,y=a*.2;return[w,f+y,w+l.width,A+y]}function uM(l,e,t,i){let n;const a=l[e];if(!Array.isArray(a)&&!t?n=a:n=a==null?void 0:a[t??0],e==="table"&&typeof n=="object"&&typeof(n==null?void 0:n.table_text)=="string")return n.table_text;if(typeof n=="string")return i?Array.isArray(i)?n.substring(i[0],i[1]):n.substring(i.begin,i.end):n}async function gM(l,e={}){const t=l.html,i=j5(l)??void 0,n=await r9({...l,docHtml:t},{sections:!0,bbox:!0,bboxInnerText:!0,...e});if(!n.bboxes)throw Error("Unexpected result from processDoc");return{processedDoc:n,textMappings:i}}class pM{constructor(e,t){U(this,"cells");const{textMappings:i,document:n}=e;this.cells=i.text_mappings.filter(a=>a.page.page_number===t).map((a,s)=>new mM(this,s,n,a))}cellAt(e){return this.cells[e]}getHighlight(e){const t=[e.location.begin,e.location.end];return this.cells.filter(n=>{const{cellField:a}=n;return a.name===e.field&&a.index===e.fieldIndex&&L1(a.span,t)}).map(n=>{const{cellField:a}=n,s=bn(a.span,t);if(Dm(t,a.span))return{cell:n,sourceSpan:s};const o=Im(a.span,s);return{cell:n.getPartial(o),sourceSpan:s}})}}class mM extends e2{constructor(t,i,n,a){const s=i,o=a.page.page_number,d=a.page.bbox,h=uM(n,a.field.name,a.field.index,a.field.span)??"";super({parent:t,id:s,pageNum:o,bbox:d,text:h});U(this,"cellField");this.cellField=a.field}}const xm=Tu("pdf:Highlighter");function Bl(...l){xm==null||xm.apply(null,l)}class lp{constructor({document:e,textMappings:t,pageNum:i,htmlBboxInfo:n,pdfTextContentInfo:a}){U(this,"pageNum");U(this,"textMappingsLayout");U(this,"pdfTextContentLayout",null);U(this,"textToHtmlBboxMappings",null);U(this,"textToPdfTextItemMappings",null);this.pageNum=i,this.textMappingsLayout=new pM({document:e,textMappings:t},i),n&&this.setHtmlBboxInfo(n),a&&this.setTextContentItems(a.textContent,a.viewport,a.spans,n)}setHtmlBboxInfo(e){const t=new rM(e,this.pageNum);this.textToHtmlBboxMappings=Rf(this.textMappingsLayout,t)}setTextContentItems(e,t,i,n){this.pdfTextContentLayout=new dM({textContent:e,viewport:t},this.pageNum,n),this.textToPdfTextItemMappings=Rf(this.textMappingsLayout,this.pdfTextContentLayout),this.setTextContentDivs(i)}setTextContentDivs(e){var t;(t=this.pdfTextContentLayout)==null||t.setDivs(e)}getHighlight(e){Bl("getHighlight: %o",e);const{id:t,field:i,fieldIndex:n,location:a,className:s,facetId:o,value:d,...h}=e,c=this.getHighlightTextMappingResult({field:i,fieldIndex:n,location:a});Bl("getHighlight - items: %o",c);const u=c.map((p,f)=>{var y;const{cell:w,span:A}=((y=p.cell)==null?void 0:y.getNormalized())||{};if(w){let x=w.bbox;return A&&(x=w.getBboxForTextSpan(A)||w.getBboxForTextSpan(A,{useRatio:!0})||w.bbox),Bl("getHighlight - cell(%i): %o",p.cell),Bl(" box: %o",x),{bbox:x,isStart:f===0,isEnd:f===c.length-1}}return Bl("getHighlight - cell(%i) is not mapped. source span: %o",p.sourceSpan),null}).filter(U1);return{highlightId:lp.getId(e),boxes:lp.optimizeHighlightBoxes(u),className:s,facetId:o,value:d,...h}}getHighlightTextMappingResult(e){let t=this.textMappingsLayout.getHighlight(e);const i=(s,o,d,h)=>F5(s,c=>{if(c.cell){const{cell:u}=c.cell.getNormalized();if(u.parent===d){const p=o.apply(c.cell);return p.length===0&&(h!=null&&h.retainUnmapped)?[c]:p.map(({cell:f,sourceSpan:w})=>({cell:f,sourceSpan:j1(w,c.sourceSpan[se])}))}return c}return[]}),{textToPdfTextItemMappings:n,textToHtmlBboxMappings:a}=this;return n&&(t=i(t,n,this.textMappingsLayout,{retainUnmapped:!0})),a&&(t=i(t,a,this.textMappingsLayout)),t}static optimizeHighlightBoxes(e){return e.reduce((t,i)=>{const n=t.length===0?null:t[t.length-1];if(n&&mA(n.bbox,i.bbox)){const[a,s,o,d]=n.bbox,[h,c,u,p]=i.bbox;n.bbox=[Math.min(a,h),Math.min(s,c),Math.max(o,u),Math.max(d,p)]}else t.push(i);return t},[])}static getId(e){return e.id?e.id:`${e.field}[${e.fieldIndex}]___${e.location.begin}_${e.location.end}`}}const Ur="highlight";function Bf(l,e){let t=!1,i=0;for(;!t&&i({page:o,bbox:[i,a,n,s]}))}]}function wM(l,e){return l.map(t=>{const i=t.bboxes.filter(n=>n.page===e).map((n,a,s)=>({bbox:n.bbox,isStart:a===0,isEnd:a===s.length-1}));return i.length>0?{highlightId:t.id||`${i[0].bbox[0]}__${i[0].bbox[1]}`,className:t.className,boxes:i}:null}).filter(U1)}const y5=`${Tt.prefix}--document-preview-pdf-viewer-highlight`,Uf=`${Tt.prefix}--category`,Lf=`${Tt.prefix}--active`,AM=`${Tt.prefix}--overlap-highlight`,xM=`${Tt.prefix}--overlap-active-pass-through`,M5=({className:l,highlightClassName:e,activeHighlightClassName:t,document:i,parsedDocument:n,page:a,highlights:s,boxHighlights:o,activeIds:d,pdfRenderedText:h,scale:c,facetInfoMap:u={},overlapMeta:p=o9(),_useHtmlBbox:f=!0,_usePdfTextItem:w=!0})=>{const A=vM({document:i,textMappings:n==null?void 0:n.textMappings,processedDoc:f?n==null?void 0:n.processedDoc:void 0,pdfRenderedText:w&&h||void 0,pageNum:a,isReady:!!n&&!!s&&(!w||(h==null?void 0:h.page)===a)}),{textDivs:y}=h||{},x=B.useMemo(()=>o?wM(o,a):(A==null||A.setTextContentDivs(y),A?(s||[]).map(D=>A.getHighlight(D)):[]),[o,A,s,a,y]),[M,v]=B.useState(UA()),I=B.useCallback(D=>{v(D)},[v]),S=B.useRef(null);return DM(S,x,d),j.jsxs("div",{ref:S,className:Ml(y5,l),children:[j.jsx(LA,{parentDiv:S,tooltipAction:M}),x.map(D=>{const T=d==null?void 0:d.includes(D.highlightId);return j.jsx(yM,{className:e,activeClassName:t,shape:D,scale:c,active:T,onTooltipShow:I,facetInfoMap:u,overlapMeta:p},D.highlightId)})]})},yM=({className:l,activeClassName:e,shape:t,scale:i,onTooltipShow:n,facetInfoMap:a={},overlapMeta:s=o9(),active:o})=>{const d=B.useRef(null);if((t==null?void 0:t.boxes.length)===0)return null;const h=f=>{var I;const w=f.target,A=w.getAttribute("data-value")||"",y=((I=w.parentElement)==null?void 0:I.getAttribute("data-highlight-id"))||"",x=w.getAttribute("data-facetid")||"",M=d.current,v=jA(a,s,x,A,y);n({tooltipEvent:d2.ENTER,rectActiveElement:M==null?void 0:M.getBoundingClientRect(),...v&&{tooltipContent:v}})},c=()=>{n({tooltipEvent:d2.LEAVE})},u=s.fieldIdWithOverlap.has(t.highlightId);let p=[`${y5}__item`,l,t.className,o&&`${y5}__item--active`,o&&e];return t.facetId&&(u?p.push(AM,o&&Lf,o&&`${Uf}-${t.facetId} highlight`,o&&xM):p.push(`${Uf}-${t.facetId} highlight`,o&&Lf)),p=p.filter(f=>typeof f=="string"),j.jsx("div",{"data-highlight-id":t.highlightId,"data-testid":t.highlightId,children:t==null?void 0:t.boxes.map(f=>j.jsx("div",{className:p.join(" "),style:{...MM(f.bbox,i)},onMouseEnter:h,onMouseLeave:c,ref:d,"data-value":t.value||"","data-facetid":t.facetId||""},`${f.bbox[0].toFixed(2)}_${f.bbox[1].toFixed(2)}`))})};function MM(l,e,t=0){const[i,n,a,s]=l;return{left:`${(i-t)*e}px`,top:`${(n-t)*e}px`,width:`${(a-i+t)*e}px`,height:`${(s-n+t)*e}px`}}const vM=({document:l,textMappings:e,processedDoc:t,pdfRenderedText:i,pageNum:n,isReady:a})=>B.useMemo(()=>a&&l&&e?new lp({document:l,textMappings:e,pageNum:n,htmlBboxInfo:t&&{bboxes:t.bboxes,styles:t.styles},pdfTextContentInfo:i!=null&&i.textContent&&(i!=null&&i.viewport)?i:void 0}):null,[l,a,n,i,t,e]);function DM(l,e,t){B.useEffect(()=>{if(!l.current)return;const i=e.find(n=>(n==null?void 0:n.highlightId)&&(t==null?void 0:t.includes(n.highlightId)));if(i){let n=setTimeout(()=>{var o;n=null;const a=l.current;if(!a)return;const s=a==null?void 0:a.querySelector(`[data-highlight-id=${i.highlightId}]`);(o=s==null?void 0:s.firstElementChild)==null||o.scrollIntoView({block:"nearest",inline:"nearest"})},0);return()=>{n&&clearTimeout(n)}}},[t,l,e])}try{M5.displayName="PdfHighlight",M5.__docgenInfo={description:"Text highlight layer for PdfViewer",displayName:"PdfHighlight",props:{page:{defaultValue:null,description:"Page number, starting at 1",name:"page",required:!0,type:{name:"number"}},scale:{defaultValue:null,description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!0,type:{name:"number"}},highlightClassName:{defaultValue:null,description:"Class name to style each highlight",name:"highlightClassName",required:!1,type:{name:"string"}},activeHighlightClassName:{defaultValue:null,description:"Class name to style each active highlight",name:"activeHighlightClassName",required:!1,type:{name:"string"}},document:{defaultValue:null,description:"Document data returned by query",name:"document",required:!1,type:{name:"QueryResult"}},highlights:{defaultValue:null,description:"Highlight spans on fields in document",name:"highlights",required:!1,type:{name:"DocumentFieldHighlight[]"}},activeIds:{defaultValue:null,description:"Active highlight IDs",name:"activeIds",required:!1,type:{name:"string[]"}},setCurrentPage:{defaultValue:null,description:"callback to be notified page change by scrollIntoActiveId",name:"setCurrentPage",required:!1,type:{name:"((page: number) => any)"}},_useHtmlBbox:{defaultValue:{value:"true"},description:`Consider bboxes in HTML field to highlight. True by default. This is for testing purpose.`,name:"_useHtmlBbox",required:!1,type:{name:"boolean"}},_usePdfTextItem:{defaultValue:{value:"true"},description:`Flag to whether to use PDF text items for finding bbox for highlighting. True by default. This is for testing and debugging purpose.`,name:"_usePdfTextItem",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"Class name to style highlight layer",name:"className",required:!1,type:{name:"string"}},parsedDocument:{defaultValue:null,description:"Parsed document information",name:"parsedDocument",required:!0,type:{name:"ExtractedDocumentInfo | null"}},pdfRenderedText:{defaultValue:null,description:"PDF text content information in a page from parsed PDF",name:"pdfRenderedText",required:!0,type:{name:"PdfRenderedText | null"}},boxHighlights:{defaultValue:null,description:"Highlight bboxes. This overrides `highlights` props",name:"boxHighlights",required:!1,type:{name:"DocumentBboxHighlight[]"}},facetInfoMap:{defaultValue:{value:"{}"},description:"Meta-data on facets",name:"facetInfoMap",required:!1,type:{name:"FacetInfoMap"}},overlapMeta:{defaultValue:{value:"initOverlapMeta()"},description:"Overlap information used by tooltip",name:"overlapMeta",required:!1,type:{name:"OverlapMeta"}}}}}catch{}const dp=B.forwardRef(({highlightClassName:l,activeHighlightClassName:e,document:t,page:i,highlight:n,highlights:a,activeIds:s,facetInfoMap:o,overlapMeta:d,_useHtmlBbox:h,_usePdfTextItem:c,_isPdfRenderError:u=!1,setCurrentPage:p,setIsPdfRenderError:f,...w},A)=>{const y=`${Tt.prefix}--category`,{scale:x}=w,M={highlightClassName:l,activeHighlightClassName:e,document:t,_useHtmlBbox:h,_usePdfTextItem:c},v=10,[I,S]=B.useState(null),D=L5(n),[T,P]=B.useState(void 0);B.useEffect(()=>{async function O(){if(t){const _=await gM(t,{tables:D});P(_)}}O()},[t,D]);const C=IM({queryHighlight:n,fieldHighlights:a,activeIds:s,document:t,documentInfo:T}),N=D5(i,C.activePages,C.activeIds,p),R=v5(u,f),L=Object.values(o||{}).map(O=>{const _=O.facetId.localeCompare(FA)===0?`z-index: ${v};`:"";return` .${y}-${O.facetId}.highlight { diff --git a/docs/storybook/assets/WithTooltip-V3YHNWJZ-JV42Hbb2.js b/docs/storybook/assets/WithTooltip-V3YHNWJZ-7eC_V2oR.js similarity index 80% rename from docs/storybook/assets/WithTooltip-V3YHNWJZ-JV42Hbb2.js rename to docs/storybook/assets/WithTooltip-V3YHNWJZ-7eC_V2oR.js index 759b3bd4..5fa259d2 100644 --- a/docs/storybook/assets/WithTooltip-V3YHNWJZ-JV42Hbb2.js +++ b/docs/storybook/assets/WithTooltip-V3YHNWJZ-7eC_V2oR.js @@ -1 +1 @@ -import{W as d,W as g,a as j}from"./index-zqxewmvn.js";import"./iframe-FA3YUiXb.js";import"../sb-preview/runtime.js";import"./pickBy-ZgIsky0p.js";import"./callBound-Uz6qjr9w.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";export{d as WithToolTipState,g as WithTooltip,j as WithTooltipPure}; +import{W as d,W as g,a as j}from"./index-tQLynm0T.js";import"./iframe-xC5OGfiz.js";import"../sb-preview/runtime.js";import"./pickBy-ZgIsky0p.js";import"./callBound-Uz6qjr9w.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";export{d as WithToolTipState,g as WithTooltip,j as WithTooltipPure}; diff --git a/docs/storybook/assets/formatter-SWP5E3XI-4AxpoQyI.js b/docs/storybook/assets/formatter-SWP5E3XI-2S88nLcu.js similarity index 99% rename from docs/storybook/assets/formatter-SWP5E3XI-4AxpoQyI.js rename to docs/storybook/assets/formatter-SWP5E3XI-2S88nLcu.js index c4646e27..72266a85 100644 --- a/docs/storybook/assets/formatter-SWP5E3XI-4AxpoQyI.js +++ b/docs/storybook/assets/formatter-SWP5E3XI-2S88nLcu.js @@ -1,4 +1,4 @@ -import{m as cl,g as Dn}from"./pickBy-ZgIsky0p.js";import{_ as ta,b as ra}from"./index-zqxewmvn.js";import"./callBound-Uz6qjr9w.js";import"./index-RfLt4OUa.js";import"./iframe-FA3YUiXb.js";import"../sb-preview/runtime.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";var Dl=ra({"node_modules/prettier/parser-html.js"(Jr,Xr){(function(Ae){if(typeof Jr=="object"&&typeof Xr=="object")Xr.exports=Ae();else if(typeof define=="function"&&define.amd)define(Ae);else{var Yt=typeof globalThis<"u"?globalThis:typeof Dn<"u"?Dn:typeof self<"u"?self:this||{};Yt.prettierPlugins=Yt.prettierPlugins||{},Yt.prettierPlugins.html=Ae()}})(function(){var Ae=(ot,Ne)=>()=>(Ne||ot((Ne={exports:{}}).exports,Ne),Ne.exports),Yt=Ae((ot,Ne)=>{var Se=function(Oe){return Oe&&Oe.Math==Math&&Oe};Ne.exports=Se(typeof globalThis=="object"&&globalThis)||Se(typeof window=="object"&&window)||Se(typeof self=="object"&&self)||Se(typeof Dn=="object"&&Dn)||function(){return this}()||Function("return this")()}),hr=Ae((ot,Ne)=>{Ne.exports=function(Se){try{return!!Se()}catch{return!0}}}),br=Ae((ot,Ne)=>{var Se=hr();Ne.exports=!Se(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})}),Hr=Ae((ot,Ne)=>{var Se=hr();Ne.exports=!Se(function(){var Oe=(function(){}).bind();return typeof Oe!="function"||Oe.hasOwnProperty("prototype")})}),gr=Ae((ot,Ne)=>{var Se=Hr(),Oe=Function.prototype.call;Ne.exports=Se?Oe.bind(Oe):function(){return Oe.apply(Oe,arguments)}}),dn=Ae(ot=>{var Ne={}.propertyIsEnumerable,Se=Object.getOwnPropertyDescriptor,Oe=Se&&!Ne.call({1:2},1);ot.f=Oe?function(ee){var V=Se(this,ee);return!!V&&V.enumerable}:Ne}),Lr=Ae((ot,Ne)=>{Ne.exports=function(Se,Oe){return{enumerable:!(Se&1),configurable:!(Se&2),writable:!(Se&4),value:Oe}}}),Dr=Ae((ot,Ne)=>{var Se=Hr(),Oe=Function.prototype,ee=Oe.call,V=Se&&Oe.bind.bind(ee,ee);Ne.exports=Se?V:function(W){return function(){return ee.apply(W,arguments)}}}),Br=Ae((ot,Ne)=>{var Se=Dr(),Oe=Se({}.toString),ee=Se("".slice);Ne.exports=function(V){return ee(Oe(V),8,-1)}}),Zr=Ae((ot,Ne)=>{var Se=Dr(),Oe=hr(),ee=Br(),V=Object,W=Se("".split);Ne.exports=Oe(function(){return!V("z").propertyIsEnumerable(0)})?function(Z){return ee(Z)=="String"?W(Z,""):V(Z)}:V}),nn=Ae((ot,Ne)=>{Ne.exports=function(Se){return Se==null}}),Vn=Ae((ot,Ne)=>{var Se=nn(),Oe=TypeError;Ne.exports=function(ee){if(Se(ee))throw Oe("Can't call method on "+ee);return ee}}),fn=Ae((ot,Ne)=>{var Se=Zr(),Oe=Vn();Ne.exports=function(ee){return Se(Oe(ee))}}),Un=Ae((ot,Ne)=>{var Se=typeof document=="object"&&document.all,Oe=typeof Se>"u"&&Se!==void 0;Ne.exports={all:Se,IS_HTMLDDA:Oe}}),dr=Ae((ot,Ne)=>{var Se=Un(),Oe=Se.all;Ne.exports=Se.IS_HTMLDDA?function(ee){return typeof ee=="function"||ee===Oe}:function(ee){return typeof ee=="function"}}),Or=Ae((ot,Ne)=>{var Se=dr(),Oe=Un(),ee=Oe.all;Ne.exports=Oe.IS_HTMLDDA?function(V){return typeof V=="object"?V!==null:Se(V)||V===ee}:function(V){return typeof V=="object"?V!==null:Se(V)}}),un=Ae((ot,Ne)=>{var Se=Yt(),Oe=dr(),ee=function(V){return Oe(V)?V:void 0};Ne.exports=function(V,W){return arguments.length<2?ee(Se[V]):Se[V]&&Se[V][W]}}),Gn=Ae((ot,Ne)=>{var Se=Dr();Ne.exports=Se({}.isPrototypeOf)}),si=Ae((ot,Ne)=>{var Se=un();Ne.exports=Se("navigator","userAgent")||""}),ai=Ae((ot,Ne)=>{var Se=Yt(),Oe=si(),ee=Se.process,V=Se.Deno,W=ee&&ee.versions||V&&V.version,Z=W&&W.v8,Y,ne;Z&&(Y=Z.split("."),ne=Y[0]>0&&Y[0]<4?1:+(Y[0]+Y[1])),!ne&&Oe&&(Y=Oe.match(/Edge\/(\d+)/),(!Y||Y[1]>=74)&&(Y=Oe.match(/Chrome\/(\d+)/),Y&&(ne=+Y[1]))),Ne.exports=ne}),Jn=Ae((ot,Ne)=>{var Se=ai(),Oe=hr();Ne.exports=!!Object.getOwnPropertySymbols&&!Oe(function(){var ee=Symbol();return!String(ee)||!(Object(ee)instanceof Symbol)||!Symbol.sham&&Se&&Se<41})}),Xn=Ae((ot,Ne)=>{var Se=Jn();Ne.exports=Se&&!Symbol.sham&&typeof Symbol.iterator=="symbol"}),Wn=Ae((ot,Ne)=>{var Se=un(),Oe=dr(),ee=Gn(),V=Xn(),W=Object;Ne.exports=V?function(Z){return typeof Z=="symbol"}:function(Z){var Y=Se("Symbol");return Oe(Y)&&ee(Y.prototype,W(Z))}}),mn=Ae((ot,Ne)=>{var Se=String;Ne.exports=function(Oe){try{return Se(Oe)}catch{return"Object"}}}),sn=Ae((ot,Ne)=>{var Se=dr(),Oe=mn(),ee=TypeError;Ne.exports=function(V){if(Se(V))return V;throw ee(Oe(V)+" is not a function")}}),hn=Ae((ot,Ne)=>{var Se=sn(),Oe=nn();Ne.exports=function(ee,V){var W=ee[V];return Oe(W)?void 0:Se(W)}}),oi=Ae((ot,Ne)=>{var Se=gr(),Oe=dr(),ee=Or(),V=TypeError;Ne.exports=function(W,Z){var Y,ne;if(Z==="string"&&Oe(Y=W.toString)&&!ee(ne=Se(Y,W))||Oe(Y=W.valueOf)&&!ee(ne=Se(Y,W))||Z!=="string"&&Oe(Y=W.toString)&&!ee(ne=Se(Y,W)))return ne;throw V("Can't convert object to primitive value")}}),li=Ae((ot,Ne)=>{Ne.exports=!1}),gn=Ae((ot,Ne)=>{var Se=Yt(),Oe=Object.defineProperty;Ne.exports=function(ee,V){try{Oe(Se,ee,{value:V,configurable:!0,writable:!0})}catch{Se[ee]=V}return V}}),yn=Ae((ot,Ne)=>{var Se=Yt(),Oe=gn(),ee="__core-js_shared__",V=Se[ee]||Oe(ee,{});Ne.exports=V}),zn=Ae((ot,Ne)=>{var Se=li(),Oe=yn();(Ne.exports=function(ee,V){return Oe[ee]||(Oe[ee]=V!==void 0?V:{})})("versions",[]).push({version:"3.26.1",mode:Se?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"})}),xn=Ae((ot,Ne)=>{var Se=Vn(),Oe=Object;Ne.exports=function(ee){return Oe(Se(ee))}}),kr=Ae((ot,Ne)=>{var Se=Dr(),Oe=xn(),ee=Se({}.hasOwnProperty);Ne.exports=Object.hasOwn||function(V,W){return ee(Oe(V),W)}}),Hn=Ae((ot,Ne)=>{var Se=Dr(),Oe=0,ee=Math.random(),V=Se(1 .toString);Ne.exports=function(W){return"Symbol("+(W===void 0?"":W)+")_"+V(++Oe+ee,36)}}),$r=Ae((ot,Ne)=>{var Se=Yt(),Oe=zn(),ee=kr(),V=Hn(),W=Jn(),Z=Xn(),Y=Oe("wks"),ne=Se.Symbol,Fe=ne&&ne.for,je=Z?ne:ne&&ne.withoutSetter||V;Ne.exports=function(he){if(!ee(Y,he)||!(W||typeof Y[he]=="string")){var qe="Symbol."+he;W&&ee(ne,he)?Y[he]=ne[he]:Z&&Fe?Y[he]=Fe(qe):Y[he]=je(qe)}return Y[he]}}),pi=Ae((ot,Ne)=>{var Se=gr(),Oe=Or(),ee=Wn(),V=hn(),W=oi(),Z=$r(),Y=TypeError,ne=Z("toPrimitive");Ne.exports=function(Fe,je){if(!Oe(Fe)||ee(Fe))return Fe;var he=V(Fe,ne),qe;if(he){if(je===void 0&&(je="default"),qe=Se(he,Fe,je),!Oe(qe)||ee(qe))return qe;throw Y("Can't convert object to primitive value")}return je===void 0&&(je="number"),W(Fe,je)}}),En=Ae((ot,Ne)=>{var Se=pi(),Oe=Wn();Ne.exports=function(ee){var V=Se(ee,"string");return Oe(V)?V:V+""}}),ci=Ae((ot,Ne)=>{var Se=Yt(),Oe=Or(),ee=Se.document,V=Oe(ee)&&Oe(ee.createElement);Ne.exports=function(W){return V?ee.createElement(W):{}}}),Yn=Ae((ot,Ne)=>{var Se=br(),Oe=hr(),ee=ci();Ne.exports=!Se&&!Oe(function(){return Object.defineProperty(ee("div"),"a",{get:function(){return 7}}).a!=7})}),Kn=Ae(ot=>{var Ne=br(),Se=gr(),Oe=dn(),ee=Lr(),V=fn(),W=En(),Z=kr(),Y=Yn(),ne=Object.getOwnPropertyDescriptor;ot.f=Ne?ne:function(Fe,je){if(Fe=V(Fe),je=W(je),Y)try{return ne(Fe,je)}catch{}if(Z(Fe,je))return ee(!Se(Oe.f,Fe,je),Fe[je])}}),Di=Ae((ot,Ne)=>{var Se=br(),Oe=hr();Ne.exports=Se&&Oe(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})}),Wr=Ae((ot,Ne)=>{var Se=Or(),Oe=String,ee=TypeError;Ne.exports=function(V){if(Se(V))return V;throw ee(Oe(V)+" is not an object")}}),en=Ae(ot=>{var Ne=br(),Se=Yn(),Oe=Di(),ee=Wr(),V=En(),W=TypeError,Z=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,ne="enumerable",Fe="configurable",je="writable";ot.f=Ne?Oe?function(he,qe,et){if(ee(he),qe=V(qe),ee(et),typeof he=="function"&&qe==="prototype"&&"value"in et&&je in et&&!et[je]){var Ze=Y(he,qe);Ze&&Ze[je]&&(he[qe]=et.value,et={configurable:Fe in et?et[Fe]:Ze[Fe],enumerable:ne in et?et[ne]:Ze[ne],writable:!1})}return Z(he,qe,et)}:Z:function(he,qe,et){if(ee(he),qe=V(qe),ee(et),Se)try{return Z(he,qe,et)}catch{}if("get"in et||"set"in et)throw W("Accessors not supported");return"value"in et&&(he[qe]=et.value),he}}),Qn=Ae((ot,Ne)=>{var Se=br(),Oe=en(),ee=Lr();Ne.exports=Se?function(V,W,Z){return Oe.f(V,W,ee(1,Z))}:function(V,W,Z){return V[W]=Z,V}}),di=Ae((ot,Ne)=>{var Se=br(),Oe=kr(),ee=Function.prototype,V=Se&&Object.getOwnPropertyDescriptor,W=Oe(ee,"name"),Z=W&&(function(){}).name==="something",Y=W&&(!Se||Se&&V(ee,"name").configurable);Ne.exports={EXISTS:W,PROPER:Z,CONFIGURABLE:Y}}),Zn=Ae((ot,Ne)=>{var Se=Dr(),Oe=dr(),ee=yn(),V=Se(Function.toString);Oe(ee.inspectSource)||(ee.inspectSource=function(W){return V(W)}),Ne.exports=ee.inspectSource}),fi=Ae((ot,Ne)=>{var Se=Yt(),Oe=dr(),ee=Se.WeakMap;Ne.exports=Oe(ee)&&/native code/.test(String(ee))}),mi=Ae((ot,Ne)=>{var Se=zn(),Oe=Hn(),ee=Se("keys");Ne.exports=function(V){return ee[V]||(ee[V]=Oe(V))}}),eu=Ae((ot,Ne)=>{Ne.exports={}}),hi=Ae((ot,Ne)=>{var Se=fi(),Oe=Yt(),ee=Or(),V=Qn(),W=kr(),Z=yn(),Y=mi(),ne=eu(),Fe="Object already initialized",je=Oe.TypeError,he=Oe.WeakMap,qe,et,Ze,nt=function(At){return Ze(At)?et(At):qe(At,{})},rt=function(At){return function(Lt){var qt;if(!ee(Lt)||(qt=et(Lt)).type!==At)throw je("Incompatible receiver, "+At+" required");return qt}};Se||Z.state?($=Z.state||(Z.state=new he),$.get=$.get,$.has=$.has,$.set=$.set,qe=function(At,Lt){if($.has(At))throw je(Fe);return Lt.facade=At,$.set(At,Lt),Lt},et=function(At){return $.get(At)||{}},Ze=function(At){return $.has(At)}):(Ft=Y("state"),ne[Ft]=!0,qe=function(At,Lt){if(W(At,Ft))throw je(Fe);return Lt.facade=At,V(At,Ft,Lt),Lt},et=function(At){return W(At,Ft)?At[Ft]:{}},Ze=function(At){return W(At,Ft)});var $,Ft;Ne.exports={set:qe,get:et,has:Ze,enforce:nt,getterFor:rt}}),yu=Ae((ot,Ne)=>{var Se=hr(),Oe=dr(),ee=kr(),V=br(),W=di().CONFIGURABLE,Z=Zn(),Y=hi(),ne=Y.enforce,Fe=Y.get,je=Object.defineProperty,he=V&&!Se(function(){return je(function(){},"length",{value:8}).length!==8}),qe=String(String).split("String"),et=Ne.exports=function(Ze,nt,rt){String(nt).slice(0,7)==="Symbol("&&(nt="["+String(nt).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),rt&&rt.getter&&(nt="get "+nt),rt&&rt.setter&&(nt="set "+nt),(!ee(Ze,"name")||W&&Ze.name!==nt)&&(V?je(Ze,"name",{value:nt,configurable:!0}):Ze.name=nt),he&&rt&&ee(rt,"arity")&&Ze.length!==rt.arity&&je(Ze,"length",{value:rt.arity});try{rt&&ee(rt,"constructor")&&rt.constructor?V&&je(Ze,"prototype",{writable:!1}):Ze.prototype&&(Ze.prototype=void 0)}catch{}var $=ne(Ze);return ee($,"source")||($.source=qe.join(typeof nt=="string"?nt:"")),Ze};Function.prototype.toString=et(function(){return Oe(this)&&Fe(this).source||Z(this)},"toString")}),gi=Ae((ot,Ne)=>{var Se=dr(),Oe=en(),ee=yu(),V=gn();Ne.exports=function(W,Z,Y,ne){ne||(ne={});var Fe=ne.enumerable,je=ne.name!==void 0?ne.name:Z;if(Se(Y)&&ee(Y,je,ne),ne.global)Fe?W[Z]=Y:V(Z,Y);else{try{ne.unsafe?W[Z]&&(Fe=!0):delete W[Z]}catch{}Fe?W[Z]=Y:Oe.f(W,Z,{value:Y,enumerable:!1,configurable:!ne.nonConfigurable,writable:!ne.nonWritable})}return W}}),yi=Ae((ot,Ne)=>{var Se=Math.ceil,Oe=Math.floor;Ne.exports=Math.trunc||function(ee){var V=+ee;return(V>0?Oe:Se)(V)}}),Tn=Ae((ot,Ne)=>{var Se=yi();Ne.exports=function(Oe){var ee=+Oe;return ee!==ee||ee===0?0:Se(ee)}}),Ei=Ae((ot,Ne)=>{var Se=Tn(),Oe=Math.max,ee=Math.min;Ne.exports=function(V,W){var Z=Se(V);return Z<0?Oe(Z+W,0):ee(Z,W)}}),Ci=Ae((ot,Ne)=>{var Se=Tn(),Oe=Math.min;Ne.exports=function(ee){return ee>0?Oe(Se(ee),9007199254740991):0}}),tn=Ae((ot,Ne)=>{var Se=Ci();Ne.exports=function(Oe){return Se(Oe.length)}}),Fi=Ae((ot,Ne)=>{var Se=fn(),Oe=Ei(),ee=tn(),V=function(W){return function(Z,Y,ne){var Fe=Se(Z),je=ee(Fe),he=Oe(ne,je),qe;if(W&&Y!=Y){for(;je>he;)if(qe=Fe[he++],qe!=qe)return!0}else for(;je>he;he++)if((W||he in Fe)&&Fe[he]===Y)return W||he||0;return!W&&-1}};Ne.exports={includes:V(!0),indexOf:V(!1)}}),Ai=Ae((ot,Ne)=>{var Se=Dr(),Oe=kr(),ee=fn(),V=Fi().indexOf,W=eu(),Z=Se([].push);Ne.exports=function(Y,ne){var Fe=ee(Y),je=0,he=[],qe;for(qe in Fe)!Oe(W,qe)&&Oe(Fe,qe)&&Z(he,qe);for(;ne.length>je;)Oe(Fe,qe=ne[je++])&&(~V(he,qe)||Z(he,qe));return he}}),vi=Ae((ot,Ne)=>{Ne.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),bi=Ae(ot=>{var Ne=Ai(),Se=vi(),Oe=Se.concat("length","prototype");ot.f=Object.getOwnPropertyNames||function(ee){return Ne(ee,Oe)}}),Si=Ae(ot=>{ot.f=Object.getOwnPropertySymbols}),xi=Ae((ot,Ne)=>{var Se=un(),Oe=Dr(),ee=bi(),V=Si(),W=Wr(),Z=Oe([].concat);Ne.exports=Se("Reflect","ownKeys")||function(Y){var ne=ee.f(W(Y)),Fe=V.f;return Fe?Z(ne,Fe(Y)):ne}}),Ti=Ae((ot,Ne)=>{var Se=kr(),Oe=xi(),ee=Kn(),V=en();Ne.exports=function(W,Z,Y){for(var ne=Oe(Z),Fe=V.f,je=ee.f,he=0;he{var Se=hr(),Oe=dr(),ee=/#|\.prototype\./,V=function(Fe,je){var he=Z[W(Fe)];return he==ne?!0:he==Y?!1:Oe(je)?Se(je):!!je},W=V.normalize=function(Fe){return String(Fe).replace(ee,".").toLowerCase()},Z=V.data={},Y=V.NATIVE="N",ne=V.POLYFILL="P";Ne.exports=V}),an=Ae((ot,Ne)=>{var Se=Yt(),Oe=Kn().f,ee=Qn(),V=gi(),W=gn(),Z=Ti(),Y=Bi();Ne.exports=function(ne,Fe){var je=ne.target,he=ne.global,qe=ne.stat,et,Ze,nt,rt,$,Ft;if(he?Ze=Se:qe?Ze=Se[je]||W(je,{}):Ze=(Se[je]||{}).prototype,Ze)for(nt in Fe){if($=Fe[nt],ne.dontCallGetSet?(Ft=Oe(Ze,nt),rt=Ft&&Ft.value):rt=Ze[nt],et=Y(he?nt:je+(qe?".":"#")+nt,ne.forced),!et&&rt!==void 0){if(typeof $==typeof rt)continue;Z($,rt)}(ne.sham||rt&&rt.sham)&&ee($,"sham",!0),V(Ze,nt,$,ne)}}}),Eu=Ae(()=>{var ot=an(),Ne=Yt();ot({global:!0,forced:Ne.globalThis!==Ne},{globalThis:Ne})}),wi=Ae(()=>{Eu()}),Cu=Ae((ot,Ne)=>{var Se=Br();Ne.exports=Array.isArray||function(Oe){return Se(Oe)=="Array"}}),Fu=Ae((ot,Ne)=>{var Se=TypeError,Oe=9007199254740991;Ne.exports=function(ee){if(ee>Oe)throw Se("Maximum allowed index exceeded");return ee}}),Au=Ae((ot,Ne)=>{var Se=Br(),Oe=Dr();Ne.exports=function(ee){if(Se(ee)==="Function")return Oe(ee)}}),vu=Ae((ot,Ne)=>{var Se=Au(),Oe=sn(),ee=Hr(),V=Se(Se.bind);Ne.exports=function(W,Z){return Oe(W),Z===void 0?W:ee?V(W,Z):function(){return W.apply(Z,arguments)}}}),bu=Ae((ot,Ne)=>{var Se=Cu(),Oe=tn(),ee=Fu(),V=vu(),W=function(Z,Y,ne,Fe,je,he,qe,et){for(var Ze=je,nt=0,rt=qe?V(qe,et):!1,$,Ft;nt0&&Se($)?(Ft=Oe($),Ze=W(Z,Y,$,Ft,Ze,he-1)-1):(ee(Ze+1),Z[Ze]=$),Ze++),nt++;return Ze};Ne.exports=W}),Ni=Ae((ot,Ne)=>{var Se=$r(),Oe=Se("toStringTag"),ee={};ee[Oe]="z",Ne.exports=String(ee)==="[object z]"}),Su=Ae((ot,Ne)=>{var Se=Ni(),Oe=dr(),ee=Br(),V=$r(),W=V("toStringTag"),Z=Object,Y=ee(function(){return arguments}())=="Arguments",ne=function(Fe,je){try{return Fe[je]}catch{}};Ne.exports=Se?ee:function(Fe){var je,he,qe;return Fe===void 0?"Undefined":Fe===null?"Null":typeof(he=ne(je=Z(Fe),W))=="string"?he:Y?ee(je):(qe=ee(je))=="Object"&&Oe(je.callee)?"Arguments":qe}}),xu=Ae((ot,Ne)=>{var Se=Dr(),Oe=hr(),ee=dr(),V=Su(),W=un(),Z=Zn(),Y=function(){},ne=[],Fe=W("Reflect","construct"),je=/^\s*(?:class|function)\b/,he=Se(je.exec),qe=!je.exec(Y),et=function(nt){if(!ee(nt))return!1;try{return Fe(Y,ne,nt),!0}catch{return!1}},Ze=function(nt){if(!ee(nt))return!1;switch(V(nt)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return qe||!!he(je,Z(nt))}catch{return!0}};Ze.sham=!0,Ne.exports=!Fe||Oe(function(){var nt;return et(et.call)||!et(Object)||!et(function(){nt=!0})||nt})?Ze:et}),_i=Ae((ot,Ne)=>{var Se=Cu(),Oe=xu(),ee=Or(),V=$r(),W=V("species"),Z=Array;Ne.exports=function(Y){var ne;return Se(Y)&&(ne=Y.constructor,Oe(ne)&&(ne===Z||Se(ne.prototype))?ne=void 0:ee(ne)&&(ne=ne[W],ne===null&&(ne=void 0))),ne===void 0?Z:ne}}),Tu=Ae((ot,Ne)=>{var Se=_i();Ne.exports=function(Oe,ee){return new(Se(Oe))(ee===0?0:ee)}}),ki=Ae(()=>{var ot=an(),Ne=bu(),Se=sn(),Oe=xn(),ee=tn(),V=Tu();ot({target:"Array",proto:!0},{flatMap:function(W){var Z=Oe(this),Y=ee(Z),ne;return Se(W),ne=V(Z,0),ne.length=Ne(ne,Z,Z,Y,0,1,W,arguments.length>1?arguments[1]:void 0),ne}})}),tu=Ae((ot,Ne)=>{Ne.exports={}}),Pi=Ae((ot,Ne)=>{var Se=$r(),Oe=tu(),ee=Se("iterator"),V=Array.prototype;Ne.exports=function(W){return W!==void 0&&(Oe.Array===W||V[ee]===W)}}),Bu=Ae((ot,Ne)=>{var Se=Su(),Oe=hn(),ee=nn(),V=tu(),W=$r(),Z=W("iterator");Ne.exports=function(Y){if(!ee(Y))return Oe(Y,Z)||Oe(Y,"@@iterator")||V[Se(Y)]}}),Ii=Ae((ot,Ne)=>{var Se=gr(),Oe=sn(),ee=Wr(),V=mn(),W=Bu(),Z=TypeError;Ne.exports=function(Y,ne){var Fe=arguments.length<2?W(Y):ne;if(Oe(Fe))return ee(Se(Fe,Y));throw Z(V(Y)+" is not iterable")}}),ji=Ae((ot,Ne)=>{var Se=gr(),Oe=Wr(),ee=hn();Ne.exports=function(V,W,Z){var Y,ne;Oe(V);try{if(Y=ee(V,"return"),!Y){if(W==="throw")throw Z;return Z}Y=Se(Y,V)}catch(Fe){ne=!0,Y=Fe}if(W==="throw")throw Z;if(ne)throw Y;return Oe(Y),Z}}),Li=Ae((ot,Ne)=>{var Se=vu(),Oe=gr(),ee=Wr(),V=mn(),W=Pi(),Z=tn(),Y=Gn(),ne=Ii(),Fe=Bu(),je=ji(),he=TypeError,qe=function(Ze,nt){this.stopped=Ze,this.result=nt},et=qe.prototype;Ne.exports=function(Ze,nt,rt){var $=rt&&rt.that,Ft=!!(rt&&rt.AS_ENTRIES),At=!!(rt&&rt.IS_RECORD),Lt=!!(rt&&rt.IS_ITERATOR),qt=!!(rt&&rt.INTERRUPTED),Zt=Se(nt,$),ue,yr,Pr,zr,fr,Rr,mr,rn=function(Fr){return ue&&je(ue,"normal",Fr),new qe(!0,Fr)},wr=function(Fr){return Ft?(ee(Fr),qt?Zt(Fr[0],Fr[1],rn):Zt(Fr[0],Fr[1])):qt?Zt(Fr,rn):Zt(Fr)};if(At)ue=Ze.iterator;else if(Lt)ue=Ze;else{if(yr=Fe(Ze),!yr)throw he(V(Ze)+" is not iterable");if(W(yr)){for(Pr=0,zr=Z(Ze);zr>Pr;Pr++)if(fr=wr(Ze[Pr]),fr&&Y(et,fr))return fr;return new qe(!1)}ue=ne(Ze,yr)}for(Rr=At?Ze.next:ue.next;!(mr=Oe(Rr,ue)).done;){try{fr=wr(mr.value)}catch(Fr){je(ue,"throw",Fr)}if(typeof fr=="object"&&fr&&Y(et,fr))return fr}return new qe(!1)}}),Oi=Ae((ot,Ne)=>{var Se=En(),Oe=en(),ee=Lr();Ne.exports=function(V,W,Z){var Y=Se(W);Y in V?Oe.f(V,Y,ee(0,Z)):V[Y]=Z}}),$i=Ae(()=>{var ot=an(),Ne=Li(),Se=Oi();ot({target:"Object",stat:!0},{fromEntries:function(Oe){var ee={};return Ne(Oe,function(V,W){Se(ee,V,W)},{AS_ENTRIES:!0}),ee}})}),Ri=Ae((ot,Ne)=>{var Se=["cliName","cliCategory","cliDescription"];function Oe(L,re){if(L==null)return{};var ge=ee(L,re),Ee,Pe;if(Object.getOwnPropertySymbols){var ie=Object.getOwnPropertySymbols(L);for(Pe=0;Pe=0)&&Object.prototype.propertyIsEnumerable.call(L,Ee)&&(ge[Ee]=L[Ee])}return ge}function ee(L,re){if(L==null)return{};var ge={},Ee=Object.keys(L),Pe,ie;for(ie=0;ie=0)&&(ge[Pe]=L[Pe]);return ge}wi(),ki(),$i();var V=Object.create,W=Object.defineProperty,Z=Object.getOwnPropertyDescriptor,Y=Object.getOwnPropertyNames,ne=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty,je=(L,re)=>function(){return L&&(re=(0,L[Y(L)[0]])(L=0)),re},he=(L,re)=>function(){return re||(0,L[Y(L)[0]])((re={exports:{}}).exports,re),re.exports},qe=(L,re)=>{for(var ge in re)W(L,ge,{get:re[ge],enumerable:!0})},et=(L,re,ge,Ee)=>{if(re&&typeof re=="object"||typeof re=="function")for(let Pe of Y(re))!Fe.call(L,Pe)&&Pe!==ge&&W(L,Pe,{get:()=>re[Pe],enumerable:!(Ee=Z(re,Pe))||Ee.enumerable});return L},Ze=(L,re,ge)=>(ge=L!=null?V(ne(L)):{},et(re||!L||!L.__esModule?W(ge,"default",{value:L,enumerable:!0}):ge,L)),nt=L=>et(W({},"__esModule",{value:!0}),L),rt,$=je({""(){rt={env:{},argv:[]}}}),Ft=he({"node_modules/angular-html-parser/lib/compiler/src/chars.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0}),L.$EOF=0,L.$BSPACE=8,L.$TAB=9,L.$LF=10,L.$VTAB=11,L.$FF=12,L.$CR=13,L.$SPACE=32,L.$BANG=33,L.$DQ=34,L.$HASH=35,L.$$=36,L.$PERCENT=37,L.$AMPERSAND=38,L.$SQ=39,L.$LPAREN=40,L.$RPAREN=41,L.$STAR=42,L.$PLUS=43,L.$COMMA=44,L.$MINUS=45,L.$PERIOD=46,L.$SLASH=47,L.$COLON=58,L.$SEMICOLON=59,L.$LT=60,L.$EQ=61,L.$GT=62,L.$QUESTION=63,L.$0=48,L.$7=55,L.$9=57,L.$A=65,L.$E=69,L.$F=70,L.$X=88,L.$Z=90,L.$LBRACKET=91,L.$BACKSLASH=92,L.$RBRACKET=93,L.$CARET=94,L.$_=95,L.$a=97,L.$b=98,L.$e=101,L.$f=102,L.$n=110,L.$r=114,L.$t=116,L.$u=117,L.$v=118,L.$x=120,L.$z=122,L.$LBRACE=123,L.$BAR=124,L.$RBRACE=125,L.$NBSP=160,L.$PIPE=124,L.$TILDA=126,L.$AT=64,L.$BT=96;function re(Ue){return Ue>=L.$TAB&&Ue<=L.$SPACE||Ue==L.$NBSP}L.isWhitespace=re;function ge(Ue){return L.$0<=Ue&&Ue<=L.$9}L.isDigit=ge;function Ee(Ue){return Ue>=L.$a&&Ue<=L.$z||Ue>=L.$A&&Ue<=L.$Z}L.isAsciiLetter=Ee;function Pe(Ue){return Ue>=L.$a&&Ue<=L.$f||Ue>=L.$A&&Ue<=L.$F||ge(Ue)}L.isAsciiHexDigit=Pe;function ie(Ue){return Ue===L.$LF||Ue===L.$CR}L.isNewLine=ie;function de(Ue){return L.$0<=Ue&&Ue<=L.$7}L.isOctalDigit=de}}),At=he({"node_modules/angular-html-parser/lib/compiler/src/aot/static_symbol.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=class{constructor(Ee,Pe,ie){this.filePath=Ee,this.name=Pe,this.members=ie}assertNoMembers(){if(this.members.length)throw new Error(`Illegal state: symbol without members expected, but got ${JSON.stringify(this)}.`)}};L.StaticSymbol=re;var ge=class{constructor(){this.cache=new Map}get(Ee,Pe,ie){ie=ie||[];let de=ie.length?`.${ie.join(".")}`:"",Ue=`"${Ee}".${Pe}${de}`,Ge=this.cache.get(Ue);return Ge||(Ge=new re(Ee,Pe,ie),this.cache.set(Ue,Ge)),Ge}};L.StaticSymbolCache=ge}}),Lt=he({"node_modules/angular-html-parser/lib/compiler/src/util.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=/-+([a-z0-9])/g;function ge(le){return le.replace(re,function(){for(var We=arguments.length,Me=new Array(We),at=0;atde(Me,this,We))}visitStringMap(le,We){let Me={};return Object.keys(le).forEach(at=>{Me[at]=de(le[at],this,We)}),Me}visitPrimitive(le,We){return le}visitOther(le,We){return le}};L.ValueTransformer=gt,L.SyncAsync={assertSync:le=>{if(st(le))throw new Error("Illegal state: value cannot be a promise");return le},then:(le,We)=>st(le)?le.then(We):We(le),all:le=>le.some(st)?Promise.all(le):le};function ce(le){throw new Error(`Internal Error: ${le}`)}L.error=ce;function ve(le,We){let Me=Error(le);return Me[Ve]=!0,We&&(Me[He]=We),Me}L.syntaxError=ve;var Ve="ngSyntaxError",He="ngParseErrors";function Je(le){return le[Ve]}L.isSyntaxError=Je;function Qe(le){return le[He]||[]}L.getParseErrors=Qe;function yt(le){return le.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}L.escapeRegExp=yt;var _t=Object.getPrototypeOf({});function ct(le){return typeof le=="object"&&le!==null&&Object.getPrototypeOf(le)===_t}function kt(le){let We="";for(let Me=0;Me=55296&&at<=56319&&le.length>Me+1){let Jt=le.charCodeAt(Me+1);Jt>=56320&&Jt<=57343&&(Me++,at=(at-55296<<10)+Jt-56320+65536)}at<=127?We+=String.fromCharCode(at):at<=2047?We+=String.fromCharCode(at>>6&31|192,at&63|128):at<=65535?We+=String.fromCharCode(at>>12|224,at>>6&63|128,at&63|128):at<=2097151&&(We+=String.fromCharCode(at>>18&7|240,at>>12&63|128,at>>6&63|128,at&63|128))}return We}L.utf8Encode=kt;function $t(le){if(typeof le=="string")return le;if(le instanceof Array)return"["+le.map($t).join(", ")+"]";if(le==null)return""+le;if(le.overriddenName)return`${le.overriddenName}`;if(le.name)return`${le.name}`;if(!le.toString)return"object";let We=le.toString();if(We==null)return""+We;let Me=We.indexOf(` +import{m as cl,g as Dn}from"./pickBy-ZgIsky0p.js";import{_ as ta,b as ra}from"./index-tQLynm0T.js";import"./callBound-Uz6qjr9w.js";import"./index-RfLt4OUa.js";import"./iframe-xC5OGfiz.js";import"../sb-preview/runtime.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";var Dl=ra({"node_modules/prettier/parser-html.js"(Jr,Xr){(function(Ae){if(typeof Jr=="object"&&typeof Xr=="object")Xr.exports=Ae();else if(typeof define=="function"&&define.amd)define(Ae);else{var Yt=typeof globalThis<"u"?globalThis:typeof Dn<"u"?Dn:typeof self<"u"?self:this||{};Yt.prettierPlugins=Yt.prettierPlugins||{},Yt.prettierPlugins.html=Ae()}})(function(){var Ae=(ot,Ne)=>()=>(Ne||ot((Ne={exports:{}}).exports,Ne),Ne.exports),Yt=Ae((ot,Ne)=>{var Se=function(Oe){return Oe&&Oe.Math==Math&&Oe};Ne.exports=Se(typeof globalThis=="object"&&globalThis)||Se(typeof window=="object"&&window)||Se(typeof self=="object"&&self)||Se(typeof Dn=="object"&&Dn)||function(){return this}()||Function("return this")()}),hr=Ae((ot,Ne)=>{Ne.exports=function(Se){try{return!!Se()}catch{return!0}}}),br=Ae((ot,Ne)=>{var Se=hr();Ne.exports=!Se(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})}),Hr=Ae((ot,Ne)=>{var Se=hr();Ne.exports=!Se(function(){var Oe=(function(){}).bind();return typeof Oe!="function"||Oe.hasOwnProperty("prototype")})}),gr=Ae((ot,Ne)=>{var Se=Hr(),Oe=Function.prototype.call;Ne.exports=Se?Oe.bind(Oe):function(){return Oe.apply(Oe,arguments)}}),dn=Ae(ot=>{var Ne={}.propertyIsEnumerable,Se=Object.getOwnPropertyDescriptor,Oe=Se&&!Ne.call({1:2},1);ot.f=Oe?function(ee){var V=Se(this,ee);return!!V&&V.enumerable}:Ne}),Lr=Ae((ot,Ne)=>{Ne.exports=function(Se,Oe){return{enumerable:!(Se&1),configurable:!(Se&2),writable:!(Se&4),value:Oe}}}),Dr=Ae((ot,Ne)=>{var Se=Hr(),Oe=Function.prototype,ee=Oe.call,V=Se&&Oe.bind.bind(ee,ee);Ne.exports=Se?V:function(W){return function(){return ee.apply(W,arguments)}}}),Br=Ae((ot,Ne)=>{var Se=Dr(),Oe=Se({}.toString),ee=Se("".slice);Ne.exports=function(V){return ee(Oe(V),8,-1)}}),Zr=Ae((ot,Ne)=>{var Se=Dr(),Oe=hr(),ee=Br(),V=Object,W=Se("".split);Ne.exports=Oe(function(){return!V("z").propertyIsEnumerable(0)})?function(Z){return ee(Z)=="String"?W(Z,""):V(Z)}:V}),nn=Ae((ot,Ne)=>{Ne.exports=function(Se){return Se==null}}),Vn=Ae((ot,Ne)=>{var Se=nn(),Oe=TypeError;Ne.exports=function(ee){if(Se(ee))throw Oe("Can't call method on "+ee);return ee}}),fn=Ae((ot,Ne)=>{var Se=Zr(),Oe=Vn();Ne.exports=function(ee){return Se(Oe(ee))}}),Un=Ae((ot,Ne)=>{var Se=typeof document=="object"&&document.all,Oe=typeof Se>"u"&&Se!==void 0;Ne.exports={all:Se,IS_HTMLDDA:Oe}}),dr=Ae((ot,Ne)=>{var Se=Un(),Oe=Se.all;Ne.exports=Se.IS_HTMLDDA?function(ee){return typeof ee=="function"||ee===Oe}:function(ee){return typeof ee=="function"}}),Or=Ae((ot,Ne)=>{var Se=dr(),Oe=Un(),ee=Oe.all;Ne.exports=Oe.IS_HTMLDDA?function(V){return typeof V=="object"?V!==null:Se(V)||V===ee}:function(V){return typeof V=="object"?V!==null:Se(V)}}),un=Ae((ot,Ne)=>{var Se=Yt(),Oe=dr(),ee=function(V){return Oe(V)?V:void 0};Ne.exports=function(V,W){return arguments.length<2?ee(Se[V]):Se[V]&&Se[V][W]}}),Gn=Ae((ot,Ne)=>{var Se=Dr();Ne.exports=Se({}.isPrototypeOf)}),si=Ae((ot,Ne)=>{var Se=un();Ne.exports=Se("navigator","userAgent")||""}),ai=Ae((ot,Ne)=>{var Se=Yt(),Oe=si(),ee=Se.process,V=Se.Deno,W=ee&&ee.versions||V&&V.version,Z=W&&W.v8,Y,ne;Z&&(Y=Z.split("."),ne=Y[0]>0&&Y[0]<4?1:+(Y[0]+Y[1])),!ne&&Oe&&(Y=Oe.match(/Edge\/(\d+)/),(!Y||Y[1]>=74)&&(Y=Oe.match(/Chrome\/(\d+)/),Y&&(ne=+Y[1]))),Ne.exports=ne}),Jn=Ae((ot,Ne)=>{var Se=ai(),Oe=hr();Ne.exports=!!Object.getOwnPropertySymbols&&!Oe(function(){var ee=Symbol();return!String(ee)||!(Object(ee)instanceof Symbol)||!Symbol.sham&&Se&&Se<41})}),Xn=Ae((ot,Ne)=>{var Se=Jn();Ne.exports=Se&&!Symbol.sham&&typeof Symbol.iterator=="symbol"}),Wn=Ae((ot,Ne)=>{var Se=un(),Oe=dr(),ee=Gn(),V=Xn(),W=Object;Ne.exports=V?function(Z){return typeof Z=="symbol"}:function(Z){var Y=Se("Symbol");return Oe(Y)&&ee(Y.prototype,W(Z))}}),mn=Ae((ot,Ne)=>{var Se=String;Ne.exports=function(Oe){try{return Se(Oe)}catch{return"Object"}}}),sn=Ae((ot,Ne)=>{var Se=dr(),Oe=mn(),ee=TypeError;Ne.exports=function(V){if(Se(V))return V;throw ee(Oe(V)+" is not a function")}}),hn=Ae((ot,Ne)=>{var Se=sn(),Oe=nn();Ne.exports=function(ee,V){var W=ee[V];return Oe(W)?void 0:Se(W)}}),oi=Ae((ot,Ne)=>{var Se=gr(),Oe=dr(),ee=Or(),V=TypeError;Ne.exports=function(W,Z){var Y,ne;if(Z==="string"&&Oe(Y=W.toString)&&!ee(ne=Se(Y,W))||Oe(Y=W.valueOf)&&!ee(ne=Se(Y,W))||Z!=="string"&&Oe(Y=W.toString)&&!ee(ne=Se(Y,W)))return ne;throw V("Can't convert object to primitive value")}}),li=Ae((ot,Ne)=>{Ne.exports=!1}),gn=Ae((ot,Ne)=>{var Se=Yt(),Oe=Object.defineProperty;Ne.exports=function(ee,V){try{Oe(Se,ee,{value:V,configurable:!0,writable:!0})}catch{Se[ee]=V}return V}}),yn=Ae((ot,Ne)=>{var Se=Yt(),Oe=gn(),ee="__core-js_shared__",V=Se[ee]||Oe(ee,{});Ne.exports=V}),zn=Ae((ot,Ne)=>{var Se=li(),Oe=yn();(Ne.exports=function(ee,V){return Oe[ee]||(Oe[ee]=V!==void 0?V:{})})("versions",[]).push({version:"3.26.1",mode:Se?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"})}),xn=Ae((ot,Ne)=>{var Se=Vn(),Oe=Object;Ne.exports=function(ee){return Oe(Se(ee))}}),kr=Ae((ot,Ne)=>{var Se=Dr(),Oe=xn(),ee=Se({}.hasOwnProperty);Ne.exports=Object.hasOwn||function(V,W){return ee(Oe(V),W)}}),Hn=Ae((ot,Ne)=>{var Se=Dr(),Oe=0,ee=Math.random(),V=Se(1 .toString);Ne.exports=function(W){return"Symbol("+(W===void 0?"":W)+")_"+V(++Oe+ee,36)}}),$r=Ae((ot,Ne)=>{var Se=Yt(),Oe=zn(),ee=kr(),V=Hn(),W=Jn(),Z=Xn(),Y=Oe("wks"),ne=Se.Symbol,Fe=ne&&ne.for,je=Z?ne:ne&&ne.withoutSetter||V;Ne.exports=function(he){if(!ee(Y,he)||!(W||typeof Y[he]=="string")){var qe="Symbol."+he;W&&ee(ne,he)?Y[he]=ne[he]:Z&&Fe?Y[he]=Fe(qe):Y[he]=je(qe)}return Y[he]}}),pi=Ae((ot,Ne)=>{var Se=gr(),Oe=Or(),ee=Wn(),V=hn(),W=oi(),Z=$r(),Y=TypeError,ne=Z("toPrimitive");Ne.exports=function(Fe,je){if(!Oe(Fe)||ee(Fe))return Fe;var he=V(Fe,ne),qe;if(he){if(je===void 0&&(je="default"),qe=Se(he,Fe,je),!Oe(qe)||ee(qe))return qe;throw Y("Can't convert object to primitive value")}return je===void 0&&(je="number"),W(Fe,je)}}),En=Ae((ot,Ne)=>{var Se=pi(),Oe=Wn();Ne.exports=function(ee){var V=Se(ee,"string");return Oe(V)?V:V+""}}),ci=Ae((ot,Ne)=>{var Se=Yt(),Oe=Or(),ee=Se.document,V=Oe(ee)&&Oe(ee.createElement);Ne.exports=function(W){return V?ee.createElement(W):{}}}),Yn=Ae((ot,Ne)=>{var Se=br(),Oe=hr(),ee=ci();Ne.exports=!Se&&!Oe(function(){return Object.defineProperty(ee("div"),"a",{get:function(){return 7}}).a!=7})}),Kn=Ae(ot=>{var Ne=br(),Se=gr(),Oe=dn(),ee=Lr(),V=fn(),W=En(),Z=kr(),Y=Yn(),ne=Object.getOwnPropertyDescriptor;ot.f=Ne?ne:function(Fe,je){if(Fe=V(Fe),je=W(je),Y)try{return ne(Fe,je)}catch{}if(Z(Fe,je))return ee(!Se(Oe.f,Fe,je),Fe[je])}}),Di=Ae((ot,Ne)=>{var Se=br(),Oe=hr();Ne.exports=Se&&Oe(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})}),Wr=Ae((ot,Ne)=>{var Se=Or(),Oe=String,ee=TypeError;Ne.exports=function(V){if(Se(V))return V;throw ee(Oe(V)+" is not an object")}}),en=Ae(ot=>{var Ne=br(),Se=Yn(),Oe=Di(),ee=Wr(),V=En(),W=TypeError,Z=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,ne="enumerable",Fe="configurable",je="writable";ot.f=Ne?Oe?function(he,qe,et){if(ee(he),qe=V(qe),ee(et),typeof he=="function"&&qe==="prototype"&&"value"in et&&je in et&&!et[je]){var Ze=Y(he,qe);Ze&&Ze[je]&&(he[qe]=et.value,et={configurable:Fe in et?et[Fe]:Ze[Fe],enumerable:ne in et?et[ne]:Ze[ne],writable:!1})}return Z(he,qe,et)}:Z:function(he,qe,et){if(ee(he),qe=V(qe),ee(et),Se)try{return Z(he,qe,et)}catch{}if("get"in et||"set"in et)throw W("Accessors not supported");return"value"in et&&(he[qe]=et.value),he}}),Qn=Ae((ot,Ne)=>{var Se=br(),Oe=en(),ee=Lr();Ne.exports=Se?function(V,W,Z){return Oe.f(V,W,ee(1,Z))}:function(V,W,Z){return V[W]=Z,V}}),di=Ae((ot,Ne)=>{var Se=br(),Oe=kr(),ee=Function.prototype,V=Se&&Object.getOwnPropertyDescriptor,W=Oe(ee,"name"),Z=W&&(function(){}).name==="something",Y=W&&(!Se||Se&&V(ee,"name").configurable);Ne.exports={EXISTS:W,PROPER:Z,CONFIGURABLE:Y}}),Zn=Ae((ot,Ne)=>{var Se=Dr(),Oe=dr(),ee=yn(),V=Se(Function.toString);Oe(ee.inspectSource)||(ee.inspectSource=function(W){return V(W)}),Ne.exports=ee.inspectSource}),fi=Ae((ot,Ne)=>{var Se=Yt(),Oe=dr(),ee=Se.WeakMap;Ne.exports=Oe(ee)&&/native code/.test(String(ee))}),mi=Ae((ot,Ne)=>{var Se=zn(),Oe=Hn(),ee=Se("keys");Ne.exports=function(V){return ee[V]||(ee[V]=Oe(V))}}),eu=Ae((ot,Ne)=>{Ne.exports={}}),hi=Ae((ot,Ne)=>{var Se=fi(),Oe=Yt(),ee=Or(),V=Qn(),W=kr(),Z=yn(),Y=mi(),ne=eu(),Fe="Object already initialized",je=Oe.TypeError,he=Oe.WeakMap,qe,et,Ze,nt=function(At){return Ze(At)?et(At):qe(At,{})},rt=function(At){return function(Lt){var qt;if(!ee(Lt)||(qt=et(Lt)).type!==At)throw je("Incompatible receiver, "+At+" required");return qt}};Se||Z.state?($=Z.state||(Z.state=new he),$.get=$.get,$.has=$.has,$.set=$.set,qe=function(At,Lt){if($.has(At))throw je(Fe);return Lt.facade=At,$.set(At,Lt),Lt},et=function(At){return $.get(At)||{}},Ze=function(At){return $.has(At)}):(Ft=Y("state"),ne[Ft]=!0,qe=function(At,Lt){if(W(At,Ft))throw je(Fe);return Lt.facade=At,V(At,Ft,Lt),Lt},et=function(At){return W(At,Ft)?At[Ft]:{}},Ze=function(At){return W(At,Ft)});var $,Ft;Ne.exports={set:qe,get:et,has:Ze,enforce:nt,getterFor:rt}}),yu=Ae((ot,Ne)=>{var Se=hr(),Oe=dr(),ee=kr(),V=br(),W=di().CONFIGURABLE,Z=Zn(),Y=hi(),ne=Y.enforce,Fe=Y.get,je=Object.defineProperty,he=V&&!Se(function(){return je(function(){},"length",{value:8}).length!==8}),qe=String(String).split("String"),et=Ne.exports=function(Ze,nt,rt){String(nt).slice(0,7)==="Symbol("&&(nt="["+String(nt).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),rt&&rt.getter&&(nt="get "+nt),rt&&rt.setter&&(nt="set "+nt),(!ee(Ze,"name")||W&&Ze.name!==nt)&&(V?je(Ze,"name",{value:nt,configurable:!0}):Ze.name=nt),he&&rt&&ee(rt,"arity")&&Ze.length!==rt.arity&&je(Ze,"length",{value:rt.arity});try{rt&&ee(rt,"constructor")&&rt.constructor?V&&je(Ze,"prototype",{writable:!1}):Ze.prototype&&(Ze.prototype=void 0)}catch{}var $=ne(Ze);return ee($,"source")||($.source=qe.join(typeof nt=="string"?nt:"")),Ze};Function.prototype.toString=et(function(){return Oe(this)&&Fe(this).source||Z(this)},"toString")}),gi=Ae((ot,Ne)=>{var Se=dr(),Oe=en(),ee=yu(),V=gn();Ne.exports=function(W,Z,Y,ne){ne||(ne={});var Fe=ne.enumerable,je=ne.name!==void 0?ne.name:Z;if(Se(Y)&&ee(Y,je,ne),ne.global)Fe?W[Z]=Y:V(Z,Y);else{try{ne.unsafe?W[Z]&&(Fe=!0):delete W[Z]}catch{}Fe?W[Z]=Y:Oe.f(W,Z,{value:Y,enumerable:!1,configurable:!ne.nonConfigurable,writable:!ne.nonWritable})}return W}}),yi=Ae((ot,Ne)=>{var Se=Math.ceil,Oe=Math.floor;Ne.exports=Math.trunc||function(ee){var V=+ee;return(V>0?Oe:Se)(V)}}),Tn=Ae((ot,Ne)=>{var Se=yi();Ne.exports=function(Oe){var ee=+Oe;return ee!==ee||ee===0?0:Se(ee)}}),Ei=Ae((ot,Ne)=>{var Se=Tn(),Oe=Math.max,ee=Math.min;Ne.exports=function(V,W){var Z=Se(V);return Z<0?Oe(Z+W,0):ee(Z,W)}}),Ci=Ae((ot,Ne)=>{var Se=Tn(),Oe=Math.min;Ne.exports=function(ee){return ee>0?Oe(Se(ee),9007199254740991):0}}),tn=Ae((ot,Ne)=>{var Se=Ci();Ne.exports=function(Oe){return Se(Oe.length)}}),Fi=Ae((ot,Ne)=>{var Se=fn(),Oe=Ei(),ee=tn(),V=function(W){return function(Z,Y,ne){var Fe=Se(Z),je=ee(Fe),he=Oe(ne,je),qe;if(W&&Y!=Y){for(;je>he;)if(qe=Fe[he++],qe!=qe)return!0}else for(;je>he;he++)if((W||he in Fe)&&Fe[he]===Y)return W||he||0;return!W&&-1}};Ne.exports={includes:V(!0),indexOf:V(!1)}}),Ai=Ae((ot,Ne)=>{var Se=Dr(),Oe=kr(),ee=fn(),V=Fi().indexOf,W=eu(),Z=Se([].push);Ne.exports=function(Y,ne){var Fe=ee(Y),je=0,he=[],qe;for(qe in Fe)!Oe(W,qe)&&Oe(Fe,qe)&&Z(he,qe);for(;ne.length>je;)Oe(Fe,qe=ne[je++])&&(~V(he,qe)||Z(he,qe));return he}}),vi=Ae((ot,Ne)=>{Ne.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),bi=Ae(ot=>{var Ne=Ai(),Se=vi(),Oe=Se.concat("length","prototype");ot.f=Object.getOwnPropertyNames||function(ee){return Ne(ee,Oe)}}),Si=Ae(ot=>{ot.f=Object.getOwnPropertySymbols}),xi=Ae((ot,Ne)=>{var Se=un(),Oe=Dr(),ee=bi(),V=Si(),W=Wr(),Z=Oe([].concat);Ne.exports=Se("Reflect","ownKeys")||function(Y){var ne=ee.f(W(Y)),Fe=V.f;return Fe?Z(ne,Fe(Y)):ne}}),Ti=Ae((ot,Ne)=>{var Se=kr(),Oe=xi(),ee=Kn(),V=en();Ne.exports=function(W,Z,Y){for(var ne=Oe(Z),Fe=V.f,je=ee.f,he=0;he{var Se=hr(),Oe=dr(),ee=/#|\.prototype\./,V=function(Fe,je){var he=Z[W(Fe)];return he==ne?!0:he==Y?!1:Oe(je)?Se(je):!!je},W=V.normalize=function(Fe){return String(Fe).replace(ee,".").toLowerCase()},Z=V.data={},Y=V.NATIVE="N",ne=V.POLYFILL="P";Ne.exports=V}),an=Ae((ot,Ne)=>{var Se=Yt(),Oe=Kn().f,ee=Qn(),V=gi(),W=gn(),Z=Ti(),Y=Bi();Ne.exports=function(ne,Fe){var je=ne.target,he=ne.global,qe=ne.stat,et,Ze,nt,rt,$,Ft;if(he?Ze=Se:qe?Ze=Se[je]||W(je,{}):Ze=(Se[je]||{}).prototype,Ze)for(nt in Fe){if($=Fe[nt],ne.dontCallGetSet?(Ft=Oe(Ze,nt),rt=Ft&&Ft.value):rt=Ze[nt],et=Y(he?nt:je+(qe?".":"#")+nt,ne.forced),!et&&rt!==void 0){if(typeof $==typeof rt)continue;Z($,rt)}(ne.sham||rt&&rt.sham)&&ee($,"sham",!0),V(Ze,nt,$,ne)}}}),Eu=Ae(()=>{var ot=an(),Ne=Yt();ot({global:!0,forced:Ne.globalThis!==Ne},{globalThis:Ne})}),wi=Ae(()=>{Eu()}),Cu=Ae((ot,Ne)=>{var Se=Br();Ne.exports=Array.isArray||function(Oe){return Se(Oe)=="Array"}}),Fu=Ae((ot,Ne)=>{var Se=TypeError,Oe=9007199254740991;Ne.exports=function(ee){if(ee>Oe)throw Se("Maximum allowed index exceeded");return ee}}),Au=Ae((ot,Ne)=>{var Se=Br(),Oe=Dr();Ne.exports=function(ee){if(Se(ee)==="Function")return Oe(ee)}}),vu=Ae((ot,Ne)=>{var Se=Au(),Oe=sn(),ee=Hr(),V=Se(Se.bind);Ne.exports=function(W,Z){return Oe(W),Z===void 0?W:ee?V(W,Z):function(){return W.apply(Z,arguments)}}}),bu=Ae((ot,Ne)=>{var Se=Cu(),Oe=tn(),ee=Fu(),V=vu(),W=function(Z,Y,ne,Fe,je,he,qe,et){for(var Ze=je,nt=0,rt=qe?V(qe,et):!1,$,Ft;nt0&&Se($)?(Ft=Oe($),Ze=W(Z,Y,$,Ft,Ze,he-1)-1):(ee(Ze+1),Z[Ze]=$),Ze++),nt++;return Ze};Ne.exports=W}),Ni=Ae((ot,Ne)=>{var Se=$r(),Oe=Se("toStringTag"),ee={};ee[Oe]="z",Ne.exports=String(ee)==="[object z]"}),Su=Ae((ot,Ne)=>{var Se=Ni(),Oe=dr(),ee=Br(),V=$r(),W=V("toStringTag"),Z=Object,Y=ee(function(){return arguments}())=="Arguments",ne=function(Fe,je){try{return Fe[je]}catch{}};Ne.exports=Se?ee:function(Fe){var je,he,qe;return Fe===void 0?"Undefined":Fe===null?"Null":typeof(he=ne(je=Z(Fe),W))=="string"?he:Y?ee(je):(qe=ee(je))=="Object"&&Oe(je.callee)?"Arguments":qe}}),xu=Ae((ot,Ne)=>{var Se=Dr(),Oe=hr(),ee=dr(),V=Su(),W=un(),Z=Zn(),Y=function(){},ne=[],Fe=W("Reflect","construct"),je=/^\s*(?:class|function)\b/,he=Se(je.exec),qe=!je.exec(Y),et=function(nt){if(!ee(nt))return!1;try{return Fe(Y,ne,nt),!0}catch{return!1}},Ze=function(nt){if(!ee(nt))return!1;switch(V(nt)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return qe||!!he(je,Z(nt))}catch{return!0}};Ze.sham=!0,Ne.exports=!Fe||Oe(function(){var nt;return et(et.call)||!et(Object)||!et(function(){nt=!0})||nt})?Ze:et}),_i=Ae((ot,Ne)=>{var Se=Cu(),Oe=xu(),ee=Or(),V=$r(),W=V("species"),Z=Array;Ne.exports=function(Y){var ne;return Se(Y)&&(ne=Y.constructor,Oe(ne)&&(ne===Z||Se(ne.prototype))?ne=void 0:ee(ne)&&(ne=ne[W],ne===null&&(ne=void 0))),ne===void 0?Z:ne}}),Tu=Ae((ot,Ne)=>{var Se=_i();Ne.exports=function(Oe,ee){return new(Se(Oe))(ee===0?0:ee)}}),ki=Ae(()=>{var ot=an(),Ne=bu(),Se=sn(),Oe=xn(),ee=tn(),V=Tu();ot({target:"Array",proto:!0},{flatMap:function(W){var Z=Oe(this),Y=ee(Z),ne;return Se(W),ne=V(Z,0),ne.length=Ne(ne,Z,Z,Y,0,1,W,arguments.length>1?arguments[1]:void 0),ne}})}),tu=Ae((ot,Ne)=>{Ne.exports={}}),Pi=Ae((ot,Ne)=>{var Se=$r(),Oe=tu(),ee=Se("iterator"),V=Array.prototype;Ne.exports=function(W){return W!==void 0&&(Oe.Array===W||V[ee]===W)}}),Bu=Ae((ot,Ne)=>{var Se=Su(),Oe=hn(),ee=nn(),V=tu(),W=$r(),Z=W("iterator");Ne.exports=function(Y){if(!ee(Y))return Oe(Y,Z)||Oe(Y,"@@iterator")||V[Se(Y)]}}),Ii=Ae((ot,Ne)=>{var Se=gr(),Oe=sn(),ee=Wr(),V=mn(),W=Bu(),Z=TypeError;Ne.exports=function(Y,ne){var Fe=arguments.length<2?W(Y):ne;if(Oe(Fe))return ee(Se(Fe,Y));throw Z(V(Y)+" is not iterable")}}),ji=Ae((ot,Ne)=>{var Se=gr(),Oe=Wr(),ee=hn();Ne.exports=function(V,W,Z){var Y,ne;Oe(V);try{if(Y=ee(V,"return"),!Y){if(W==="throw")throw Z;return Z}Y=Se(Y,V)}catch(Fe){ne=!0,Y=Fe}if(W==="throw")throw Z;if(ne)throw Y;return Oe(Y),Z}}),Li=Ae((ot,Ne)=>{var Se=vu(),Oe=gr(),ee=Wr(),V=mn(),W=Pi(),Z=tn(),Y=Gn(),ne=Ii(),Fe=Bu(),je=ji(),he=TypeError,qe=function(Ze,nt){this.stopped=Ze,this.result=nt},et=qe.prototype;Ne.exports=function(Ze,nt,rt){var $=rt&&rt.that,Ft=!!(rt&&rt.AS_ENTRIES),At=!!(rt&&rt.IS_RECORD),Lt=!!(rt&&rt.IS_ITERATOR),qt=!!(rt&&rt.INTERRUPTED),Zt=Se(nt,$),ue,yr,Pr,zr,fr,Rr,mr,rn=function(Fr){return ue&&je(ue,"normal",Fr),new qe(!0,Fr)},wr=function(Fr){return Ft?(ee(Fr),qt?Zt(Fr[0],Fr[1],rn):Zt(Fr[0],Fr[1])):qt?Zt(Fr,rn):Zt(Fr)};if(At)ue=Ze.iterator;else if(Lt)ue=Ze;else{if(yr=Fe(Ze),!yr)throw he(V(Ze)+" is not iterable");if(W(yr)){for(Pr=0,zr=Z(Ze);zr>Pr;Pr++)if(fr=wr(Ze[Pr]),fr&&Y(et,fr))return fr;return new qe(!1)}ue=ne(Ze,yr)}for(Rr=At?Ze.next:ue.next;!(mr=Oe(Rr,ue)).done;){try{fr=wr(mr.value)}catch(Fr){je(ue,"throw",Fr)}if(typeof fr=="object"&&fr&&Y(et,fr))return fr}return new qe(!1)}}),Oi=Ae((ot,Ne)=>{var Se=En(),Oe=en(),ee=Lr();Ne.exports=function(V,W,Z){var Y=Se(W);Y in V?Oe.f(V,Y,ee(0,Z)):V[Y]=Z}}),$i=Ae(()=>{var ot=an(),Ne=Li(),Se=Oi();ot({target:"Object",stat:!0},{fromEntries:function(Oe){var ee={};return Ne(Oe,function(V,W){Se(ee,V,W)},{AS_ENTRIES:!0}),ee}})}),Ri=Ae((ot,Ne)=>{var Se=["cliName","cliCategory","cliDescription"];function Oe(L,re){if(L==null)return{};var ge=ee(L,re),Ee,Pe;if(Object.getOwnPropertySymbols){var ie=Object.getOwnPropertySymbols(L);for(Pe=0;Pe=0)&&Object.prototype.propertyIsEnumerable.call(L,Ee)&&(ge[Ee]=L[Ee])}return ge}function ee(L,re){if(L==null)return{};var ge={},Ee=Object.keys(L),Pe,ie;for(ie=0;ie=0)&&(ge[Pe]=L[Pe]);return ge}wi(),ki(),$i();var V=Object.create,W=Object.defineProperty,Z=Object.getOwnPropertyDescriptor,Y=Object.getOwnPropertyNames,ne=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty,je=(L,re)=>function(){return L&&(re=(0,L[Y(L)[0]])(L=0)),re},he=(L,re)=>function(){return re||(0,L[Y(L)[0]])((re={exports:{}}).exports,re),re.exports},qe=(L,re)=>{for(var ge in re)W(L,ge,{get:re[ge],enumerable:!0})},et=(L,re,ge,Ee)=>{if(re&&typeof re=="object"||typeof re=="function")for(let Pe of Y(re))!Fe.call(L,Pe)&&Pe!==ge&&W(L,Pe,{get:()=>re[Pe],enumerable:!(Ee=Z(re,Pe))||Ee.enumerable});return L},Ze=(L,re,ge)=>(ge=L!=null?V(ne(L)):{},et(re||!L||!L.__esModule?W(ge,"default",{value:L,enumerable:!0}):ge,L)),nt=L=>et(W({},"__esModule",{value:!0}),L),rt,$=je({""(){rt={env:{},argv:[]}}}),Ft=he({"node_modules/angular-html-parser/lib/compiler/src/chars.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0}),L.$EOF=0,L.$BSPACE=8,L.$TAB=9,L.$LF=10,L.$VTAB=11,L.$FF=12,L.$CR=13,L.$SPACE=32,L.$BANG=33,L.$DQ=34,L.$HASH=35,L.$$=36,L.$PERCENT=37,L.$AMPERSAND=38,L.$SQ=39,L.$LPAREN=40,L.$RPAREN=41,L.$STAR=42,L.$PLUS=43,L.$COMMA=44,L.$MINUS=45,L.$PERIOD=46,L.$SLASH=47,L.$COLON=58,L.$SEMICOLON=59,L.$LT=60,L.$EQ=61,L.$GT=62,L.$QUESTION=63,L.$0=48,L.$7=55,L.$9=57,L.$A=65,L.$E=69,L.$F=70,L.$X=88,L.$Z=90,L.$LBRACKET=91,L.$BACKSLASH=92,L.$RBRACKET=93,L.$CARET=94,L.$_=95,L.$a=97,L.$b=98,L.$e=101,L.$f=102,L.$n=110,L.$r=114,L.$t=116,L.$u=117,L.$v=118,L.$x=120,L.$z=122,L.$LBRACE=123,L.$BAR=124,L.$RBRACE=125,L.$NBSP=160,L.$PIPE=124,L.$TILDA=126,L.$AT=64,L.$BT=96;function re(Ue){return Ue>=L.$TAB&&Ue<=L.$SPACE||Ue==L.$NBSP}L.isWhitespace=re;function ge(Ue){return L.$0<=Ue&&Ue<=L.$9}L.isDigit=ge;function Ee(Ue){return Ue>=L.$a&&Ue<=L.$z||Ue>=L.$A&&Ue<=L.$Z}L.isAsciiLetter=Ee;function Pe(Ue){return Ue>=L.$a&&Ue<=L.$f||Ue>=L.$A&&Ue<=L.$F||ge(Ue)}L.isAsciiHexDigit=Pe;function ie(Ue){return Ue===L.$LF||Ue===L.$CR}L.isNewLine=ie;function de(Ue){return L.$0<=Ue&&Ue<=L.$7}L.isOctalDigit=de}}),At=he({"node_modules/angular-html-parser/lib/compiler/src/aot/static_symbol.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=class{constructor(Ee,Pe,ie){this.filePath=Ee,this.name=Pe,this.members=ie}assertNoMembers(){if(this.members.length)throw new Error(`Illegal state: symbol without members expected, but got ${JSON.stringify(this)}.`)}};L.StaticSymbol=re;var ge=class{constructor(){this.cache=new Map}get(Ee,Pe,ie){ie=ie||[];let de=ie.length?`.${ie.join(".")}`:"",Ue=`"${Ee}".${Pe}${de}`,Ge=this.cache.get(Ue);return Ge||(Ge=new re(Ee,Pe,ie),this.cache.set(Ue,Ge)),Ge}};L.StaticSymbolCache=ge}}),Lt=he({"node_modules/angular-html-parser/lib/compiler/src/util.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=/-+([a-z0-9])/g;function ge(le){return le.replace(re,function(){for(var We=arguments.length,Me=new Array(We),at=0;atde(Me,this,We))}visitStringMap(le,We){let Me={};return Object.keys(le).forEach(at=>{Me[at]=de(le[at],this,We)}),Me}visitPrimitive(le,We){return le}visitOther(le,We){return le}};L.ValueTransformer=gt,L.SyncAsync={assertSync:le=>{if(st(le))throw new Error("Illegal state: value cannot be a promise");return le},then:(le,We)=>st(le)?le.then(We):We(le),all:le=>le.some(st)?Promise.all(le):le};function ce(le){throw new Error(`Internal Error: ${le}`)}L.error=ce;function ve(le,We){let Me=Error(le);return Me[Ve]=!0,We&&(Me[He]=We),Me}L.syntaxError=ve;var Ve="ngSyntaxError",He="ngParseErrors";function Je(le){return le[Ve]}L.isSyntaxError=Je;function Qe(le){return le[He]||[]}L.getParseErrors=Qe;function yt(le){return le.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}L.escapeRegExp=yt;var _t=Object.getPrototypeOf({});function ct(le){return typeof le=="object"&&le!==null&&Object.getPrototypeOf(le)===_t}function kt(le){let We="";for(let Me=0;Me=55296&&at<=56319&&le.length>Me+1){let Jt=le.charCodeAt(Me+1);Jt>=56320&&Jt<=57343&&(Me++,at=(at-55296<<10)+Jt-56320+65536)}at<=127?We+=String.fromCharCode(at):at<=2047?We+=String.fromCharCode(at>>6&31|192,at&63|128):at<=65535?We+=String.fromCharCode(at>>12|224,at>>6&63|128,at&63|128):at<=2097151&&(We+=String.fromCharCode(at>>18&7|240,at>>12&63|128,at>>6&63|128,at&63|128))}return We}L.utf8Encode=kt;function $t(le){if(typeof le=="string")return le;if(le instanceof Array)return"["+le.map($t).join(", ")+"]";if(le==null)return""+le;if(le.overriddenName)return`${le.overriddenName}`;if(le.name)return`${le.name}`;if(!le.toString)return"object";let We=le.toString();if(We==null)return""+We;let Me=We.indexOf(` `);return Me===-1?We:We.substring(0,Me)}L.stringify=$t;function ir(le){return typeof le=="function"&&le.hasOwnProperty("__forward_ref__")?le():le}L.resolveForwardRef=ir;function st(le){return!!le&&typeof le.then=="function"}L.isPromise=st;var Ot=class{constructor(le){this.full=le;let We=le.split(".");this.major=We[0],this.minor=We[1],this.patch=We.slice(2).join(".")}};L.Version=Ot;var Vt=typeof window<"u"&&window,Ut=typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&self,rr=typeof globalThis<"u"&&globalThis,z=rr||Vt||Ut;L.global=z}}),qt=he({"node_modules/angular-html-parser/lib/compiler/src/compile_metadata.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=At(),ge=Lt(),Ee=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/;function Pe(Me){return Me.replace(/\W/g,"_")}L.sanitizeIdentifier=Pe;var ie=0;function de(Me){if(!Me||!Me.reference)return null;let at=Me.reference;if(at instanceof re.StaticSymbol)return at.name;if(at.__anonymousType)return at.__anonymousType;let Jt=ge.stringify(at);return Jt.indexOf("(")>=0?(Jt=`anonymous_${ie++}`,at.__anonymousType=Jt):Jt=Pe(Jt),Jt}L.identifierName=de;function Ue(Me){let at=Me.reference;return at instanceof re.StaticSymbol?at.filePath:`./${ge.stringify(at)}`}L.identifierModuleUrl=Ue;function Ge(Me,at){return`View_${de({reference:Me})}_${at}`}L.viewClassName=Ge;function gt(Me){return`RenderType_${de({reference:Me})}`}L.rendererTypeName=gt;function ce(Me){return`HostView_${de({reference:Me})}`}L.hostViewClassName=ce;function ve(Me){return`${de({reference:Me})}NgFactory`}L.componentFactoryName=ve;var Ve;(function(Me){Me[Me.Pipe=0]="Pipe",Me[Me.Directive=1]="Directive",Me[Me.NgModule=2]="NgModule",Me[Me.Injectable=3]="Injectable"})(Ve=L.CompileSummaryKind||(L.CompileSummaryKind={}));function He(Me){return Me.value!=null?Pe(Me.value):de(Me.identifier)}L.tokenName=He;function Je(Me){return Me.identifier!=null?Me.identifier.reference:Me.value}L.tokenReference=Je;var Qe=class{constructor(){let{moduleUrl:Me,styles:at,styleUrls:Jt}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.moduleUrl=Me||null,this.styles=st(at),this.styleUrls=st(Jt)}};L.CompileStylesheetMetadata=Qe;var yt=class{constructor(Me){let{encapsulation:at,template:Jt,templateUrl:er,htmlAst:Ar,styles:Er,styleUrls:_r,externalStylesheets:xr,animations:Ir,ngContentSelectors:Mr,interpolation:or,isInline:lt,preserveWhitespaces:mt}=Me;if(this.encapsulation=at,this.template=Jt,this.templateUrl=er,this.htmlAst=Ar,this.styles=st(Er),this.styleUrls=st(_r),this.externalStylesheets=st(xr),this.animations=Ir?Vt(Ir):[],this.ngContentSelectors=Mr||[],or&&or.length!=2)throw new Error("'interpolation' should have a start and an end symbol.");this.interpolation=or,this.isInline=lt,this.preserveWhitespaces=mt}toSummary(){return{ngContentSelectors:this.ngContentSelectors,encapsulation:this.encapsulation,styles:this.styles,animations:this.animations}}};L.CompileTemplateMetadata=yt;var _t=class{static create(Me){let{isHost:at,type:Jt,isComponent:er,selector:Ar,exportAs:Er,changeDetection:_r,inputs:xr,outputs:Ir,host:Mr,providers:or,viewProviders:lt,queries:mt,guards:St,viewQueries:xt,entryComponents:Kt,template:sr,componentViewType:lr,rendererType:Qt,componentFactory:Kr}=Me,In={},jn={},Yu={};Mr!=null&&Object.keys(Mr).forEach(vr=>{let Qr=Mr[vr],cn=vr.match(Ee);cn===null?Yu[vr]=Qr:cn[1]!=null?jn[cn[1]]=Qr:cn[2]!=null&&(In[cn[2]]=Qr)});let Ku={};xr==null||xr.forEach(vr=>{let Qr=ge.splitAtColon(vr,[vr,vr]);Ku[Qr[0]]=Qr[1]});let Qu={};return Ir==null||Ir.forEach(vr=>{let Qr=ge.splitAtColon(vr,[vr,vr]);Qu[Qr[0]]=Qr[1]}),new _t({isHost:at,type:Jt,isComponent:!!er,selector:Ar,exportAs:Er,changeDetection:_r,inputs:Ku,outputs:Qu,hostListeners:In,hostProperties:jn,hostAttributes:Yu,providers:or,viewProviders:lt,queries:mt,guards:St,viewQueries:xt,entryComponents:Kt,template:sr,componentViewType:lr,rendererType:Qt,componentFactory:Kr})}constructor(Me){let{isHost:at,type:Jt,isComponent:er,selector:Ar,exportAs:Er,changeDetection:_r,inputs:xr,outputs:Ir,hostListeners:Mr,hostProperties:or,hostAttributes:lt,providers:mt,viewProviders:St,queries:xt,guards:Kt,viewQueries:sr,entryComponents:lr,template:Qt,componentViewType:Kr,rendererType:In,componentFactory:jn}=Me;this.isHost=!!at,this.type=Jt,this.isComponent=er,this.selector=Ar,this.exportAs=Er,this.changeDetection=_r,this.inputs=xr,this.outputs=Ir,this.hostListeners=Mr,this.hostProperties=or,this.hostAttributes=lt,this.providers=st(mt),this.viewProviders=st(St),this.queries=st(xt),this.guards=Kt,this.viewQueries=st(sr),this.entryComponents=st(lr),this.template=Qt,this.componentViewType=Kr,this.rendererType=In,this.componentFactory=jn}toSummary(){return{summaryKind:Ve.Directive,type:this.type,isComponent:this.isComponent,selector:this.selector,exportAs:this.exportAs,inputs:this.inputs,outputs:this.outputs,hostListeners:this.hostListeners,hostProperties:this.hostProperties,hostAttributes:this.hostAttributes,providers:this.providers,viewProviders:this.viewProviders,queries:this.queries,guards:this.guards,viewQueries:this.viewQueries,entryComponents:this.entryComponents,changeDetection:this.changeDetection,template:this.template&&this.template.toSummary(),componentViewType:this.componentViewType,rendererType:this.rendererType,componentFactory:this.componentFactory}}};L.CompileDirectiveMetadata=_t;var ct=class{constructor(Me){let{type:at,name:Jt,pure:er}=Me;this.type=at,this.name=Jt,this.pure=!!er}toSummary(){return{summaryKind:Ve.Pipe,type:this.type,name:this.name,pure:this.pure}}};L.CompilePipeMetadata=ct;var kt=class{};L.CompileShallowModuleMetadata=kt;var $t=class{constructor(Me){let{type:at,providers:Jt,declaredDirectives:er,exportedDirectives:Ar,declaredPipes:Er,exportedPipes:_r,entryComponents:xr,bootstrapComponents:Ir,importedModules:Mr,exportedModules:or,schemas:lt,transitiveModule:mt,id:St}=Me;this.type=at||null,this.declaredDirectives=st(er),this.exportedDirectives=st(Ar),this.declaredPipes=st(Er),this.exportedPipes=st(_r),this.providers=st(Jt),this.entryComponents=st(xr),this.bootstrapComponents=st(Ir),this.importedModules=st(Mr),this.exportedModules=st(or),this.schemas=st(lt),this.id=St||null,this.transitiveModule=mt||null}toSummary(){let Me=this.transitiveModule;return{summaryKind:Ve.NgModule,type:this.type,entryComponents:Me.entryComponents,providers:Me.providers,modules:Me.modules,exportedDirectives:Me.exportedDirectives,exportedPipes:Me.exportedPipes}}};L.CompileNgModuleMetadata=$t;var ir=class{constructor(){this.directivesSet=new Set,this.directives=[],this.exportedDirectivesSet=new Set,this.exportedDirectives=[],this.pipesSet=new Set,this.pipes=[],this.exportedPipesSet=new Set,this.exportedPipes=[],this.modulesSet=new Set,this.modules=[],this.entryComponentsSet=new Set,this.entryComponents=[],this.providers=[]}addProvider(Me,at){this.providers.push({provider:Me,module:at})}addDirective(Me){this.directivesSet.has(Me.reference)||(this.directivesSet.add(Me.reference),this.directives.push(Me))}addExportedDirective(Me){this.exportedDirectivesSet.has(Me.reference)||(this.exportedDirectivesSet.add(Me.reference),this.exportedDirectives.push(Me))}addPipe(Me){this.pipesSet.has(Me.reference)||(this.pipesSet.add(Me.reference),this.pipes.push(Me))}addExportedPipe(Me){this.exportedPipesSet.has(Me.reference)||(this.exportedPipesSet.add(Me.reference),this.exportedPipes.push(Me))}addModule(Me){this.modulesSet.has(Me.reference)||(this.modulesSet.add(Me.reference),this.modules.push(Me))}addEntryComponent(Me){this.entryComponentsSet.has(Me.componentType)||(this.entryComponentsSet.add(Me.componentType),this.entryComponents.push(Me))}};L.TransitiveCompileNgModuleMetadata=ir;function st(Me){return Me||[]}var Ot=class{constructor(Me,at){let{useClass:Jt,useValue:er,useExisting:Ar,useFactory:Er,deps:_r,multi:xr}=at;this.token=Me,this.useClass=Jt||null,this.useValue=er,this.useExisting=Ar,this.useFactory=Er||null,this.dependencies=_r||null,this.multi=!!xr}};L.ProviderMeta=Ot;function Vt(Me){return Me.reduce((at,Jt)=>{let er=Array.isArray(Jt)?Vt(Jt):Jt;return at.concat(er)},[])}L.flatten=Vt;function Ut(Me){return Me.replace(/(\w+:\/\/[\w:-]+)?(\/+)?/,"ng:///")}function rr(Me,at,Jt){let er;return Jt.isInline?at.type.reference instanceof re.StaticSymbol?er=`${at.type.reference.filePath}.${at.type.reference.name}.html`:er=`${de(Me)}/${de(at.type)}.html`:er=Jt.templateUrl,at.type.reference instanceof re.StaticSymbol?er:Ut(er)}L.templateSourceUrl=rr;function z(Me,at){let Jt=Me.moduleUrl.split(/\/\\/g),er=Jt[Jt.length-1];return Ut(`css/${at}${er}.ngstyle.js`)}L.sharedStylesheetJitUrl=z;function le(Me){return Ut(`${de(Me.type)}/module.ngfactory.js`)}L.ngModuleJitUrl=le;function We(Me,at){return Ut(`${de(Me)}/${de(at.type)}.ngfactory.js`)}L.templateJitUrl=We}}),Zt=he({"node_modules/angular-html-parser/lib/compiler/src/parse_util.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=Ft(),ge=qt(),Ee=class{constructor(ce,ve,Ve,He){this.file=ce,this.offset=ve,this.line=Ve,this.col=He}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(ce){let ve=this.file.content,Ve=ve.length,He=this.offset,Je=this.line,Qe=this.col;for(;He>0&&ce<0;)if(He--,ce++,ve.charCodeAt(He)==re.$LF){Je--;let yt=ve.substr(0,He-1).lastIndexOf(String.fromCharCode(re.$LF));Qe=yt>0?He-yt:He}else Qe--;for(;He0;){let yt=ve.charCodeAt(He);He++,ce--,yt==re.$LF?(Je++,Qe=0):Qe++}return new Ee(this.file,He,Je,Qe)}getContext(ce,ve){let Ve=this.file.content,He=this.offset;if(He!=null){He>Ve.length-1&&(He=Ve.length-1);let Je=He,Qe=0,yt=0;for(;Qe0&&(He--,Qe++,!(Ve[He]==` `&&++yt==ve)););for(Qe=0,yt=0;Qe2&&arguments[2]!==void 0?arguments[2]:null;this.start=ce,this.end=ve,this.details=Ve}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}};L.ParseSourceSpan=ie,L.EMPTY_PARSE_LOCATION=new Ee(new Pe("",""),0,0,0),L.EMPTY_SOURCE_SPAN=new ie(L.EMPTY_PARSE_LOCATION,L.EMPTY_PARSE_LOCATION);var de;(function(ce){ce[ce.WARNING=0]="WARNING",ce[ce.ERROR=1]="ERROR"})(de=L.ParseErrorLevel||(L.ParseErrorLevel={}));var Ue=class{constructor(ce,ve){let Ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:de.ERROR;this.span=ce,this.msg=ve,this.level=Ve}contextualMessage(){let ce=this.span.start.getContext(100,3);return ce?`${this.msg} ("${ce.before}[${de[this.level]} ->]${ce.after}")`:this.msg}toString(){let ce=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${ce}`}};L.ParseError=Ue;function Ge(ce,ve){let Ve=ge.identifierModuleUrl(ve),He=Ve!=null?`in ${ce} ${ge.identifierName(ve)} in ${Ve}`:`in ${ce} ${ge.identifierName(ve)}`,Je=new Pe("",He);return new ie(new Ee(Je,-1,-1,-1),new Ee(Je,-1,-1,-1))}L.typeSourceSpan=Ge;function gt(ce,ve,Ve){let He=`in ${ce} ${ve} in ${Ve}`,Je=new Pe("",He);return new ie(new Ee(Je,-1,-1,-1),new Ee(Je,-1,-1,-1))}L.r3JitTypeSourceSpan=gt}}),ue=he({"src/utils/front-matter/parse.js"(L,re){$();var ge=new RegExp("^(?-{3}|\\+{3})(?[^\\n]*)\\n(?:|(?.*?)\\n)(?\\k|\\.{3})[^\\S\\n]*(?:\\n|$)","s");function Ee(Pe){let ie=Pe.match(ge);if(!ie)return{content:Pe};let{startDelimiter:de,language:Ue,value:Ge="",endDelimiter:gt}=ie.groups,ce=Ue.trim()||"yaml";if(de==="+++"&&(ce="toml"),ce!=="yaml"&&de!==gt)return{content:Pe};let[ve]=ie;return{frontMatter:{type:"front-matter",lang:ce,value:Ge,startDelimiter:de,endDelimiter:gt,raw:ve.replace(/\n$/,"")},content:ve.replace(/[^\n]/g," ")+Pe.slice(ve.length)}}re.exports=Ee}}),yr=he({"src/utils/get-last.js"(L,re){$();var ge=Ee=>Ee[Ee.length-1];re.exports=ge}}),Pr=he({"src/common/parser-create-error.js"(L,re){$();function ge(Ee,Pe){let ie=new SyntaxError(Ee+" ("+Pe.start.line+":"+Pe.start.column+")");return ie.loc=Pe,ie}re.exports=ge}}),zr={};qe(zr,{default:()=>fr});function fr(L){if(typeof L!="string")throw new TypeError("Expected a string");return L.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Rr=je({"node_modules/escape-string-regexp/index.js"(){$()}}),mr=he({"node_modules/semver/internal/debug.js"(L,re){$();var ge=typeof rt=="object"&&rt.env&&rt.env.NODE_DEBUG&&/\bsemver\b/i.test(rt.env.NODE_DEBUG)?function(){for(var Ee=arguments.length,Pe=new Array(Ee),ie=0;ie{};re.exports=ge}}),rn=he({"node_modules/semver/internal/constants.js"(L,re){$();var ge="2.0.0",Ee=256,Pe=Number.MAX_SAFE_INTEGER||9007199254740991,ie=16;re.exports={SEMVER_SPEC_VERSION:ge,MAX_LENGTH:Ee,MAX_SAFE_INTEGER:Pe,MAX_SAFE_COMPONENT_LENGTH:ie}}}),wr=he({"node_modules/semver/internal/re.js"(L,re){$();var{MAX_SAFE_COMPONENT_LENGTH:ge}=rn(),Ee=mr();L=re.exports={};var Pe=L.re=[],ie=L.src=[],de=L.t={},Ue=0,Ge=(gt,ce,ve)=>{let Ve=Ue++;Ee(gt,Ve,ce),de[gt]=Ve,ie[Ve]=ce,Pe[Ve]=new RegExp(ce,ve?"g":void 0)};Ge("NUMERICIDENTIFIER","0|[1-9]\\d*"),Ge("NUMERICIDENTIFIERLOOSE","[0-9]+"),Ge("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),Ge("MAINVERSION",`(${ie[de.NUMERICIDENTIFIER]})\\.(${ie[de.NUMERICIDENTIFIER]})\\.(${ie[de.NUMERICIDENTIFIER]})`),Ge("MAINVERSIONLOOSE",`(${ie[de.NUMERICIDENTIFIERLOOSE]})\\.(${ie[de.NUMERICIDENTIFIERLOOSE]})\\.(${ie[de.NUMERICIDENTIFIERLOOSE]})`),Ge("PRERELEASEIDENTIFIER",`(?:${ie[de.NUMERICIDENTIFIER]}|${ie[de.NONNUMERICIDENTIFIER]})`),Ge("PRERELEASEIDENTIFIERLOOSE",`(?:${ie[de.NUMERICIDENTIFIERLOOSE]}|${ie[de.NONNUMERICIDENTIFIER]})`),Ge("PRERELEASE",`(?:-(${ie[de.PRERELEASEIDENTIFIER]}(?:\\.${ie[de.PRERELEASEIDENTIFIER]})*))`),Ge("PRERELEASELOOSE",`(?:-?(${ie[de.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ie[de.PRERELEASEIDENTIFIERLOOSE]})*))`),Ge("BUILDIDENTIFIER","[0-9A-Za-z-]+"),Ge("BUILD",`(?:\\+(${ie[de.BUILDIDENTIFIER]}(?:\\.${ie[de.BUILDIDENTIFIER]})*))`),Ge("FULLPLAIN",`v?${ie[de.MAINVERSION]}${ie[de.PRERELEASE]}?${ie[de.BUILD]}?`),Ge("FULL",`^${ie[de.FULLPLAIN]}$`),Ge("LOOSEPLAIN",`[v=\\s]*${ie[de.MAINVERSIONLOOSE]}${ie[de.PRERELEASELOOSE]}?${ie[de.BUILD]}?`),Ge("LOOSE",`^${ie[de.LOOSEPLAIN]}$`),Ge("GTLT","((?:<|>)?=?)"),Ge("XRANGEIDENTIFIERLOOSE",`${ie[de.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),Ge("XRANGEIDENTIFIER",`${ie[de.NUMERICIDENTIFIER]}|x|X|\\*`),Ge("XRANGEPLAIN",`[v=\\s]*(${ie[de.XRANGEIDENTIFIER]})(?:\\.(${ie[de.XRANGEIDENTIFIER]})(?:\\.(${ie[de.XRANGEIDENTIFIER]})(?:${ie[de.PRERELEASE]})?${ie[de.BUILD]}?)?)?`),Ge("XRANGEPLAINLOOSE",`[v=\\s]*(${ie[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ie[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ie[de.XRANGEIDENTIFIERLOOSE]})(?:${ie[de.PRERELEASELOOSE]})?${ie[de.BUILD]}?)?)?`),Ge("XRANGE",`^${ie[de.GTLT]}\\s*${ie[de.XRANGEPLAIN]}$`),Ge("XRANGELOOSE",`^${ie[de.GTLT]}\\s*${ie[de.XRANGEPLAINLOOSE]}$`),Ge("COERCE",`(^|[^\\d])(\\d{1,${ge}})(?:\\.(\\d{1,${ge}}))?(?:\\.(\\d{1,${ge}}))?(?:$|[^\\d])`),Ge("COERCERTL",ie[de.COERCE],!0),Ge("LONETILDE","(?:~>?)"),Ge("TILDETRIM",`(\\s*)${ie[de.LONETILDE]}\\s+`,!0),L.tildeTrimReplace="$1~",Ge("TILDE",`^${ie[de.LONETILDE]}${ie[de.XRANGEPLAIN]}$`),Ge("TILDELOOSE",`^${ie[de.LONETILDE]}${ie[de.XRANGEPLAINLOOSE]}$`),Ge("LONECARET","(?:\\^)"),Ge("CARETTRIM",`(\\s*)${ie[de.LONECARET]}\\s+`,!0),L.caretTrimReplace="$1^",Ge("CARET",`^${ie[de.LONECARET]}${ie[de.XRANGEPLAIN]}$`),Ge("CARETLOOSE",`^${ie[de.LONECARET]}${ie[de.XRANGEPLAINLOOSE]}$`),Ge("COMPARATORLOOSE",`^${ie[de.GTLT]}\\s*(${ie[de.LOOSEPLAIN]})$|^$`),Ge("COMPARATOR",`^${ie[de.GTLT]}\\s*(${ie[de.FULLPLAIN]})$|^$`),Ge("COMPARATORTRIM",`(\\s*)${ie[de.GTLT]}\\s*(${ie[de.LOOSEPLAIN]}|${ie[de.XRANGEPLAIN]})`,!0),L.comparatorTrimReplace="$1$2$3",Ge("HYPHENRANGE",`^\\s*(${ie[de.XRANGEPLAIN]})\\s+-\\s+(${ie[de.XRANGEPLAIN]})\\s*$`),Ge("HYPHENRANGELOOSE",`^\\s*(${ie[de.XRANGEPLAINLOOSE]})\\s+-\\s+(${ie[de.XRANGEPLAINLOOSE]})\\s*$`),Ge("STAR","(<|>)?=?\\s*\\*"),Ge("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),Ge("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}}),Fr=he({"node_modules/semver/internal/parse-options.js"(L,re){$();var ge=["includePrerelease","loose","rtl"],Ee=Pe=>Pe?typeof Pe!="object"?{loose:!0}:ge.filter(ie=>Pe[ie]).reduce((ie,de)=>(ie[de]=!0,ie),{}):{};re.exports=Ee}}),Bn=he({"node_modules/semver/internal/identifiers.js"(L,re){$();var ge=/^[0-9]+$/,Ee=(ie,de)=>{let Ue=ge.test(ie),Ge=ge.test(de);return Ue&&Ge&&(ie=+ie,de=+de),ie===de?0:Ue&&!Ge?-1:Ge&&!Ue?1:ieEe(de,ie);re.exports={compareIdentifiers:Ee,rcompareIdentifiers:Pe}}}),wn=he({"node_modules/semver/classes/semver.js"(L,re){$();var ge=mr(),{MAX_LENGTH:Ee,MAX_SAFE_INTEGER:Pe}=rn(),{re:ie,t:de}=wr(),Ue=Fr(),{compareIdentifiers:Ge}=Bn(),gt=class{constructor(ce,ve){if(ve=Ue(ve),ce instanceof gt){if(ce.loose===!!ve.loose&&ce.includePrerelease===!!ve.includePrerelease)return ce;ce=ce.version}else if(typeof ce!="string")throw new TypeError(`Invalid Version: ${ce}`);if(ce.length>Ee)throw new TypeError(`version is longer than ${Ee} characters`);ge("SemVer",ce,ve),this.options=ve,this.loose=!!ve.loose,this.includePrerelease=!!ve.includePrerelease;let Ve=ce.trim().match(ve.loose?ie[de.LOOSE]:ie[de.FULL]);if(!Ve)throw new TypeError(`Invalid Version: ${ce}`);if(this.raw=ce,this.major=+Ve[1],this.minor=+Ve[2],this.patch=+Ve[3],this.major>Pe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Pe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Pe||this.patch<0)throw new TypeError("Invalid patch version");Ve[4]?this.prerelease=Ve[4].split(".").map(He=>{if(/^[0-9]+$/.test(He)){let Je=+He;if(Je>=0&&Je=0;)typeof this.prerelease[Ve]=="number"&&(this.prerelease[Ve]++,Ve=-2);Ve===-1&&this.prerelease.push(0)}ve&&(Ge(this.prerelease[0],ve)===0?isNaN(this.prerelease[1])&&(this.prerelease=[ve,0]):this.prerelease=[ve,0]);break;default:throw new Error(`invalid increment argument: ${ce}`)}return this.format(),this.raw=this.version,this}};re.exports=gt}}),on=he({"node_modules/semver/functions/compare.js"(L,re){$();var ge=wn(),Ee=(Pe,ie,de)=>new ge(Pe,de).compare(new ge(ie,de));re.exports=Ee}}),Nr=he({"node_modules/semver/functions/lt.js"(L,re){$();var ge=on(),Ee=(Pe,ie,de)=>ge(Pe,ie,de)<0;re.exports=Ee}}),wu=he({"node_modules/semver/functions/gte.js"(L,re){$();var ge=on(),Ee=(Pe,ie,de)=>ge(Pe,ie,de)>=0;re.exports=Ee}}),Mi=he({"src/utils/arrayify.js"(L,re){$(),re.exports=(ge,Ee)=>Object.entries(ge).map(Pe=>{let[ie,de]=Pe;return Object.assign({[Ee]:ie},de)})}}),Nu=he({"package.json"(L,re){re.exports={version:"2.8.8"}}}),qi=he({"node_modules/outdent/lib/index.js"(L,re){$(),Object.defineProperty(L,"__esModule",{value:!0}),L.outdent=void 0;function ge(){for(var ct=[],kt=0;kt{for(const t of e)if(t.type==="childList")for(const r of t.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&c(r)}).observe(document,{childList:!0,subtree:!0});function n(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function c(e){if(e.ep)return;e.ep=!0;const t=n(e);fetch(e.href,t)}})();const d="modulepreload",p=function(s,_){return new URL(s,_).href},O={},o=function(_,n,c){let e=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link");e=Promise.all(n.map(r=>{if(r=p(r,c),r in O)return;O[r]=!0;const a=r.endsWith(".css"),E=a?'[rel="stylesheet"]':"";if(!!c)for(let u=t.length-1;u>=0;u--){const l=t[u];if(l.href===r&&(!a||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${E}`))return;const i=document.createElement("link");if(i.rel=a?"stylesheet":d,a||(i.as="script",i.crossOrigin=""),i.href=r,document.head.appendChild(i),a)return new Promise((u,l)=>{i.addEventListener("load",u),i.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${r}`)))})}))}return e.then(()=>_()).catch(t=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=t,window.dispatchEvent(r),!r.defaultPrevented)throw t})},{createBrowserChannel:R}=__STORYBOOK_MODULE_CHANNELS__,{addons:f}=__STORYBOOK_MODULE_PREVIEW_API__,m=R({page:"preview"});f.setChannel(m);window.__STORYBOOK_ADDONS_CHANNEL__=m;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=m);const P={"./src/components/CIDocument/components/CIDocument/__stories__/CIDocument.stories.tsx":async()=>o(()=>import("./CIDocument.stories-FI8TOmnC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url),"./src/components/DiscoverySearch/__stories__/DiscoverySearch.stories.tsx":async()=>o(()=>import("./DiscoverySearch.stories--_VaJIQm.js"),__vite__mapDeps([31,1,2,32,4,23,33,34,35,3,5,6,7,8,9,36,37,38,39,11,40,41]),import.meta.url),"./src/components/DocumentPreview/__stories__/DocumentPreview.stories.tsx":async()=>o(()=>import("./DocumentPreview.stories-zKUa4qDs.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,8,9,39,11,40,12,10,26,20,43,44,25,45,13,19,15,16,17,21,18,22,23,24,46,32,30,47]),import.meta.url),"./src/components/ResultsPagination/__stories__/ResultsPagination.stories.tsx":async()=>o(()=>import("./ResultsPagination.stories-w7hUE3z8.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,8,9,39,11,40,41,20,49,12,10,44]),import.meta.url),"./src/components/SearchFacets/__stories__/SearchFacets.stories.tsx":async()=>o(()=>import("./SearchFacets.stories-v9tNlu02.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,8,9,10,11,39,40,17,45,12,51,16,52,53,15,22,44,24,25,35,27,28,49,18,54,41]),import.meta.url),"./src/components/SearchInput/__stories__/SearchInput.stories.tsx":async()=>o(()=>import("./SearchInput.stories-NBXB9EYF.js"),__vite__mapDeps([55,1,2,3,4,5,6,7,8,9,54,10,11,12,53,15,16,17,39,40,56,20,30,26,14,46,49,41]),import.meta.url),"./src/components/SearchResults/__stories__/SearchResults.stories.tsx":async()=>o(()=>import("./SearchResults.stories-f1YvWRzI.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,8,9,41,39,11,40,56,20,30,17,26,12,10,14,15,16,46,49,24,25]),import.meta.url),"./src/components/StructuredQuery/__stories__/StructuredQuery.stories.tsx":async()=>o(()=>import("./StructuredQuery.stories-0QUAx_jq.js"),__vite__mapDeps([58,1,2,3,4,5,6,7,8,9,41,39,11,40,12,10,29,13,28,51,16,52,53,22,44,49,43,25,45]),import.meta.url)};async function w(s){return P[s]()}const{composeConfigs:S,PreviewWeb:T,ClientApi:h}=__STORYBOOK_MODULE_PREVIEW_API__,I=async()=>{const s=await Promise.all([o(()=>import("./addDecorator-szpYX4kx.js").then(_=>_.a),__vite__mapDeps([59,3,4,2,5,6,7,8,9]),import.meta.url),o(()=>import("./entry-preview-TGgN7-T4.js"),__vite__mapDeps([60,2,61,21]),import.meta.url),o(()=>import("./entry-preview-docs-LMj18ab8.js"),__vite__mapDeps([62,63,4,2,38,33,11,7,6]),import.meta.url),o(()=>import("./preview-AKHunSk0.js"),__vite__mapDeps([64,8,7,40]),import.meta.url),o(()=>import("./preview-qSo6RKZ8.js"),__vite__mapDeps([]),import.meta.url),o(()=>import("./preview-xTeskd23.js"),__vite__mapDeps([65,66,5,4,2,21,12,16,52,17,47,30,24,25,7,63,38,33,67]),import.meta.url)]);return S(s)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new T;window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore;window.__STORYBOOK_CLIENT_API__=window.__STORYBOOK_CLIENT_API__||new h({storyStore:window.__STORYBOOK_PREVIEW__.storyStore});window.__STORYBOOK_PREVIEW__.initialize({importFn:w,getProjectAnnotations:I});export{o as _}; +import"../sb-preview/runtime.js";(function(){const _=document.createElement("link").relList;if(_&&_.supports&&_.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))c(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const r of t.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&c(r)}).observe(document,{childList:!0,subtree:!0});function n(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function c(e){if(e.ep)return;e.ep=!0;const t=n(e);fetch(e.href,t)}})();const d="modulepreload",p=function(s,_){return new URL(s,_).href},O={},o=function(_,n,c){let e=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link");e=Promise.all(n.map(r=>{if(r=p(r,c),r in O)return;O[r]=!0;const a=r.endsWith(".css"),E=a?'[rel="stylesheet"]':"";if(!!c)for(let u=t.length-1;u>=0;u--){const l=t[u];if(l.href===r&&(!a||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${E}`))return;const i=document.createElement("link");if(i.rel=a?"stylesheet":d,a||(i.as="script",i.crossOrigin=""),i.href=r,document.head.appendChild(i),a)return new Promise((u,l)=>{i.addEventListener("load",u),i.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${r}`)))})}))}return e.then(()=>_()).catch(t=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=t,window.dispatchEvent(r),!r.defaultPrevented)throw t})},{createBrowserChannel:R}=__STORYBOOK_MODULE_CHANNELS__,{addons:f}=__STORYBOOK_MODULE_PREVIEW_API__,m=R({page:"preview"});f.setChannel(m);window.__STORYBOOK_ADDONS_CHANNEL__=m;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=m);const P={"./src/components/CIDocument/components/CIDocument/__stories__/CIDocument.stories.tsx":async()=>o(()=>import("./CIDocument.stories-FI8TOmnC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url),"./src/components/DiscoverySearch/__stories__/DiscoverySearch.stories.tsx":async()=>o(()=>import("./DiscoverySearch.stories--_VaJIQm.js"),__vite__mapDeps([31,1,2,32,4,23,33,34,35,3,5,6,7,8,9,36,37,38,39,11,40,41]),import.meta.url),"./src/components/DocumentPreview/__stories__/DocumentPreview.stories.tsx":async()=>o(()=>import("./DocumentPreview.stories-YcbEC6Qs.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,8,9,39,11,40,12,10,26,20,43,44,25,45,13,19,15,16,17,21,18,22,23,24,46,32,30,47]),import.meta.url),"./src/components/ResultsPagination/__stories__/ResultsPagination.stories.tsx":async()=>o(()=>import("./ResultsPagination.stories-w7hUE3z8.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,8,9,39,11,40,41,20,49,12,10,44]),import.meta.url),"./src/components/SearchFacets/__stories__/SearchFacets.stories.tsx":async()=>o(()=>import("./SearchFacets.stories-v9tNlu02.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,8,9,10,11,39,40,17,45,12,51,16,52,53,15,22,44,24,25,35,27,28,49,18,54,41]),import.meta.url),"./src/components/SearchInput/__stories__/SearchInput.stories.tsx":async()=>o(()=>import("./SearchInput.stories-NBXB9EYF.js"),__vite__mapDeps([55,1,2,3,4,5,6,7,8,9,54,10,11,12,53,15,16,17,39,40,56,20,30,26,14,46,49,41]),import.meta.url),"./src/components/SearchResults/__stories__/SearchResults.stories.tsx":async()=>o(()=>import("./SearchResults.stories-f1YvWRzI.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,8,9,41,39,11,40,56,20,30,17,26,12,10,14,15,16,46,49,24,25]),import.meta.url),"./src/components/StructuredQuery/__stories__/StructuredQuery.stories.tsx":async()=>o(()=>import("./StructuredQuery.stories-0QUAx_jq.js"),__vite__mapDeps([58,1,2,3,4,5,6,7,8,9,41,39,11,40,12,10,29,13,28,51,16,52,53,22,44,49,43,25,45]),import.meta.url)};async function w(s){return P[s]()}const{composeConfigs:S,PreviewWeb:T,ClientApi:h}=__STORYBOOK_MODULE_PREVIEW_API__,I=async()=>{const s=await Promise.all([o(()=>import("./addDecorator-szpYX4kx.js").then(_=>_.a),__vite__mapDeps([59,3,4,2,5,6,7,8,9]),import.meta.url),o(()=>import("./entry-preview-TGgN7-T4.js"),__vite__mapDeps([60,2,61,21]),import.meta.url),o(()=>import("./entry-preview-docs-LMj18ab8.js"),__vite__mapDeps([62,63,4,2,38,33,11,7,6]),import.meta.url),o(()=>import("./preview-AKHunSk0.js"),__vite__mapDeps([64,8,7,40]),import.meta.url),o(()=>import("./preview-ejw2DU4K.js"),__vite__mapDeps([]),import.meta.url),o(()=>import("./preview-zE350L_8.js"),__vite__mapDeps([65,66,5,4,2,21,12,16,52,17,47,30,24,25,7,63,38,33,67]),import.meta.url)]);return S(s)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new T;window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore;window.__STORYBOOK_CLIENT_API__=window.__STORYBOOK_CLIENT_API__||new h({storyStore:window.__STORYBOOK_PREVIEW__.storyStore});window.__STORYBOOK_PREVIEW__.initialize({importFn:w,getProjectAnnotations:I});export{o as _}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./CIDocument.stories-FI8TOmnC.js","./jsx-runtime-FsUICBgo.js","./index-RfLt4OUa.js","./index-zZCSeRuV.js","./callBound-Uz6qjr9w.js","./pickBy-ZgIsky0p.js","./isPlainObject-4EZXVN1F.js","./index-xck8ovCi.js","./preview-errors-Ix78kkVy.js","./debounce-A_lzSYvo.js","./Button-BahrfF6T.js","./index-4QtD-hFu.js","./extends-z9a7DBh-.js","./_baseSlice-BktYtjHb.js","./useControllableState-yL8Xrxl6.js","./possibleConstructorReturn-WWGP77t3.js","./setPrototypeOf-08Rm0-g8.js","./_baseUniq-tk6_MLAQ.js","./wrapFocus-e-GadNjh.js","./withErrorBoundary-hW5QtRQy.js","./index-tUYgphcS.js","./index-miLrID2P.js","./mergeRefs-Zi_35mDS.js","./events-fK0UhkIE.js","./cloneDeep-BBxW03fY.js","./_baseClone-YJfCp7aQ.js","./getDocumentTitle-olcUjOng.js","./index--j9O0ezx.js","./uniqueId-rw2kwGds.js","./ResizeObserver.es-r-La2wdr.js","./uniq-TDmnBOQ0.js","./DiscoverySearch.stories--_VaJIQm.js","./browser-l0_MOcmM.js","./util-6S_QBGOh.js","./index-Tqe2LtrA.js","./index-zqflMFO-.js","./url-xgBfOcQT.js","./index-3tb_HT71.js","./assert-Q0sut4U-.js","./chunk-WFFRPTHA-GGX4IOMG.js","./v4-yQnnJER4.js","./storybookUtils-xT9FlM1M.js","./DocumentPreview.stories-zKUa4qDs.js","./omit-J2xkfX-U.js","./bucket-34-dzXWEVBo.js","./last-zLtIjBiu.js","./purify.es-29Q0w72t.js","./pickBy-zEDcIzXe.js","./ResultsPagination.stories-w7hUE3z8.js","./formatMessage-wl7oTduw.js","./SearchFacets.stories-v9tNlu02.js","./createPropAdapter-Rutju3Z2.js","./inheritsLoose-uwS37NTe.js","./index-RV2I_HDp.js","./index-wXJJ0UxW.js","./SearchInput.stories-NBXB9EYF.js","./SearchResults-gsHYbwsX.js","./SearchResults.stories-f1YvWRzI.js","./StructuredQuery.stories-0QUAx_jq.js","./addDecorator-szpYX4kx.js","./entry-preview-TGgN7-T4.js","./react-16-hgR7FrAp.js","./entry-preview-docs-LMj18ab8.js","./index-U0jbV_xt.js","./preview-AKHunSk0.js","./preview-xTeskd23.js","./index-zqxewmvn.js","./preview-NvvT5yR_.css"] + __vite__mapDeps.viteFileDeps = ["./CIDocument.stories-FI8TOmnC.js","./jsx-runtime-FsUICBgo.js","./index-RfLt4OUa.js","./index-zZCSeRuV.js","./callBound-Uz6qjr9w.js","./pickBy-ZgIsky0p.js","./isPlainObject-4EZXVN1F.js","./index-xck8ovCi.js","./preview-errors-Ix78kkVy.js","./debounce-A_lzSYvo.js","./Button-BahrfF6T.js","./index-4QtD-hFu.js","./extends-z9a7DBh-.js","./_baseSlice-BktYtjHb.js","./useControllableState-yL8Xrxl6.js","./possibleConstructorReturn-WWGP77t3.js","./setPrototypeOf-08Rm0-g8.js","./_baseUniq-tk6_MLAQ.js","./wrapFocus-e-GadNjh.js","./withErrorBoundary-hW5QtRQy.js","./index-tUYgphcS.js","./index-miLrID2P.js","./mergeRefs-Zi_35mDS.js","./events-fK0UhkIE.js","./cloneDeep-BBxW03fY.js","./_baseClone-YJfCp7aQ.js","./getDocumentTitle-olcUjOng.js","./index--j9O0ezx.js","./uniqueId-rw2kwGds.js","./ResizeObserver.es-r-La2wdr.js","./uniq-TDmnBOQ0.js","./DiscoverySearch.stories--_VaJIQm.js","./browser-l0_MOcmM.js","./util-6S_QBGOh.js","./index-Tqe2LtrA.js","./index-zqflMFO-.js","./url-xgBfOcQT.js","./index-3tb_HT71.js","./assert-Q0sut4U-.js","./chunk-WFFRPTHA-GGX4IOMG.js","./v4-yQnnJER4.js","./storybookUtils-xT9FlM1M.js","./DocumentPreview.stories-YcbEC6Qs.js","./omit-J2xkfX-U.js","./bucket-34-dzXWEVBo.js","./last-zLtIjBiu.js","./purify.es-29Q0w72t.js","./pickBy-zEDcIzXe.js","./ResultsPagination.stories-w7hUE3z8.js","./formatMessage-wl7oTduw.js","./SearchFacets.stories-v9tNlu02.js","./createPropAdapter-Rutju3Z2.js","./inheritsLoose-uwS37NTe.js","./index-RV2I_HDp.js","./index-wXJJ0UxW.js","./SearchInput.stories-NBXB9EYF.js","./SearchResults-gsHYbwsX.js","./SearchResults.stories-f1YvWRzI.js","./StructuredQuery.stories-0QUAx_jq.js","./addDecorator-szpYX4kx.js","./entry-preview-TGgN7-T4.js","./react-16-hgR7FrAp.js","./entry-preview-docs-LMj18ab8.js","./index-U0jbV_xt.js","./preview-AKHunSk0.js","./preview-zE350L_8.js","./index-tQLynm0T.js","./preview-NvvT5yR_.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/docs/storybook/assets/index-zqxewmvn.js b/docs/storybook/assets/index-tQLynm0T.js similarity index 99% rename from docs/storybook/assets/index-zqxewmvn.js rename to docs/storybook/assets/index-tQLynm0T.js index 320a43eb..53705560 100644 --- a/docs/storybook/assets/index-zqxewmvn.js +++ b/docs/storybook/assets/index-tQLynm0T.js @@ -1,4 +1,4 @@ -import{_ as Ht}from"./iframe-FA3YUiXb.js";import{m as ar,g as yr,j as Lc,s as Dc}from"./pickBy-ZgIsky0p.js";import{r as b,b as cl,R as a,c as qn}from"./index-RfLt4OUa.js";import{r as Bi,R as _c}from"./index-miLrID2P.js";import{_ as yn}from"./extends-z9a7DBh-.js";import{_ as Hi,a as Mc}from"./setPrototypeOf-08Rm0-g8.js";import{_ as $c}from"./inheritsLoose-uwS37NTe.js";import{a as Bc}from"./_baseUniq-tk6_MLAQ.js";import{p as Hc}from"./pickBy-zEDcIzXe.js";import{u as Ic}from"./uniq-TDmnBOQ0.js";import{c as Nc}from"./cloneDeep-BBxW03fY.js";import"./callBound-Uz6qjr9w.js";import{d as Ee}from"./index-xck8ovCi.js";import{S as dl,s as wa,a as Un}from"./index-U0jbV_xt.js";var Ne=e=>`control-${e.replace(/\s+/g,"-")}`,vn=e=>`set-${e.replace(/\s+/g,"-")}`;const{global:Zc}=__STORYBOOK_MODULE_GLOBAL__,{logger:jc}=__STORYBOOK_MODULE_CLIENT_LOGGER__;var Pc=Object.create,Ii=Object.defineProperty,Vc=Object.getOwnPropertyDescriptor,Ni=Object.getOwnPropertyNames,zc=Object.getPrototypeOf,qc=Object.prototype.hasOwnProperty,lo=(e,t)=>function(){return t||(0,e[Ni(e)[0]])((t={exports:{}}).exports,t),t.exports},Uc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ni(t))!qc.call(e,o)&&o!==r&&Ii(e,o,{get:()=>t[o],enumerable:!(n=Vc(t,o))||n.enumerable});return e},Zi=(e,t,r)=>(r=e!=null?Pc(zc(e)):{},Uc(t||!e||!e.__esModule?Ii(r,"default",{value:e,enumerable:!0}):r,e));function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jr(e,t,r){return Kc()?Jr=Reflect.construct.bind():Jr=function(n,o,l){var i=[null];i.push.apply(i,o);var s=Function.bind.apply(n,i),u=new s;return l&&vr(u,l.prototype),u},Jr.apply(null,arguments)}function Ca(e){var t=typeof Map=="function"?new Map:void 0;return Ca=function(r){if(r===null||!Yc(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return Jr(r,arguments,Aa(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),vr(n,r)},Ca(e)}var Xc={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }). +import{_ as Ht}from"./iframe-xC5OGfiz.js";import{m as ar,g as yr,j as Lc,s as Dc}from"./pickBy-ZgIsky0p.js";import{r as b,b as cl,R as a,c as qn}from"./index-RfLt4OUa.js";import{r as Bi,R as _c}from"./index-miLrID2P.js";import{_ as yn}from"./extends-z9a7DBh-.js";import{_ as Hi,a as Mc}from"./setPrototypeOf-08Rm0-g8.js";import{_ as $c}from"./inheritsLoose-uwS37NTe.js";import{a as Bc}from"./_baseUniq-tk6_MLAQ.js";import{p as Hc}from"./pickBy-zEDcIzXe.js";import{u as Ic}from"./uniq-TDmnBOQ0.js";import{c as Nc}from"./cloneDeep-BBxW03fY.js";import"./callBound-Uz6qjr9w.js";import{d as Ee}from"./index-xck8ovCi.js";import{S as dl,s as wa,a as Un}from"./index-U0jbV_xt.js";var Ne=e=>`control-${e.replace(/\s+/g,"-")}`,vn=e=>`set-${e.replace(/\s+/g,"-")}`;const{global:Zc}=__STORYBOOK_MODULE_GLOBAL__,{logger:jc}=__STORYBOOK_MODULE_CLIENT_LOGGER__;var Pc=Object.create,Ii=Object.defineProperty,Vc=Object.getOwnPropertyDescriptor,Ni=Object.getOwnPropertyNames,zc=Object.getPrototypeOf,qc=Object.prototype.hasOwnProperty,lo=(e,t)=>function(){return t||(0,e[Ni(e)[0]])((t={exports:{}}).exports,t),t.exports},Uc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ni(t))!qc.call(e,o)&&o!==r&&Ii(e,o,{get:()=>t[o],enumerable:!(n=Vc(t,o))||n.enumerable});return e},Zi=(e,t,r)=>(r=e!=null?Pc(zc(e)):{},Uc(t||!e||!e.__esModule?Ii(r,"default",{value:e,enumerable:!0}):r,e));function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jr(e,t,r){return Kc()?Jr=Reflect.construct.bind():Jr=function(n,o,l){var i=[null];i.push.apply(i,o);var s=Function.bind.apply(n,i),u=new s;return l&&vr(u,l.prototype),u},Jr.apply(null,arguments)}function Ca(e){var t=typeof Map=="function"?new Map:void 0;return Ca=function(r){if(r===null||!Yc(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return Jr(r,arguments,Aa(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),vr(n,r)},Ca(e)}var Xc={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }). `,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }). @@ -226,9 +226,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho path { fill: currentColor; } -`,ye=({icon:e,useSymbol:t,...r})=>a.createElement(yu,{viewBox:"0 0 14 14",width:"14px",height:"14px",...r},t?a.createElement("use",{xlinkHref:`#icon--${e}`}):Lr[e]),Uf=b.memo(function({icons:e=Object.keys(Lr)}){return a.createElement(yu,{viewBox:"0 0 14 14",style:{position:"absolute",width:0,height:0},"data-chromatic":"ignore"},e.map(t=>a.createElement("symbol",{id:`icon--${t}`,key:t},Lr[t])))}),Wf=0,Gf=e=>e.button===Wf&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey,Yf=(e,t)=>{Gf(e)&&(e.preventDefault(),t(e))},Kf=R.span(({withArrow:e})=>e?{"> svg:last-of-type":{height:"0.7em",width:"0.7em",marginRight:0,marginLeft:"0.25em",bottom:"auto",verticalAlign:"inherit"}}:{},({containsIcon:e})=>e?{svg:{height:"1em",width:"1em",verticalAlign:"middle",position:"relative",bottom:0,marginRight:0}}:{}),Xf=R.a(({theme:e})=>({display:"inline-block",transition:"all 150ms ease-out",textDecoration:"none",color:e.color.secondary,"&:hover, &:focus":{cursor:"pointer",color:Wt(.07,e.color.secondary),"svg path:not([fill])":{fill:Wt(.07,e.color.secondary)}},"&:active":{color:Wt(.1,e.color.secondary),"svg path:not([fill])":{fill:Wt(.1,e.color.secondary)}},svg:{display:"inline-block",height:"1em",width:"1em",verticalAlign:"text-top",position:"relative",bottom:"-0.125em",marginRight:"0.4em","& path":{fill:e.color.secondary}}}),({theme:e,secondary:t,tertiary:r})=>{let n;return t&&(n=[e.textMutedColor,e.color.dark,e.color.darker]),r&&(n=[e.color.dark,e.color.darkest,e.textMutedColor]),n?{color:n[0],"svg path:not([fill])":{fill:n[0]},"&:hover":{color:n[1],"svg path:not([fill])":{fill:n[1]}},"&:active":{color:n[2],"svg path:not([fill])":{fill:n[2]}}}:{}},({nochrome:e})=>e?{color:"inherit","&:hover, &:active":{color:"inherit",textDecoration:"underline"}}:{},({theme:e,inverse:t})=>t?{color:e.color.lightest,":not([fill])":{fill:e.color.lightest},"&:hover":{color:e.color.lighter,"svg path:not([fill])":{fill:e.color.lighter}},"&:active":{color:e.color.light,"svg path:not([fill])":{fill:e.color.light}}}:{},({isButton:e})=>e?{border:0,borderRadius:0,background:"none",padding:0,fontSize:"inherit"}:{}),Et=({cancel:e,children:t,onClick:r,withArrow:n,containsIcon:o,className:l,...i})=>a.createElement(Xf,{...i,onClick:r&&e?s=>Yf(s,r):r,className:l},a.createElement(Kf,{withArrow:n,containsIcon:o},t,n&&a.createElement(ye,{icon:"arrowright"})));Et.defaultProps={cancel:!0,className:void 0,style:void 0,onClick:void 0,withArrow:!1,containsIcon:!1};var Jf=R.div(({theme:e})=>({fontSize:`${e.typography.size.s2}px`,lineHeight:"1.6",h1:{fontSize:`${e.typography.size.l1}px`,fontWeight:e.typography.weight.bold},h2:{fontSize:`${e.typography.size.m2}px`,borderBottom:`1px solid ${e.appBorderColor}`},h3:{fontSize:`${e.typography.size.m1}px`},h4:{fontSize:`${e.typography.size.s3}px`},h5:{fontSize:`${e.typography.size.s2}px`},h6:{fontSize:`${e.typography.size.s2}px`,color:e.color.dark},"pre:not(.prismjs)":{background:"transparent",border:"none",borderRadius:0,padding:0,margin:0},"pre pre, pre.prismjs":{padding:15,margin:0,whiteSpace:"pre-wrap",color:"inherit",fontSize:"13px",lineHeight:"19px"},"pre pre code, pre.prismjs code":{color:"inherit",fontSize:"inherit"},"pre code":{margin:0,padding:0,whiteSpace:"pre",border:"none",background:"transparent"},"pre code, pre tt":{backgroundColor:"transparent",border:"none"},"body > *:first-of-type":{marginTop:"0 !important"},"body > *:last-child":{marginBottom:"0 !important"},a:{color:e.color.secondary,textDecoration:"none"},"a.absent":{color:"#cc0000"},"a.anchor":{display:"block",paddingLeft:30,marginLeft:-30,cursor:"pointer",position:"absolute",top:0,left:0,bottom:0},"h1, h2, h3, h4, h5, h6":{margin:"20px 0 10px",padding:0,cursor:"text",position:"relative","&:first-of-type":{marginTop:0,paddingTop:0},"&:hover a.anchor":{textDecoration:"none"},"& tt, & code":{fontSize:"inherit"}},"h1:first-of-type + h2":{marginTop:0,paddingTop:0},"p, blockquote, ul, ol, dl, li, table, pre":{margin:"15px 0"},hr:{border:"0 none",borderTop:`1px solid ${e.appBorderColor}`,height:4,padding:0},"body > h1:first-of-type, body > h2:first-of-type, body > h3:first-of-type, body > h4:first-of-type, body > h5:first-of-type, body > h6:first-of-type":{marginTop:0,paddingTop:0},"body > h1:first-of-type + h2":{marginTop:0,paddingTop:0},"a:first-of-type h1, a:first-of-type h2, a:first-of-type h3, a:first-of-type h4, a:first-of-type h5, a:first-of-type h6":{marginTop:0,paddingTop:0},"h1 p, h2 p, h3 p, h4 p, h5 p, h6 p":{marginTop:0},"li p.first":{display:"inline-block"},"ul, ol":{paddingLeft:30,"& :first-of-type":{marginTop:0},"& :last-child":{marginBottom:0}},dl:{padding:0},"dl dt":{fontSize:"14px",fontWeight:"bold",fontStyle:"italic",margin:"0 0 15px",padding:"0 15px","&:first-of-type":{padding:0},"& > :first-of-type":{marginTop:0},"& > :last-child":{marginBottom:0}},blockquote:{borderLeft:`4px solid ${e.color.medium}`,padding:"0 15px",color:e.color.dark,"& > :first-of-type":{marginTop:0},"& > :last-child":{marginBottom:0}},table:{padding:0,borderCollapse:"collapse","& tr":{borderTop:`1px solid ${e.appBorderColor}`,backgroundColor:"white",margin:0,padding:0,"& th":{fontWeight:"bold",border:`1px solid ${e.appBorderColor}`,textAlign:"left",margin:0,padding:"6px 13px"},"& td":{border:`1px solid ${e.appBorderColor}`,textAlign:"left",margin:0,padding:"6px 13px"},"&:nth-of-type(2n)":{backgroundColor:e.color.lighter},"& th :first-of-type, & td :first-of-type":{marginTop:0},"& th :last-child, & td :last-child":{marginBottom:0}}},img:{maxWidth:"100%"},"span.frame":{display:"block",overflow:"hidden","& > span":{border:`1px solid ${e.color.medium}`,display:"block",float:"left",overflow:"hidden",margin:"13px 0 0",padding:7,width:"auto"},"& span img":{display:"block",float:"left"},"& span span":{clear:"both",color:e.color.darkest,display:"block",padding:"5px 0 0"}},"span.align-center":{display:"block",overflow:"hidden",clear:"both","& > span":{display:"block",overflow:"hidden",margin:"13px auto 0",textAlign:"center"},"& span img":{margin:"0 auto",textAlign:"center"}},"span.align-right":{display:"block",overflow:"hidden",clear:"both","& > span":{display:"block",overflow:"hidden",margin:"13px 0 0",textAlign:"right"},"& span img":{margin:0,textAlign:"right"}},"span.float-left":{display:"block",marginRight:13,overflow:"hidden",float:"left","& span":{margin:"13px 0 0"}},"span.float-right":{display:"block",marginLeft:13,overflow:"hidden",float:"right","& > span":{display:"block",overflow:"hidden",margin:"13px auto 0",textAlign:"right"}},"code, tt":{margin:"0 2px",padding:"0 5px",whiteSpace:"nowrap",border:`1px solid ${e.color.mediumlight}`,backgroundColor:e.color.lighter,borderRadius:3,color:e.base==="dark"&&e.color.darkest}})),$t=[],nr=null,Qf=b.lazy(async()=>{let{SyntaxHighlighter:e}=await Ht(()=>import("./syntaxhighlighter-V7JZZA35-kp0Lh13z.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url);return $t.length>0&&($t.forEach(t=>{e.registerLanguage(...t)}),$t=[]),nr===null&&(nr=e),{default:t=>a.createElement(e,{...t})}}),em=b.lazy(async()=>{let[{SyntaxHighlighter:e},{formatter:t}]=await Promise.all([Ht(()=>import("./syntaxhighlighter-V7JZZA35-kp0Lh13z.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),Ht(()=>import("./formatter-SWP5E3XI-4AxpoQyI.js"),__vite__mapDeps([18,2,3,4,1,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url)]);return $t.length>0&&($t.forEach(r=>{e.registerLanguage(...r)}),$t=[]),nr===null&&(nr=e),{default:r=>a.createElement(e,{...r,formatter:t})}}),_n=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},e.format!==!1?a.createElement(em,{...e}):a.createElement(Qf,{...e}));_n.registerLanguage=(...e)=>{if(nr!==null){nr.registerLanguage(...e);return}$t.push(e)};var tm=e=>typeof e=="number"?e:Number(e),rm=R.div(({theme:e,col:t,row:r=1})=>t?{display:"inline-block",verticalAlign:"inherit","& > *":{marginLeft:t*e.layoutMargin,verticalAlign:"inherit"},[`& > *:first-child${_a}`]:{marginLeft:0}}:{"& > *":{marginTop:r*e.layoutMargin},[`& > *:first-child${_a}`]:{marginTop:0}},({theme:e,outer:t,col:r,row:n})=>{switch(!0){case!!(t&&r):return{marginLeft:t*e.layoutMargin,marginRight:t*e.layoutMargin};case!!(t&&n):return{marginTop:t*e.layoutMargin,marginBottom:t*e.layoutMargin};default:return{}}}),nm=({col:e,row:t,outer:r,children:n,...o})=>{let l=tm(typeof r=="number"||!r?r:e||t);return a.createElement(rm,{col:e,row:t,outer:l,...o},n)},am=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold})),om=R.div(),lm=R.div(({theme:e})=>({padding:30,textAlign:"center",color:e.color.defaultText,fontSize:e.typography.size.s2-1})),vu=({children:e,...t})=>{let[r,n]=b.Children.toArray(e);return a.createElement(lm,{...t},a.createElement(am,null,r),n&&a.createElement(om,null,n))},im=R.div(({scale:e=1,elementHeight:t})=>({height:t||"auto",transformOrigin:"top left",transform:`scale(${1/e})`}));function sm({scale:e,children:t}){let r=b.useRef(null),[n,o]=b.useState(0),l=b.useCallback(({height:i})=>{i&&o(i/e)},[e]);return b.useEffect(()=>{r.current&&o(r.current.getBoundingClientRect().height)},[e]),Ys({ref:r,onResize:l}),a.createElement(im,{scale:e,elementHeight:n},a.createElement("div",{ref:r,className:"innerZoomElementWrapper"},t))}var um=class extends b.Component{constructor(){super(...arguments),this.iframe=null}componentDidMount(){let{iFrameRef:e}=this.props;this.iframe=e.current}shouldComponentUpdate(e){let{scale:t,active:r}=this.props;return t!==e.scale&&this.setIframeInnerZoom(e.scale),r!==e.active&&this.iframe.setAttribute("data-is-storybook",e.active?"true":"false"),e.children.props.src!==this.props.children.props.src}setIframeInnerZoom(e){try{Object.assign(this.iframe.contentDocument.body.style,{width:`${e*100}%`,height:`${e*100}%`,transform:`scale(${1/e})`,transformOrigin:"top left"})}catch{this.setIframeZoom(e)}}setIframeZoom(e){Object.assign(this.iframe.style,{width:`${e*100}%`,height:`${e*100}%`,transform:`scale(${1/e})`,transformOrigin:"top left"})}render(){let{children:e}=this.props;return a.createElement(a.Fragment,null,e)}},Eu={Element:sm,IFrame:um},{document:cm}=lf,dm=R.strong(({theme:e})=>({color:e.color.orange})),pm=R.strong(({theme:e})=>({color:e.color.ancillary,textDecoration:"underline"})),ti=R.em(({theme:e})=>({color:e.textMutedColor})),fm=/(Error): (.*)\n/,mm=/at (?:(.*) )?\(?(.+)\)?/,gm=/([^@]+)?(?:\/<)?@(.+)?/,hm=/([^@]+)?@(.+)?/,xu=({error:e})=>{if(!e)return a.createElement(b.Fragment,null,"This error has no stack or message");if(!e.stack)return a.createElement(b.Fragment,null,e.message||"This error has no stack or message");let t=e.stack.toString();t&&e.message&&!t.includes(e.message)&&(t=`Error: ${e.message} +`,ye=({icon:e,useSymbol:t,...r})=>a.createElement(yu,{viewBox:"0 0 14 14",width:"14px",height:"14px",...r},t?a.createElement("use",{xlinkHref:`#icon--${e}`}):Lr[e]),Uf=b.memo(function({icons:e=Object.keys(Lr)}){return a.createElement(yu,{viewBox:"0 0 14 14",style:{position:"absolute",width:0,height:0},"data-chromatic":"ignore"},e.map(t=>a.createElement("symbol",{id:`icon--${t}`,key:t},Lr[t])))}),Wf=0,Gf=e=>e.button===Wf&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey,Yf=(e,t)=>{Gf(e)&&(e.preventDefault(),t(e))},Kf=R.span(({withArrow:e})=>e?{"> svg:last-of-type":{height:"0.7em",width:"0.7em",marginRight:0,marginLeft:"0.25em",bottom:"auto",verticalAlign:"inherit"}}:{},({containsIcon:e})=>e?{svg:{height:"1em",width:"1em",verticalAlign:"middle",position:"relative",bottom:0,marginRight:0}}:{}),Xf=R.a(({theme:e})=>({display:"inline-block",transition:"all 150ms ease-out",textDecoration:"none",color:e.color.secondary,"&:hover, &:focus":{cursor:"pointer",color:Wt(.07,e.color.secondary),"svg path:not([fill])":{fill:Wt(.07,e.color.secondary)}},"&:active":{color:Wt(.1,e.color.secondary),"svg path:not([fill])":{fill:Wt(.1,e.color.secondary)}},svg:{display:"inline-block",height:"1em",width:"1em",verticalAlign:"text-top",position:"relative",bottom:"-0.125em",marginRight:"0.4em","& path":{fill:e.color.secondary}}}),({theme:e,secondary:t,tertiary:r})=>{let n;return t&&(n=[e.textMutedColor,e.color.dark,e.color.darker]),r&&(n=[e.color.dark,e.color.darkest,e.textMutedColor]),n?{color:n[0],"svg path:not([fill])":{fill:n[0]},"&:hover":{color:n[1],"svg path:not([fill])":{fill:n[1]}},"&:active":{color:n[2],"svg path:not([fill])":{fill:n[2]}}}:{}},({nochrome:e})=>e?{color:"inherit","&:hover, &:active":{color:"inherit",textDecoration:"underline"}}:{},({theme:e,inverse:t})=>t?{color:e.color.lightest,":not([fill])":{fill:e.color.lightest},"&:hover":{color:e.color.lighter,"svg path:not([fill])":{fill:e.color.lighter}},"&:active":{color:e.color.light,"svg path:not([fill])":{fill:e.color.light}}}:{},({isButton:e})=>e?{border:0,borderRadius:0,background:"none",padding:0,fontSize:"inherit"}:{}),Et=({cancel:e,children:t,onClick:r,withArrow:n,containsIcon:o,className:l,...i})=>a.createElement(Xf,{...i,onClick:r&&e?s=>Yf(s,r):r,className:l},a.createElement(Kf,{withArrow:n,containsIcon:o},t,n&&a.createElement(ye,{icon:"arrowright"})));Et.defaultProps={cancel:!0,className:void 0,style:void 0,onClick:void 0,withArrow:!1,containsIcon:!1};var Jf=R.div(({theme:e})=>({fontSize:`${e.typography.size.s2}px`,lineHeight:"1.6",h1:{fontSize:`${e.typography.size.l1}px`,fontWeight:e.typography.weight.bold},h2:{fontSize:`${e.typography.size.m2}px`,borderBottom:`1px solid ${e.appBorderColor}`},h3:{fontSize:`${e.typography.size.m1}px`},h4:{fontSize:`${e.typography.size.s3}px`},h5:{fontSize:`${e.typography.size.s2}px`},h6:{fontSize:`${e.typography.size.s2}px`,color:e.color.dark},"pre:not(.prismjs)":{background:"transparent",border:"none",borderRadius:0,padding:0,margin:0},"pre pre, pre.prismjs":{padding:15,margin:0,whiteSpace:"pre-wrap",color:"inherit",fontSize:"13px",lineHeight:"19px"},"pre pre code, pre.prismjs code":{color:"inherit",fontSize:"inherit"},"pre code":{margin:0,padding:0,whiteSpace:"pre",border:"none",background:"transparent"},"pre code, pre tt":{backgroundColor:"transparent",border:"none"},"body > *:first-of-type":{marginTop:"0 !important"},"body > *:last-child":{marginBottom:"0 !important"},a:{color:e.color.secondary,textDecoration:"none"},"a.absent":{color:"#cc0000"},"a.anchor":{display:"block",paddingLeft:30,marginLeft:-30,cursor:"pointer",position:"absolute",top:0,left:0,bottom:0},"h1, h2, h3, h4, h5, h6":{margin:"20px 0 10px",padding:0,cursor:"text",position:"relative","&:first-of-type":{marginTop:0,paddingTop:0},"&:hover a.anchor":{textDecoration:"none"},"& tt, & code":{fontSize:"inherit"}},"h1:first-of-type + h2":{marginTop:0,paddingTop:0},"p, blockquote, ul, ol, dl, li, table, pre":{margin:"15px 0"},hr:{border:"0 none",borderTop:`1px solid ${e.appBorderColor}`,height:4,padding:0},"body > h1:first-of-type, body > h2:first-of-type, body > h3:first-of-type, body > h4:first-of-type, body > h5:first-of-type, body > h6:first-of-type":{marginTop:0,paddingTop:0},"body > h1:first-of-type + h2":{marginTop:0,paddingTop:0},"a:first-of-type h1, a:first-of-type h2, a:first-of-type h3, a:first-of-type h4, a:first-of-type h5, a:first-of-type h6":{marginTop:0,paddingTop:0},"h1 p, h2 p, h3 p, h4 p, h5 p, h6 p":{marginTop:0},"li p.first":{display:"inline-block"},"ul, ol":{paddingLeft:30,"& :first-of-type":{marginTop:0},"& :last-child":{marginBottom:0}},dl:{padding:0},"dl dt":{fontSize:"14px",fontWeight:"bold",fontStyle:"italic",margin:"0 0 15px",padding:"0 15px","&:first-of-type":{padding:0},"& > :first-of-type":{marginTop:0},"& > :last-child":{marginBottom:0}},blockquote:{borderLeft:`4px solid ${e.color.medium}`,padding:"0 15px",color:e.color.dark,"& > :first-of-type":{marginTop:0},"& > :last-child":{marginBottom:0}},table:{padding:0,borderCollapse:"collapse","& tr":{borderTop:`1px solid ${e.appBorderColor}`,backgroundColor:"white",margin:0,padding:0,"& th":{fontWeight:"bold",border:`1px solid ${e.appBorderColor}`,textAlign:"left",margin:0,padding:"6px 13px"},"& td":{border:`1px solid ${e.appBorderColor}`,textAlign:"left",margin:0,padding:"6px 13px"},"&:nth-of-type(2n)":{backgroundColor:e.color.lighter},"& th :first-of-type, & td :first-of-type":{marginTop:0},"& th :last-child, & td :last-child":{marginBottom:0}}},img:{maxWidth:"100%"},"span.frame":{display:"block",overflow:"hidden","& > span":{border:`1px solid ${e.color.medium}`,display:"block",float:"left",overflow:"hidden",margin:"13px 0 0",padding:7,width:"auto"},"& span img":{display:"block",float:"left"},"& span span":{clear:"both",color:e.color.darkest,display:"block",padding:"5px 0 0"}},"span.align-center":{display:"block",overflow:"hidden",clear:"both","& > span":{display:"block",overflow:"hidden",margin:"13px auto 0",textAlign:"center"},"& span img":{margin:"0 auto",textAlign:"center"}},"span.align-right":{display:"block",overflow:"hidden",clear:"both","& > span":{display:"block",overflow:"hidden",margin:"13px 0 0",textAlign:"right"},"& span img":{margin:0,textAlign:"right"}},"span.float-left":{display:"block",marginRight:13,overflow:"hidden",float:"left","& span":{margin:"13px 0 0"}},"span.float-right":{display:"block",marginLeft:13,overflow:"hidden",float:"right","& > span":{display:"block",overflow:"hidden",margin:"13px auto 0",textAlign:"right"}},"code, tt":{margin:"0 2px",padding:"0 5px",whiteSpace:"nowrap",border:`1px solid ${e.color.mediumlight}`,backgroundColor:e.color.lighter,borderRadius:3,color:e.base==="dark"&&e.color.darkest}})),$t=[],nr=null,Qf=b.lazy(async()=>{let{SyntaxHighlighter:e}=await Ht(()=>import("./syntaxhighlighter-V7JZZA35-CIYHiC15.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url);return $t.length>0&&($t.forEach(t=>{e.registerLanguage(...t)}),$t=[]),nr===null&&(nr=e),{default:t=>a.createElement(e,{...t})}}),em=b.lazy(async()=>{let[{SyntaxHighlighter:e},{formatter:t}]=await Promise.all([Ht(()=>import("./syntaxhighlighter-V7JZZA35-CIYHiC15.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url),Ht(()=>import("./formatter-SWP5E3XI-2S88nLcu.js"),__vite__mapDeps([18,2,3,4,1,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url)]);return $t.length>0&&($t.forEach(r=>{e.registerLanguage(...r)}),$t=[]),nr===null&&(nr=e),{default:r=>a.createElement(e,{...r,formatter:t})}}),_n=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},e.format!==!1?a.createElement(em,{...e}):a.createElement(Qf,{...e}));_n.registerLanguage=(...e)=>{if(nr!==null){nr.registerLanguage(...e);return}$t.push(e)};var tm=e=>typeof e=="number"?e:Number(e),rm=R.div(({theme:e,col:t,row:r=1})=>t?{display:"inline-block",verticalAlign:"inherit","& > *":{marginLeft:t*e.layoutMargin,verticalAlign:"inherit"},[`& > *:first-child${_a}`]:{marginLeft:0}}:{"& > *":{marginTop:r*e.layoutMargin},[`& > *:first-child${_a}`]:{marginTop:0}},({theme:e,outer:t,col:r,row:n})=>{switch(!0){case!!(t&&r):return{marginLeft:t*e.layoutMargin,marginRight:t*e.layoutMargin};case!!(t&&n):return{marginTop:t*e.layoutMargin,marginBottom:t*e.layoutMargin};default:return{}}}),nm=({col:e,row:t,outer:r,children:n,...o})=>{let l=tm(typeof r=="number"||!r?r:e||t);return a.createElement(rm,{col:e,row:t,outer:l,...o},n)},am=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold})),om=R.div(),lm=R.div(({theme:e})=>({padding:30,textAlign:"center",color:e.color.defaultText,fontSize:e.typography.size.s2-1})),vu=({children:e,...t})=>{let[r,n]=b.Children.toArray(e);return a.createElement(lm,{...t},a.createElement(am,null,r),n&&a.createElement(om,null,n))},im=R.div(({scale:e=1,elementHeight:t})=>({height:t||"auto",transformOrigin:"top left",transform:`scale(${1/e})`}));function sm({scale:e,children:t}){let r=b.useRef(null),[n,o]=b.useState(0),l=b.useCallback(({height:i})=>{i&&o(i/e)},[e]);return b.useEffect(()=>{r.current&&o(r.current.getBoundingClientRect().height)},[e]),Ys({ref:r,onResize:l}),a.createElement(im,{scale:e,elementHeight:n},a.createElement("div",{ref:r,className:"innerZoomElementWrapper"},t))}var um=class extends b.Component{constructor(){super(...arguments),this.iframe=null}componentDidMount(){let{iFrameRef:e}=this.props;this.iframe=e.current}shouldComponentUpdate(e){let{scale:t,active:r}=this.props;return t!==e.scale&&this.setIframeInnerZoom(e.scale),r!==e.active&&this.iframe.setAttribute("data-is-storybook",e.active?"true":"false"),e.children.props.src!==this.props.children.props.src}setIframeInnerZoom(e){try{Object.assign(this.iframe.contentDocument.body.style,{width:`${e*100}%`,height:`${e*100}%`,transform:`scale(${1/e})`,transformOrigin:"top left"})}catch{this.setIframeZoom(e)}}setIframeZoom(e){Object.assign(this.iframe.style,{width:`${e*100}%`,height:`${e*100}%`,transform:`scale(${1/e})`,transformOrigin:"top left"})}render(){let{children:e}=this.props;return a.createElement(a.Fragment,null,e)}},Eu={Element:sm,IFrame:um},{document:cm}=lf,dm=R.strong(({theme:e})=>({color:e.color.orange})),pm=R.strong(({theme:e})=>({color:e.color.ancillary,textDecoration:"underline"})),ti=R.em(({theme:e})=>({color:e.textMutedColor})),fm=/(Error): (.*)\n/,mm=/at (?:(.*) )?\(?(.+)\)?/,gm=/([^@]+)?(?:\/<)?@(.+)?/,hm=/([^@]+)?@(.+)?/,xu=({error:e})=>{if(!e)return a.createElement(b.Fragment,null,"This error has no stack or message");if(!e.stack)return a.createElement(b.Fragment,null,e.message||"This error has no stack or message");let t=e.stack.toString();t&&e.message&&!t.includes(e.message)&&(t=`Error: ${e.message} -${t}`);let r=t.match(fm);if(!r)return a.createElement(b.Fragment,null,t);let[,n,o]=r,l=t.split(/\n/).slice(1),[,...i]=l.map(s=>{let u=s.match(mm)||s.match(gm)||s.match(hm);return u?{name:(u[1]||"").replace("/<",""),location:u[2].replace(cm.location.origin,"")}:null}).filter(Boolean);return a.createElement(b.Fragment,null,a.createElement("span",null,n),": ",a.createElement(dm,null,o),a.createElement("br",null),i.map((s,u)=>s.name?a.createElement(b.Fragment,{key:u}," ","at ",a.createElement(pm,null,s.name)," (",a.createElement(ti,null,s.location),")",a.createElement("br",null)):a.createElement(b.Fragment,{key:u}," ","at ",a.createElement(ti,null,s.location),a.createElement("br",null))))},wu=R.button(({small:e,theme:t})=>({border:0,borderRadius:"3em",cursor:"pointer",display:"inline-block",overflow:"hidden",padding:e?"8px 16px":"13px 20px",position:"relative",textAlign:"center",textDecoration:"none",transitionProperty:"background, box-shadow",transitionDuration:"150ms",transitionTimingFunction:"ease-out",verticalAlign:"top",whiteSpace:"nowrap",userSelect:"none",opacity:1,margin:0,background:"transparent",fontSize:`${e?t.typography.size.s1:t.typography.size.s2-1}px`,fontWeight:t.typography.weight.bold,lineHeight:"1",svg:{display:"inline-block",height:e?12:14,width:e?12:14,verticalAlign:"top",marginRight:e?4:6,marginTop:e?0:-1,marginBottom:e?0:-1,pointerEvents:"none",path:{fill:"currentColor"}}}),({disabled:e})=>e?{cursor:"not-allowed !important",opacity:.5,"&:hover":{transform:"none"}}:{},({containsIcon:e,small:t})=>e?{svg:{display:"block",margin:0},...t?{padding:10}:{padding:13}}:{},({theme:e,primary:t,secondary:r,gray:n})=>{let o;return n?o=e.color.mediumlight:r?o=e.color.secondary:t&&(o=e.color.primary),o?{background:o,color:n?e.color.darkest:e.color.lightest,"&:hover":{background:Wt(.05,o)},"&:active":{boxShadow:"rgba(0, 0, 0, 0.1) 0 0 0 3em inset"},"&:focus":{boxShadow:`${ut(o,1)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${ut(o,.2)} 0 8px 18px 0px`}}:{}},({theme:e,tertiary:t,inForm:r,small:n})=>t?{background:e.button.background,color:e.input.color,boxShadow:`${e.button.border} 0 0 0 1px inset`,borderRadius:e.input.borderRadius,...r&&n?{padding:"10px 16px"}:{},"&:hover":{background:e.base==="light"?Wt(.02,e.button.background):Mf(.03,e.button.background),...r?{}:{boxShadow:"rgba(0,0,0,.2) 0 2px 6px 0, rgba(0,0,0,.1) 0 0 0 1px inset"}},"&:active":{background:e.button.background},"&:focus":{boxShadow:`${ut(e.color.secondary,1)} 0 0 0 1px inset`,outline:"none"}}:{},({theme:e,outline:t})=>t?{boxShadow:`${ve(.8,e.color.defaultText)} 0 0 0 1px inset`,color:ve(.3,e.color.defaultText),background:"transparent","&:hover, &:focus":{boxShadow:`${ve(.5,e.color.defaultText)} 0 0 0 1px inset`,outline:"none"},"&:active":{boxShadow:`${ve(.5,e.color.defaultText)} 0 0 0 2px inset`,color:ve(0,e.color.defaultText)}}:{},({theme:e,outline:t,primary:r})=>{let n=e.color.primary;return t&&r?{boxShadow:`${n} 0 0 0 1px inset`,color:n,"svg path:not([fill])":{fill:n},"&:hover":{boxShadow:`${n} 0 0 0 1px inset`,background:"transparent"},"&:active":{background:n,boxShadow:`${n} 0 0 0 1px inset`,color:e.color.tertiary},"&:focus":{boxShadow:`${n} 0 0 0 1px inset, ${ut(n,.4)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${n} 0 0 0 1px inset, ${ut(n,.2)} 0 8px 18px 0px`}}:{}},({theme:e,outline:t,primary:r,secondary:n})=>{let o;return n?o=e.color.secondary:r&&(o=e.color.primary),t&&o?{boxShadow:`${o} 0 0 0 1px inset`,color:o,"svg path:not([fill])":{fill:o},"&:hover":{boxShadow:`${o} 0 0 0 1px inset`,background:"transparent"},"&:active":{background:o,boxShadow:`${o} 0 0 0 1px inset`,color:e.color.tertiary},"&:focus":{boxShadow:`${o} 0 0 0 1px inset, ${ut(o,.4)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${o} 0 0 0 1px inset, ${ut(o,.2)} 0 8px 18px 0px`}}:{}}),bm=wu.withComponent("a"),Au=Object.assign(b.forwardRef(function({isLink:e,children:t,...r},n){return e?a.createElement(bm,{...r,ref:n},t):a.createElement(wu,{...r,ref:n},t)}),{defaultProps:{isLink:!1}}),ym=R.label(({theme:e})=>({display:"flex",borderBottom:`1px solid ${e.appBorderColor}`,margin:"0 15px",padding:"8px 0","&:last-child":{marginBottom:"3rem"}})),vm=R.span(({theme:e})=>({minWidth:100,fontWeight:e.typography.weight.bold,marginRight:15,display:"flex",justifyContent:"flex-start",alignItems:"center",lineHeight:"16px"})),Cu=({label:e,children:t,...r})=>a.createElement(ym,{...r},e?a.createElement(vm,null,a.createElement("span",null,e)):null,t);Cu.defaultProps={label:void 0};function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[o]=e[o]);return r}var ri=function(e,t){if(typeof e=="function"){e(t);return}e.current=t},xm=function(e,t){var r=b.useRef();return b.useCallback(function(n){e.current=n,r.current&&ri(r.current,null),r.current=t,t&&ri(t,n)},[t])},wm=xm,Am=function(){},Cm=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Sm=function(e,t){e.cacheMeasurements,e.maxRows,e.minRows;var r=e.onChange,n=r===void 0?Am:r;e.onHeightChange;var o=Em(e,Cm);o.value;var l=b.useRef(null),i=wm(l,t);return b.useRef(0),b.useRef(),b.createElement("textarea",Ua({},o,{onChange:n,ref:i}))},km=b.forwardRef(Sm),Rm={appearance:"none",border:"0 none",boxSizing:"inherit",display:" block",margin:" 0",background:"transparent",padding:0,fontSize:"inherit",position:"relative"},Po=({theme:e})=>({...Rm,transition:"box-shadow 200ms ease-out, opacity 200ms ease-out",color:e.input.color||"inherit",background:e.input.background,boxShadow:`${e.input.border} 0 0 0 1px inset`,borderRadius:e.input.borderRadius,fontSize:e.typography.size.s2-1,lineHeight:"20px",padding:"6px 10px",boxSizing:"border-box",height:32,'&[type="file"]':{height:"auto"},"&:focus":{boxShadow:`${e.color.secondary} 0 0 0 1px inset`,outline:"none"},"&[disabled]":{cursor:"not-allowed",opacity:.5},"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 3em ${e.color.lightest} inset`},"&::placeholder":{color:e.textMutedColor,opacity:1}}),Mn=({size:e})=>{switch(e){case"100%":return{width:"100%"};case"flex":return{flex:1};case"auto":default:return{display:"inline"}}},Su=({align:e})=>{switch(e){case"end":return{textAlign:"right"};case"center":return{textAlign:"center"};case"start":default:return{textAlign:"left"}}},$n=({valid:e,theme:t})=>{switch(e){case"valid":return{boxShadow:`${t.color.positive} 0 0 0 1px inset !important`};case"error":return{boxShadow:`${t.color.negative} 0 0 0 1px inset !important`};case"warn":return{boxShadow:`${t.color.warning} 0 0 0 1px inset`};case void 0:case null:default:return{}}},Fm=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement("input",{...n,ref:o})}))(Po,Mn,Su,$n,{minHeight:32}),{displayName:"Input"}),Tm=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement("select",{...n,ref:o})}))(Po,Mn,$n,{height:32,userSelect:"none",paddingRight:20,appearance:"menulist"}),{displayName:"Select"}),Om=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement(km,{...n,ref:o})}))(Po,Mn,Su,$n,({height:e=400})=>({overflow:"visible",maxHeight:e})),{displayName:"Textarea"}),Lm=R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement(Au,{...n,ref:o})}))(Mn,$n,{userSelect:"none",overflow:"visible",zIndex:2,"&:hover":{transform:"none"}}),Dm=Object.assign(b.forwardRef(function(e,t){return a.createElement(Lm,{...e,tertiary:!0,small:!0,inForm:!0,ref:t})}),{displayName:"Button"}),Ie=Object.assign(R.form({boxSizing:"border-box",width:"100%"}),{Field:Cu,Input:Fm,Select:Tm,Textarea:Om,Button:Dm}),_m=b.lazy(()=>Ht(()=>import("./WithTooltip-V3YHNWJZ-JV42Hbb2.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(e=>({default:e.WithTooltip}))),Mm=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement(_m,{...e})),$m=b.lazy(()=>Ht(()=>import("./WithTooltip-V3YHNWJZ-JV42Hbb2.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(e=>({default:e.WithTooltipPure}))),ku=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement($m,{...e})),Bm=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold})),Hm=R.span(),Im=R.div(({theme:e})=>({marginTop:8,textAlign:"center","> *":{margin:"0 8px",fontWeight:e.typography.weight.bold}})),Nm=R.div(({theme:e})=>({color:e.color.defaultText,lineHeight:"18px"})),Zm=R.div({padding:15,width:280,boxSizing:"border-box"}),Ru=({title:e,desc:t,links:r})=>a.createElement(Zm,null,a.createElement(Nm,null,e&&a.createElement(Bm,null,e),t&&a.createElement(Hm,null,t)),r&&a.createElement(Im,null,r.map(({title:n,...o})=>a.createElement(Et,{...o,key:n},n))));Ru.defaultProps={title:null,desc:null,links:null};var jm=R.div(({theme:e})=>({padding:"2px 6px",lineHeight:"16px",fontSize:10,fontWeight:e.typography.weight.bold,color:e.color.lightest,boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.3)",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:-1,background:e.base==="light"?"rgba(60, 60, 60, 0.9)":"rgba(0, 0, 0, 0.95)",margin:6})),Pm=({note:e,...t})=>a.createElement(jm,{...t},e),Vm=R(({active:e,loading:t,disabled:r,...n})=>a.createElement("span",{...n}))(({theme:e})=>({color:e.color.defaultText,fontWeight:e.typography.weight.regular}),({active:e,theme:t})=>e?{color:t.color.secondary,fontWeight:t.typography.weight.bold}:{},({loading:e,theme:t})=>e?{display:"inline-block",flex:"none",...t.animation.inlineGlow}:{},({disabled:e,theme:t})=>e?{color:ve(.7,t.color.defaultText)}:{}),zm=R.span({display:"flex","& svg":{height:12,width:12,margin:"3px 0",verticalAlign:"top"},"& path":{fill:"inherit"}}),qm=R.span({flex:1,textAlign:"left",display:"flex",flexDirection:"column"},({isIndented:e})=>e?{marginLeft:24}:{}),Um=R.span(({theme:e})=>({fontSize:"11px",lineHeight:"14px"}),({active:e,theme:t})=>e?{color:t.color.secondary}:{},({theme:e,disabled:t})=>t?{color:e.textMutedColor}:{}),ni=R.span(({active:e,theme:t})=>e?{"& svg":{opacity:1},"& svg path:not([fill])":{fill:t.color.secondary}}:{},()=>({display:"flex",maxWidth:14})),Wm=R.a(({theme:e})=>({fontSize:e.typography.size.s1,transition:"all 150ms ease-out",color:e.color.dark,textDecoration:"none",cursor:"pointer",justifyContent:"space-between",lineHeight:"18px",padding:"7px 10px",display:"flex",alignItems:"center","& > * + *":{paddingLeft:10},"&:hover":{background:e.background.hoverable},"&:hover svg":{opacity:1}}),({disabled:e})=>e?{cursor:"not-allowed"}:{}),Gm=ar(100)((e,t,r)=>{let n={};return e&&Object.assign(n,{onClick:e}),t&&Object.assign(n,{href:t}),r&&t&&Object.assign(n,{to:t,as:r}),n}),Fu=({loading:e,left:t,title:r,center:n,right:o,icon:l,active:i,disabled:s,isIndented:u,href:c,onClick:d,LinkWrapper:h,...m})=>{let p=Gm(d,c,h),g={active:i,disabled:s},f=typeof l=="string"&&Lr[l];return a.createElement(Wm,{...g,...m,...p},l?a.createElement(ni,{...g},f?a.createElement(ye,{icon:l}):l):t&&a.createElement(ni,{...g},t),r||n?a.createElement(qm,{isIndented:!t&&!l&&u},r&&a.createElement(Vm,{...g,loading:e},r),n&&a.createElement(Um,{...g},n)):null,o&&a.createElement(zm,{...g},o))};Fu.defaultProps={loading:!1,left:null,title:a.createElement("span",null,"Loading state"),center:null,right:null,active:!1,disabled:!1,href:null,LinkWrapper:null,onClick:null};var Vo=Fu,Ym=R.div({minWidth:180,overflow:"hidden",overflowY:"auto",maxHeight:15.5*32},({theme:e})=>({borderRadius:e.appBorderRadius})),Km=e=>{let{LinkWrapper:t,onClick:r,id:n,isIndented:o,...l}=e,{title:i,href:s,active:u}=l,c=b.useCallback(h=>{r(h,l)},[r]),d=!!r;return a.createElement(Vo,{title:i,active:u,href:s,id:`list-item-${n}`,LinkWrapper:t,isIndented:o,...l,...d?{onClick:c}:{}})},zo=({links:e,LinkWrapper:t})=>{let r=e.some(n=>n.left||n.icon);return a.createElement(Ym,null,e.map(({isGatsby:n,...o})=>a.createElement(Km,{key:o.id,LinkWrapper:n?t:null,isIndented:r,...o})))};zo.defaultProps={LinkWrapper:Vo.defaultProps.LinkWrapper};var qo=a.forwardRef(({children:e,...t},r)=>t.href!=null?a.createElement("a",{ref:r,...t},e):a.createElement("button",{ref:r,type:"button",...t},e));qo.displayName="ButtonOrLink";var Nr=R(qo,{shouldForwardProp:so})({whiteSpace:"normal",display:"inline-flex",overflow:"hidden",verticalAlign:"top",justifyContent:"center",alignItems:"center",textAlign:"center",textDecoration:"none","&:empty":{display:"none"}},({theme:e})=>({padding:"0 15px",transition:"color 0.2s linear, border-bottom-color 0.2s linear",height:40,lineHeight:"12px",cursor:"pointer",background:"transparent",border:"0 solid transparent",borderTop:"3px solid transparent",borderBottom:"3px solid transparent",fontWeight:"bold",fontSize:13,"&:focus":{outline:"0 none",borderBottomColor:e.color.secondary}}),({active:e,textColor:t,theme:r})=>e?{color:t||r.barSelectedColor,borderBottomColor:r.barSelectedColor}:{color:t||r.barTextColor,borderBottomColor:"transparent"});Nr.displayName="TabButton";var Bt=R(qo,{shouldForwardProp:so})(()=>({alignItems:"center",background:"transparent",border:"none",borderRadius:4,color:"inherit",cursor:"pointer",display:"inline-flex",fontSize:13,fontWeight:"bold",height:28,justifyContent:"center",marginTop:6,padding:"8px 7px","& > svg":{width:14}}),({active:e,theme:t})=>e?{backgroundColor:t.background.hoverable,color:t.barSelectedColor}:{},({disabled:e,theme:t})=>e?{opacity:.5,cursor:"not-allowed"}:{"&:hover, &:focus-visible":{background:ve(.88,t.color.secondary),color:t.barHoverColor},"&:focus-visible":{outline:Ln},"&:focus:not(:focus-visible)":{outline:"none"}});Bt.displayName="IconButton";var Xm=R.div(({theme:e})=>({width:14,height:14,backgroundColor:e.appBorderColor,animation:`${e.animation.glow} 1.5s ease-in-out infinite`})),Jm=R.div(()=>({marginTop:6,padding:7,height:28})),Tu=()=>a.createElement(Jm,null,a.createElement(Xm,null)),Wa=R.div({display:"flex",whiteSpace:"nowrap",flexBasis:"auto",marginLeft:3,marginRight:3},({scrollable:e})=>e?{flexShrink:0}:{},({left:e})=>e?{"& > *":{marginLeft:4}}:{},({right:e})=>e?{marginLeft:30,"& > *":{marginRight:4}}:{});Wa.displayName="Side";var Qm=({children:e,className:t,scrollable:r})=>r?a.createElement(So,{vertical:!1,className:t},e):a.createElement("div",{className:t},e),Uo=R(Qm)(({theme:e,scrollable:t=!0})=>({color:e.barTextColor,width:"100%",height:40,flexShrink:0,overflow:t?"auto":"hidden",overflowY:"hidden"}),({theme:e,border:t=!1})=>t?{boxShadow:`${e.appBorderColor} 0 -1px 0 0 inset`,background:e.barBg}:{});Uo.displayName="Bar";var eg=R.div(({bgColor:e})=>({display:"flex",justifyContent:"space-between",position:"relative",flexWrap:"nowrap",flexShrink:0,height:40,backgroundColor:e||""})),Bn=({children:e,backgroundColor:t,...r})=>{let[n,o]=b.Children.toArray(e);return a.createElement(Uo,{...r},a.createElement(eg,{bgColor:t},a.createElement(Wa,{scrollable:r.scrollable,left:!0},n),o?a.createElement(Wa,{right:!0},o):null))};Bn.displayName="FlexBar";var Ou=R.div(({active:e})=>e?{display:"block"}:{display:"none"}),ai=e=>b.Children.toArray(e).map(({props:{title:t,id:r,color:n,children:o}})=>{let l=Array.isArray(o)?o[0]:o;return{title:t,id:r,...n?{color:n}:{},render:typeof l=="function"?l:({active:i})=>a.createElement(Ou,{active:i,role:"tabpanel"},l)}}),tg=R.span(({theme:e,isActive:t})=>({display:"inline-block",width:0,height:0,marginLeft:8,color:t?e.color.secondary:e.color.mediumdark,borderRight:"3px solid transparent",borderLeft:"3px solid transparent",borderTop:"3px solid",transition:"transform .1s ease-out"})),rg=R(Nr)(({active:e,theme:t,preActive:r})=>` +${t}`);let r=t.match(fm);if(!r)return a.createElement(b.Fragment,null,t);let[,n,o]=r,l=t.split(/\n/).slice(1),[,...i]=l.map(s=>{let u=s.match(mm)||s.match(gm)||s.match(hm);return u?{name:(u[1]||"").replace("/<",""),location:u[2].replace(cm.location.origin,"")}:null}).filter(Boolean);return a.createElement(b.Fragment,null,a.createElement("span",null,n),": ",a.createElement(dm,null,o),a.createElement("br",null),i.map((s,u)=>s.name?a.createElement(b.Fragment,{key:u}," ","at ",a.createElement(pm,null,s.name)," (",a.createElement(ti,null,s.location),")",a.createElement("br",null)):a.createElement(b.Fragment,{key:u}," ","at ",a.createElement(ti,null,s.location),a.createElement("br",null))))},wu=R.button(({small:e,theme:t})=>({border:0,borderRadius:"3em",cursor:"pointer",display:"inline-block",overflow:"hidden",padding:e?"8px 16px":"13px 20px",position:"relative",textAlign:"center",textDecoration:"none",transitionProperty:"background, box-shadow",transitionDuration:"150ms",transitionTimingFunction:"ease-out",verticalAlign:"top",whiteSpace:"nowrap",userSelect:"none",opacity:1,margin:0,background:"transparent",fontSize:`${e?t.typography.size.s1:t.typography.size.s2-1}px`,fontWeight:t.typography.weight.bold,lineHeight:"1",svg:{display:"inline-block",height:e?12:14,width:e?12:14,verticalAlign:"top",marginRight:e?4:6,marginTop:e?0:-1,marginBottom:e?0:-1,pointerEvents:"none",path:{fill:"currentColor"}}}),({disabled:e})=>e?{cursor:"not-allowed !important",opacity:.5,"&:hover":{transform:"none"}}:{},({containsIcon:e,small:t})=>e?{svg:{display:"block",margin:0},...t?{padding:10}:{padding:13}}:{},({theme:e,primary:t,secondary:r,gray:n})=>{let o;return n?o=e.color.mediumlight:r?o=e.color.secondary:t&&(o=e.color.primary),o?{background:o,color:n?e.color.darkest:e.color.lightest,"&:hover":{background:Wt(.05,o)},"&:active":{boxShadow:"rgba(0, 0, 0, 0.1) 0 0 0 3em inset"},"&:focus":{boxShadow:`${ut(o,1)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${ut(o,.2)} 0 8px 18px 0px`}}:{}},({theme:e,tertiary:t,inForm:r,small:n})=>t?{background:e.button.background,color:e.input.color,boxShadow:`${e.button.border} 0 0 0 1px inset`,borderRadius:e.input.borderRadius,...r&&n?{padding:"10px 16px"}:{},"&:hover":{background:e.base==="light"?Wt(.02,e.button.background):Mf(.03,e.button.background),...r?{}:{boxShadow:"rgba(0,0,0,.2) 0 2px 6px 0, rgba(0,0,0,.1) 0 0 0 1px inset"}},"&:active":{background:e.button.background},"&:focus":{boxShadow:`${ut(e.color.secondary,1)} 0 0 0 1px inset`,outline:"none"}}:{},({theme:e,outline:t})=>t?{boxShadow:`${ve(.8,e.color.defaultText)} 0 0 0 1px inset`,color:ve(.3,e.color.defaultText),background:"transparent","&:hover, &:focus":{boxShadow:`${ve(.5,e.color.defaultText)} 0 0 0 1px inset`,outline:"none"},"&:active":{boxShadow:`${ve(.5,e.color.defaultText)} 0 0 0 2px inset`,color:ve(0,e.color.defaultText)}}:{},({theme:e,outline:t,primary:r})=>{let n=e.color.primary;return t&&r?{boxShadow:`${n} 0 0 0 1px inset`,color:n,"svg path:not([fill])":{fill:n},"&:hover":{boxShadow:`${n} 0 0 0 1px inset`,background:"transparent"},"&:active":{background:n,boxShadow:`${n} 0 0 0 1px inset`,color:e.color.tertiary},"&:focus":{boxShadow:`${n} 0 0 0 1px inset, ${ut(n,.4)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${n} 0 0 0 1px inset, ${ut(n,.2)} 0 8px 18px 0px`}}:{}},({theme:e,outline:t,primary:r,secondary:n})=>{let o;return n?o=e.color.secondary:r&&(o=e.color.primary),t&&o?{boxShadow:`${o} 0 0 0 1px inset`,color:o,"svg path:not([fill])":{fill:o},"&:hover":{boxShadow:`${o} 0 0 0 1px inset`,background:"transparent"},"&:active":{background:o,boxShadow:`${o} 0 0 0 1px inset`,color:e.color.tertiary},"&:focus":{boxShadow:`${o} 0 0 0 1px inset, ${ut(o,.4)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${o} 0 0 0 1px inset, ${ut(o,.2)} 0 8px 18px 0px`}}:{}}),bm=wu.withComponent("a"),Au=Object.assign(b.forwardRef(function({isLink:e,children:t,...r},n){return e?a.createElement(bm,{...r,ref:n},t):a.createElement(wu,{...r,ref:n},t)}),{defaultProps:{isLink:!1}}),ym=R.label(({theme:e})=>({display:"flex",borderBottom:`1px solid ${e.appBorderColor}`,margin:"0 15px",padding:"8px 0","&:last-child":{marginBottom:"3rem"}})),vm=R.span(({theme:e})=>({minWidth:100,fontWeight:e.typography.weight.bold,marginRight:15,display:"flex",justifyContent:"flex-start",alignItems:"center",lineHeight:"16px"})),Cu=({label:e,children:t,...r})=>a.createElement(ym,{...r},e?a.createElement(vm,null,a.createElement("span",null,e)):null,t);Cu.defaultProps={label:void 0};function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[o]=e[o]);return r}var ri=function(e,t){if(typeof e=="function"){e(t);return}e.current=t},xm=function(e,t){var r=b.useRef();return b.useCallback(function(n){e.current=n,r.current&&ri(r.current,null),r.current=t,t&&ri(t,n)},[t])},wm=xm,Am=function(){},Cm=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Sm=function(e,t){e.cacheMeasurements,e.maxRows,e.minRows;var r=e.onChange,n=r===void 0?Am:r;e.onHeightChange;var o=Em(e,Cm);o.value;var l=b.useRef(null),i=wm(l,t);return b.useRef(0),b.useRef(),b.createElement("textarea",Ua({},o,{onChange:n,ref:i}))},km=b.forwardRef(Sm),Rm={appearance:"none",border:"0 none",boxSizing:"inherit",display:" block",margin:" 0",background:"transparent",padding:0,fontSize:"inherit",position:"relative"},Po=({theme:e})=>({...Rm,transition:"box-shadow 200ms ease-out, opacity 200ms ease-out",color:e.input.color||"inherit",background:e.input.background,boxShadow:`${e.input.border} 0 0 0 1px inset`,borderRadius:e.input.borderRadius,fontSize:e.typography.size.s2-1,lineHeight:"20px",padding:"6px 10px",boxSizing:"border-box",height:32,'&[type="file"]':{height:"auto"},"&:focus":{boxShadow:`${e.color.secondary} 0 0 0 1px inset`,outline:"none"},"&[disabled]":{cursor:"not-allowed",opacity:.5},"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 3em ${e.color.lightest} inset`},"&::placeholder":{color:e.textMutedColor,opacity:1}}),Mn=({size:e})=>{switch(e){case"100%":return{width:"100%"};case"flex":return{flex:1};case"auto":default:return{display:"inline"}}},Su=({align:e})=>{switch(e){case"end":return{textAlign:"right"};case"center":return{textAlign:"center"};case"start":default:return{textAlign:"left"}}},$n=({valid:e,theme:t})=>{switch(e){case"valid":return{boxShadow:`${t.color.positive} 0 0 0 1px inset !important`};case"error":return{boxShadow:`${t.color.negative} 0 0 0 1px inset !important`};case"warn":return{boxShadow:`${t.color.warning} 0 0 0 1px inset`};case void 0:case null:default:return{}}},Fm=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement("input",{...n,ref:o})}))(Po,Mn,Su,$n,{minHeight:32}),{displayName:"Input"}),Tm=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement("select",{...n,ref:o})}))(Po,Mn,$n,{height:32,userSelect:"none",paddingRight:20,appearance:"menulist"}),{displayName:"Select"}),Om=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement(km,{...n,ref:o})}))(Po,Mn,Su,$n,({height:e=400})=>({overflow:"visible",maxHeight:e})),{displayName:"Textarea"}),Lm=R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement(Au,{...n,ref:o})}))(Mn,$n,{userSelect:"none",overflow:"visible",zIndex:2,"&:hover":{transform:"none"}}),Dm=Object.assign(b.forwardRef(function(e,t){return a.createElement(Lm,{...e,tertiary:!0,small:!0,inForm:!0,ref:t})}),{displayName:"Button"}),Ie=Object.assign(R.form({boxSizing:"border-box",width:"100%"}),{Field:Cu,Input:Fm,Select:Tm,Textarea:Om,Button:Dm}),_m=b.lazy(()=>Ht(()=>import("./WithTooltip-V3YHNWJZ-7eC_V2oR.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(e=>({default:e.WithTooltip}))),Mm=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement(_m,{...e})),$m=b.lazy(()=>Ht(()=>import("./WithTooltip-V3YHNWJZ-7eC_V2oR.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(e=>({default:e.WithTooltipPure}))),ku=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement($m,{...e})),Bm=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold})),Hm=R.span(),Im=R.div(({theme:e})=>({marginTop:8,textAlign:"center","> *":{margin:"0 8px",fontWeight:e.typography.weight.bold}})),Nm=R.div(({theme:e})=>({color:e.color.defaultText,lineHeight:"18px"})),Zm=R.div({padding:15,width:280,boxSizing:"border-box"}),Ru=({title:e,desc:t,links:r})=>a.createElement(Zm,null,a.createElement(Nm,null,e&&a.createElement(Bm,null,e),t&&a.createElement(Hm,null,t)),r&&a.createElement(Im,null,r.map(({title:n,...o})=>a.createElement(Et,{...o,key:n},n))));Ru.defaultProps={title:null,desc:null,links:null};var jm=R.div(({theme:e})=>({padding:"2px 6px",lineHeight:"16px",fontSize:10,fontWeight:e.typography.weight.bold,color:e.color.lightest,boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.3)",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:-1,background:e.base==="light"?"rgba(60, 60, 60, 0.9)":"rgba(0, 0, 0, 0.95)",margin:6})),Pm=({note:e,...t})=>a.createElement(jm,{...t},e),Vm=R(({active:e,loading:t,disabled:r,...n})=>a.createElement("span",{...n}))(({theme:e})=>({color:e.color.defaultText,fontWeight:e.typography.weight.regular}),({active:e,theme:t})=>e?{color:t.color.secondary,fontWeight:t.typography.weight.bold}:{},({loading:e,theme:t})=>e?{display:"inline-block",flex:"none",...t.animation.inlineGlow}:{},({disabled:e,theme:t})=>e?{color:ve(.7,t.color.defaultText)}:{}),zm=R.span({display:"flex","& svg":{height:12,width:12,margin:"3px 0",verticalAlign:"top"},"& path":{fill:"inherit"}}),qm=R.span({flex:1,textAlign:"left",display:"flex",flexDirection:"column"},({isIndented:e})=>e?{marginLeft:24}:{}),Um=R.span(({theme:e})=>({fontSize:"11px",lineHeight:"14px"}),({active:e,theme:t})=>e?{color:t.color.secondary}:{},({theme:e,disabled:t})=>t?{color:e.textMutedColor}:{}),ni=R.span(({active:e,theme:t})=>e?{"& svg":{opacity:1},"& svg path:not([fill])":{fill:t.color.secondary}}:{},()=>({display:"flex",maxWidth:14})),Wm=R.a(({theme:e})=>({fontSize:e.typography.size.s1,transition:"all 150ms ease-out",color:e.color.dark,textDecoration:"none",cursor:"pointer",justifyContent:"space-between",lineHeight:"18px",padding:"7px 10px",display:"flex",alignItems:"center","& > * + *":{paddingLeft:10},"&:hover":{background:e.background.hoverable},"&:hover svg":{opacity:1}}),({disabled:e})=>e?{cursor:"not-allowed"}:{}),Gm=ar(100)((e,t,r)=>{let n={};return e&&Object.assign(n,{onClick:e}),t&&Object.assign(n,{href:t}),r&&t&&Object.assign(n,{to:t,as:r}),n}),Fu=({loading:e,left:t,title:r,center:n,right:o,icon:l,active:i,disabled:s,isIndented:u,href:c,onClick:d,LinkWrapper:h,...m})=>{let p=Gm(d,c,h),g={active:i,disabled:s},f=typeof l=="string"&&Lr[l];return a.createElement(Wm,{...g,...m,...p},l?a.createElement(ni,{...g},f?a.createElement(ye,{icon:l}):l):t&&a.createElement(ni,{...g},t),r||n?a.createElement(qm,{isIndented:!t&&!l&&u},r&&a.createElement(Vm,{...g,loading:e},r),n&&a.createElement(Um,{...g},n)):null,o&&a.createElement(zm,{...g},o))};Fu.defaultProps={loading:!1,left:null,title:a.createElement("span",null,"Loading state"),center:null,right:null,active:!1,disabled:!1,href:null,LinkWrapper:null,onClick:null};var Vo=Fu,Ym=R.div({minWidth:180,overflow:"hidden",overflowY:"auto",maxHeight:15.5*32},({theme:e})=>({borderRadius:e.appBorderRadius})),Km=e=>{let{LinkWrapper:t,onClick:r,id:n,isIndented:o,...l}=e,{title:i,href:s,active:u}=l,c=b.useCallback(h=>{r(h,l)},[r]),d=!!r;return a.createElement(Vo,{title:i,active:u,href:s,id:`list-item-${n}`,LinkWrapper:t,isIndented:o,...l,...d?{onClick:c}:{}})},zo=({links:e,LinkWrapper:t})=>{let r=e.some(n=>n.left||n.icon);return a.createElement(Ym,null,e.map(({isGatsby:n,...o})=>a.createElement(Km,{key:o.id,LinkWrapper:n?t:null,isIndented:r,...o})))};zo.defaultProps={LinkWrapper:Vo.defaultProps.LinkWrapper};var qo=a.forwardRef(({children:e,...t},r)=>t.href!=null?a.createElement("a",{ref:r,...t},e):a.createElement("button",{ref:r,type:"button",...t},e));qo.displayName="ButtonOrLink";var Nr=R(qo,{shouldForwardProp:so})({whiteSpace:"normal",display:"inline-flex",overflow:"hidden",verticalAlign:"top",justifyContent:"center",alignItems:"center",textAlign:"center",textDecoration:"none","&:empty":{display:"none"}},({theme:e})=>({padding:"0 15px",transition:"color 0.2s linear, border-bottom-color 0.2s linear",height:40,lineHeight:"12px",cursor:"pointer",background:"transparent",border:"0 solid transparent",borderTop:"3px solid transparent",borderBottom:"3px solid transparent",fontWeight:"bold",fontSize:13,"&:focus":{outline:"0 none",borderBottomColor:e.color.secondary}}),({active:e,textColor:t,theme:r})=>e?{color:t||r.barSelectedColor,borderBottomColor:r.barSelectedColor}:{color:t||r.barTextColor,borderBottomColor:"transparent"});Nr.displayName="TabButton";var Bt=R(qo,{shouldForwardProp:so})(()=>({alignItems:"center",background:"transparent",border:"none",borderRadius:4,color:"inherit",cursor:"pointer",display:"inline-flex",fontSize:13,fontWeight:"bold",height:28,justifyContent:"center",marginTop:6,padding:"8px 7px","& > svg":{width:14}}),({active:e,theme:t})=>e?{backgroundColor:t.background.hoverable,color:t.barSelectedColor}:{},({disabled:e,theme:t})=>e?{opacity:.5,cursor:"not-allowed"}:{"&:hover, &:focus-visible":{background:ve(.88,t.color.secondary),color:t.barHoverColor},"&:focus-visible":{outline:Ln},"&:focus:not(:focus-visible)":{outline:"none"}});Bt.displayName="IconButton";var Xm=R.div(({theme:e})=>({width:14,height:14,backgroundColor:e.appBorderColor,animation:`${e.animation.glow} 1.5s ease-in-out infinite`})),Jm=R.div(()=>({marginTop:6,padding:7,height:28})),Tu=()=>a.createElement(Jm,null,a.createElement(Xm,null)),Wa=R.div({display:"flex",whiteSpace:"nowrap",flexBasis:"auto",marginLeft:3,marginRight:3},({scrollable:e})=>e?{flexShrink:0}:{},({left:e})=>e?{"& > *":{marginLeft:4}}:{},({right:e})=>e?{marginLeft:30,"& > *":{marginRight:4}}:{});Wa.displayName="Side";var Qm=({children:e,className:t,scrollable:r})=>r?a.createElement(So,{vertical:!1,className:t},e):a.createElement("div",{className:t},e),Uo=R(Qm)(({theme:e,scrollable:t=!0})=>({color:e.barTextColor,width:"100%",height:40,flexShrink:0,overflow:t?"auto":"hidden",overflowY:"hidden"}),({theme:e,border:t=!1})=>t?{boxShadow:`${e.appBorderColor} 0 -1px 0 0 inset`,background:e.barBg}:{});Uo.displayName="Bar";var eg=R.div(({bgColor:e})=>({display:"flex",justifyContent:"space-between",position:"relative",flexWrap:"nowrap",flexShrink:0,height:40,backgroundColor:e||""})),Bn=({children:e,backgroundColor:t,...r})=>{let[n,o]=b.Children.toArray(e);return a.createElement(Uo,{...r},a.createElement(eg,{bgColor:t},a.createElement(Wa,{scrollable:r.scrollable,left:!0},n),o?a.createElement(Wa,{right:!0},o):null))};Bn.displayName="FlexBar";var Ou=R.div(({active:e})=>e?{display:"block"}:{display:"none"}),ai=e=>b.Children.toArray(e).map(({props:{title:t,id:r,color:n,children:o}})=>{let l=Array.isArray(o)?o[0]:o;return{title:t,id:r,...n?{color:n}:{},render:typeof l=="function"?l:({active:i})=>a.createElement(Ou,{active:i,role:"tabpanel"},l)}}),tg=R.span(({theme:e,isActive:t})=>({display:"inline-block",width:0,height:0,marginLeft:8,color:t?e.color.secondary:e.color.mediumdark,borderRight:"3px solid transparent",borderLeft:"3px solid transparent",borderTop:"3px solid",transition:"transform .1s ease-out"})),rg=R(Nr)(({active:e,theme:t,preActive:r})=>` color: ${r||e?t.color.secondary:t.color.mediumdark}; &:hover { color: ${t.color.secondary}; @@ -292,7 +292,7 @@ ${t}`);let r=t.match(fm);if(!r)return a.createElement(b.Fragment,null,t);let[,n, ${Ge(.02,e.input.background)} 100%)`:`linear-gradient(to right, ${e.color.green} 0%, ${e.color.green} ${(n-t)/(r-t)*100}%, ${Ot(.02,e.input.background)} ${(n-t)/(r-t)*100}%, - ${Ot(.02,e.input.background)} 100%)`,boxShadow:`${e.appBorderColor} 0 0 0 1px inset`,color:"transparent",width:"100%",height:"6px",cursor:"pointer"},"&::-ms-fill-lower":{borderRadius:6},"&::-ms-fill-upper":{borderRadius:6},"&::-ms-thumb":{width:16,height:16,background:`${e.input.background}`,border:`1px solid ${ct(e.appBorderColor,.2)}`,borderRadius:50,cursor:"grab",marginTop:0},"@supports (-ms-ime-align:auto)":{"input[type=range]":{margin:"0"}}})),xc=R.span({paddingLeft:5,paddingRight:5,fontSize:12,whiteSpace:"nowrap",fontFeatureSettings:"tnum",fontVariantNumeric:"tabular-nums"}),z3=R(xc)(({numberOFDecimalsPlaces:e,max:t})=>({width:`${e+t.toString().length*2+3}ch`,textAlign:"right",flexShrink:0})),q3=R.div({display:"flex",alignItems:"center",width:"100%"});function U3(e){let t=e.toString().match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}var W3=({name:e,value:t,onChange:r,min:n=0,max:o=100,step:l=1,onBlur:i,onFocus:s})=>{let u=h=>{r(l3(h.target.value))},c=t!==void 0,d=b.useMemo(()=>U3(l),[l]);return a.createElement(q3,null,a.createElement(xc,null,n),a.createElement(V3,{id:Ne(e),type:"range",onChange:u,name:e,value:t,min:n,max:o,step:l,onFocus:s,onBlur:i}),a.createElement(z3,{numberOFDecimalsPlaces:d,max:o},c?t.toFixed(d):"--"," / ",o))},G3=R.label({display:"flex"}),Y3=R.div(({isMaxed:e})=>({marginLeft:"0.75rem",paddingTop:"0.35rem",color:e?"red":void 0})),K3=({name:e,value:t,onChange:r,onFocus:n,onBlur:o,maxLength:l})=>{let i=h=>{r(h.target.value)},[s,u]=b.useState(!1),c=b.useCallback(()=>{r(""),u(!0)},[u]);if(t===void 0)return a.createElement(Ie.Button,{id:vn(e),onClick:c},"Set string");let d=typeof t=="string";return a.createElement(G3,null,a.createElement(Ie.Textarea,{id:Ne(e),maxLength:l,onChange:i,size:"flex",placeholder:"Edit string...",autoFocus:s,valid:d?null:"error",name:e,value:d?t:"",onFocus:n,onBlur:o}),l&&a.createElement(Y3,{isMaxed:(t==null?void 0:t.length)===l},(t==null?void 0:t.length)??0," / ",l))},X3=R(Ie.Input)({padding:10});function J3(e){e.forEach(t=>{t.startsWith("blob:")&&URL.revokeObjectURL(t)})}var Q3=({onChange:e,name:t,accept:r="image/*",value:n})=>{let o=b.useRef(null);function l(i){if(!i.target.files)return;let s=Array.from(i.target.files).map(u=>URL.createObjectURL(u));e(s),J3(n)}return b.useEffect(()=>{n==null&&o.current&&(o.current.value=null)},[n,t]),a.createElement(X3,{ref:o,id:Ne(t),type:"file",name:t,multiple:!0,onChange:l,accept:r,size:"flex"})},e4=b.lazy(()=>Ht(()=>import("./Color-6VNJS4EI-buA192xZ.js"),__vite__mapDeps([20,4,21,3,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url)),t4=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement(e4,{...e})),r4={array:_i,object:_i,boolean:Jb,color:t4,date:a3,number:i3,check:qt,"inline-check":qt,radio:qt,"inline-radio":qt,select:qt,"multi-select":qt,range:W3,text:K3,file:Q3},Mi=()=>a.createElement(a.Fragment,null,"-"),n4=({row:e,arg:t,updateArgs:r,isHovered:n})=>{let{key:o,control:l}=e,[i,s]=b.useState(!1),[u,c]=b.useState({value:t});b.useEffect(()=>{i||c({value:t})},[i,t]);let d=b.useCallback(f=>(c({value:f}),r({[o]:f}),f),[r,o]),h=b.useCallback(()=>s(!1),[]),m=b.useCallback(()=>s(!0),[]);if(!l||l.disable)return n?a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Setup controls"):a.createElement(Mi,null);let p={name:o,argType:e,value:u.value,onChange:d,onBlur:h,onFocus:m},g=r4[l.type]||Mi;return a.createElement(g,{...p,...l,controlType:l.type})},a4=R.span({fontWeight:"bold"}),o4=R.span(({theme:e})=>({color:e.color.negative,fontFamily:e.typography.fonts.mono,cursor:"help"})),l4=R.div(({theme:e})=>({"&&":{p:{margin:"0 0 10px 0"},a:{color:e.color.secondary}},code:{...ft({theme:e}),fontSize:12,fontFamily:e.typography.fonts.mono},"& code":{margin:0,display:"inline-block"},"& pre > code":{whiteSpace:"pre-wrap"}})),i4=R.div(({theme:e,hasDescription:t})=>({color:e.base==="light"?J(.1,e.color.defaultText):J(.2,e.color.defaultText),marginTop:t?4:0})),s4=R.div(({theme:e,hasDescription:t})=>({color:e.base==="light"?J(.1,e.color.defaultText):J(.2,e.color.defaultText),marginTop:t?12:0,marginBottom:12})),u4=R.td(({theme:e,expandable:t})=>({paddingLeft:t?"40px !important":"20px !important"})),Kr=e=>{var f;let[t,r]=b.useState(!1),{row:n,updateArgs:o,compact:l,expandable:i,initialExpandedArgs:s}=e,{name:u,description:c}=n,d=n.table||{},h=d.type||n.type,m=d.defaultValue||n.defaultValue,p=(f=n.type)==null?void 0:f.required,g=c!=null&&c!=="";return a.createElement("tr",{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1)},a.createElement(u4,{expandable:i},a.createElement(a4,null,u),p?a.createElement(o4,{title:"Required"},"*"):null),l?null:a.createElement("td",null,g&&a.createElement(l4,null,a.createElement(oc,null,c)),d.jsDocTags!=null?a.createElement(a.Fragment,null,a.createElement(s4,{hasDescription:g},a.createElement(va,{value:h,initialExpandedArgs:s})),a.createElement(Zb,{tags:d.jsDocTags})):a.createElement(i4,{hasDescription:g},a.createElement(va,{value:h,initialExpandedArgs:s}))),l?null:a.createElement("td",null,a.createElement(va,{value:m,initialExpandedArgs:s})),o?a.createElement("td",null,a.createElement(n4,{...e,isHovered:t})):null)},c4=R(ye)(({theme:e})=>({marginRight:8,marginLeft:-10,marginTop:-2,height:12,width:12,color:e.base==="light"?J(.25,e.color.defaultText):J(.3,e.color.defaultText),border:"none",display:"inline-block"})),d4=R.span(({theme:e})=>({display:"flex",lineHeight:"20px",alignItems:"center"})),p4=R.td(({theme:e})=>({position:"relative",letterSpacing:"0.35em",textTransform:"uppercase",fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s1-1,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText),background:`${e.background.app} !important`,"& ~ td":{background:`${e.background.app} !important`}})),f4=R.td(({theme:e})=>({position:"relative",fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s2-1,background:e.background.app})),m4=R.td(()=>({position:"relative"})),g4=R.tr(({theme:e})=>({"&:hover > td":{backgroundColor:`${Ot(.005,e.background.app)} !important`,boxShadow:`${e.color.mediumlight} 0 - 1px 0 0 inset`,cursor:"row-resize"}})),$i=R.button(()=>({background:"none",border:"none",padding:"0",font:"inherit",position:"absolute",top:0,bottom:0,left:0,right:0,height:"100%",width:"100%",color:"transparent",cursor:"row-resize !important"})),xa=({level:e="section",label:t,children:r,initialExpanded:n=!0,colSpan:o=3})=>{let[l,i]=b.useState(n),s=e==="subsection"?f4:p4,u=(r==null?void 0:r.length)||0,c=e==="subsection"?`${u} item${u!==1?"s":""}`:"",d=l?"arrowdown":"arrowright",h=`${l?"Hide":"Show"} ${e==="subsection"?u:t} item${u!==1?"s":""}`;return a.createElement(a.Fragment,null,a.createElement(g4,{title:h},a.createElement(s,{colSpan:1},a.createElement($i,{onClick:m=>i(!l),tabIndex:0},h),a.createElement(d4,null,a.createElement(c4,{icon:d}),t)),a.createElement(m4,{colSpan:o-1},a.createElement($i,{onClick:m=>i(!l),tabIndex:-1,style:{outline:"none"}},h),l?null:c)),l?r:null)},Xr=R.div(({theme:e})=>({display:"flex",gap:16,borderBottom:`1px solid ${e.appBorderColor}`,"&:last-child":{borderBottom:0}})),fe=R.div(({numColumn:e})=>({display:"flex",flexDirection:"column",flex:e||1,gap:5,padding:"12px 20px"})),ae=R.div(({theme:e,width:t,height:r})=>({animation:`${e.animation.glow} 1.5s ease-in-out infinite`,background:e.appBorderColor,width:t||"100%",height:r||16,borderRadius:3})),me=[2,4,2,2],h4=()=>a.createElement(a.Fragment,null,a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"})))),b4=R.div(({inAddonPanel:e,theme:t})=>({height:e?"100%":"auto",display:"flex",border:e?"none":`1px solid ${t.appBorderColor}`,borderRadius:e?0:t.appBorderRadius,padding:e?0:40,alignItems:"center",justifyContent:"center",flexDirection:"column",gap:15,background:t.background.content,boxShadow:"rgba(0, 0, 0, 0.10) 0 1px 3px 0"})),y4=R.div({display:"flex",flexDirection:"column",gap:4,maxWidth:415}),v4=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s2-1,textAlign:"center",color:e.textColor})),E4=R.div(({theme:e})=>({fontWeight:e.typography.weight.regular,fontSize:e.typography.size.s2-1,textAlign:"center",color:e.textMutedColor})),x4=R.div(({theme:e})=>({display:"flex",fontSize:e.typography.size.s2-1,gap:25})),w4=R.div(({theme:e})=>({width:1,height:16,backgroundColor:e.appBorderColor})),A4=({inAddonPanel:e})=>{let[t,r]=b.useState(!0);return b.useEffect(()=>{let n=setTimeout(()=>{r(!1)},100);return()=>clearTimeout(n)},[]),t?null:a.createElement(b4,{inAddonPanel:e},a.createElement(y4,null,a.createElement(v4,null,e?"Interactive story playground":"Args table with interactive controls couldn't be auto-generated"),a.createElement(E4,null,"Controls give you an easy to use interface to test your components. Set your story args and you'll see controls appearing here automatically.")),a.createElement(x4,null,e&&a.createElement(a.Fragment,null,a.createElement(Et,{href:"https://youtu.be/0gOfS6K0x0E",target:"_blank",withArrow:!0},a.createElement(ye,{icon:"video"})," Watch 5m video"),a.createElement(w4,null),a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Read docs")),!e&&a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Learn how to set that up")))},C4=R.table(({theme:e,compact:t,inAddonPanel:r})=>({"&&":{borderSpacing:0,color:e.color.defaultText,"td, th":{padding:0,border:"none",verticalAlign:"top",textOverflow:"ellipsis"},fontSize:e.typography.size.s2-1,lineHeight:"20px",textAlign:"left",width:"100%",marginTop:r?0:25,marginBottom:r?0:40,"thead th:first-of-type, td:first-of-type":{width:"25%"},"th:first-of-type, td:first-of-type":{paddingLeft:20},"th:nth-of-type(2), td:nth-of-type(2)":{...t?null:{width:"35%"}},"td:nth-of-type(3)":{...t?null:{width:"15%"}},"th:last-of-type, td:last-of-type":{paddingRight:20,...t?null:{width:"25%"}},th:{color:e.base==="light"?J(.25,e.color.defaultText):J(.45,e.color.defaultText),paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},td:{paddingTop:"10px",paddingBottom:"10px","&:not(:first-of-type)":{paddingLeft:15,paddingRight:15},"&:last-of-type":{paddingRight:20}},marginLeft:r?0:1,marginRight:r?0:1,tbody:{...r?null:{filter:e.base==="light"?"drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.10))":"drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.20))"},"> tr > *":{background:e.background.content,borderTop:`1px solid ${e.appBorderColor}`},...r?null:{"> tr:first-of-type > *":{borderBlockStart:`1px solid ${e.appBorderColor}`},"> tr:last-of-type > *":{borderBlockEnd:`1px solid ${e.appBorderColor}`},"> tr > *:first-of-type":{borderInlineStart:`1px solid ${e.appBorderColor}`},"> tr > *:last-of-type":{borderInlineEnd:`1px solid ${e.appBorderColor}`},"> tr:first-of-type > td:first-of-type":{borderTopLeftRadius:e.appBorderRadius},"> tr:first-of-type > td:last-of-type":{borderTopRightRadius:e.appBorderRadius},"> tr:last-of-type > td:first-of-type":{borderBottomLeftRadius:e.appBorderRadius},"> tr:last-of-type > td:last-of-type":{borderBottomRightRadius:e.appBorderRadius}}}}})),S4=R(Bt)(({theme:e})=>({color:e.barTextColor,margin:"-4px -12px -4px 0"})),k4=R.span({display:"flex",justifyContent:"space-between"}),R4={alpha:(e,t)=>e.name.localeCompare(t.name),requiredFirst:(e,t)=>{var r,n;return+!!((r=t.type)!=null&&r.required)-+!!((n=e.type)!=null&&n.required)||e.name.localeCompare(t.name)},none:void 0},F4=(e,t)=>{let r={ungrouped:[],ungroupedSubsections:{},sections:{}};if(!e)return r;Object.entries(e).forEach(([l,i])=>{let{category:s,subcategory:u}=(i==null?void 0:i.table)||{};if(s){let c=r.sections[s]||{ungrouped:[],subsections:{}};if(!u)c.ungrouped.push({key:l,...i});else{let d=c.subsections[u]||[];d.push({key:l,...i}),c.subsections[u]=d}r.sections[s]=c}else if(u){let c=r.ungroupedSubsections[u]||[];c.push({key:l,...i}),r.ungroupedSubsections[u]=c}else r.ungrouped.push({key:l,...i})});let n=R4[t],o=l=>n?Object.keys(l).reduce((i,s)=>({...i,[s]:l[s].sort(n)}),{}):l;return{ungrouped:r.ungrouped.sort(n),ungroupedSubsections:o(r.ungroupedSubsections),sections:Object.keys(r.sections).reduce((l,i)=>({...l,[i]:{ungrouped:r.sections[i].ungrouped.sort(n),subsections:o(r.sections[i].subsections)}}),{})}},T4=(e,t,r)=>{try{return Mo.includeConditionalArg(e,t,r)}catch(n){return ib.warn(n.message),!1}},O4=e=>{let{updateArgs:t,resetArgs:r,compact:n,inAddonPanel:o,initialExpandedArgs:l,sort:i="none",isLoading:s}=e;if("error"in e){let{error:v}=e;return a.createElement(ic,null,v," ",a.createElement(Et,{href:"http://storybook.js.org/docs/",target:"_blank",withArrow:!0},"Read the docs"))}if(s)return a.createElement(h4,null);let{rows:u,args:c,globals:d}="rows"in e&&e,h=F4(Hc(u,v=>{var y;return!((y=v==null?void 0:v.table)!=null&&y.disable)&&T4(v,c||{},d||{})}),i),m=h.ungrouped.length===0,p=Object.entries(h.sections).length===0,g=Object.entries(h.ungroupedSubsections).length===0;if(m&&p&&g)return a.createElement(A4,{inAddonPanel:o});let f=1;t&&(f+=1),n||(f+=2);let w=Object.keys(h.sections).length>0,A={updateArgs:t,compact:n,inAddonPanel:o,initialExpandedArgs:l};return a.createElement(jo,null,a.createElement(C4,{compact:n,inAddonPanel:o,className:"docblock-argstable sb-unstyled"},a.createElement("thead",{className:"docblock-argstable-head"},a.createElement("tr",null,a.createElement("th",null,a.createElement("span",null,"Name")),n?null:a.createElement("th",null,a.createElement("span",null,"Description")),n?null:a.createElement("th",null,a.createElement("span",null,"Default")),t?a.createElement("th",null,a.createElement(k4,null,"Control"," ",!s&&r&&a.createElement(S4,{onClick:()=>r(),title:"Reset controls"},a.createElement(ye,{icon:"undo","aria-hidden":!0})))):null)),a.createElement("tbody",{className:"docblock-argstable-body"},h.ungrouped.map(v=>a.createElement(Kr,{key:v.key,row:v,arg:c&&c[v.key],...A})),Object.entries(h.ungroupedSubsections).map(([v,y])=>a.createElement(xa,{key:v,label:v,level:"subsection",colSpan:f},y.map(x=>a.createElement(Kr,{key:x.key,row:x,arg:c&&c[x.key],expandable:w,...A})))),Object.entries(h.sections).map(([v,y])=>a.createElement(xa,{key:v,label:v,level:"section",colSpan:f},y.ungrouped.map(x=>a.createElement(Kr,{key:x.key,row:x,arg:c&&c[x.key],...A})),Object.entries(y.subsections).map(([x,E])=>a.createElement(xa,{key:x,label:x,level:"subsection",colSpan:f},E.map(C=>a.createElement(Kr,{key:C.key,row:C,arg:c&&c[C.key],expandable:w,...A})))))))))};R.div(({theme:e})=>({marginRight:30,fontSize:`${e.typography.size.s1}px`,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText)}));R.div({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});R.div({display:"flex",flexDirection:"row",alignItems:"baseline","&:not(:last-child)":{marginBottom:"1rem"}});R.div(Q,({theme:e})=>({...jn(e),margin:"25px 0 40px",padding:"30px 20px"}));R.div(({theme:e})=>({fontWeight:e.typography.weight.bold,color:e.color.defaultText}));R.div(({theme:e})=>({color:e.base==="light"?J(.2,e.color.defaultText):J(.6,e.color.defaultText)}));R.div({flex:"0 0 30%",lineHeight:"20px",marginTop:5});R.div(({theme:e})=>({flex:1,textAlign:"center",fontFamily:e.typography.fonts.mono,fontSize:e.typography.size.s1,lineHeight:1,overflow:"hidden",color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText),"> div":{display:"inline-block",overflow:"hidden",maxWidth:"100%",textOverflow:"ellipsis"},span:{display:"block",marginTop:2}}));R.div({display:"flex",flexDirection:"row"});R.div(({background:e})=>({position:"relative",flex:1,"&::before":{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:e,content:'""'}}));R.div(({theme:e})=>({...jn(e),display:"flex",flexDirection:"row",height:50,marginBottom:5,overflow:"hidden",backgroundColor:"white",backgroundImage:"repeating-linear-gradient(-45deg, #ccc, #ccc 1px, #fff 1px, #fff 16px)",backgroundClip:"padding-box"}));R.div({display:"flex",flexDirection:"column",flex:1,position:"relative",marginBottom:30});R.div({flex:1,display:"flex",flexDirection:"row"});R.div({display:"flex",alignItems:"flex-start"});R.div({flex:"0 0 30%"});R.div({flex:1});R.div(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",paddingBottom:20,fontWeight:e.typography.weight.bold,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText)}));R.div(({theme:e})=>({fontSize:e.typography.size.s2,lineHeight:"20px",display:"flex",flexDirection:"column"}));R.div(({theme:e})=>({fontFamily:e.typography.fonts.base,fontSize:e.typography.size.s2,color:e.color.defaultText,marginLeft:10,lineHeight:1.2}));R.div(({theme:e})=>({...jn(e),overflow:"hidden",height:40,width:40,display:"flex",alignItems:"center",justifyContent:"center",flex:"none","> img, > svg":{width:20,height:20}}));R.div({display:"inline-flex",flexDirection:"row",alignItems:"center",flex:"0 1 calc(20% - 10px)",minWidth:120,margin:"0px 10px 30px 0"});R.div({display:"flex",flexFlow:"row wrap"});var L4=e=>`anchor--${e}`,D4=({storyId:e,children:t})=>a.createElement("div",{id:L4(e),className:"sb-anchor"},t);Le&&Le.__DOCS_CONTEXT__===void 0&&(Le.__DOCS_CONTEXT__=b.createContext(null),Le.__DOCS_CONTEXT__.displayName="DocsContext");var Fe=Le?Le.__DOCS_CONTEXT__:b.createContext(null),Zr=(e,t)=>b.useContext(Fe).resolveOf(e,t);function _4(e,t="start"){e.scrollIntoView({behavior:"smooth",block:t,inline:"nearest"})}function M4(e,t){let r=nl([e],t);return r&&r[0]}function nl(e,t){let[r,n]=b.useState({});return b.useEffect(()=>{Promise.all(e.map(async o=>{let l=await t.loadStory(o);n(i=>i[o]===l?i:{...i,[o]:l})}))}),e.map(o=>{if(r[o])return r[o];try{return t.storyById(o)}catch{return null}})}function wc(e){return Dc(e)}var Ac=b.createContext({sources:{}}),Cc="--unknown--",$4=({children:e,channel:t})=>{let[r,n]=b.useState({});return b.useEffect(()=>{let o=(l,i=null,s=!1)=>{let{id:u,args:c=void 0,source:d,format:h}=typeof l=="string"?{id:l,source:i,format:s}:l,m=c?wc(c):Cc;n(p=>({...p,[u]:{...p[u],[m]:{code:d,format:h}}}))};return t.on(dl,o),()=>t.off(dl,o)},[]),a.createElement(Ac.Provider,{value:{sources:r}},e)},B4=(e=>(e.OPEN="open",e.CLOSED="closed",e.NONE="none",e))(B4||{}),H4=e=>{let t=e.map(r=>{var n,o;return(o=(n=r.parameters.docs)==null?void 0:n.source)==null?void 0:o.state}).filter(Boolean);return t.length===0?"closed":t[0]},I4=(e,t,r)=>{let{sources:n}=r,o=n==null?void 0:n[e];return(o==null?void 0:o[wc(t)])||(o==null?void 0:o[Cc])||{code:""}},N4=({snippet:e,storyContext:t,typeFromProps:r,transformFromProps:n})=>{var u,c,d,h,m,p;let{__isArgsStory:o}=t.parameters,l=((u=t.parameters.docs)==null?void 0:u.source)||{},i=r||l.type||Un.AUTO;if(l.code!==void 0)return l.code;let s=i===Un.DYNAMIC||i===Un.AUTO&&e&&o?e:l.originalSource||"";return l.transformSource&&ce(Ee`The \`transformSource\` parameter at \`parameters.docs.source.transformSource\` is deprecated, please use \`parameters.docs.source.transform\` instead. + ${Ot(.02,e.input.background)} 100%)`,boxShadow:`${e.appBorderColor} 0 0 0 1px inset`,color:"transparent",width:"100%",height:"6px",cursor:"pointer"},"&::-ms-fill-lower":{borderRadius:6},"&::-ms-fill-upper":{borderRadius:6},"&::-ms-thumb":{width:16,height:16,background:`${e.input.background}`,border:`1px solid ${ct(e.appBorderColor,.2)}`,borderRadius:50,cursor:"grab",marginTop:0},"@supports (-ms-ime-align:auto)":{"input[type=range]":{margin:"0"}}})),xc=R.span({paddingLeft:5,paddingRight:5,fontSize:12,whiteSpace:"nowrap",fontFeatureSettings:"tnum",fontVariantNumeric:"tabular-nums"}),z3=R(xc)(({numberOFDecimalsPlaces:e,max:t})=>({width:`${e+t.toString().length*2+3}ch`,textAlign:"right",flexShrink:0})),q3=R.div({display:"flex",alignItems:"center",width:"100%"});function U3(e){let t=e.toString().match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}var W3=({name:e,value:t,onChange:r,min:n=0,max:o=100,step:l=1,onBlur:i,onFocus:s})=>{let u=h=>{r(l3(h.target.value))},c=t!==void 0,d=b.useMemo(()=>U3(l),[l]);return a.createElement(q3,null,a.createElement(xc,null,n),a.createElement(V3,{id:Ne(e),type:"range",onChange:u,name:e,value:t,min:n,max:o,step:l,onFocus:s,onBlur:i}),a.createElement(z3,{numberOFDecimalsPlaces:d,max:o},c?t.toFixed(d):"--"," / ",o))},G3=R.label({display:"flex"}),Y3=R.div(({isMaxed:e})=>({marginLeft:"0.75rem",paddingTop:"0.35rem",color:e?"red":void 0})),K3=({name:e,value:t,onChange:r,onFocus:n,onBlur:o,maxLength:l})=>{let i=h=>{r(h.target.value)},[s,u]=b.useState(!1),c=b.useCallback(()=>{r(""),u(!0)},[u]);if(t===void 0)return a.createElement(Ie.Button,{id:vn(e),onClick:c},"Set string");let d=typeof t=="string";return a.createElement(G3,null,a.createElement(Ie.Textarea,{id:Ne(e),maxLength:l,onChange:i,size:"flex",placeholder:"Edit string...",autoFocus:s,valid:d?null:"error",name:e,value:d?t:"",onFocus:n,onBlur:o}),l&&a.createElement(Y3,{isMaxed:(t==null?void 0:t.length)===l},(t==null?void 0:t.length)??0," / ",l))},X3=R(Ie.Input)({padding:10});function J3(e){e.forEach(t=>{t.startsWith("blob:")&&URL.revokeObjectURL(t)})}var Q3=({onChange:e,name:t,accept:r="image/*",value:n})=>{let o=b.useRef(null);function l(i){if(!i.target.files)return;let s=Array.from(i.target.files).map(u=>URL.createObjectURL(u));e(s),J3(n)}return b.useEffect(()=>{n==null&&o.current&&(o.current.value=null)},[n,t]),a.createElement(X3,{ref:o,id:Ne(t),type:"file",name:t,multiple:!0,onChange:l,accept:r,size:"flex"})},e4=b.lazy(()=>Ht(()=>import("./Color-6VNJS4EI--3Onf2Q9.js"),__vite__mapDeps([20,4,21,3,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url)),t4=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement(e4,{...e})),r4={array:_i,object:_i,boolean:Jb,color:t4,date:a3,number:i3,check:qt,"inline-check":qt,radio:qt,"inline-radio":qt,select:qt,"multi-select":qt,range:W3,text:K3,file:Q3},Mi=()=>a.createElement(a.Fragment,null,"-"),n4=({row:e,arg:t,updateArgs:r,isHovered:n})=>{let{key:o,control:l}=e,[i,s]=b.useState(!1),[u,c]=b.useState({value:t});b.useEffect(()=>{i||c({value:t})},[i,t]);let d=b.useCallback(f=>(c({value:f}),r({[o]:f}),f),[r,o]),h=b.useCallback(()=>s(!1),[]),m=b.useCallback(()=>s(!0),[]);if(!l||l.disable)return n?a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Setup controls"):a.createElement(Mi,null);let p={name:o,argType:e,value:u.value,onChange:d,onBlur:h,onFocus:m},g=r4[l.type]||Mi;return a.createElement(g,{...p,...l,controlType:l.type})},a4=R.span({fontWeight:"bold"}),o4=R.span(({theme:e})=>({color:e.color.negative,fontFamily:e.typography.fonts.mono,cursor:"help"})),l4=R.div(({theme:e})=>({"&&":{p:{margin:"0 0 10px 0"},a:{color:e.color.secondary}},code:{...ft({theme:e}),fontSize:12,fontFamily:e.typography.fonts.mono},"& code":{margin:0,display:"inline-block"},"& pre > code":{whiteSpace:"pre-wrap"}})),i4=R.div(({theme:e,hasDescription:t})=>({color:e.base==="light"?J(.1,e.color.defaultText):J(.2,e.color.defaultText),marginTop:t?4:0})),s4=R.div(({theme:e,hasDescription:t})=>({color:e.base==="light"?J(.1,e.color.defaultText):J(.2,e.color.defaultText),marginTop:t?12:0,marginBottom:12})),u4=R.td(({theme:e,expandable:t})=>({paddingLeft:t?"40px !important":"20px !important"})),Kr=e=>{var f;let[t,r]=b.useState(!1),{row:n,updateArgs:o,compact:l,expandable:i,initialExpandedArgs:s}=e,{name:u,description:c}=n,d=n.table||{},h=d.type||n.type,m=d.defaultValue||n.defaultValue,p=(f=n.type)==null?void 0:f.required,g=c!=null&&c!=="";return a.createElement("tr",{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1)},a.createElement(u4,{expandable:i},a.createElement(a4,null,u),p?a.createElement(o4,{title:"Required"},"*"):null),l?null:a.createElement("td",null,g&&a.createElement(l4,null,a.createElement(oc,null,c)),d.jsDocTags!=null?a.createElement(a.Fragment,null,a.createElement(s4,{hasDescription:g},a.createElement(va,{value:h,initialExpandedArgs:s})),a.createElement(Zb,{tags:d.jsDocTags})):a.createElement(i4,{hasDescription:g},a.createElement(va,{value:h,initialExpandedArgs:s}))),l?null:a.createElement("td",null,a.createElement(va,{value:m,initialExpandedArgs:s})),o?a.createElement("td",null,a.createElement(n4,{...e,isHovered:t})):null)},c4=R(ye)(({theme:e})=>({marginRight:8,marginLeft:-10,marginTop:-2,height:12,width:12,color:e.base==="light"?J(.25,e.color.defaultText):J(.3,e.color.defaultText),border:"none",display:"inline-block"})),d4=R.span(({theme:e})=>({display:"flex",lineHeight:"20px",alignItems:"center"})),p4=R.td(({theme:e})=>({position:"relative",letterSpacing:"0.35em",textTransform:"uppercase",fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s1-1,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText),background:`${e.background.app} !important`,"& ~ td":{background:`${e.background.app} !important`}})),f4=R.td(({theme:e})=>({position:"relative",fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s2-1,background:e.background.app})),m4=R.td(()=>({position:"relative"})),g4=R.tr(({theme:e})=>({"&:hover > td":{backgroundColor:`${Ot(.005,e.background.app)} !important`,boxShadow:`${e.color.mediumlight} 0 - 1px 0 0 inset`,cursor:"row-resize"}})),$i=R.button(()=>({background:"none",border:"none",padding:"0",font:"inherit",position:"absolute",top:0,bottom:0,left:0,right:0,height:"100%",width:"100%",color:"transparent",cursor:"row-resize !important"})),xa=({level:e="section",label:t,children:r,initialExpanded:n=!0,colSpan:o=3})=>{let[l,i]=b.useState(n),s=e==="subsection"?f4:p4,u=(r==null?void 0:r.length)||0,c=e==="subsection"?`${u} item${u!==1?"s":""}`:"",d=l?"arrowdown":"arrowright",h=`${l?"Hide":"Show"} ${e==="subsection"?u:t} item${u!==1?"s":""}`;return a.createElement(a.Fragment,null,a.createElement(g4,{title:h},a.createElement(s,{colSpan:1},a.createElement($i,{onClick:m=>i(!l),tabIndex:0},h),a.createElement(d4,null,a.createElement(c4,{icon:d}),t)),a.createElement(m4,{colSpan:o-1},a.createElement($i,{onClick:m=>i(!l),tabIndex:-1,style:{outline:"none"}},h),l?null:c)),l?r:null)},Xr=R.div(({theme:e})=>({display:"flex",gap:16,borderBottom:`1px solid ${e.appBorderColor}`,"&:last-child":{borderBottom:0}})),fe=R.div(({numColumn:e})=>({display:"flex",flexDirection:"column",flex:e||1,gap:5,padding:"12px 20px"})),ae=R.div(({theme:e,width:t,height:r})=>({animation:`${e.animation.glow} 1.5s ease-in-out infinite`,background:e.appBorderColor,width:t||"100%",height:r||16,borderRadius:3})),me=[2,4,2,2],h4=()=>a.createElement(a.Fragment,null,a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"})))),b4=R.div(({inAddonPanel:e,theme:t})=>({height:e?"100%":"auto",display:"flex",border:e?"none":`1px solid ${t.appBorderColor}`,borderRadius:e?0:t.appBorderRadius,padding:e?0:40,alignItems:"center",justifyContent:"center",flexDirection:"column",gap:15,background:t.background.content,boxShadow:"rgba(0, 0, 0, 0.10) 0 1px 3px 0"})),y4=R.div({display:"flex",flexDirection:"column",gap:4,maxWidth:415}),v4=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s2-1,textAlign:"center",color:e.textColor})),E4=R.div(({theme:e})=>({fontWeight:e.typography.weight.regular,fontSize:e.typography.size.s2-1,textAlign:"center",color:e.textMutedColor})),x4=R.div(({theme:e})=>({display:"flex",fontSize:e.typography.size.s2-1,gap:25})),w4=R.div(({theme:e})=>({width:1,height:16,backgroundColor:e.appBorderColor})),A4=({inAddonPanel:e})=>{let[t,r]=b.useState(!0);return b.useEffect(()=>{let n=setTimeout(()=>{r(!1)},100);return()=>clearTimeout(n)},[]),t?null:a.createElement(b4,{inAddonPanel:e},a.createElement(y4,null,a.createElement(v4,null,e?"Interactive story playground":"Args table with interactive controls couldn't be auto-generated"),a.createElement(E4,null,"Controls give you an easy to use interface to test your components. Set your story args and you'll see controls appearing here automatically.")),a.createElement(x4,null,e&&a.createElement(a.Fragment,null,a.createElement(Et,{href:"https://youtu.be/0gOfS6K0x0E",target:"_blank",withArrow:!0},a.createElement(ye,{icon:"video"})," Watch 5m video"),a.createElement(w4,null),a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Read docs")),!e&&a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Learn how to set that up")))},C4=R.table(({theme:e,compact:t,inAddonPanel:r})=>({"&&":{borderSpacing:0,color:e.color.defaultText,"td, th":{padding:0,border:"none",verticalAlign:"top",textOverflow:"ellipsis"},fontSize:e.typography.size.s2-1,lineHeight:"20px",textAlign:"left",width:"100%",marginTop:r?0:25,marginBottom:r?0:40,"thead th:first-of-type, td:first-of-type":{width:"25%"},"th:first-of-type, td:first-of-type":{paddingLeft:20},"th:nth-of-type(2), td:nth-of-type(2)":{...t?null:{width:"35%"}},"td:nth-of-type(3)":{...t?null:{width:"15%"}},"th:last-of-type, td:last-of-type":{paddingRight:20,...t?null:{width:"25%"}},th:{color:e.base==="light"?J(.25,e.color.defaultText):J(.45,e.color.defaultText),paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},td:{paddingTop:"10px",paddingBottom:"10px","&:not(:first-of-type)":{paddingLeft:15,paddingRight:15},"&:last-of-type":{paddingRight:20}},marginLeft:r?0:1,marginRight:r?0:1,tbody:{...r?null:{filter:e.base==="light"?"drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.10))":"drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.20))"},"> tr > *":{background:e.background.content,borderTop:`1px solid ${e.appBorderColor}`},...r?null:{"> tr:first-of-type > *":{borderBlockStart:`1px solid ${e.appBorderColor}`},"> tr:last-of-type > *":{borderBlockEnd:`1px solid ${e.appBorderColor}`},"> tr > *:first-of-type":{borderInlineStart:`1px solid ${e.appBorderColor}`},"> tr > *:last-of-type":{borderInlineEnd:`1px solid ${e.appBorderColor}`},"> tr:first-of-type > td:first-of-type":{borderTopLeftRadius:e.appBorderRadius},"> tr:first-of-type > td:last-of-type":{borderTopRightRadius:e.appBorderRadius},"> tr:last-of-type > td:first-of-type":{borderBottomLeftRadius:e.appBorderRadius},"> tr:last-of-type > td:last-of-type":{borderBottomRightRadius:e.appBorderRadius}}}}})),S4=R(Bt)(({theme:e})=>({color:e.barTextColor,margin:"-4px -12px -4px 0"})),k4=R.span({display:"flex",justifyContent:"space-between"}),R4={alpha:(e,t)=>e.name.localeCompare(t.name),requiredFirst:(e,t)=>{var r,n;return+!!((r=t.type)!=null&&r.required)-+!!((n=e.type)!=null&&n.required)||e.name.localeCompare(t.name)},none:void 0},F4=(e,t)=>{let r={ungrouped:[],ungroupedSubsections:{},sections:{}};if(!e)return r;Object.entries(e).forEach(([l,i])=>{let{category:s,subcategory:u}=(i==null?void 0:i.table)||{};if(s){let c=r.sections[s]||{ungrouped:[],subsections:{}};if(!u)c.ungrouped.push({key:l,...i});else{let d=c.subsections[u]||[];d.push({key:l,...i}),c.subsections[u]=d}r.sections[s]=c}else if(u){let c=r.ungroupedSubsections[u]||[];c.push({key:l,...i}),r.ungroupedSubsections[u]=c}else r.ungrouped.push({key:l,...i})});let n=R4[t],o=l=>n?Object.keys(l).reduce((i,s)=>({...i,[s]:l[s].sort(n)}),{}):l;return{ungrouped:r.ungrouped.sort(n),ungroupedSubsections:o(r.ungroupedSubsections),sections:Object.keys(r.sections).reduce((l,i)=>({...l,[i]:{ungrouped:r.sections[i].ungrouped.sort(n),subsections:o(r.sections[i].subsections)}}),{})}},T4=(e,t,r)=>{try{return Mo.includeConditionalArg(e,t,r)}catch(n){return ib.warn(n.message),!1}},O4=e=>{let{updateArgs:t,resetArgs:r,compact:n,inAddonPanel:o,initialExpandedArgs:l,sort:i="none",isLoading:s}=e;if("error"in e){let{error:v}=e;return a.createElement(ic,null,v," ",a.createElement(Et,{href:"http://storybook.js.org/docs/",target:"_blank",withArrow:!0},"Read the docs"))}if(s)return a.createElement(h4,null);let{rows:u,args:c,globals:d}="rows"in e&&e,h=F4(Hc(u,v=>{var y;return!((y=v==null?void 0:v.table)!=null&&y.disable)&&T4(v,c||{},d||{})}),i),m=h.ungrouped.length===0,p=Object.entries(h.sections).length===0,g=Object.entries(h.ungroupedSubsections).length===0;if(m&&p&&g)return a.createElement(A4,{inAddonPanel:o});let f=1;t&&(f+=1),n||(f+=2);let w=Object.keys(h.sections).length>0,A={updateArgs:t,compact:n,inAddonPanel:o,initialExpandedArgs:l};return a.createElement(jo,null,a.createElement(C4,{compact:n,inAddonPanel:o,className:"docblock-argstable sb-unstyled"},a.createElement("thead",{className:"docblock-argstable-head"},a.createElement("tr",null,a.createElement("th",null,a.createElement("span",null,"Name")),n?null:a.createElement("th",null,a.createElement("span",null,"Description")),n?null:a.createElement("th",null,a.createElement("span",null,"Default")),t?a.createElement("th",null,a.createElement(k4,null,"Control"," ",!s&&r&&a.createElement(S4,{onClick:()=>r(),title:"Reset controls"},a.createElement(ye,{icon:"undo","aria-hidden":!0})))):null)),a.createElement("tbody",{className:"docblock-argstable-body"},h.ungrouped.map(v=>a.createElement(Kr,{key:v.key,row:v,arg:c&&c[v.key],...A})),Object.entries(h.ungroupedSubsections).map(([v,y])=>a.createElement(xa,{key:v,label:v,level:"subsection",colSpan:f},y.map(x=>a.createElement(Kr,{key:x.key,row:x,arg:c&&c[x.key],expandable:w,...A})))),Object.entries(h.sections).map(([v,y])=>a.createElement(xa,{key:v,label:v,level:"section",colSpan:f},y.ungrouped.map(x=>a.createElement(Kr,{key:x.key,row:x,arg:c&&c[x.key],...A})),Object.entries(y.subsections).map(([x,E])=>a.createElement(xa,{key:x,label:x,level:"subsection",colSpan:f},E.map(C=>a.createElement(Kr,{key:C.key,row:C,arg:c&&c[C.key],expandable:w,...A})))))))))};R.div(({theme:e})=>({marginRight:30,fontSize:`${e.typography.size.s1}px`,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText)}));R.div({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});R.div({display:"flex",flexDirection:"row",alignItems:"baseline","&:not(:last-child)":{marginBottom:"1rem"}});R.div(Q,({theme:e})=>({...jn(e),margin:"25px 0 40px",padding:"30px 20px"}));R.div(({theme:e})=>({fontWeight:e.typography.weight.bold,color:e.color.defaultText}));R.div(({theme:e})=>({color:e.base==="light"?J(.2,e.color.defaultText):J(.6,e.color.defaultText)}));R.div({flex:"0 0 30%",lineHeight:"20px",marginTop:5});R.div(({theme:e})=>({flex:1,textAlign:"center",fontFamily:e.typography.fonts.mono,fontSize:e.typography.size.s1,lineHeight:1,overflow:"hidden",color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText),"> div":{display:"inline-block",overflow:"hidden",maxWidth:"100%",textOverflow:"ellipsis"},span:{display:"block",marginTop:2}}));R.div({display:"flex",flexDirection:"row"});R.div(({background:e})=>({position:"relative",flex:1,"&::before":{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:e,content:'""'}}));R.div(({theme:e})=>({...jn(e),display:"flex",flexDirection:"row",height:50,marginBottom:5,overflow:"hidden",backgroundColor:"white",backgroundImage:"repeating-linear-gradient(-45deg, #ccc, #ccc 1px, #fff 1px, #fff 16px)",backgroundClip:"padding-box"}));R.div({display:"flex",flexDirection:"column",flex:1,position:"relative",marginBottom:30});R.div({flex:1,display:"flex",flexDirection:"row"});R.div({display:"flex",alignItems:"flex-start"});R.div({flex:"0 0 30%"});R.div({flex:1});R.div(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",paddingBottom:20,fontWeight:e.typography.weight.bold,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText)}));R.div(({theme:e})=>({fontSize:e.typography.size.s2,lineHeight:"20px",display:"flex",flexDirection:"column"}));R.div(({theme:e})=>({fontFamily:e.typography.fonts.base,fontSize:e.typography.size.s2,color:e.color.defaultText,marginLeft:10,lineHeight:1.2}));R.div(({theme:e})=>({...jn(e),overflow:"hidden",height:40,width:40,display:"flex",alignItems:"center",justifyContent:"center",flex:"none","> img, > svg":{width:20,height:20}}));R.div({display:"inline-flex",flexDirection:"row",alignItems:"center",flex:"0 1 calc(20% - 10px)",minWidth:120,margin:"0px 10px 30px 0"});R.div({display:"flex",flexFlow:"row wrap"});var L4=e=>`anchor--${e}`,D4=({storyId:e,children:t})=>a.createElement("div",{id:L4(e),className:"sb-anchor"},t);Le&&Le.__DOCS_CONTEXT__===void 0&&(Le.__DOCS_CONTEXT__=b.createContext(null),Le.__DOCS_CONTEXT__.displayName="DocsContext");var Fe=Le?Le.__DOCS_CONTEXT__:b.createContext(null),Zr=(e,t)=>b.useContext(Fe).resolveOf(e,t);function _4(e,t="start"){e.scrollIntoView({behavior:"smooth",block:t,inline:"nearest"})}function M4(e,t){let r=nl([e],t);return r&&r[0]}function nl(e,t){let[r,n]=b.useState({});return b.useEffect(()=>{Promise.all(e.map(async o=>{let l=await t.loadStory(o);n(i=>i[o]===l?i:{...i,[o]:l})}))}),e.map(o=>{if(r[o])return r[o];try{return t.storyById(o)}catch{return null}})}function wc(e){return Dc(e)}var Ac=b.createContext({sources:{}}),Cc="--unknown--",$4=({children:e,channel:t})=>{let[r,n]=b.useState({});return b.useEffect(()=>{let o=(l,i=null,s=!1)=>{let{id:u,args:c=void 0,source:d,format:h}=typeof l=="string"?{id:l,source:i,format:s}:l,m=c?wc(c):Cc;n(p=>({...p,[u]:{...p[u],[m]:{code:d,format:h}}}))};return t.on(dl,o),()=>t.off(dl,o)},[]),a.createElement(Ac.Provider,{value:{sources:r}},e)},B4=(e=>(e.OPEN="open",e.CLOSED="closed",e.NONE="none",e))(B4||{}),H4=e=>{let t=e.map(r=>{var n,o;return(o=(n=r.parameters.docs)==null?void 0:n.source)==null?void 0:o.state}).filter(Boolean);return t.length===0?"closed":t[0]},I4=(e,t,r)=>{let{sources:n}=r,o=n==null?void 0:n[e];return(o==null?void 0:o[wc(t)])||(o==null?void 0:o[Cc])||{code:""}},N4=({snippet:e,storyContext:t,typeFromProps:r,transformFromProps:n})=>{var u,c,d,h,m,p;let{__isArgsStory:o}=t.parameters,l=((u=t.parameters.docs)==null?void 0:u.source)||{},i=r||l.type||Un.AUTO;if(l.code!==void 0)return l.code;let s=i===Un.DYNAMIC||i===Un.AUTO&&e&&o?e:l.originalSource||"";return l.transformSource&&ce(Ee`The \`transformSource\` parameter at \`parameters.docs.source.transformSource\` is deprecated, please use \`parameters.docs.source.transform\` instead. Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#source-block `),(c=t.parameters.docs)!=null&&c.transformSource&&ce(Ee`The \`transformSource\` parameter at \`parameters.docs.transformSource\` is deprecated, please use \`parameters.docs.source.transform\` instead. @@ -348,7 +348,7 @@ ${t}`);let r=t.match(fm);if(!r)return a.createElement(b.Fragment,null,t);let[,n, `),o?a.createElement(Tc,{of:o.moduleExport,expanded:!1,__primary:!0,withToolbar:!0}):null},w7=({children:e,disableAnchor:t,...r})=>{if(t||typeof e!="string")return a.createElement(No,null,e);let n=e.toLowerCase().replace(/[^a-z0-9]/gi,"-");return a.createElement(ol,{as:"h2",id:n,...r},e)},A7=R(w7)(({theme:e})=>({fontSize:`${e.typography.size.s2-1}px`,fontWeight:e.typography.weight.bold,lineHeight:"16px",letterSpacing:"0.35em",textTransform:"uppercase",color:e.textMutedColor,border:0,marginBottom:"12px","&:first-of-type":{marginTop:"56px"}})),C7=({title:e="Stories",includePrimary:t=!0})=>{let{componentStories:r}=b.useContext(Fe),n=r().filter(o=>{var l,i;return!((i=(l=o.parameters)==null?void 0:l.docs)!=null&&i.disable)});return t||(n=n.slice(1)),!n||n.length===0?null:a.createElement(a.Fragment,null,a.createElement(A7,null,e),n.map(o=>o&&a.createElement(Tc,{key:o.id,of:o.moduleExport,expanded:!0,__forceInitialArgs:!0})))},S7=()=>{let e=Zr("meta",["meta"]),{stories:t}=e.csfFile,r=Object.keys(t).length===1;return a.createElement(a.Fragment,null,a.createElement(y7,null),a.createElement(v7,null),a.createElement(oo,{of:"meta"}),r?a.createElement(oo,{of:"story"}):null,a.createElement(x7,null),a.createElement(W4,null),r?null:a.createElement(C7,null))};function q7({context:e,docsParameter:t}){let r=t.container||g7,n=t.page||S7;return a.createElement(r,{context:e,theme:t.theme},a.createElement(n,null))}export{K4 as A,G4 as C,q7 as D,Ie as F,e7 as H,ye as I,ko as S,Pm as T,af as W,ke as _,Gs as a,H as b,$s as c,g7 as d,S7 as e,Mm as f,Ne as g,R as n,j7 as s}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./syntaxhighlighter-V7JZZA35-kp0Lh13z.js","./iframe-FA3YUiXb.js","./pickBy-ZgIsky0p.js","./callBound-Uz6qjr9w.js","./index-RfLt4OUa.js","./index-miLrID2P.js","./extends-z9a7DBh-.js","./setPrototypeOf-08Rm0-g8.js","./inheritsLoose-uwS37NTe.js","./_baseUniq-tk6_MLAQ.js","./pickBy-zEDcIzXe.js","./uniq-TDmnBOQ0.js","./cloneDeep-BBxW03fY.js","./_baseClone-YJfCp7aQ.js","./index-xck8ovCi.js","./index-U0jbV_xt.js","./assert-Q0sut4U-.js","./util-6S_QBGOh.js","./formatter-SWP5E3XI-4AxpoQyI.js","./WithTooltip-V3YHNWJZ-JV42Hbb2.js","./Color-6VNJS4EI-buA192xZ.js","./debounce-A_lzSYvo.js"] + __vite__mapDeps.viteFileDeps = ["./syntaxhighlighter-V7JZZA35-CIYHiC15.js","./iframe-xC5OGfiz.js","./pickBy-ZgIsky0p.js","./callBound-Uz6qjr9w.js","./index-RfLt4OUa.js","./index-miLrID2P.js","./extends-z9a7DBh-.js","./setPrototypeOf-08Rm0-g8.js","./inheritsLoose-uwS37NTe.js","./_baseUniq-tk6_MLAQ.js","./pickBy-zEDcIzXe.js","./uniq-TDmnBOQ0.js","./cloneDeep-BBxW03fY.js","./_baseClone-YJfCp7aQ.js","./index-xck8ovCi.js","./index-U0jbV_xt.js","./assert-Q0sut4U-.js","./util-6S_QBGOh.js","./formatter-SWP5E3XI-2S88nLcu.js","./WithTooltip-V3YHNWJZ-7eC_V2oR.js","./Color-6VNJS4EI--3Onf2Q9.js","./debounce-A_lzSYvo.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/docs/storybook/assets/preview-qSo6RKZ8.js b/docs/storybook/assets/preview-ejw2DU4K.js similarity index 67% rename from docs/storybook/assets/preview-qSo6RKZ8.js rename to docs/storybook/assets/preview-ejw2DU4K.js index f1abf513..c5e7e475 100644 --- a/docs/storybook/assets/preview-qSo6RKZ8.js +++ b/docs/storybook/assets/preview-ejw2DU4K.js @@ -1,7 +1,7 @@ -import{_ as e}from"./iframe-FA3YUiXb.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-IFd-AFEu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url);return new r}}};export{a as parameters}; +import{_ as e}from"./iframe-xC5OGfiz.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-5-Yx17EK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url);return new r}}};export{a as parameters}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./DocsRenderer-NNNQARDV-IFd-AFEu.js","./iframe-FA3YUiXb.js","./index-RfLt4OUa.js","./react-16-hgR7FrAp.js","./index-miLrID2P.js","./index-zqxewmvn.js","./pickBy-ZgIsky0p.js","./callBound-Uz6qjr9w.js","./extends-z9a7DBh-.js","./setPrototypeOf-08Rm0-g8.js","./inheritsLoose-uwS37NTe.js","./_baseUniq-tk6_MLAQ.js","./pickBy-zEDcIzXe.js","./uniq-TDmnBOQ0.js","./cloneDeep-BBxW03fY.js","./_baseClone-YJfCp7aQ.js","./index-xck8ovCi.js","./index-U0jbV_xt.js","./assert-Q0sut4U-.js","./util-6S_QBGOh.js"] + __vite__mapDeps.viteFileDeps = ["./DocsRenderer-NNNQARDV-5-Yx17EK.js","./iframe-xC5OGfiz.js","./index-RfLt4OUa.js","./react-16-hgR7FrAp.js","./index-miLrID2P.js","./index-tQLynm0T.js","./pickBy-ZgIsky0p.js","./callBound-Uz6qjr9w.js","./extends-z9a7DBh-.js","./setPrototypeOf-08Rm0-g8.js","./inheritsLoose-uwS37NTe.js","./_baseUniq-tk6_MLAQ.js","./pickBy-zEDcIzXe.js","./uniq-TDmnBOQ0.js","./cloneDeep-BBxW03fY.js","./_baseClone-YJfCp7aQ.js","./index-xck8ovCi.js","./index-U0jbV_xt.js","./assert-Q0sut4U-.js","./util-6S_QBGOh.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/docs/storybook/assets/preview-xTeskd23.js b/docs/storybook/assets/preview-zE350L_8.js similarity index 80% rename from docs/storybook/assets/preview-xTeskd23.js rename to docs/storybook/assets/preview-zE350L_8.js index f3f8ed6f..7007f8d3 100644 --- a/docs/storybook/assets/preview-xTeskd23.js +++ b/docs/storybook/assets/preview-zE350L_8.js @@ -1 +1 @@ -import{d as o,e as r}from"./index-zqxewmvn.js";import"./iframe-FA3YUiXb.js";import"../sb-preview/runtime.js";import"./pickBy-ZgIsky0p.js";import"./callBound-Uz6qjr9w.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";const P={parameters:{docs:{container:o,page:r}}};export{P as default}; +import{d as o,e as r}from"./index-tQLynm0T.js";import"./iframe-xC5OGfiz.js";import"../sb-preview/runtime.js";import"./pickBy-ZgIsky0p.js";import"./callBound-Uz6qjr9w.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";const P={parameters:{docs:{container:o,page:r}}};export{P as default}; diff --git a/docs/storybook/assets/syntaxhighlighter-V7JZZA35-kp0Lh13z.js b/docs/storybook/assets/syntaxhighlighter-V7JZZA35-CIYHiC15.js similarity index 81% rename from docs/storybook/assets/syntaxhighlighter-V7JZZA35-kp0Lh13z.js rename to docs/storybook/assets/syntaxhighlighter-V7JZZA35-CIYHiC15.js index 818d3ac2..d76b1fee 100644 --- a/docs/storybook/assets/syntaxhighlighter-V7JZZA35-kp0Lh13z.js +++ b/docs/storybook/assets/syntaxhighlighter-V7JZZA35-CIYHiC15.js @@ -1 +1 @@ -import{S,c as b,s as F}from"./index-zqxewmvn.js";import"./iframe-FA3YUiXb.js";import"../sb-preview/runtime.js";import"./pickBy-ZgIsky0p.js";import"./callBound-Uz6qjr9w.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";export{S as SyntaxHighlighter,b as createCopyToClipboardFunction,F as default}; +import{S,c as b,s as F}from"./index-tQLynm0T.js";import"./iframe-xC5OGfiz.js";import"../sb-preview/runtime.js";import"./pickBy-ZgIsky0p.js";import"./callBound-Uz6qjr9w.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./extends-z9a7DBh-.js";import"./setPrototypeOf-08Rm0-g8.js";import"./inheritsLoose-uwS37NTe.js";import"./_baseUniq-tk6_MLAQ.js";import"./pickBy-zEDcIzXe.js";import"./uniq-TDmnBOQ0.js";import"./cloneDeep-BBxW03fY.js";import"./_baseClone-YJfCp7aQ.js";import"./index-xck8ovCi.js";import"./index-U0jbV_xt.js";import"./assert-Q0sut4U-.js";import"./util-6S_QBGOh.js";export{S as SyntaxHighlighter,b as createCopyToClipboardFunction,F as default}; diff --git a/docs/storybook/components/DocumentPreview/components/PdfHighlight/utils/Highlighter.d.ts b/docs/storybook/components/DocumentPreview/components/PdfHighlight/utils/Highlighter.d.ts index 736e73c1..8bda7b70 100644 --- a/docs/storybook/components/DocumentPreview/components/PdfHighlight/utils/Highlighter.d.ts +++ b/docs/storybook/components/DocumentPreview/components/PdfHighlight/utils/Highlighter.d.ts @@ -40,7 +40,7 @@ export declare class Highlighter { * Update text content HTML elements * @param textContentDivs HTML elements where text content items are rendered */ - setTextContentDivs(textContentDivs?: HTMLCollection): void; + setTextContentDivs(textContentDivs?: HTMLCollection | Element[]): void; /** * Get highlight shape from a span on a field * @param highlight a span on a document field to highlight diff --git a/docs/storybook/components/DocumentPreview/components/PdfHighlight/utils/textLayout/PdfTextContentTextLayout.d.ts b/docs/storybook/components/DocumentPreview/components/PdfHighlight/utils/textLayout/PdfTextContentTextLayout.d.ts index 1b159a97..c73a2dc5 100644 --- a/docs/storybook/components/DocumentPreview/components/PdfHighlight/utils/textLayout/PdfTextContentTextLayout.d.ts +++ b/docs/storybook/components/DocumentPreview/components/PdfHighlight/utils/textLayout/PdfTextContentTextLayout.d.ts @@ -22,7 +22,7 @@ export declare class PdfTextContentTextLayout implements TextLayout - + diff --git a/docs/storybook/project.json b/docs/storybook/project.json index 54f36304..7cabbd71 100644 --- a/docs/storybook/project.json +++ b/docs/storybook/project.json @@ -1 +1 @@ -{"generatedAt":1723134275410,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":true,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"CRA","packageName":"react-scripts","version":"5.0.1"},"monorepo":"Lerna","packageManager":{"type":"yarn","version":"4.2.2"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"7.6.10","storybookVersionSpecifier":"^7.6.10","language":"typescript","storybookPackages":{"@storybook/addons":{"version":"7.6.10"},"@storybook/preset-create-react-app":{"version":"7.6.10"},"@storybook/react":{"version":"7.6.10"},"@storybook/react-vite":{"version":"7.6.10"},"@storybook/source-loader":{"version":"7.6.10"},"storybook":{"version":"7.6.10"}},"addons":{"@storybook/addon-actions":{"version":"7.6.10"},"@storybook/addon-docs":{"version":"7.6.10"},"@storybook/addon-knobs":{"version":"7.0.2"}}} +{"generatedAt":1723567663341,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":true,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"CRA","packageName":"react-scripts","version":"5.0.1"},"monorepo":"Lerna","packageManager":{"type":"yarn","version":"4.2.2"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"7.6.10","storybookVersionSpecifier":"^7.6.10","language":"typescript","storybookPackages":{"@storybook/addons":{"version":"7.6.10"},"@storybook/preset-create-react-app":{"version":"7.6.10"},"@storybook/react":{"version":"7.6.10"},"@storybook/react-vite":{"version":"7.6.10"},"@storybook/source-loader":{"version":"7.6.10"},"storybook":{"version":"7.6.10"}},"addons":{"@storybook/addon-actions":{"version":"7.6.10"},"@storybook/addon-docs":{"version":"7.6.10"},"@storybook/addon-knobs":{"version":"7.0.2"}}} diff --git a/lerna.json b/lerna.json index 94d79054..c002413c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "packages": ["packages/*"], - "version": "6.0.0", + "version": "6.0.1", "npmClient": "yarn", "command": { "publish": { diff --git a/packages/discovery-react-components/CHANGELOG.md b/packages/discovery-react-components/CHANGELOG.md index b66d7317..4465c353 100644 --- a/packages/discovery-react-components/CHANGELOG.md +++ b/packages/discovery-react-components/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.0.1](https://github.com/watson-developer-cloud/discovery-components/compare/v6.0.0...v6.0.1) (2024-08-13) + + +### Bug Fixes + +* return normalized text divs/content values ([#581](https://github.com/watson-developer-cloud/discovery-components/issues/581)) ([a357da2](https://github.com/watson-developer-cloud/discovery-components/commit/a357da2bf166fe6ec125dfbd89a67b51b365a4f2)) + + + + + # [6.0.0](https://github.com/watson-developer-cloud/discovery-components/compare/v5.0.4...v6.0.0) (2024-08-08) diff --git a/packages/discovery-react-components/package.json b/packages/discovery-react-components/package.json index 704cc3f1..bef1e356 100644 --- a/packages/discovery-react-components/package.json +++ b/packages/discovery-react-components/package.json @@ -1,6 +1,6 @@ { "name": "@ibm-watson/discovery-react-components", - "version": "6.0.0", + "version": "6.0.1", "description": "Discovery components built with the React framework and IBM Carbon components", "license": "Apache-2.0", "author": "IBM Corp.",