Files
gemini-viewer-examples/public/demo/libs/gemini-viewer.esm.min.js

1 line
3.7 MiB
JavaScript
Raw Normal View History

var e={21593:function(e,t,n){var r=n(98235),i=n(83671),s=n(3019);function a(e,t){return e[0]===t[0]&&e[1]===t[1]}e.exports=function(e,t){for(var n={},r=e.length,p=[],d=0;d<r;d++){var m=e[d],f=e[(d+1)%r];h(m,c),h(f,u);for(var g=0;g<r;g++)if(d!==g){var _=e[g],v=e[(g+1)%r];if(h(_,o),h(v,l),!(a(o,c)||a(o,u)||a(l,c)||a(l,u))){var y=i(c,u,o,l),b=y[2];if(1!==b.length||b[0]){var x=s(y[2]);if(y[0]=s(y[0])/x,y[1]=s(y[1])/x,y.pop(),!(a(y,c)||a(y,u)||a(y,o)||a(y,l))){var T=y+"",w=!n[T];w&&(n[T]=!0);var E=w;t&&(E=t(y,d,m,f,g,_,v,w)),E&&p.push(y)}}}}}return p};var o=[0,0],l=[0,0],c=[0,0],u=[0,0];function h(e,t){r(e)?(t[0]=e[0],t[1]=e[1]):(t[0]=e.x,t[1]=e.y)}},19353:function(e,t,n){e.exports={RBTree:n(34760),BinTree:n(62754)}},62754:function(e,t,n){var r=n(84854);function i(e){this.data=e,this.left=null,this.right=null}function s(e){this._root=null,this._comparator=e,this.size=0}i.prototype.get_child=function(e){return e?this.right:this.left},i.prototype.set_child=function(e,t){e?this.right=t:this.left=t},s.prototype=new r,s.prototype.insert=function(e){if(null===this._root)return this._root=new i(e),this.size++,!0;for(var t=0,n=null,r=this._root;;){if(null===r)return r=new i(e),n.set_child(t,r),ret=!0,this.size++,!0;if(0===this._comparator(r.data,e))return!1;t=this._comparator(r.data,e)<0,n=r,r=r.get_child(t)}},s.prototype.remove=function(e){if(null===this._root)return!1;var t=new i(void 0),n=t;n.right=this._root;for(var r=null,s=null,a=1;null!==n.get_child(a);){r=n,n=n.get_child(a);var o=this._comparator(e,n.data);a=o>0,0===o&&(s=n)}return null!==s&&(s.data=n.data,r.set_child(r.right===n,n.get_child(null===n.left)),this._root=t.right,this.size--,!0)},e.exports=s},34760:function(e,t,n){var r=n(84854);function i(e){this.data=e,this.left=null,this.right=null,this.red=!0}function s(e){this._root=null,this._comparator=e,this.size=0}function a(e){return null!==e&&e.red}function o(e,t){var n=e.get_child(!t);return e.set_child(!t,n.get_child(t)),n.set_child(t,e),e.red=!0,n.red=!1,n}function l(e,t){return e.set_child(!t,o(e.get_child(!t),!t)),o(e,t)}i.prototype.get_child=function(e){return e?this.right:this.left},i.prototype.set_child=function(e,t){e?this.right=t:this.left=t},s.prototype=new r,s.prototype.insert=function(e){var t=!1;if(null===this._root)this._root=new i(e),t=!0,this.size++;else{var n=new i(void 0),r=0,s=0,c=null,u=n,h=null,p=this._root;for(u.right=this._root;;){if(null===p?(p=new i(e),h.set_child(r,p),t=!0,this.size++):a(p.left)&&a(p.right)&&(p.red=!0,p.left.red=!1,p.right.red=!1),a(p)&&a(h)){var d=u.right===c;p===h.get_child(s)?u.set_child(d,o(c,!s)):u.set_child(d,l(c,!s))}var m=this._comparator(p.data,e);if(0===m)break;s=r,r=m<0,null!==c&&(u=c),c=h,h=p,p=p.get_child(r)}this._root=n.right}return this._root.red=!1,t},s.prototype.remove=function(e){if(null===this._root)return!1;var t=new i(void 0),n=t;n.right=this._root;for(var r=null,s=null,c=null,u=1;null!==n.get_child(u);){var h=u;s=r,r=n,n=n.get_child(u);var p=this._comparator(e,n.data);if(u=p>0,0===p&&(c=n),!a(n)&&!a(n.get_child(u)))if(a(n.get_child(!u))){var d=o(n,u);r.set_child(h,d),r=d}else if(!a(n.get_child(!u))){var m=r.get_child(!h);if(null!==m)if(a(m.get_child(!h))||a(m.get_child(h))){var f=s.right===r;a(m.get_child(h))?s.set_child(f,l(r,h)):a(m.get_child(!h))&&s.set_child(f,o(r,h));var g=s.get_child(f);g.red=!0,n.red=!0,g.left.red=!1,g.right.red=!1}else r.red=!1,m.red=!0,n.red=!0}}return null!==c&&(c.data=n.data,r.set_child(r.right===n,n.get_child(null===n.left)),this.size--),this._root=t.right,null!==this._root&&(this._root.red=!1),null!==c},e.exports=s},84854:function(e){function t(){}function n(e){this._tree=e,this._ancestors=[],this._cursor=null}t.prototype.clear=function(){this._root=null,this.size=0},t.prototype.find=function(e){for(var t=this._root;null!==t;){var n=this._comparator(e,t.data);if(0===n)return t.data;t=t.get_child(n>0)}return null},t.prototype.findIter=function(e){for(var t=this._root,n=this.iterator();null!==t;){var r=this._comparator(e,t.data);if(0===r)return n._cursor=t,n;n._ancestors.push(t),t=t.get_child(r>0)}return null},t.prototype.low