tosijs-styled-editor 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/SECURITY.md +29 -0
- package/dist/changes.d.ts +20 -0
- package/dist/index.js +5 -5
- package/dist/module.js +54 -49
- package/dist/tosijs-styled-editor.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(()=>{var{defineProperty:Gt,getOwnPropertyNames:Bo,getOwnPropertyDescriptor:$o}=Object,No=Object.prototype.hasOwnProperty;function zo(e){return this[e]}var Oo=(e)=>{var t=(yi??=new WeakMap).get(e),n;if(t)return t;if(t=Gt({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var i of Bo(e))if(!No.call(t,i))Gt(t,i,{get:zo.bind(e,i),enumerable:!(n=$o(e,i))||n.enumerable})}return yi.set(e,t),t},yi;var Do=(e)=>e;function Io(e,t){this[e]=Do.bind(null,t)}var Ho=(e,t)=>{for(var n in t)Gt(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Io.bind(t,n)})};var Aa={};Ho(Aa,{DEL_TAG:()=>K,FOOTNOTE_TAG:()=>je,INS_TAG:()=>ue,MAX_DIFF_TOKENS:()=>Un,MENU_CLASS:()=>yo,MISSPELLING_TAG:()=>Vt,NON_PROSE_SELECTOR:()=>Qn,Selectable:()=>it,TosiDel:()=>Gn,TosiFootnote:()=>en,TosiIns:()=>Kn,TosiMisspelling:()=>ei,TosijsStyledEditor:()=>mi,acceptChange:()=>Yn,allowSelection:()=>Yt,applyRevision:()=>Zn,blockIsEmpty:()=>nt,caretGeometryAt:()=>Mt,cellAbove:()=>At,cellBelow:()=>St,cellIndex:()=>rt,cellOf:()=>J,changeId:()=>$e,changesIn:()=>Xn,characterAtPoint:()=>te,characterStyleWidgets:()=>di,checkSpelling:()=>ni,clearMisspellings:()=>mt,closestSingleParentAncestor:()=>kt,colOfCell:()=>_e,commandButton:()=>I,commands:()=>ct,createCell:()=>ie,createTable:()=>on,debugWidget:()=>Mo,defaultMenubar:()=>pi,defaultToolbar:()=>fi,defineChanges:()=>Ke,defineFootnote:()=>st,defineMisspelling:()=>Ft,diffWords:()=>Fs,executeCommand:()=>cn,firstLeafNode:()=>et,fontFamilyMenu:()=>xo,fontSizeMenu:()=>wo,getCellsInCol:()=>sn,getCellsInRow:()=>V,getColumnCount:()=>O,getColumnWidths:()=>Et,getRowCount:()=>Lt,insertMenu:()=>Eo,isBefore:()=>Ct,isHeaderCell:()=>lt,isProseText:()=>qt,isSafeNavigationUrl:()=>De,isTableCell:()=>Xo,justificationMenu:()=>bo,lastLeafNode:()=>tt,leafNodes:()=>He,lineSpacingMenu:()=>Co,localePickerWidget:()=>ci,makeCSS:()=>ln,makeFilter:()=>Ie,minimalToolbar:()=>hi,nextCell:()=>Tt,nextLeafNode:()=>F,paragraphStyleMenu:()=>vo,paragraphStyleWidgets:()=>ko,prevCell:()=>nn,previousLeafNode:()=>q,rejectChange:()=>Jn,renumberFootnotes:()=>ot,rowOfCell:()=>ne,runCommand:()=>an,sanitizeInPlace:()=>wt,setColumnWidths:()=>Re,siblingOrder:()=>qo,spanify:()=>k,stickySelectionBounds:()=>wi,tableMenu:()=>So,tableOf:()=>P,tokenize:()=>Wn,toolbarSpacer:()=>Ne,topSingleParentAncestor:()=>Y,tosijsStyledEditor:()=>Sa,undoRedoWidgets:()=>ui,version:()=>To,wordsIn:()=>ti});function Xt(e){return e.replace(/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,"").replace(/[\u0000-\u001f\u007f]/g,"")}function xi(e){let t=Xt(e);if(!/^[a-z][a-z0-9+.-]*:/i.test(t))return!0;if(/^data:image\/(png|jpeg|jpg|gif|webp|avif|bmp|svg\+xml);/i.test(t))return!/^data:image\/svg/i.test(t);return/^(https?|mailto|tel):/i.test(t)}var jo=new Set(["script","iframe","object","embed","link","meta","base","style","form","noscript","template","animate","animatetransform","animatemotion","set"]),Ro=["href","src","srcset","xlink:href","action","formaction","ping","poster","background","cite","data","longdesc","profile","usemap","manifest"],_o=/^(javascript|vbscript|livescript|mocha|data:text\/html)/i,Po=new Set(["ping"]),vi=Object.getOwnPropertyDescriptor(Element.prototype,"localName")?.get,bi=Object.getOwnPropertyDescriptor(Element.prototype,"attributes")?.get;function Vo(e){return vi?vi.call(e):e.localName}function Fo(e){return bi?bi.call(e):e.attributes}function wt(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),n=[],i;while(i=t.nextNode()){let s=i,o=String(Vo(s)??"").toLowerCase();if(jo.has(o)){n.push(s);continue}for(let r of Array.from(Fo(s)??[])){let l=r.name.toLowerCase();if(l.startsWith("on")){s.removeAttribute(r.name);continue}if(Po.has(l)){s.removeAttribute(r.name);continue}let a=Xt(r.value);if(_o.test(a)){s.removeAttribute(r.name);continue}if(Ro.includes(l)&&!xi(r.value))s.removeAttribute(r.name)}}for(let s of n)s.remove()}function De(e){return xi(e)&&!/^data:/i.test(Xt(e))}function Ie(e){if(typeof e==="function")return e;if(typeof e==="string"){let t=e;return(n)=>n.nodeType===1&&n.matches(t)}return()=>!0}function Ct(e,t){return(e.compareDocumentPosition(t)&4)!==0}function qo(e){let t=e.parentNode;if(!t)return-1;let n=t.childNodes;for(let i=0;i<n.length;i++)if(n[i]===e)return i;return-1}function et(e){while(e.firstChild)e=e.firstChild;return e}function tt(e){while(e.lastChild)e=e.lastChild;return e}function F(e,t,n){let i=n!==void 0?Ie(n):null,s=e;while(s){if(s.nextSibling){let o=et(s.nextSibling);if(!i||i(o))return o;s=o;continue}if(s.parentNode&&s.parentNode!==(t||null)){s=s.parentNode;continue}break}return null}function q(e,t,n){let i=n!==void 0?Ie(n):null,s=e;while(s){if(s.previousSibling){let o=tt(s.previousSibling);if(!i||i(o))return o;s=o;continue}if(s.parentNode&&s.parentNode!==(t||null)){s=s.parentNode;continue}break}return null}function He(e,t){let n=[],i=t!==void 0?Ie(t):null;function s(o){if(!o.firstChild){if(!i||i(o))n.push(o)}else for(let r=0;r<o.childNodes.length;r++)s(o.childNodes[r])}return s(e),n}function Y(e,t){let n=Ie(t);while(e.parentNode&&e.parentNode.childNodes.length===1&&n(e.parentNode))e=e.parentNode;return e}function kt(e,t){let n=Ie(t),i=e.parentNode;while(i){if(n(i))return i;if(!i.parentNode||i.parentNode.childNodes.length!==1)break;i=i.parentNode}return null}function Yt(e,t){e.style.userSelect=t?"text":"none",e.style.webkitUserSelect=t?"text":"none"}function Wo(e){if(e.nodeType!==3||!e.textContent)return!1;let t=e.parentElement;if(!t)return!1;return!t.closest(".not-selectable, .do-not-spanify, .not-editable")}function te(e,t,n){let i=[],s=(h)=>{if(Wo(h)){i.push(h);return}for(let f of Array.from(h.childNodes))s(f)};if(s(e),i.length===0)return null;let o=document.createRange(),r=1/0,l=[];for(let h of i){o.selectNodeContents(h);let f=o.getBoundingClientRect();if(f.width===0&&f.height===0)continue;let p=n<f.top?f.top-n:n>f.bottom?n-f.bottom:0;if(l.push({node:h,dy:p}),p<r)r=p}if(l.length===0)return null;let a=l.filter((h)=>h.dy<=r+2).map((h)=>h.node),c=null,d=1/0,u=(h)=>{let f=h.parentElement;return!!f&&getComputedStyle(f).direction==="rtl"};for(let h of a){let f=h.textContent||"",p=u(h);for(let b=0;b<f.length;b++){o.setStart(h,b),o.setEnd(h,b+1);let v=o.getBoundingClientRect();if(v.width===0&&v.height===0)continue;let G=n<v.top?v.top-n:n>v.bottom?n-v.bottom:0,Q=t<v.left?v.left-t:t>v.right?t-v.right:0,ke=Math.abs(t-(v.left+v.right)/2),X=G*1000+Q+ke/1000;if(X<d)d=X,c={node:h,offset:b,rect:v,after:p?t-v.left<v.width/2:t-v.left>=v.width/2}}}return c}function Mt(e,t){let n=(c)=>{let d=c;while(d){if(d.nodeType===3&&d.data.length>0)return d;d=F(d,t)}return null},i=(c)=>{let d=c;while(d){if(d.nodeType===3&&d.data.length>0)return d;d=q(d,t)}return null},s=(c,d)=>{let u=document.createRange();u.setStart(c,d),u.collapse(!0);let h=u.getBoundingClientRect();return h.height?{left:h.left,top:h.top,height:h.height}:null},o=n(F(e,t));if(o){let c=s(o,0);if(c)return c}let r=i(q(e,t));if(r){let c=s(r,r.data.length);if(c)return c}let l=getComputedStyle(e.parentElement||e).direction==="rtl",a=document.createRange();if(o){a.setStart(o,0),a.setEnd(o,1);let c=a.getBoundingClientRect();if(c.height)return{left:l?c.right:c.left,top:c.top,height:c.height}}if(r){a.setStart(r,r.data.length-1),a.setEnd(r,r.data.length);let c=a.getBoundingClientRect();if(c.height)return{left:l?c.left:c.right,top:c.top,height:c.height}}return null}var Uo=new Set(["a","b","i","u","s","em","strong","span","font","sub","sup","small","big","mark","abbr","cite","q","time","bdi","bdo","ruby","del","ins","strike","tt","var","wbr","rt","rp","code","kbd","samp","dfn","output","data","nobr","acronym"]);function nt(e){if(e.textContent?.trim())return!1;for(let t of Array.from(e.querySelectorAll("*"))){if(t.matches(".sel-start, .sel-end, .caret"))continue;if(!Uo.has(t.localName))return!1}return!0}function Jt(e){let t=Intl.Segmenter;if(!t)return Array.from(e);let n=new t(void 0,{granularity:"grapheme"});return Array.from(n.segment(e),(i)=>i.segment)}function Zt(e,t){let n=Intl.Segmenter;if(n){let o=new n(void 0,{granularity:"word"});for(let r of o.segment(e)){let l=r.index+r.segment.length;if(t>=r.index&&t<l)return{start:r.index,end:l}}return{start:t,end:t}}let i=t,s=t;while(i>0&&!/\s/.test(e[i-1]))i--;while(s<e.length&&!/\s/.test(e[s]))s++;return{start:i,end:s}}function wi(e,t,n){let i=Zt(e,t);if(n>=i.start&&n<=i.end)return n<t?{start:n,end:t}:{start:t,end:n};let s=Zt(e,n),o=(l)=>{let a=l;while(a>0&&/\s/.test(e[a-1]))a--;return a},r=(l)=>{let a=l;while(a<e.length&&/\s/.test(e[a]))a++;return a};return n<t?{start:r(s.start),end:i.end}:{start:i.start,end:o(s.end)}}function Ko(e){return e.nodeType===3&&!e.parentElement?.closest(".do-not-spanify")}function k(e,t,n=!1){if(t){let i=He(e,Ko);for(let s of i){let o=s.textContent||"",r;if(n)r=o.match(/\s+|\w+|[^\w\s]+/g)||[o];else r=Jt(o);if(r.length<=1&&Jt(o).length<=1)continue;let l=s.parentNode;if(!l)continue;if(l instanceof Element)l.classList.remove("spanified");let a=document.createDocumentFragment();for(let c of r){if(/^\s+$/.test(c)){a.appendChild(document.createTextNode(c));continue}if(Jt(c).length>1){let d=document.createElement("span");d.className="spanified-word",d.textContent=c,k(d,!0,!1),a.appendChild(d)}else{let d=document.createElement("span");d.className="spanified",d.textContent=c,a.appendChild(d)}}l.replaceChild(a,s)}}else{let i=Array.from(e.querySelectorAll(".spanified-word"));for(let o of i){let r=o.parentNode;if(r){while(o.firstChild)r.insertBefore(o.firstChild,o);r.removeChild(o)}}let s=Array.from(e.querySelectorAll(".spanified"));for(let o of s){let r=o.parentNode;if(r){while(o.firstChild)r.insertBefore(o.firstChild,o);r.removeChild(o)}}e.normalize()}}class it{root;selecting=!1;touchMode=!1;constructor(e){this.root=e,this.setup()}lastHovered=null;dragAnchor=null;pendingCollapse=null;setup(){Yt(this.root,!1),this.root.addEventListener("mousemove",this.handleMouseMove),this.root.addEventListener("mousedown",this.handleMouseDown),this.root.addEventListener("mouseup",this.handleMouseUp),this.root.addEventListener("mouseleave",this.handleMouseLeave),this.root.addEventListener("touchstart",this.handleTouchStart,{passive:!1}),this.root.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.root.addEventListener("touchend",this.handleTouchEnd,{passive:!1})}destroy(){this.root.removeEventListener("mousemove",this.handleMouseMove),this.root.removeEventListener("mousedown",this.handleMouseDown),this.root.removeEventListener("mouseup",this.handleMouseUp),this.root.removeEventListener("mouseleave",this.handleMouseLeave),this.root.removeEventListener("touchstart",this.handleTouchStart),this.root.removeEventListener("touchmove",this.handleTouchMove),this.root.removeEventListener("touchend",this.handleTouchEnd)}handleMouseMove=(e)=>{let t=e.target;if(t.closest(".not-selectable")||t.classList.contains("not-selectable"))return;if(this.lastHovered&&this.lastHovered!==t){let n=this.topLevelAncestor(this.lastHovered),i=this.topLevelAncestor(t);if(n&&n!==i&&!n.classList.contains("selected-block"))k(n,!1)}if(t instanceof Element&&t!==this.root)this.lastHovered=t;if(this.selecting){let n=te(this.root,e.clientX,e.clientY),i=this.find(".sel-end");if(n&&i){if(!this.extendSticky(n)){let s=document.createRange();s.setStart(n.node,n.after?n.offset+1:n.offset),s.collapse(!0),s.insertNode(i),this.root.normalize()}this.extendSelection(),this.onBoundsChanged?.()}}e.preventDefault(),e.stopPropagation()};placeCaretAt(e,t){let n=te(this.root,e,t);if(!n)return;this.removeBounds();let i=document.createRange();i.setStart(n.node,n.after?n.offset+1:n.offset),i.collapse(!0),i.insertNode(this.createBounds()),this.root.normalize(),this.onBoundsChanged?.()}textIndexOf(e){let t=[],n="",i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),s;while(s=i.nextNode()){let o=s;t.push({node:o,start:n.length}),n+=o.data}return{text:n,locate:(o)=>{for(let r=t.length-1;r>=0;r--)if(o>=t[r].start)return{node:t[r].node,offset:o-t[r].start};return null},indexOf:(o,r)=>{let l=t.find((a)=>a.node===o);return l?l.start+r:null}}}extendSticky(e){let t=this.dragAnchor;if(this.selecting!==1||!t)return!1;let n=this.topLevelAncestor(e.node);if(!n||n!==t.block)return!1;let i=this.textIndexOf(n),s=i.indexOf(e.node,e.after?e.offset+1:e.offset);if(s===null)return!1;let{start:o,end:r}=wi(i.text,t.index,s),l=i.locate(o),a=i.locate(r);if(!l||!a)return!1;let c=this.find(".sel-start"),d=this.find(".sel-end");if(!c||!d)return!1;let u=document.createRange();u.setStart(a.node,Math.min(a.offset,a.node.length)),u.collapse(!0),u.insertNode(d);let h=document.createRange();return h.setStart(l.node,Math.min(l.offset,l.node.length)),h.collapse(!0),h.insertNode(c),this.root.normalize(),!0}selectWordAt(e,t){let n=this.topLevelAncestor(e)||this.root,i=this.textIndexOf(n),s=i.indexOf(e,t);if(s===null)return;let{start:o,end:r}=Zt(i.text,s),l=i.locate,a=l(o),c=l(r);if(!a||!c)return;this.removeBounds();let d=document.createElement("span");d.className="sel-start";let u=document.createElement("span");u.className="sel-end caret";let h=document.createRange();h.setStart(c.node,Math.min(c.offset,c.node.length)),h.collapse(!0),h.insertNode(u);let f=document.createRange();f.setStart(a.node,Math.min(a.offset,a.node.length)),f.collapse(!0),f.insertNode(d),this.onBoundsChanged?.()}handleMouseDown=(e)=>{this.touchMode=!1;let t=e.target;if(t.closest(".not-selectable")||t.classList.contains("not-selectable"))return;if(e.detail===1&&!e.shiftKey&&t.closest?.(".selected")&&!t.closest?.(".not-selectable")){this.pendingCollapse={x:e.clientX,y:e.clientY,target:t};return}this.selecting=e.detail;let n=te(this.root,e.clientX,e.clientY);if(n)if(e.shiftKey){let i=this.find(".sel-end");if(i){i.remove();let s=document.createRange();s.setStart(n.node,n.after?n.offset+1:n.offset),s.collapse(!0),s.insertNode(i),this.root.normalize(),this.extendSelection()}}else if(this.selecting===1){let i=this.topLevelAncestor(n.node);this.dragAnchor=i?{block:i,index:this.textIndexOf(i).indexOf(n.node,n.after?n.offset+1:n.offset)??0}:null,this.placeCaretAt(e.clientX,e.clientY)}else if(this.selecting===2)this.selectWordAt(n.node,n.offset),this.extendSelection();else this.placeCaretAt(e.clientX,e.clientY),this.extendSelection();else if(t instanceof HTMLElement&&t.querySelectorAll(".spanified").length===0&&t!==this.root){this.removeBounds();let i=this.createBounds();t.appendChild(i)}e.preventDefault(),e.stopPropagation()};handleMouseUp=(e)=>{let t=this.pendingCollapse;if(this.pendingCollapse=null,t){if(Math.abs(e.clientX-t.x)+Math.abs(e.clientY-t.y)<4)this.unmark(),this.selecting=1,this.placeCaretAt(t.x,t.y),this.selecting=!1,this.selectionChanged();return}let n=e.target;if(n.closest(".not-selectable")||n.classList.contains("not-selectable"))return;if(this.selecting){let i=this.selecting;if(this.extendSelection(),i!==1)this.resetBounds();this.normalizeBoundsOrder(),this.selecting=!1,this.dragAnchor=null}for(let i of Array.from(this.root.children))if(!i.classList.contains("selected-block"))k(i,!1);this.lastHovered=null,this.selectionChanged(),e.preventDefault(),e.stopPropagation()};handleMouseLeave=()=>{if(this.lastHovered){let e=this.topLevelAncestor(this.lastHovered);if(e&&!e.classList.contains("selected-block"))k(e,!1);this.lastHovered=null}};handleTouchStart=(e)=>{if(e.touches.length!==1)return;this.touchMode=!0;let t=e.touches[0],n=e.target;if(n.closest(".not-selectable")||n.classList.contains("not-selectable"))return;if(this.selecting=1,te(this.root,t.clientX,t.clientY))this.placeCaretAt(t.clientX,t.clientY);else if(n instanceof HTMLElement&&n!==this.root){this.removeBounds();let s=this.createBounds();n.appendChild(s)}if(e.cancelable)e.preventDefault()};handleTouchMove=(e)=>{if(!this.selecting||e.touches.length!==1)return;let t=e.touches[0],n=this.root.getRootNode(),i=n.elementFromPoint?n.elementFromPoint(t.clientX,t.clientY):document.elementFromPoint(t.clientX,t.clientY);if(!i||i.closest(".not-selectable")||i.classList.contains("not-selectable"))return;let s=te(this.root,t.clientX,t.clientY),o=this.find(".sel-end");if(s&&o){let r=document.createRange();r.setStart(s.node,s.after?s.offset+1:s.offset),r.collapse(!0),r.insertNode(o),this.root.normalize(),this.extendSelection(),this.onBoundsChanged?.()}if(e.cancelable)e.preventDefault()};handleTouchEnd=(e)=>{if(this.selecting)this.extendSelection(),this.normalizeBoundsOrder(),this.selecting=!1;for(let t of Array.from(this.root.children))if(!t.classList.contains("selected-block"))k(t,!1);if(this.lastHovered=null,this.selectionChanged(),e.cancelable)e.preventDefault()};selectionChanged(){this.focus(),this.root.dispatchEvent(new CustomEvent("selectionchanged",{bubbles:!0}))}onBoundsChanged;focusTarget;focus(){this.focusTarget?.focus(),this.onBoundsChanged?.()}createBounds(){let e=document.createDocumentFragment(),t=document.createElement("span");t.className="sel-start";let n=document.createElement("span");return n.className="sel-end caret",e.appendChild(t),e.appendChild(n),e}normalizeBoundsOrder(){let e=this.find(".sel-start"),t=this.find(".sel-end");if(!e||!t||e===t)return;if(Ct(e,t))return;e.className="sel-end caret",t.className="sel-start",this.onBoundsChanged?.()}find(e){return this.root.querySelector(e)}findAll(e){return Array.from(this.root.querySelectorAll(e))}markBounds(){let e=this.find(".sel-start"),t=this.find(".sel-end");if(e&&t)this.markRange(e,t);this.onBoundsChanged?.()}removeBounds(){for(let e of this.findAll(".sel-start, .sel-end"))e.remove();this.onBoundsChanged?.()}textOffsetOf(e,t){let n=0,i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),s;while(s=i.nextNode())if(t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_PRECEDING)n+=s.data.length;return n}withoutBounds(e){let t=this.findAll(".sel-start, .sel-end");if(t.length===0)return e();let n=t.map((i)=>{let s=this.topLevelAncestor(i),o=!s||s===i?this.root:s;return{el:i,container:o,parent:i.parentNode,next:i.nextSibling,offset:this.textOffsetOf(o,i)}});for(let{el:i}of n)i.remove();this.normalize();try{return e()}finally{for(let{el:i,container:s,parent:o,next:r,offset:l}of n){let a=s.isConnected?this.textIndexOf(s).locate(l):null;if(a){let c=document.createRange();c.setStart(a.node,Math.min(a.offset,a.node.length)),c.collapse(!0),c.insertNode(i);continue}if(o?.isConnected&&(!r||r.parentNode===o))o.insertBefore(i,r);else if(s.isConnected)s.appendChild(i);else this.root.appendChild(i)}this.normalize(),this.onBoundsChanged?.()}}resetBounds(){let e=this.findAll(".selected");if(e.length===0)return this;this.removeBounds();let t=document.createElement("span");t.className="sel-start";let n=document.createElement("span");n.className="sel-end caret";let i=e[0],s=e[e.length-1],o=et(i),r=tt(s);return o.parentNode?.insertBefore(t,o),r.parentNode?.insertBefore(n,r.nextSibling),this.onBoundsChanged?.(),this}extendSelection(){let e=this.find(".sel-start"),t=this.find(".sel-end");if(!e||!t)return;let n=e,i=t;switch(this.selecting){case 1:break;case 2:if(n.closest(".spanified-word"))n=n.closest(".spanified-word");if(i.closest(".spanified-word"))i=i.closest(".spanified-word");break;default:n=this.topLevelAncestor(n)||n,i=this.topLevelAncestor(i)||i;break}this.markRange(n,i),this.onBoundsChanged?.()}topLevelAncestor(e){let t=e;while(t&&t.parentNode!==this.root)t=t.parentNode;return t instanceof Element?t:null}unmark(){for(let e of this.findAll(".selected"))if(e.classList.remove("selected"),e.removeAttribute("draggable"),e.removeAttribute("data-drag"),e instanceof HTMLElement&&e.classList.length===0&&e.getAttribute("class")!==null)e.removeAttribute("class");for(let e of this.findAll("span"))if(e.attributes.length===0){let t=e.parentNode;if(t){while(e.firstChild)t.insertBefore(e.firstChild,e);t.removeChild(e)}}for(let e of this.findAll(".selected-block"))e.classList.remove("selected-block");for(let e of this.findAll(".first-block"))e.classList.remove("first-block");for(let e of this.findAll(".last-block"))e.classList.remove("last-block")}isBlock(e){return e.parentNode===this.root}markRange(e,t){if(!e)return;if(!t)t=e;if(!Ct(e,t)&&e!==t){let d=t;t=e,e=d}this.unmark();let n=this.isBlock(e)?e:this.topLevelAncestor(e),i=this.isBlock(t)?t:this.topLevelAncestor(t);if(!n||!i)return;n.classList.add("first-block"),i.classList.add("last-block");let s=[n];if(n!==i){let d=n.nextElementSibling;while(d&&d!==i)s.push(d),d=d.nextElementSibling;s.push(i)}for(let d of s)d.classList.add("selected-block");for(let d of Array.from(this.root.children))if(!d.classList.contains("selected-block"))k(d,!1);let o=e.classList.contains("sel-start")||e.classList.contains("sel-end")?F(e,this.root):et(e),r=t.classList.contains("sel-start")||t.classList.contains("sel-end")?q(t,this.root):tt(t);if(!o||!r)return;let l=[];for(let d of s)l.push(...He(d));let a=l.indexOf(o),c=l.indexOf(r);if(a<0||c<0)return;for(let d=a;d<=c;d++)this.markNode(l[d])}static DRAG_TYPES="text/html;text/plain";makeDraggable(e){e.setAttribute("draggable","true"),e.setAttribute("data-drag",it.DRAG_TYPES)}markNode(e){if(e.nodeType===3){let t=e.parentNode;if(t&&t.childNodes.length===1)t.classList.add("selected"),this.makeDraggable(t);else if(t){let n=document.createElement("span");n.className="selected",t.insertBefore(n,e),n.appendChild(e),this.makeDraggable(n)}}else if(e instanceof Element){if(!e.classList.contains("sel-start")&&!e.classList.contains("sel-end"))e.classList.add("selected"),this.makeDraggable(e)}}despanify(){for(let e of Array.from(this.root.children))if(!e.classList.contains("selected-block"))k(e,!1);this.lastHovered=null}normalize(){let e=this.root;for(let t=e.childNodes.length-1;t>=0;t--){let n=e.childNodes[t];if(n.nodeType===3&&/^\s*$/.test(n.textContent||""))e.removeChild(n)}for(let t of Array.from(e.querySelectorAll(".editor-table")))for(let n=t.childNodes.length-1;n>=0;n--){let i=t.childNodes[n];if(i.nodeType===3)t.removeChild(i)}return e.normalize(),this}}var Qt=new WeakSet;function Ci(e){if(!e||Qt.has(e))return;Qt.add(e),queueMicrotask(()=>{if(Qt.delete(e),e.isConnected)ot(e)})}class en extends HTMLElement{editorRoot=null;connectedCallback(){this.editorRoot=this.closest('[part="doc"]')??this.parentElement,this.classList.add("not-selectable","do-not-spanify"),Ci(this.editorRoot)}disconnectedCallback(){Ci(this.editorRoot)}}var je="tosi-footnote";function st(){if(typeof customElements>"u")return;if(customElements.get(je))return;customElements.define(je,en)}function tn(e){return e instanceof Element&&e.tagName==="LI"}function Go(e){return e instanceof Element&&e.tagName==="UL"}function Xo(e){return J(e)!==null}function J(e){let t=e;while(t){if(tn(t)&&t.parentElement?.classList.contains("editor-table"))return t;t=t.parentNode}return null}function P(e){let t=e;while(t){if(Go(t)&&t.classList.contains("editor-table"))return t;t=t.parentNode}return null}function O(e){let t=e.style.gridTemplateColumns.trim();if(!t)return 1;return t.split(/\s+/).length}function Et(e){let t=e.style.gridTemplateColumns.trim();if(!t)return["1fr"];return t.split(/\s+/)}function Re(e,t){e.style.gridTemplateColumns=t.join(" ")}function rt(e){let t=e.parentElement;if(!t)return-1;return Array.from(t.querySelectorAll(":scope > li")).indexOf(e)}function ne(e,t){return Math.floor(rt(e)/t)}function _e(e,t){return rt(e)%t}function St(e){let t=e.parentElement;if(!t)return null;let n=O(t),s=rt(e)+n,o=Array.from(t.querySelectorAll(":scope > li"));return s<o.length?o[s]:null}function At(e){let t=e.parentElement;if(!t)return null;let n=O(t),s=rt(e)-n;if(s<0)return null;return Array.from(t.querySelectorAll(":scope > li"))[s]}function Tt(e){let t=e.nextElementSibling;return t&&tn(t)?t:null}function nn(e){let t=e.previousElementSibling;return t&&tn(t)?t:null}function lt(e){return e.classList.contains("table-header")}function ie(e=!1){let t=document.createElement("li");if(e)t.classList.add("table-header");return t.innerHTML=" ",t}function V(e,t,n){let i=Array.from(e.querySelectorAll(":scope > li")),s=t*n;return i.slice(s,s+n)}function sn(e,t,n){let i=Array.from(e.querySelectorAll(":scope > li")),s=[];for(let o=t;o<i.length;o+=n)s.push(i[o]);return s}function Lt(e){let t=e.querySelectorAll(":scope > li"),n=O(e);return Math.ceil(t.length/n)}function on(e,t=2,n=1){let i=document.createElement("ul");i.className="editor-table",i.style.gridTemplateColumns=Array(e).fill("1fr").join(" ");for(let s=0;s<t;s++){let o=s<n;for(let r=0;r<e;r++)i.appendChild(ie(o))}return i}function ln(e){if(e.length%2!==0)return console.error("Error: expected even number of arguments",e),null;let t={};for(let n=0;n<e.length;n+=2)t[e[n]]=e[n+1].replace(/\+/g," ");return t}function rn(e,t){for(let[n,i]of Object.entries(t))e.style.setProperty(n,i)}function at(e){return(e.tagName==="UL"||e.tagName==="OL")&&!e.classList.contains("editor-table")}function Yo(e){let t=e.parentNode;if(!t)return;for(let n of Array.from(e.children)){let i=document.createElement("p");while(n.firstChild)i.appendChild(n.firstChild);i.classList.add("selected-block"),t.insertBefore(i,e)}e.remove()}function Jo(e){let t=e,n=t.previousElementSibling;if(n&&at(n)&&n.tagName===t.tagName){while(t.firstChild)n.appendChild(t.firstChild);n.classList.add("selected-block"),t.remove(),t=n}let i=t.nextElementSibling;if(i&&at(i)&&i.tagName===t.tagName){while(i.firstChild)t.appendChild(i.firstChild);i.remove()}return t}function ki(e,t){if(!t||t==="_self"){e.removeAttribute("target"),e.removeAttribute("rel");return}e.setAttribute("target",t),e.setAttribute("rel","noopener")}var Mi=0;function Zo(){return Mi+=1,`fn-${Date.now().toString(36)}-${Mi}`}function ot(e){let t=Array.from(e.querySelectorAll(`${je}[data-footnote], .footnote-ref[data-footnote]`)).filter((s)=>!s.closest(".footnotes")),n=e.querySelector("ol.footnotes");if(t.length===0){n?.remove();return}if(!n)n=document.createElement("ol"),n.className="footnotes",e.appendChild(n);let i=new Map;for(let s of Array.from(n.children)){let o=s.getAttribute("data-footnote");if(o)i.set(o,s)}t.forEach((s,o)=>{let r=s.getAttribute("data-footnote"),l=s.querySelector("a");if(l)l.textContent=String(o+1),l.setAttribute("href",`#${r}`);let a=i.get(r);if(!a)a=document.createElement("li"),a.className="footnote",a.setAttribute("data-footnote",r),a.textContent="Footnote text";a.id=r,i.delete(r),n.appendChild(a)});for(let s of i.values())s.remove()}var ct={setText(e,...t){let n=ln(t);if(!n)return;e.selectable.resetBounds(),k(e.root,!1),e.selectable.markBounds(),e.normalize();let i=e.selectedLeafNodes();e.selectable.removeBounds();for(let s of i)if(s.nodeType===3){let o=kt(s,".setText");if(o&&o instanceof HTMLElement)rn(o,n);else{let r=document.createElement("span");r.className="setText",rn(r,n),s.parentNode?.insertBefore(r,s),r.appendChild(s)}}e.selectable.resetBounds(),e.focus(),e.updateUndo("new")},setBlockType(e,t){let n=e.selectedBlocks();for(let i of n){let s=document.createElement(t);while(i.firstChild)s.appendChild(i.firstChild);s.classList.add("selected-block"),i.parentNode?.replaceChild(s,i)}e.updateUndo("new")},setList(e,t="ul"){let n=t.toLowerCase(),i=e.selectedBlocks().filter((r)=>!r.classList.contains("editor-table"));if(i.length===0)return;let s=i.every(at)&&i.every((r)=>r.tagName.toLowerCase()===n);if(n==="none"||s){for(let r of i)if(at(r))Yo(r);e.updateUndo("new");return}let o=[];for(let r of i){let l=o[o.length-1];if(l&&l[l.length-1].nextElementSibling===r)l.push(r);else o.push([r])}for(let r of o){let l=document.createElement(n);l.classList.add("selected-block");for(let a of r)if(at(a))while(a.firstChild)l.appendChild(a.firstChild);else{let c=document.createElement("li");while(a.firstChild)c.appendChild(a.firstChild);l.appendChild(c)}r[0].parentNode?.insertBefore(l,r[0]);for(let a of r)a.remove();Jo(l)}e.updateUndo("new")},setLink(e,t,n="_blank"){if(!t)return;if(!De(t)){console.error("setLink: refusing unsafe URL scheme",t);return}e.selectable.resetBounds(),k(e.root,!1),e.selectable.markBounds(),e.normalize();let i=e.selectedLeafNodes();e.selectable.removeBounds();for(let s of i){if(s.nodeType!==3)continue;let o=kt(s,"a");if(o instanceof Element)o.setAttribute("href",t),ki(o,n);else{let r=document.createElement("a");r.setAttribute("href",t),ki(r,n),s.parentNode?.insertBefore(r,s),r.appendChild(s)}}e.selectable.resetBounds(),e.focus(),e.updateUndo("new")},removeLink(e){e.selectable.resetBounds(),k(e.root,!1),e.selectable.markBounds();let t=e.selectedLeafNodes();e.selectable.removeBounds();let n=new Set;for(let i of t){let s=i.parentElement?.closest("a")??(i instanceof Element?i.closest("a"):null);if(s&&e.root.contains(s))n.add(s)}for(let i of n){let s=i.parentNode;if(!s)continue;while(i.firstChild)s.insertBefore(i.firstChild,i);s.removeChild(i)}e.selectable.resetBounds(),e.focus(),e.updateUndo("new")},insertImage(e,t,...n){let i=e.insertionPoint();if(!i||!t)return;let s=document.createElement("img");s.setAttribute("src",t),s.setAttribute("alt",n.join(" ")),i.before(s),e.normalize(),e.focus(),e.updateUndo("new")},insertFootnote(e,...t){let n=e.insertionPoint();if(!n)return;let i=Zo();st();let s=document.createElement(je);s.className="footnote-ref",s.setAttribute("data-footnote",i);let o=document.createElement("a");o.setAttribute("href",`#${i}`),o.textContent="?",s.appendChild(o),n.before(s);let r=e.root.querySelector("ol.footnotes");if(!r)r=document.createElement("ol"),r.className="footnotes",e.root.appendChild(r);let l=document.createElement("li");l.className="footnote",l.setAttribute("data-footnote",i),l.id=i,l.textContent=t.length?t.join(" "):"Footnote text",r.appendChild(l),ot(e.root),e.normalize(),e.focus(),e.updateUndo("new")},renumberFootnotes(e){ot(e.root),e.updateUndo("new")},setBlocks(e,...t){let n=ln(t);if(!n)return;for(let i of e.selectedBlocks())rn(i,n);e.updateUndo("new")},updateUndo(e,t){e.updateUndo(t)},setDebug(e){e.root.classList.toggle("debug")},annotate(e,t){let n=e.insertionPoint();if(!n)return;let i=document.querySelector(`.annotation-template .${t}`);if(!i)return;let s=document.createElement("span");s.className="annotation do-not-spanify not-selectable not-editable";let o=i.cloneNode(!0);o.classList.add("annotation-body"),s.appendChild(o),n.after(s),e.updateUndo("new")},insertTable(e,...t){let n=parseInt(t[0])||3,i=parseInt(t[1])||2,s=parseInt(t[2])||1,o=e.insertionPoint();if(!o)return;let r=e.block(o),l=on(n,i,s);if(r)r.after(l);else e.root.appendChild(l);let a=l.querySelector("li");if(a)a.innerHTML="",a.appendChild(e.selectable.createBounds()),e.selectable.normalize(),e.focus();e.updateUndo("new")},insertTableRow(e,t="after"){let n=e.insertionPoint();if(!n)return;let i=J(n);if(!i)return;let s=P(i);if(!s)return;let o=O(s),r=ne(i,o),l=t==="before"&&r===0&<(i),a=V(s,r,o),c=t==="before"?a[0]:a[a.length-1];for(let d=0;d<o;d++){let u=ie(l);if(t==="before")c.before(u);else c.after(u)}e.updateUndo("new")},insertTableCol(e,t="after"){let n=e.insertionPoint();if(!n)return;let i=J(n);if(!i)return;let s=P(i);if(!s)return;let o=O(s),r=_e(i,o),l=Lt(s);for(let d=l-1;d>=0;d--){let h=V(s,d,o)[r],f=lt(h),p=ie(f);if(t==="before")h.before(p);else h.after(p)}let a=Et(s),c=t==="before"?r:r+1;a.splice(c,0,"1fr"),Re(s,a),e.updateUndo("new")},deleteTableRow(e){if(e.tracksChanges()&&e.refuseStructural("delete-table-row"))return;let t=e.insertionPoint();if(!t)return;let n=J(t);if(!n)return;let i=P(n);if(!i)return;let s=O(i);if(Lt(i)<=1)return;let r=ne(n,s),l=V(i,r,s),a=r>0?r-1:1,c=V(i,a,s);if(c.length>0)c[0].appendChild(e.selectable.createBounds()),e.selectable.normalize(),e.focus();for(let d of l)d.remove();e.updateUndo("new")},deleteTableCol(e){if(e.tracksChanges()&&e.refuseStructural("delete-table-col"))return;let t=e.insertionPoint();if(!t)return;let n=J(t);if(!n)return;let i=P(n);if(!i)return;let s=O(i);if(s<=1)return;let o=_e(n,s),r=ne(n,s),l=o>0?o-1:1,a=V(i,r,s);if(a[l])a[l].appendChild(e.selectable.createBounds()),e.selectable.normalize(),e.focus();let c=sn(i,o,s);for(let u=c.length-1;u>=0;u--)c[u].remove();let d=Et(i);d.splice(o,1),Re(i,d),e.updateUndo("new")},toggleHeaderRow(e){let t=e.insertionPoint();if(!t)return;let n=J(t);if(!n)return;let i=P(n);if(!i)return;let s=O(i),o=ne(n,s),r=V(i,o,s),l=!lt(r[0]);for(let a of r)a.classList.toggle("table-header",l);e.updateUndo("new")}};function an(e,t,...n){let s=(e.commands??ct)[t];if(s)s(e,...n);else console.error("unrecognized command",t)}function cn(e,t){let n=e.commands??ct,i=t.split(/;\s*/);for(let s of i){let o=s.trim().split(/\s+/),r=o.shift();if(!r)continue;let l=n[r];if(l)l(e,...o);else console.error("unrecognized command",r)}}var Ae={debug:!1,perf:!1,quiet:!1};function re(e,t){if(e==null||typeof e!=="object")return e;if(e instanceof Date)return new Date(e.getTime());if(t===void 0)t=new WeakMap;else if(t.has(e))return t.get(e);if(e instanceof Set){let i=new Set;t.set(e,i);for(let s of e)i.add(re(s,t));return i}if(e instanceof Map){let i=new Map;t.set(e,i);for(let[s,o]of e)i.set(re(s,t),re(o,t));return i}if(Array.isArray(e)){let i=[];t.set(e,i);for(let s of e)i.push(re(s,t));return i}let n={};t.set(e,n);for(let i in e)n[i]=re(e[i],t);return n}var ae={},yn=null,Qo=(e)=>{yn=e},Bn=()=>{if(yn===null)throw Error("xin proxy not initialized");return yn},vn=null,bn=null,er=(e,t)=>{vn=e,bn=t},tr=()=>{if(vn===null)throw Error("bind not initialized");return vn},nr=()=>{if(bn===null)throw Error("on not initialized");return bn},ve="-tosi-data",xn=`.${ve}`,U=Symbol.for("xin-path"),Te=Symbol.for("xin-value"),ir="xinObserve",sr="xinBind",or="xinOn",rr=Symbol.for("tosi-accessor"),$n=Symbol.for("tosi-take"),Ot=Symbol("list-binding"),qe=Symbol("list-instance"),wn=new Map;function lr(e,t){let n=wn.get(e);if(n===void 0)n=new Set,wn.set(e,n);n.add(t)}function ar(e){return wn.get(e)}var Ei=new Set;function le(e,t){if(!Ei.has(e)){if(Ei.add(e),Ae.quiet!==!0)console.warn(t)}}function Rt(e,t){let n=!1;return(...i)=>{if(!n)console.warn(t),n=!0;return e(...i)}}var ce=(e)=>e&&e[U]||void 0;function B(e){if(typeof e==="object"&&e!==null){let t=e[Te];return t!==void 0?t:e}return e}var Va=Rt(ce,"xinPath is deprecated. Use tosiPath instead."),Fa=Rt(B,"xinValue is deprecated. Use tosiValue instead."),ns=(e,t)=>{let{take:n}=e;if(n==null)return;n.paths=n.paths.map((i)=>i.startsWith("^")?`${t}${i.substring(1)}`:i)},is=(e,t,n)=>{let{binding:i,options:s,take:o}=t,{toDOM:r}=i;if(r==null)return;let l=Bn();if(o==null){r(e,l[n],s);return}let a=o.paths.map((d)=>l[d]),c=o.lastInputs;if(c!=null&&a.every((d,u)=>d===c[u]))return;o.lastInputs=a,r(e,o.transform(...a),s)},We=new WeakMap,de=new WeakMap,Dt=new WeakMap,cr=0;var dr=0,Nn=()=>{dr++},ur=(e,t)=>{if(!Dt.has(e))cr++;Dt.set(e,t)};var ht=(e)=>{let t=e.cloneNode();if(t instanceof Element){let i=de.get(e),s=We.get(e);if(i!=null)de.set(t,i.map((r)=>({...r,options:r.options!=null?{...r.options}:void 0,take:r.take!=null?{...r.take,paths:[...r.take.paths]}:void 0})));if(s!=null)We.set(t,re(s));let o=Dt.get(e);if(o!=null)Dt.set(t,o)}let n=t instanceof HTMLTemplateElement?t.content:t;for(let i of Array.from(e instanceof HTMLTemplateElement?e.content.childNodes:e.childNodes))if(i instanceof Element||i instanceof DocumentFragment)n.appendChild(ht(i));else n.appendChild(i.cloneNode());return t},hr=(e)=>{try{return JSON.stringify(e)}catch(t){return"{has circular references}"}},ss=(...e)=>Error(e.map(hr).join(" ")),fr=()=>new Date(parseInt("1000000000",36)+Date.now()).valueOf().toString(36).slice(1),pr=0,gr=()=>(parseInt("10000",36)+ ++pr).toString(36).slice(-5),mr=()=>fr()+gr(),Cn=Symbol("delete"),os=Symbol("new-object"),dn=Symbol("automatic-index");function rs(e){if(e==="")return[];if(Array.isArray(e))return e;else{let t=[];while(e.length>0){let n=e.search(/\[[^\]]+\]/);if(n===-1){t.push(e.split("."));break}else{let i=e.slice(0,n);if(e=e.slice(n),i!=="")t.push(i.split("."));if(n=e.indexOf("]")+1,t.push(e.slice(1,n-1)),e.slice(n,n+1)===".")n+=1;e=e.slice(n)}}return t}}var Se=new WeakMap;function ls(e,t){if(Se.get(e)===void 0)Se.set(e,{});let n={};if(Se.get(e)[t]=n,t==="_auto_")e.forEach((i,s)=>{if(i[dn]===void 0)i[dn]=mr();n[i[dn]+""]=s});else e.forEach((i,s)=>{n[_(i,t)+""]=s});return n}function yr(e,t){if(Se.get(e)===void 0||Se.get(e)[t]===void 0)return ls(e,t);else return Se.get(e)[t]}function vr(e,t,n){n=n+"";let i=yr(e,t)[n];if(i===void 0||_(e[i],t)+""!==n)i=ls(e,t)[n];return i}var br=new Set(["__proto__","constructor","prototype"]);class zn extends Error{constructor(e){super(`unsafe path segment "${e}": it would escape the object graph into the prototype chain`);this.name="UnsafePathError"}}function xr(e){if(br.has(e))throw new zn(e)}function wr(e){if(e==="__proto__")throw new zn(e)}function Cr(e,t,n){if(xr(t),(!Object.prototype.hasOwnProperty.call(e,t)||e[t]===void 0)&&n!==void 0)e[t]=n;return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function as(e,t,n,i){let s=t!==""?vr(e,t,n):n;if(i===Cn){if(s!==void 0)e.splice(s,1),Se.delete(e);return Symbol("deleted")}else if(i===os){if(t===""&&e[s]===void 0)e[s]={}}else if(i!==void 0)if(s!==void 0)e[s]=i;else if(t!==""&&_(i,t)+""===n+"")e.push(i),s=e.length-1;else throw Error(`byIdPath insert failed at [${t}=${n}]`);return e[s]}function Si(e){if(!Array.isArray(e))throw ss("setByPath failed: expected array, found",e)}function Ai(e){if(e==null||!(e instanceof Object))throw ss("setByPath failed: expected Object, found",e)}function _(e,t){let n=rs(t),i=e,s,o,r,l;for(s=0,o=n.length;i!==void 0&&s<o;s++){let a=n[s];if(Array.isArray(a))for(r=0,l=a.length;i!==void 0&&r<l;r++){let c=a[r];i=i[c]}else if(i.length===0){if(i=i[Number(a.slice(1))],a[0]!=="=")return}else if(a.includes("=")){let[c,...d]=a.split("=");i=as(i,c,d.join("="))}else r=parseInt(a,10),i=i[r]}return i}function cs(e,t,n){let i=e;if(t==="")throw Error("setByPath cannot be used to set the root object");let s=rs(t);while(i!=null&&s.length>0){let o=s.shift();if(typeof o==="string"){let r=o.indexOf("=");if(r>-1){if(r===0)Ai(i);else Si(i);let l=o.slice(0,r),a=o.slice(r+1);if(i=as(i,l,a,s.length>0?os:n),s.length===0)return!0}else{Si(i);let l=parseInt(o,10);if(s.length>0)i=i[l];else{if(n!==Cn){if(i[l]===n)return!1;i[l]=n}else i.splice(l,1);return!0}}}else if(Array.isArray(o)&&o.length>0){Ai(i);while(o.length>0){let r=o.shift();if(o.length>0||s.length>0){if(i=Cr(i,r,o.length>0?{}:[]),i==null)throw Error(`setByPath failed at "${r}" in "${t}": not a container`)}else{if(wr(r),n!==Cn){if(i[r]===n)return!1;i[r]=n}else{if(!Object.prototype.hasOwnProperty.call(i,r))return!1;delete i[r]}return!0}}}else throw Error(`setByPath failed, bad path ${t}`)}throw Error(`setByPath(${e}, ${t}, ${n}) failed`)}var Ti=Symbol("observer should be removed"),It=[],Ve=[],kn=!1,kr,Mn;function Mr(e,t,n,i){let s=ar(e);if(s===void 0)return[];let o=[];for(let r of s){let l=_(n,r);if(l!==void 0)o.push(`${e}[${r}=${l}]${i}`)}return o}var ft=(e,t)=>{if(!t.startsWith(e))return!1;if(t.length===e.length)return!0;let n=t.charAt(e.length);return n==="."||n==="["};class ds{description;test;callback;constructor(e,t){let n=typeof t==="string"?`"${t}"`:`function ${t.name}`,i;if(typeof e==="string")this.test=(s)=>typeof s==="string"&&s!==""&&(ft(s,e)||ft(e,s)),i=`test = "${e}"`;else if(e instanceof RegExp)this.test=e.test.bind(e),i=`test = "${e.toString()}"`;else if(e instanceof Function)this.test=e,i=`test = function ${e.name}`;else throw Error("expect listener test to be a string, RegExp, or test function");if(this.description=`${i}, ${n}`,typeof t==="function")this.callback=t;else throw Error("expect callback to be a path or function");It.push(this)}}var Er=()=>{if(Ae.perf)console.time("xin async update");let e=Array.from(Ve);Ve.length=0,kn=!1;let t=Mn;Mn=void 0;try{for(let n of e)It.filter((i)=>{let s;try{s=i.test(n)}catch(o){return console.error(`Listener ${i.description} threw "${o}" at "${n}"`),!1}if(s===Ti)return En(i),!1;return s}).forEach((i)=>{let s;try{s=i.callback(n)}catch(o){console.error(`Listener ${i.description} threw "${o}" handling "${n}"`)}if(s===Ti)En(i)})}finally{if(typeof t==="function")t();if(Ae.perf)console.timeEnd("xin async update")}},Ue=(e)=>{let t=typeof e==="string"?e:ce(e);if(t===void 0)throw console.error("touch was called on an invalid target",e),Error("touch was called on an invalid target");if(kn===!1)kr=new Promise((i)=>{Mn=i}),kn=setTimeout(Er);if(Ve.find((i)=>ft(i,t))==null)Ve.push(t);let n=t.match(/^(.+)\[(\d+)\](.*)$/);if(n!==null){let[,i,s,o]=n,r=parseInt(s,10),l=_(ae,`${i}[${r}]`);if(l!=null){let a=Mr(i,r,l,o);for(let c of a)if(Ve.find((d)=>ft(d,c))==null)Ve.push(c)}}},On=(e,t)=>new ds(e,t),En=(e)=>{let t=It.indexOf(e);if(t>-1)It.splice(t,1);else throw Error("unobserve failed, listener not found")},us=(e,t,{bubbles:n=!1,composed:i=!1}={})=>{let s=new Event(t,{bubbles:n,composed:i});e.dispatchEvent(s)},hs=(e)=>{if(e instanceof HTMLInputElement)return e.type;else if(e instanceof HTMLSelectElement&&e.hasAttribute("multiple"))return"multi-select";else return"other"},R=(e,t=2)=>String(e).padStart(t,"0"),Sr=(e,t)=>{switch(e){case"date":return`${t.getUTCFullYear()}-${R(t.getUTCMonth()+1)}-${R(t.getUTCDate())}`;case"month":return`${t.getUTCFullYear()}-${R(t.getUTCMonth()+1)}`;case"datetime-local":return`${t.getFullYear()}-${R(t.getMonth()+1)}-${R(t.getDate())}T${R(t.getHours())}:${R(t.getMinutes())}`;default:return t.toISOString()}},Ar=(e)=>{let t=Math.floor(e/1000),n=`${R(Math.floor(t/3600))}:${R(Math.floor(t/60)%60)}`;return t%60===0?n:`${n}:${R(t%60)}`},Tr=(e)=>{let t=e.match(/^(\d\d):(\d\d)(?::(\d\d)(?:\.(\d+))?)?$/);if(t==null)return NaN;let[,n,i,s,o]=t;return(Number(n)*60+Number(i))*60000+Number(s??0)*1000+Number(o??0)},Sn=0,Lr=()=>Sn>0,Br=(e,t)=>{Sn++;try{$r(e,t)}finally{Sn--}},$r=(e,t)=>{let n=hs(e);switch(n){case"radio":e.checked=t!=null&&e.value===String(t);break;case"checkbox":e.checked=!!t;break;case"date":case"datetime-local":case"month":case"week":{let i=e;if(t==null||t==="")i.value="";else if(t instanceof Date||typeof t==="number"){let s=t instanceof Date?t:new Date(t);if(n==="week")try{i.valueAsDate=s}catch(o){}else i.value=Sr(n,s)}else i.value=String(t);break}case"time":{let i=e;if(t==null||t==="")i.value="";else if(typeof t==="number")i.value=Ar(t);else if(t instanceof Date)i.value=`${R(t.getHours())}:${R(t.getMinutes())}:${R(t.getSeconds())}`;else i.value=String(t);break}case"multi-select":for(let i of Array.from(e.querySelectorAll("option")))i.selected=Array.isArray(t)?t.map(String).includes(i.value):t!=null?!!t[i.value]:!1;break;default:e.value=t==null?"":t}},Nr=(e)=>{switch(hs(e)){case"radio":{let t=e.parentElement?.querySelector(`[name="${e.name}"]:checked`);return t!=null?t.value:null}case"checkbox":return e.checked;case"number":case"range":{let t=e,n=typeof t.valueAsNumber==="number"?t.valueAsNumber:Number(t.value);return Number.isNaN(n)?t.value:n}case"date":case"datetime-local":case"month":case"week":{let t=e,n=t.valueAsDate??(t.value!==""?new Date(t.value):null);return n!=null&&!Number.isNaN(n.getTime())?n:t.value}case"time":{let t=e,n=typeof t.valueAsNumber==="number"?t.valueAsNumber:NaN;if(Number.isNaN(n))n=Tr(t.value);return Number.isNaN(n)?t.value:n}case"multi-select":return Array.from(e.querySelectorAll("option")).reduce((t,n)=>(t[n.value]=n.selected,t),{});default:return e.value}},{ResizeObserver:Li}=globalThis,An=Li!=null?new Li((e)=>{for(let t of e){let n=t.target;us(n,"resize")}}):{observe(){},unobserve(){}},Bi=(e,t,n=!0)=>{if(e!=null&&t!=null)if(typeof t==="string")e.textContent=t;else if(Array.isArray(t))t.forEach((i)=>{e.append(i instanceof Node&&n?ht(i):i)});else if(t instanceof Node)e.append(n?ht(t):t);else throw Error("expect text content or document node")};var Ht=(e,t=250)=>{let n,i=Date.now()-t;return function(...s){clearTimeout(n);let o=Date.now()-i;if(o>=t)i=Date.now(),e.apply(this,s);else n=setTimeout(()=>{i=Date.now(),e.apply(this,s)},t-o)}},zr=16,Or=100;function $i(e,t){let n=Array.from(e.getElementsByClassName(ve));if(e.classList.contains(ve))n.unshift(e);for(let i of n){let s=de.get(i);for(let o of s){if(o.path.startsWith("^"))o.path=`${t}${o.path.substring(1)}`;ns(o,t),is(i,o,o.path)}}}var Ni=!1;class fs{boundElement;listTop;listBottom;isNamespaced;templates;options;itemToElement;idToElement=new Map;array=[];_filteredCache;_update;_previousSlice;static filterBoundObservers=new WeakMap;constructor(e,t,n={}){if(this.boundElement=e,this.itemToElement=new WeakMap,n.idPath!=null){let l=ce(t);if(l!=null)lr(l,n.idPath)}let i=n.virtual?.itemsPerRow??1,s=Array.from(e.children).find((l)=>l instanceof HTMLTemplateElement),o=null;if(s!=null){let l=i;if(s.content.children.length<1||s.content.children.length!==l)throw Error(`ListBinding expects a template with exactly ${l} child element(s)`);this.templates=Array.from(s.content.children).map((a)=>ht(a)),o=s.nextElementSibling,s.remove()}else if(e.children.length===1)this.templates=[e.children[0]],this.templates[0].remove();else throw Error("ListBinding expects a <template> child or exactly one child element");this.options=n;let r=e.namespaceURI;if(this.isNamespaced=r==="http://www.w3.org/2000/svg"||r==="http://www.w3.org/1998/Math/MathML",this.isNamespaced)this.listTop=null,this.listBottom=null;else if(this.listTop=document.createElement("div"),this.listBottom=document.createElement("div"),this.listTop.classList.add("virtual-list-padding"),this.listBottom.classList.add("virtual-list-padding"),this.listTop.setAttribute("role","presentation"),this.listBottom.setAttribute("role","presentation"),this.listTop.setAttribute("aria-hidden","true"),this.listBottom.setAttribute("aria-hidden","true"),o!=null)this.boundElement.insertBefore(this.listTop,o),this.boundElement.insertBefore(this.listBottom,o);else this.boundElement.append(this.listTop),this.boundElement.append(this.listBottom);if(i>1){this.boundElement.classList.add("tosi-virtual-grid");let l=this.boundElement.style;if(l!=null)l.setProperty("--tosi-columns",String(i)),l.display=l.display||"grid",l.gridTemplateColumns=l.gridTemplateColumns||"repeat(var(--tosi-columns), 1fr)";if(this.listTop!=null&&this.listBottom!=null)this.listTop.style.gridColumn="1 / -1",this.listBottom.style.gridColumn="1 / -1"}if(n.virtual!=null&&!this.boundElement.getAttribute("role"))this.boundElement.setAttribute("role",i>1?"grid":"list");if(this.boundElement[Ot]=this,this.isNamespaced&&n.virtual!=null)console.warn("ListBinding: virtual scrolling is not supported in SVG/MathML containers, ignoring virtual option");if(!this.isNamespaced&&n.virtual!=null)if(An.observe(this.boundElement),this._update=Ht(()=>{this.update(this.array,!0)},zr),this.boundElement.addEventListener("resize",this._update),n.virtual.scrollContainer==="window")window.addEventListener("scroll",this._update),window.addEventListener("resize",this._update);else this.boundElement.addEventListener("scroll",this._update)}filteredArray(){if(this._filteredCache!=null)return this._filteredCache;let{hiddenProp:e,visibleProp:t}=this.options,n=this.array;if(e!==void 0)n=n.filter((i)=>i[e]!==!0);if(t!==void 0)n=n.filter((i)=>i[t]===!0);if(this.options.filter&&this.needle!==void 0)n=this.options.filter(n,this.needle);return this._filteredCache=n,n}visibleSlice(){let{virtual:e}=this.options,t=this.filteredArray(),n=0,i=t.length-1,s=0,o=0;if(e!=null&&this.boundElement instanceof HTMLElement){let r=this.boundElement.offsetWidth,l=e.scrollContainer==="window",a,c;if(l){a=window.innerHeight;let h=this.boundElement.getBoundingClientRect();c=Math.max(0,-h.top)}else a=this.boundElement.offsetHeight,c=this.boundElement.scrollTop;let d=e.width!=null?Math.max(1,Math.floor(r/e.width)):e.visibleColumns??1,u=Math.ceil(t.length/d);if(e.minHeight!=null){let h=e.minHeight,f=Math.ceil(a/h)+(e.rowChunkSize||1),p=d*f,b=u*h,v=Math.max(0,b-a),G=v>0?Math.min(1,Math.max(0,c/v)):0,Q=Math.max(0,u-f+1),ke=G*Q,X=Math.floor(ke);if(e.rowChunkSize)X-=X%e.rowChunkSize;return n=X*d,i=n+p-1,s=c,o=Math.max(0,b-c-a),{items:t,firstItem:n,lastItem:i,topBuffer:s,bottomBuffer:o,interpolation:{t:G,position:ke,scrollTop:c,viewportHeight:a,totalScrollHeight:b,rowHeight:e.height}}}else{let h=Math.ceil(a/e.height)+(e.rowChunkSize||1),f=d*h,p=Math.floor(c/e.height);if(p>u-h+1)p=Math.max(0,u-h+1);if(e.rowChunkSize)p-=p%e.rowChunkSize;n=p*d,i=n+f-1,s=p*e.height,o=Math.max((u-h)*e.height-s,0)}}return{items:t,firstItem:n,lastItem:i,topBuffer:s,bottomBuffer:o}}needle;filter=Ht((e)=>{if(this.needle!==e)this.needle=e,this.update(this.array)},Or);update(e,t){if(e==null)e=[];if(this.array=e,!t)this._filteredCache=void 0;let{hiddenProp:n,visibleProp:i}=this.options,s=ce(e),o=this.visibleSlice();if(this.boundElement.classList.toggle("-xin-empty-list",o.items.length===0),this.options.virtual!=null)this.boundElement.setAttribute("aria-rowcount",String(o.items.length));let r=this._previousSlice,{firstItem:l,lastItem:a,topBuffer:c,bottomBuffer:d}=o,u=n===void 0&&i===void 0&&t===!0&&r!=null&&l===r.firstItem&&a===r.lastItem;if(u&&o.interpolation==null&&c===r.topBuffer&&d===r.bottomBuffer)return;if(u&&o.interpolation!=null){this._updateInterpolatedBuffers(o);return}this._previousSlice=o;let h=0,f=0,p=0,{idPath:b}=this.options,v=this.options.virtual?.itemsPerRow??1,G;if(b!=null){G=new Set;for(let A=l;A<=a;A++){let S=o.items[A];if(S!==void 0)G.add(String(S[b]))}}let Q=new Set;for(let A of Array.from(this.boundElement.children)){if(A===this.listTop||A===this.listBottom)continue;let S=A[qe];if(S==null)continue;else if(S===!0)A.remove(),h++;else{if(Q.has(S))continue;let T;if(b!=null)T=!G.has(String(S[b]));else{let z=o.items.indexOf(S);T=z<l||z>a}if(T){Q.add(S);let z=this.itemToElement.get(S);if(z!=null)for(let M of z)M.remove();else A.remove();if(this.itemToElement.delete(S),b!=null)this.idToElement.delete(String(S[b]));h++}}}if(this.listTop!=null&&this.listBottom!=null)this.listTop.style.height=String(c)+"px",this.listBottom.style.height=String(d)+"px";let ke=[],X=b!=null?new Set:null;for(let A=l;A<=a;A++){let S=o.items[A];if(S===void 0)continue;if(X!=null&&b!=null){let z=String(S[b]);if(X.has(z)){if(!Ni)Ni=!0,console.error(`tosijs list binding: duplicate idPath value "${z}" (idPath: "${b}"). `+"id-path values must be unique — items sharing an id collapse to a single "+"row and updates target the wrong item. Warned once per session.")}else X.add(z)}let T=this.itemToElement.get(B(S));if(T==null&&b!=null){let z=String(S[b]);if(T=this.idToElement.get(z),T!=null){let M=B(S);this.itemToElement.set(M,T);for(let ee of T)ee[qe]=M}}if(T==null){p++;let z=B(S);if(T=this.templates.map((M)=>ht(M)),typeof S==="object")this.itemToElement.set(z,T);for(let M of T)M[qe]=typeof S==="object"?z:!0;for(let M of T)if(this.listBottom!=null)this.boundElement.insertBefore(M,this.listBottom);else this.boundElement.append(M);if(b!=null){let M=S[b],ee=`${s}[${b}=${M}]`;for(let Lo of T)$i(Lo,ee);this.idToElement.set(String(M),T)}else{let M=`${s}[${A}]`;for(let ee of T)$i(ee,M)}}if(this.options.virtual!=null){let z=String(A+1);if(v>1)for(let M=0;M<T.length;M++){let ee=T[M];ee.setAttribute("role","gridcell"),ee.setAttribute("aria-rowindex",z),ee.setAttribute("aria-colindex",String(M+1))}else for(let M of T)M.setAttribute("role","listitem"),M.setAttribute("aria-rowindex",z)}ke.push(...T)}let xt=this.listTop;for(let A of ke){if(A.previousElementSibling!==xt)if(f++,xt?.nextElementSibling!=null)this.boundElement.insertBefore(A,xt.nextElementSibling);else if(this.listBottom!=null)this.boundElement.insertBefore(A,this.listBottom);else this.boundElement.append(A);xt=A}if(o.interpolation!=null)this._updateInterpolatedBuffers(o);if(Ae.perf)console.log(s,"updated",{removed:h,created:p,moved:f})}_updateInterpolatedBuffers(e){let{t,position:n,scrollTop:i,viewportHeight:s,totalScrollHeight:o,rowHeight:r}=e.interpolation,l=0;for(let u of Array.from(this.boundElement.children)){if(u===this.listTop||u===this.listBottom)continue;l+=u.offsetHeight||r}let a=i,c=i+s-l,d=Math.max(0,t*c+(1-t)*a-n%1*r);if(this.listTop!=null&&this.listBottom!=null)this.listTop.style.height=String(d)+"px",this.listBottom.style.height=String(Math.max(0,o-d-l))+"px"}}var Dr=(e,t,n)=>{let i=e[Ot];if(t&&i===void 0)i=new fs(e,t,n),e[Ot]=i;return i},Ir=(e)=>{let t;while(!(t=e[qe])&&e&&e.parentElement)e=e.parentElement;return t?{element:e,item:t}:void 0},Hr=(e)=>{let t=Ir(e);return t?t.item:void 0};var{document:pt,MutationObserver:zi}=globalThis,ps=(e,t)=>{let n=de.get(e);if(n==null)return;for(let i of n){let{binding:s}=i,{path:o}=i,{toDOM:r}=s;if(r!=null){if(o.startsWith("^")){let l=Hr(e);if(l!=null&&l[U]!=null){let a=l[U];o=i.path=`${a}${o.substring(1)}`,ns(i,a)}else{if(e instanceof HTMLElement)console.warn(`Unresolved relative binding "${o}" —`,e,"is not part of a list. If this is a list template, wrap it in a <template>.");continue}}if(t==null||ft(t,o))is(e,i,o)}}},Oi=new Set;function gs(e,t,n){let i=`${e}:${t.tagName}:${n?.message??n}`;if(Oi.has(i))return;Oi.add(i),console.error(`tosijs: a binding threw while ${e} this element; the rest of the `+"pass continued. (Reported once per element type and message — fix the "+"binding, the transform, or the state it reads.)",t,n)}function jr(e){Nn();let t=Array.from(e.getElementsByClassName(ve));if(e.classList.contains(ve))t.unshift(e);t.forEach((n)=>{try{ps(n)}catch(i){gs("hydrating",n,i)}})}if(zi!=null)new zi((e)=>{e.forEach((t)=>{Array.from(t.addedNodes).forEach((n)=>{if(n instanceof Element)jr(n)})})}).observe(pt.body,{subtree:!0,childList:!0});On(()=>!0,(e)=>{if(globalThis.document==null)return;let t=Array.from(pt.getElementsByClassName(ve));for(let n of t)try{ps(n,e)}catch(i){gs("updating",n,i)}});var ms=(e)=>{let t=e.composed&&e.composedPath!=null?e.composedPath()[0]:e.target;return t instanceof Element?t:null},Tn=(e,t)=>{while(e!=null){let n=e.closest(t);if(n!=null)return n;let i=e.getRootNode();e=typeof ShadowRoot<"u"&&i instanceof ShadowRoot?i.host:null}return null},Rr=(e,t)=>{if(e.parentElement!=null)return Tn(e.parentElement,t);let n=e.getRootNode();if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot)return Tn(n.host,t);return null},ys=(e)=>{if(e.parentElement!=null)return e.parentElement;let t=e.getRootNode();return typeof ShadowRoot<"u"&&t instanceof ShadowRoot?t.host:null},Di=(e)=>{while(e!=null&&!We.has(e))e=ys(e);return e},Ii=(e)=>{let t=Tn(ms(e),xn);while(t!=null){let n=de.get(t);for(let i of n??[]){let{binding:s,path:o}=i,{fromDOM:r}=s;if(r!=null){let l;try{l=r(t,i.options)}catch(a){throw console.error("Cannot get value from",t,"via",i),Error("Cannot obtain value fromDOM",{cause:a})}if(l!=null){let a=Bn(),c=a[o];if(c==null)a[o]=l;else{let d=c[U]!=null?c[Te]:c,u=l[U]!=null?l[Te]:l;if(typeof d==="number"&&typeof u==="string"){let h=u.trim();if(h!==""){let f=Number(h);if(!Number.isNaN(f))u=f}}else if(u instanceof Date){if(typeof d==="number")u=u.getTime();else if(typeof d==="string")u=t.value}if(d instanceof Date&&u instanceof Date?d.getTime()!==u.getTime():d!==u)a[o]=u}}}}t=Rr(t,xn)}};if(globalThis.document!=null)pt.body.addEventListener("change",Ii,!0),pt.body.addEventListener("input",Ii,!0);function _r(e,t,n,i){let{paths:s,transform:o}=t,{toDOM:r}=n;if(r==null)return e;e.classList?.add(ve);let l=de.get(e);if(l==null)l=[],de.set(e,l),Nn();let a={paths:[...s],transform:o};for(let c of a.paths)l.push({path:c,binding:n,options:i,take:a});if(!s[0].startsWith("^"))Ue(s[0]);return e}var Hi=!1,Pr=(e,t)=>{if(Hi)return;if(typeof ShadowRoot<"u"&&e.getRootNode!=null&&e.getRootNode()instanceof ShadowRoot)Hi=!0,console.warn(`tosijs: ${t} targets an element inside a shadow root, where data bindings do not operate (documented Component design boundary). A shadow-DOM component is bound like an <input>: bind its VALUE from outside (bindings.value) and implement render() to reflect value into the shadow DOM. Warned once per session.`,e)};function me(e,t,n,i){if(e instanceof DocumentFragment)throw Error("bind cannot bind to a DocumentFragment");if(Pr(e,"bind()"),t!=null&&typeof t==="object"&&t[$n])return _r(e,t,n,i);let s;if(typeof t==="object"&&t[U]===void 0&&i===void 0){let{value:l}=t;s=typeof l==="string"?l:l[U],i={...t},delete i.value}else s=typeof t==="string"?t:t[U];if(s==null)throw Error("bind requires a path or object with xin Proxy");let{toDOM:o}=n;e.classList?.add(ve);let r=de.get(e);if(r==null)r=[],de.set(e,r),Nn();if(r.push({path:s,binding:n,options:i}),o!=null&&!s.startsWith("^"))Ue(s);if(i?.filter&&i?.needle)me(e,i.needle,{toDOM(l,a){l[Ot]?.filter(a)}});return e}var ji=new Set,Vr=(e)=>{let t=Di(ms(e)),n=!1,i=new Proxy(e,{get(o,r){if(r==="stopPropagation")return()=>{e.stopPropagation(),n=!0};else{let l=o[r];return typeof l==="function"?l.bind(o):l}}}),s=new Set;while(!n&&t!=null){let o=We.get(t)?.[e.type]??s;for(let r of o){if(typeof r==="function")r(i);else{let l=Bn()[r];if(typeof l==="function")l(i);else throw Error(`no event handler found at path ${r}`)}if(n)continue}t=Di(ys(t))}};function Dn(e,t,n){let i=ce(n);if(i!=null)n=i;let s=We.get(e);if(s==null)s={},We.set(e,s);if(!s[t])s[t]=new Set;if(s[t].add(n),!ji.has(t))ji.add(t),pt.body.addEventListener(t,Vr,!0);return()=>{s[t].delete(n)}}er(me,Dn);var jt={value:{toDOM:Br,fromDOM(e){return Nr(e)}},text:{toDOM(e,t){e.textContent=t}},enabled:{toDOM(e,t){e.disabled=!t}},disabled:{toDOM(e,t){e.disabled=Boolean(t)}},list:{toDOM(e,t,n){Dr(e,t,n).update(t)}}},qa=180/Math.PI,Wa=Math.PI/180;function se(e,t,n){return n<e?NaN:t<e?e:t>n?n:t}function Me(e,t,n,i=!0){if(i)n=se(0,n,1);return n*(t-e)+e}function Fr(e,t=document.body){let n=getComputedStyle(t);if(e.endsWith(")")&&e.startsWith("var("))e=e.slice(4,-1);return n.getPropertyValue(e).trim()}var qr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Wr=(e,t,n)=>(0.299*e+0.587*t+0.114*n)/255,Ee=(e)=>("00"+Math.round(Number(e)).toString(16)).slice(-2);class vs{h;s;l;constructor(e,t,n){e/=255,t/=255,n/=255;let i=Math.max(e,t,n),s=i-Math.min(e,t,n),o=s!==0?i===e?(t-n)/s:i===t?2+(n-e)/s:4+(e-t)/s:0;this.h=60*o<0?60*o+360:60*o,this.s=s!==0?i<=0.5?s/(2*i-s):s/(2-(2*i-s)):0,this.l=(2*i-s)/2}}var ge=globalThis.document!==void 0?globalThis.document.createElement("span"):void 0;if(ge)ge.style.display="none";class g{r;g;b;a;static fromVar(e,t=document.body){return g.fromCss(Fr(e,t))}static fromCss(e){let t=qr[String(e).trim().toLowerCase()];if(t!==void 0)e=t;let n=e.match(/^#([0-9a-fA-F]+)$/);if(n){let c=n[1],d=(u,h)=>parseInt(c.slice(u,u+h),16);if(c.length===3||c.length===4){let u=(h)=>d(h,1)*17;return new g(u(0),u(1),u(2),c.length===4?u(3)/255:1)}if(c.length===6||c.length===8)return new g(d(0,2),d(2,2),d(4,2),c.length===8?d(6,2)/255:1)}let i=e;if(ge instanceof HTMLSpanElement)ge.style.color="black",ge.style.color=e,document.body.appendChild(ge),i=getComputedStyle(ge).color,ge.remove();let[s,o,r,l]=i.match(/[\d.]+/g)||["0","0","0","0"],a=i.startsWith("color(srgb")?255:1;return new g(Number(s)*a,Number(o)*a,Number(r)*a,l==null?1:Number(l))}static fromHsl(e,t,n,i=1){let s,o,r;if(t===0)s=o=r=n;else{let a=(h,f,p)=>{if(p<0)p+=1;if(p>1)p-=1;if(p<0.16666666666666666)return h+(f-h)*6*p;if(p<0.5)return f;if(p<0.6666666666666666)return h+(f-h)*(0.6666666666666666-p)*6;return h},c=n<0.5?n*(1+t):n+t-n*t,d=2*n-c,u=(e%360+360)%360/360;s=a(d,c,u+0.3333333333333333),o=a(d,c,u),r=a(d,c,u-0.3333333333333333)}let l=new g(s*255,o*255,r*255,i);return l.hslCached={h:(e%360+360)%360,s:t,l:n},l}static black=new g(0,0,0);static white=new g(255,255,255);constructor(e,t,n,i=1){this.r=se(0,e,255),this.g=se(0,t,255),this.b=se(0,n,255),this.a=se(0,i,1)}get inverse(){return new g(255-this.r,255-this.g,255-this.b,this.a)}get inverseLuminance(){let{h:e,s:t,l:n}=this._hsl;return g.fromHsl(e,t,1-n,this.a)}get opaque(){return this.a===1?this:new g(this.r,this.g,this.b,1)}contrasting(e=1){return this.opaque.blend(this.brightness>0.5?g.black:g.white,e)}get rgb(){let{r:e,g:t,b:n}=this;return`rgb(${e.toFixed(0)},${t.toFixed(0)},${n.toFixed(0)})`}get rgba(){let{r:e,g:t,b:n,a:i}=this;return`rgba(${e.toFixed(0)},${t.toFixed(0)},${n.toFixed(0)},${i.toFixed(2)})`}get RGBA(){return[this.r/255,this.g/255,this.b/255,this.a]}get ARGB(){return[this.a,this.r/255,this.g/255,this.b/255]}hslCached;get _hsl(){if(this.hslCached==null)this.hslCached=new vs(this.r,this.g,this.b);return this.hslCached}get hsl(){let{h:e,s:t,l:n}=this._hsl;return`hsl(${e.toFixed(0)}deg ${(t*100).toFixed(0)}% ${(n*100).toFixed(0)}%)`}get hsla(){let{h:e,s:t,l:n}=this._hsl;return`hsl(${e.toFixed(0)}deg ${(t*100).toFixed(0)}% ${(n*100).toFixed(0)}% / ${(this.a*100).toFixed(0)}%)`}get mono(){let e=this.brightness*255;return new g(e,e,e)}get brightness(){return Wr(this.r,this.g,this.b)}get html(){return this.toString()}toString(){return this.a===1?"#"+Ee(this.r)+Ee(this.g)+Ee(this.b):"#"+Ee(this.r)+Ee(this.g)+Ee(this.b)+Ee(255*this.a)}brighten(e){let{h:t,s:n,l:i}=this._hsl,s=se(0,i+e*(1-i),1);return g.fromHsl(t,n,s,this.a)}darken(e){let{h:t,s:n,l:i}=this._hsl,s=se(0,i*(1-e),1);return g.fromHsl(t,n,s,this.a)}saturate(e){let{h:t,s:n,l:i}=this._hsl,s=se(0,n+e*(1-n),1);return g.fromHsl(t,s,i,this.a)}desaturate(e){let{h:t,s:n,l:i}=this._hsl,s=se(0,n*(1-e),1);return g.fromHsl(t,s,i,this.a)}rotate(e){let{h:t,s:n,l:i}=this._hsl,s=(t+360+e)%360;return g.fromHsl(s,n,i,this.a)}opacity(e){let{h:t,s:n,l:i}=this._hsl;return g.fromHsl(t,n,i,e)}swatch(){return console.log(`%c %c ${this.html}, ${this.rgba}`,`background-color: ${this.html}`,"background-color: transparent"),this}blend(e,t){return new g(Me(this.r,e.r,t),Me(this.g,e.g,t),Me(this.b,e.b,t),Me(this.a,e.a,t))}static blendHue(e,t,n){let i=(t-e+720)%360;if(i<180)return e+n*i;else return e-(360-i)*n}mix(e,t){let n=this._hsl,i=e._hsl;return g.fromHsl(n.s===0?i.h:i.s===0?n.h:g.blendHue(n.h,i.h,t),Me(n.s,i.s,t),Me(n.l,i.l,t),Me(this.a,e.a,t))}colorMix(e,t){return g.fromCss(`color-mix(in hsl, ${this.html}, ${e.html} ${(t*100).toFixed(0)}%)`)}static computedColorStylesheet=null;static computedColors=new Map;static recomputeQueued=!1;static registerComputedColor(e,t,n,i){if(!g.computedColors.has(e))g.computedColors.set(e,{varName:t,scale:n,method:i}),g.queueRecompute()}static queueRecompute(){if(g.recomputeQueued)return;g.recomputeQueued=!0,queueMicrotask(()=>{g.recomputeQueued=!1,g.recomputeColors()})}static recomputeColors(){if(g.computedColors.size===0)return;let e=[];for(let[n,{varName:i,scale:s,method:o}]of g.computedColors)try{let r=g.fromVar(i),l;switch(o){case"b":l=s>0?r.brighten(s):r.darken(-s);break;case"s":l=s>0?r.saturate(s):r.desaturate(-s);break;case"h":l=r.rotate(s*100);break;case"o":l=r.opacity(s);break;default:continue}e.push(` ${n}: ${l.rgba};`)}catch(r){}if(e.length===0)return;let t=`:root {
|
|
1
|
+
(()=>{var{defineProperty:Xt,getOwnPropertyNames:$o,getOwnPropertyDescriptor:No}=Object,zo=Object.prototype.hasOwnProperty;function Oo(e){return this[e]}var Do=(e)=>{var t=(vi??=new WeakMap).get(e),n;if(t)return t;if(t=Xt({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var i of $o(e))if(!zo.call(t,i))Xt(t,i,{get:Oo.bind(e,i),enumerable:!(n=No(e,i))||n.enumerable})}return vi.set(e,t),t},vi;var Io=(e)=>e;function Ho(e,t){this[e]=Io.bind(null,t)}var jo=(e,t)=>{for(var n in t)Xt(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Ho.bind(t,n)})};var Ta={};jo(Ta,{DEL_TAG:()=>K,FOOTNOTE_TAG:()=>Re,INS_TAG:()=>he,MAX_DIFF_TOKENS:()=>Kn,MENU_CLASS:()=>vo,MISSPELLING_TAG:()=>Ft,NON_PROSE_SELECTOR:()=>ei,Selectable:()=>st,TosiDel:()=>Xn,TosiFootnote:()=>tn,TosiIns:()=>Gn,TosiMisspelling:()=>ti,TosijsStyledEditor:()=>yi,acceptChange:()=>Jn,allowSelection:()=>Jt,applyRevision:()=>Qn,blockIsEmpty:()=>it,caretGeometryAt:()=>Et,cellAbove:()=>Tt,cellBelow:()=>At,cellIndex:()=>lt,cellOf:()=>J,changeId:()=>Ne,changesIn:()=>Yn,characterAtPoint:()=>ne,characterStyleWidgets:()=>ui,checkSpelling:()=>ii,clearMisspellings:()=>yt,closestSingleParentAncestor:()=>Mt,colOfCell:()=>Pe,commandButton:()=>I,commands:()=>dt,createCell:()=>se,createTable:()=>rn,debugWidget:()=>Eo,defaultMenubar:()=>gi,defaultToolbar:()=>pi,defineChanges:()=>Ge,defineFootnote:()=>ot,defineMisspelling:()=>qt,diffWords:()=>qs,executeCommand:()=>dn,firstLeafNode:()=>tt,fontFamilyMenu:()=>wo,fontSizeMenu:()=>Co,getCellsInCol:()=>on,getCellsInRow:()=>V,getColumnCount:()=>O,getColumnWidths:()=>St,getRowCount:()=>Bt,insertMenu:()=>So,isBefore:()=>kt,isHeaderCell:()=>at,isProseText:()=>Wt,isSafeNavigationUrl:()=>Ie,isTableCell:()=>Yo,justificationMenu:()=>xo,lastLeafNode:()=>nt,leafNodes:()=>je,lineSpacingMenu:()=>ko,localePickerWidget:()=>di,makeCSS:()=>an,makeFilter:()=>He,minimalToolbar:()=>fi,nextCell:()=>Lt,nextLeafNode:()=>F,paragraphStyleMenu:()=>bo,paragraphStyleWidgets:()=>Mo,prevCell:()=>sn,previousLeafNode:()=>q,rejectChange:()=>Zn,renumberFootnotes:()=>rt,rowOfCell:()=>ie,runCommand:()=>cn,safeAttributeValue:()=>Z,sanitizeInPlace:()=>Ct,setColumnWidths:()=>_e,siblingOrder:()=>Wo,spanify:()=>k,stickySelectionBounds:()=>Ci,tableMenu:()=>Ao,tableOf:()=>P,tokenize:()=>Un,toolbarSpacer:()=>ze,topSingleParentAncestor:()=>Y,tosijsStyledEditor:()=>Aa,undoRedoWidgets:()=>hi,version:()=>Lo,wordsIn:()=>ni});function Yt(e){return e.replace(/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,"").replace(/[\u0000-\u001f\u007f]/g,"")}function wi(e){let t=Yt(e);if(!/^[a-z][a-z0-9+.-]*:/i.test(t))return!0;if(/^data:image\/(png|jpeg|jpg|gif|webp|avif|bmp|svg\+xml);/i.test(t))return!/^data:image\/svg/i.test(t);return/^(https?|mailto|tel):/i.test(t)}var Ro=new Set(["script","iframe","object","embed","link","meta","base","style","form","noscript","template","animate","animatetransform","animatemotion","set"]),_o=["href","src","srcset","xlink:href","action","formaction","ping","poster","background","cite","data","longdesc","profile","usemap","manifest"],Po=/^(javascript|vbscript|livescript|mocha|data:text\/html)/i,Vo=new Set(["ping"]),bi=Object.getOwnPropertyDescriptor(Element.prototype,"localName")?.get,xi=Object.getOwnPropertyDescriptor(Element.prototype,"attributes")?.get;function Fo(e){return bi?bi.call(e):e.localName}function qo(e){return xi?xi.call(e):e.attributes}function Ct(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),n=[],i;while(i=t.nextNode()){let s=i,o=String(Fo(s)??"").toLowerCase();if(Ro.has(o)){n.push(s);continue}for(let r of Array.from(qo(s)??[])){let l=r.name.toLowerCase();if(l.startsWith("on")){s.removeAttribute(r.name);continue}if(Vo.has(l)){s.removeAttribute(r.name);continue}let a=Yt(r.value);if(Po.test(a)){s.removeAttribute(r.name);continue}if(_o.includes(l)&&!wi(r.value))s.removeAttribute(r.name)}}for(let s of n)s.remove()}function Ie(e){return wi(e)&&!/^data:/i.test(Yt(e))}function He(e){if(typeof e==="function")return e;if(typeof e==="string"){let t=e;return(n)=>n.nodeType===1&&n.matches(t)}return()=>!0}function kt(e,t){return(e.compareDocumentPosition(t)&4)!==0}function Wo(e){let t=e.parentNode;if(!t)return-1;let n=t.childNodes;for(let i=0;i<n.length;i++)if(n[i]===e)return i;return-1}function tt(e){while(e.firstChild)e=e.firstChild;return e}function nt(e){while(e.lastChild)e=e.lastChild;return e}function F(e,t,n){let i=n!==void 0?He(n):null,s=e;while(s){if(s.nextSibling){let o=tt(s.nextSibling);if(!i||i(o))return o;s=o;continue}if(s.parentNode&&s.parentNode!==(t||null)){s=s.parentNode;continue}break}return null}function q(e,t,n){let i=n!==void 0?He(n):null,s=e;while(s){if(s.previousSibling){let o=nt(s.previousSibling);if(!i||i(o))return o;s=o;continue}if(s.parentNode&&s.parentNode!==(t||null)){s=s.parentNode;continue}break}return null}function je(e,t){let n=[],i=t!==void 0?He(t):null;function s(o){if(!o.firstChild){if(!i||i(o))n.push(o)}else for(let r=0;r<o.childNodes.length;r++)s(o.childNodes[r])}return s(e),n}function Y(e,t){let n=He(t);while(e.parentNode&&e.parentNode.childNodes.length===1&&n(e.parentNode))e=e.parentNode;return e}function Mt(e,t){let n=He(t),i=e.parentNode;while(i){if(n(i))return i;if(!i.parentNode||i.parentNode.childNodes.length!==1)break;i=i.parentNode}return null}function Jt(e,t){e.style.userSelect=t?"text":"none",e.style.webkitUserSelect=t?"text":"none"}function Uo(e){if(e.nodeType!==3||!e.textContent)return!1;let t=e.parentElement;if(!t)return!1;return!t.closest(".not-selectable, .do-not-spanify, .not-editable")}function ne(e,t,n){let i=[],s=(h)=>{if(Uo(h)){i.push(h);return}for(let f of Array.from(h.childNodes))s(f)};if(s(e),i.length===0)return null;let o=document.createRange(),r=1/0,l=[];for(let h of i){o.selectNodeContents(h);let f=o.getBoundingClientRect();if(f.width===0&&f.height===0)continue;let p=n<f.top?f.top-n:n>f.bottom?n-f.bottom:0;if(l.push({node:h,dy:p}),p<r)r=p}if(l.length===0)return null;let a=l.filter((h)=>h.dy<=r+2).map((h)=>h.node),c=null,d=1/0,u=(h)=>{let f=h.parentElement;return!!f&&getComputedStyle(f).direction==="rtl"};for(let h of a){let f=h.textContent||"",p=u(h);for(let b=0;b<f.length;b++){o.setStart(h,b),o.setEnd(h,b+1);let v=o.getBoundingClientRect();if(v.width===0&&v.height===0)continue;let G=n<v.top?v.top-n:n>v.bottom?n-v.bottom:0,ee=t<v.left?v.left-t:t>v.right?t-v.right:0,Me=Math.abs(t-(v.left+v.right)/2),X=G*1000+ee+Me/1000;if(X<d)d=X,c={node:h,offset:b,rect:v,after:p?t-v.left<v.width/2:t-v.left>=v.width/2}}}return c}function Et(e,t){let n=(c)=>{let d=c;while(d){if(d.nodeType===3&&d.data.length>0)return d;d=F(d,t)}return null},i=(c)=>{let d=c;while(d){if(d.nodeType===3&&d.data.length>0)return d;d=q(d,t)}return null},s=(c,d)=>{let u=document.createRange();u.setStart(c,d),u.collapse(!0);let h=u.getBoundingClientRect();return h.height?{left:h.left,top:h.top,height:h.height}:null},o=n(F(e,t));if(o){let c=s(o,0);if(c)return c}let r=i(q(e,t));if(r){let c=s(r,r.data.length);if(c)return c}let l=getComputedStyle(e.parentElement||e).direction==="rtl",a=document.createRange();if(o){a.setStart(o,0),a.setEnd(o,1);let c=a.getBoundingClientRect();if(c.height)return{left:l?c.right:c.left,top:c.top,height:c.height}}if(r){a.setStart(r,r.data.length-1),a.setEnd(r,r.data.length);let c=a.getBoundingClientRect();if(c.height)return{left:l?c.left:c.right,top:c.top,height:c.height}}return null}var Ko=new Set(["a","b","i","u","s","em","strong","span","font","sub","sup","small","big","mark","abbr","cite","q","time","bdi","bdo","ruby","del","ins","strike","tt","var","wbr","rt","rp","code","kbd","samp","dfn","output","data","nobr","acronym"]);function it(e){if(e.textContent?.trim())return!1;for(let t of Array.from(e.querySelectorAll("*"))){if(t.matches(".sel-start, .sel-end, .caret"))continue;if(!Ko.has(t.localName))return!1}return!0}function Zt(e){let t=Intl.Segmenter;if(!t)return Array.from(e);let n=new t(void 0,{granularity:"grapheme"});return Array.from(n.segment(e),(i)=>i.segment)}function Qt(e,t){let n=Intl.Segmenter;if(n){let o=new n(void 0,{granularity:"word"});for(let r of o.segment(e)){let l=r.index+r.segment.length;if(t>=r.index&&t<l)return{start:r.index,end:l}}return{start:t,end:t}}let i=t,s=t;while(i>0&&!/\s/.test(e[i-1]))i--;while(s<e.length&&!/\s/.test(e[s]))s++;return{start:i,end:s}}function Ci(e,t,n){let i=Qt(e,t);if(n>=i.start&&n<=i.end)return n<t?{start:n,end:t}:{start:t,end:n};let s=Qt(e,n),o=(l)=>{let a=l;while(a>0&&/\s/.test(e[a-1]))a--;return a},r=(l)=>{let a=l;while(a<e.length&&/\s/.test(e[a]))a++;return a};return n<t?{start:r(s.start),end:i.end}:{start:i.start,end:o(s.end)}}function Go(e){return e.nodeType===3&&!e.parentElement?.closest(".do-not-spanify")}function k(e,t,n=!1){if(t){let i=je(e,Go);for(let s of i){let o=s.textContent||"",r;if(n)r=o.match(/\s+|\w+|[^\w\s]+/g)||[o];else r=Zt(o);if(r.length<=1&&Zt(o).length<=1)continue;let l=s.parentNode;if(!l)continue;if(l instanceof Element)l.classList.remove("spanified");let a=document.createDocumentFragment();for(let c of r){if(/^\s+$/.test(c)){a.appendChild(document.createTextNode(c));continue}if(Zt(c).length>1){let d=document.createElement("span");d.className="spanified-word",d.textContent=c,k(d,!0,!1),a.appendChild(d)}else{let d=document.createElement("span");d.className="spanified",d.textContent=c,a.appendChild(d)}}l.replaceChild(a,s)}}else{let i=Array.from(e.querySelectorAll(".spanified-word"));for(let o of i){let r=o.parentNode;if(r){while(o.firstChild)r.insertBefore(o.firstChild,o);r.removeChild(o)}}let s=Array.from(e.querySelectorAll(".spanified"));for(let o of s){let r=o.parentNode;if(r){while(o.firstChild)r.insertBefore(o.firstChild,o);r.removeChild(o)}}e.normalize()}}class st{root;selecting=!1;touchMode=!1;constructor(e){this.root=e,this.setup()}lastHovered=null;dragAnchor=null;pendingCollapse=null;setup(){Jt(this.root,!1),this.root.addEventListener("mousemove",this.handleMouseMove),this.root.addEventListener("mousedown",this.handleMouseDown),this.root.addEventListener("mouseup",this.handleMouseUp),this.root.addEventListener("mouseleave",this.handleMouseLeave),this.root.addEventListener("touchstart",this.handleTouchStart,{passive:!1}),this.root.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.root.addEventListener("touchend",this.handleTouchEnd,{passive:!1})}destroy(){this.root.removeEventListener("mousemove",this.handleMouseMove),this.root.removeEventListener("mousedown",this.handleMouseDown),this.root.removeEventListener("mouseup",this.handleMouseUp),this.root.removeEventListener("mouseleave",this.handleMouseLeave),this.root.removeEventListener("touchstart",this.handleTouchStart),this.root.removeEventListener("touchmove",this.handleTouchMove),this.root.removeEventListener("touchend",this.handleTouchEnd)}handleMouseMove=(e)=>{let t=e.target;if(t.closest(".not-selectable")||t.classList.contains("not-selectable"))return;if(this.lastHovered&&this.lastHovered!==t){let n=this.topLevelAncestor(this.lastHovered),i=this.topLevelAncestor(t);if(n&&n!==i&&!n.classList.contains("selected-block"))k(n,!1)}if(t instanceof Element&&t!==this.root)this.lastHovered=t;if(this.selecting){let n=ne(this.root,e.clientX,e.clientY),i=this.find(".sel-end");if(n&&i){if(!this.extendSticky(n)){let s=document.createRange();s.setStart(n.node,n.after?n.offset+1:n.offset),s.collapse(!0),s.insertNode(i),this.root.normalize()}this.extendSelection(),this.onBoundsChanged?.()}}e.preventDefault(),e.stopPropagation()};placeCaretAt(e,t){let n=ne(this.root,e,t);if(!n)return;this.removeBounds();let i=document.createRange();i.setStart(n.node,n.after?n.offset+1:n.offset),i.collapse(!0),i.insertNode(this.createBounds()),this.root.normalize(),this.onBoundsChanged?.()}textIndexOf(e){let t=[],n="",i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),s;while(s=i.nextNode()){let o=s;t.push({node:o,start:n.length}),n+=o.data}return{text:n,locate:(o)=>{for(let r=t.length-1;r>=0;r--)if(o>=t[r].start)return{node:t[r].node,offset:o-t[r].start};return null},indexOf:(o,r)=>{let l=t.find((a)=>a.node===o);return l?l.start+r:null}}}extendSticky(e){let t=this.dragAnchor;if(this.selecting!==1||!t)return!1;let n=this.topLevelAncestor(e.node);if(!n||n!==t.block)return!1;let i=this.textIndexOf(n),s=i.indexOf(e.node,e.after?e.offset+1:e.offset);if(s===null)return!1;let{start:o,end:r}=Ci(i.text,t.index,s),l=i.locate(o),a=i.locate(r);if(!l||!a)return!1;let c=this.find(".sel-start"),d=this.find(".sel-end");if(!c||!d)return!1;let u=document.createRange();u.setStart(a.node,Math.min(a.offset,a.node.length)),u.collapse(!0),u.insertNode(d);let h=document.createRange();return h.setStart(l.node,Math.min(l.offset,l.node.length)),h.collapse(!0),h.insertNode(c),this.root.normalize(),!0}selectWordAt(e,t){let n=this.topLevelAncestor(e)||this.root,i=this.textIndexOf(n),s=i.indexOf(e,t);if(s===null)return;let{start:o,end:r}=Qt(i.text,s),l=i.locate,a=l(o),c=l(r);if(!a||!c)return;this.removeBounds();let d=document.createElement("span");d.className="sel-start";let u=document.createElement("span");u.className="sel-end caret";let h=document.createRange();h.setStart(c.node,Math.min(c.offset,c.node.length)),h.collapse(!0),h.insertNode(u);let f=document.createRange();f.setStart(a.node,Math.min(a.offset,a.node.length)),f.collapse(!0),f.insertNode(d),this.onBoundsChanged?.()}handleMouseDown=(e)=>{this.touchMode=!1;let t=e.target;if(t.closest(".not-selectable")||t.classList.contains("not-selectable"))return;if(e.detail===1&&!e.shiftKey&&t.closest?.(".selected")&&!t.closest?.(".not-selectable")){this.pendingCollapse={x:e.clientX,y:e.clientY,target:t};return}this.selecting=e.detail;let n=ne(this.root,e.clientX,e.clientY);if(n)if(e.shiftKey){let i=this.find(".sel-end");if(i){i.remove();let s=document.createRange();s.setStart(n.node,n.after?n.offset+1:n.offset),s.collapse(!0),s.insertNode(i),this.root.normalize(),this.extendSelection()}}else if(this.selecting===1){let i=this.topLevelAncestor(n.node);this.dragAnchor=i?{block:i,index:this.textIndexOf(i).indexOf(n.node,n.after?n.offset+1:n.offset)??0}:null,this.placeCaretAt(e.clientX,e.clientY)}else if(this.selecting===2)this.selectWordAt(n.node,n.offset),this.extendSelection();else this.placeCaretAt(e.clientX,e.clientY),this.extendSelection();else if(t instanceof HTMLElement&&t.querySelectorAll(".spanified").length===0&&t!==this.root){this.removeBounds();let i=this.createBounds();t.appendChild(i)}e.preventDefault(),e.stopPropagation()};handleMouseUp=(e)=>{let t=this.pendingCollapse;if(this.pendingCollapse=null,t){if(Math.abs(e.clientX-t.x)+Math.abs(e.clientY-t.y)<4)this.unmark(),this.selecting=1,this.placeCaretAt(t.x,t.y),this.selecting=!1,this.selectionChanged();return}let n=e.target;if(n.closest(".not-selectable")||n.classList.contains("not-selectable"))return;if(this.selecting){let i=this.selecting;if(this.extendSelection(),i!==1)this.resetBounds();this.normalizeBoundsOrder(),this.selecting=!1,this.dragAnchor=null}for(let i of Array.from(this.root.children))if(!i.classList.contains("selected-block"))k(i,!1);this.lastHovered=null,this.selectionChanged(),e.preventDefault(),e.stopPropagation()};handleMouseLeave=()=>{if(this.lastHovered){let e=this.topLevelAncestor(this.lastHovered);if(e&&!e.classList.contains("selected-block"))k(e,!1);this.lastHovered=null}};handleTouchStart=(e)=>{if(e.touches.length!==1)return;this.touchMode=!0;let t=e.touches[0],n=e.target;if(n.closest(".not-selectable")||n.classList.contains("not-selectable"))return;if(this.selecting=1,ne(this.root,t.clientX,t.clientY))this.placeCaretAt(t.clientX,t.clientY);else if(n instanceof HTMLElement&&n!==this.root){this.removeBounds();let s=this.createBounds();n.appendChild(s)}if(e.cancelable)e.preventDefault()};handleTouchMove=(e)=>{if(!this.selecting||e.touches.length!==1)return;let t=e.touches[0],n=this.root.getRootNode(),i=n.elementFromPoint?n.elementFromPoint(t.clientX,t.clientY):document.elementFromPoint(t.clientX,t.clientY);if(!i||i.closest(".not-selectable")||i.classList.contains("not-selectable"))return;let s=ne(this.root,t.clientX,t.clientY),o=this.find(".sel-end");if(s&&o){let r=document.createRange();r.setStart(s.node,s.after?s.offset+1:s.offset),r.collapse(!0),r.insertNode(o),this.root.normalize(),this.extendSelection(),this.onBoundsChanged?.()}if(e.cancelable)e.preventDefault()};handleTouchEnd=(e)=>{if(this.selecting)this.extendSelection(),this.normalizeBoundsOrder(),this.selecting=!1;for(let t of Array.from(this.root.children))if(!t.classList.contains("selected-block"))k(t,!1);if(this.lastHovered=null,this.selectionChanged(),e.cancelable)e.preventDefault()};selectionChanged(){this.focus(),this.root.dispatchEvent(new CustomEvent("selectionchanged",{bubbles:!0}))}onBoundsChanged;focusTarget;focus(){this.focusTarget?.focus(),this.onBoundsChanged?.()}createBounds(){let e=document.createDocumentFragment(),t=document.createElement("span");t.className="sel-start";let n=document.createElement("span");return n.className="sel-end caret",e.appendChild(t),e.appendChild(n),e}normalizeBoundsOrder(){let e=this.find(".sel-start"),t=this.find(".sel-end");if(!e||!t||e===t)return;if(kt(e,t))return;e.className="sel-end caret",t.className="sel-start",this.onBoundsChanged?.()}find(e){return this.root.querySelector(e)}findAll(e){return Array.from(this.root.querySelectorAll(e))}markBounds(){let e=this.find(".sel-start"),t=this.find(".sel-end");if(e&&t)this.markRange(e,t);this.onBoundsChanged?.()}removeBounds(){for(let e of this.findAll(".sel-start, .sel-end"))e.remove();this.onBoundsChanged?.()}textOffsetOf(e,t){let n=0,i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),s;while(s=i.nextNode())if(t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_PRECEDING)n+=s.data.length;return n}withoutBounds(e){let t=this.findAll(".sel-start, .sel-end");if(t.length===0)return e();let n=t.map((i)=>{let s=this.topLevelAncestor(i),o=!s||s===i?this.root:s;return{el:i,container:o,parent:i.parentNode,next:i.nextSibling,offset:this.textOffsetOf(o,i)}});for(let{el:i}of n)i.remove();this.normalize();try{return e()}finally{for(let{el:i,container:s,parent:o,next:r,offset:l}of n){let a=s.isConnected?this.textIndexOf(s).locate(l):null;if(a){let c=document.createRange();c.setStart(a.node,Math.min(a.offset,a.node.length)),c.collapse(!0),c.insertNode(i);continue}if(o?.isConnected&&(!r||r.parentNode===o))o.insertBefore(i,r);else if(s.isConnected)s.appendChild(i);else this.root.appendChild(i)}this.normalize(),this.onBoundsChanged?.()}}resetBounds(){let e=this.findAll(".selected");if(e.length===0)return this;this.removeBounds();let t=document.createElement("span");t.className="sel-start";let n=document.createElement("span");n.className="sel-end caret";let i=e[0],s=e[e.length-1],o=tt(i),r=nt(s);return o.parentNode?.insertBefore(t,o),r.parentNode?.insertBefore(n,r.nextSibling),this.onBoundsChanged?.(),this}extendSelection(){let e=this.find(".sel-start"),t=this.find(".sel-end");if(!e||!t)return;let n=e,i=t;switch(this.selecting){case 1:break;case 2:if(n.closest(".spanified-word"))n=n.closest(".spanified-word");if(i.closest(".spanified-word"))i=i.closest(".spanified-word");break;default:n=this.topLevelAncestor(n)||n,i=this.topLevelAncestor(i)||i;break}this.markRange(n,i),this.onBoundsChanged?.()}topLevelAncestor(e){let t=e;while(t&&t.parentNode!==this.root)t=t.parentNode;return t instanceof Element?t:null}unmark(){for(let e of this.findAll(".selected"))if(e.classList.remove("selected"),e.removeAttribute("draggable"),e.removeAttribute("data-drag"),e instanceof HTMLElement&&e.classList.length===0&&e.getAttribute("class")!==null)e.removeAttribute("class");for(let e of this.findAll("span"))if(e.attributes.length===0){let t=e.parentNode;if(t){while(e.firstChild)t.insertBefore(e.firstChild,e);t.removeChild(e)}}for(let e of this.findAll(".selected-block"))e.classList.remove("selected-block");for(let e of this.findAll(".first-block"))e.classList.remove("first-block");for(let e of this.findAll(".last-block"))e.classList.remove("last-block")}isBlock(e){return e.parentNode===this.root}markRange(e,t){if(!e)return;if(!t)t=e;if(!kt(e,t)&&e!==t){let d=t;t=e,e=d}this.unmark();let n=this.isBlock(e)?e:this.topLevelAncestor(e),i=this.isBlock(t)?t:this.topLevelAncestor(t);if(!n||!i)return;n.classList.add("first-block"),i.classList.add("last-block");let s=[n];if(n!==i){let d=n.nextElementSibling;while(d&&d!==i)s.push(d),d=d.nextElementSibling;s.push(i)}for(let d of s)d.classList.add("selected-block");for(let d of Array.from(this.root.children))if(!d.classList.contains("selected-block"))k(d,!1);let o=e.classList.contains("sel-start")||e.classList.contains("sel-end")?F(e,this.root):tt(e),r=t.classList.contains("sel-start")||t.classList.contains("sel-end")?q(t,this.root):nt(t);if(!o||!r)return;let l=[];for(let d of s)l.push(...je(d));let a=l.indexOf(o),c=l.indexOf(r);if(a<0||c<0)return;for(let d=a;d<=c;d++)this.markNode(l[d])}static DRAG_TYPES="text/html;text/plain";makeDraggable(e){e.setAttribute("draggable","true"),e.setAttribute("data-drag",st.DRAG_TYPES)}markNode(e){if(e.nodeType===3){let t=e.parentNode;if(t&&t.childNodes.length===1)t.classList.add("selected"),this.makeDraggable(t);else if(t){let n=document.createElement("span");n.className="selected",t.insertBefore(n,e),n.appendChild(e),this.makeDraggable(n)}}else if(e instanceof Element){if(!e.classList.contains("sel-start")&&!e.classList.contains("sel-end"))e.classList.add("selected"),this.makeDraggable(e)}}despanify(){for(let e of Array.from(this.root.children))if(!e.classList.contains("selected-block"))k(e,!1);this.lastHovered=null}normalize(){let e=this.root;for(let t=e.childNodes.length-1;t>=0;t--){let n=e.childNodes[t];if(n.nodeType===3&&/^\s*$/.test(n.textContent||""))e.removeChild(n)}for(let t of Array.from(e.querySelectorAll(".editor-table")))for(let n=t.childNodes.length-1;n>=0;n--){let i=t.childNodes[n];if(i.nodeType===3)t.removeChild(i)}return e.normalize(),this}}var en=new WeakSet;function ki(e){if(!e||en.has(e))return;en.add(e),queueMicrotask(()=>{if(en.delete(e),e.isConnected)rt(e)})}class tn extends HTMLElement{editorRoot=null;connectedCallback(){this.editorRoot=this.closest('[part="doc"]')??this.parentElement,this.classList.add("not-selectable","do-not-spanify"),ki(this.editorRoot)}disconnectedCallback(){ki(this.editorRoot)}}var Re="tosi-footnote";function ot(){if(typeof customElements>"u")return;if(customElements.get(Re))return;customElements.define(Re,tn)}function nn(e){return e instanceof Element&&e.tagName==="LI"}function Xo(e){return e instanceof Element&&e.tagName==="UL"}function Yo(e){return J(e)!==null}function J(e){let t=e;while(t){if(nn(t)&&t.parentElement?.classList.contains("editor-table"))return t;t=t.parentNode}return null}function P(e){let t=e;while(t){if(Xo(t)&&t.classList.contains("editor-table"))return t;t=t.parentNode}return null}function O(e){let t=e.style.gridTemplateColumns.trim();if(!t)return 1;return t.split(/\s+/).length}function St(e){let t=e.style.gridTemplateColumns.trim();if(!t)return["1fr"];return t.split(/\s+/)}function _e(e,t){e.style.gridTemplateColumns=t.join(" ")}function lt(e){let t=e.parentElement;if(!t)return-1;return Array.from(t.querySelectorAll(":scope > li")).indexOf(e)}function ie(e,t){return Math.floor(lt(e)/t)}function Pe(e,t){return lt(e)%t}function At(e){let t=e.parentElement;if(!t)return null;let n=O(t),s=lt(e)+n,o=Array.from(t.querySelectorAll(":scope > li"));return s<o.length?o[s]:null}function Tt(e){let t=e.parentElement;if(!t)return null;let n=O(t),s=lt(e)-n;if(s<0)return null;return Array.from(t.querySelectorAll(":scope > li"))[s]}function Lt(e){let t=e.nextElementSibling;return t&&nn(t)?t:null}function sn(e){let t=e.previousElementSibling;return t&&nn(t)?t:null}function at(e){return e.classList.contains("table-header")}function se(e=!1){let t=document.createElement("li");if(e)t.classList.add("table-header");return t.innerHTML=" ",t}function V(e,t,n){let i=Array.from(e.querySelectorAll(":scope > li")),s=t*n;return i.slice(s,s+n)}function on(e,t,n){let i=Array.from(e.querySelectorAll(":scope > li")),s=[];for(let o=t;o<i.length;o+=n)s.push(i[o]);return s}function Bt(e){let t=e.querySelectorAll(":scope > li"),n=O(e);return Math.ceil(t.length/n)}function rn(e,t=2,n=1){let i=document.createElement("ul");i.className="editor-table",i.style.gridTemplateColumns=Array(e).fill("1fr").join(" ");for(let s=0;s<t;s++){let o=s<n;for(let r=0;r<e;r++)i.appendChild(se(o))}return i}function an(e){if(e.length%2!==0)return console.error("Error: expected even number of arguments",e),null;let t={};for(let n=0;n<e.length;n+=2)t[e[n]]=e[n+1].replace(/\+/g," ");return t}function ln(e,t){for(let[n,i]of Object.entries(t))e.style.setProperty(n,i)}function ct(e){return(e.tagName==="UL"||e.tagName==="OL")&&!e.classList.contains("editor-table")}function Jo(e){let t=e.parentNode;if(!t)return;for(let n of Array.from(e.children)){let i=document.createElement("p");while(n.firstChild)i.appendChild(n.firstChild);i.classList.add("selected-block"),t.insertBefore(i,e)}e.remove()}function Zo(e){let t=e,n=t.previousElementSibling;if(n&&ct(n)&&n.tagName===t.tagName){while(t.firstChild)n.appendChild(t.firstChild);n.classList.add("selected-block"),t.remove(),t=n}let i=t.nextElementSibling;if(i&&ct(i)&&i.tagName===t.tagName){while(i.firstChild)t.appendChild(i.firstChild);i.remove()}return t}function Mi(e,t){if(!t||t==="_self"){e.removeAttribute("target"),e.removeAttribute("rel");return}e.setAttribute("target",t),e.setAttribute("rel","noopener")}var Ei=0;function Qo(){return Ei+=1,`fn-${Date.now().toString(36)}-${Ei}`}function rt(e){let t=Array.from(e.querySelectorAll(`${Re}[data-footnote], .footnote-ref[data-footnote]`)).filter((s)=>!s.closest(".footnotes")),n=e.querySelector("ol.footnotes");if(t.length===0){n?.remove();return}if(!n)n=document.createElement("ol"),n.className="footnotes",e.appendChild(n);let i=new Map;for(let s of Array.from(n.children)){let o=s.getAttribute("data-footnote");if(o)i.set(o,s)}t.forEach((s,o)=>{let r=s.getAttribute("data-footnote"),l=s.querySelector("a");if(l)l.textContent=String(o+1),l.setAttribute("href",`#${r}`);let a=i.get(r);if(!a)a=document.createElement("li"),a.className="footnote",a.setAttribute("data-footnote",r),a.textContent="Footnote text";a.id=r,i.delete(r),n.appendChild(a)});for(let s of i.values())s.remove()}var dt={setText(e,...t){let n=an(t);if(!n)return;e.selectable.resetBounds(),k(e.root,!1),e.selectable.markBounds(),e.normalize();let i=e.selectedLeafNodes();e.selectable.removeBounds();for(let s of i)if(s.nodeType===3){let o=Mt(s,".setText");if(o&&o instanceof HTMLElement)ln(o,n);else{let r=document.createElement("span");r.className="setText",ln(r,n),s.parentNode?.insertBefore(r,s),r.appendChild(s)}}e.selectable.resetBounds(),e.focus(),e.updateUndo("new")},setBlockType(e,t){let n=e.selectedBlocks();for(let i of n){let s=document.createElement(t);while(i.firstChild)s.appendChild(i.firstChild);s.classList.add("selected-block"),i.parentNode?.replaceChild(s,i)}e.updateUndo("new")},setList(e,t="ul"){let n=t.toLowerCase(),i=e.selectedBlocks().filter((r)=>!r.classList.contains("editor-table"));if(i.length===0)return;let s=i.every(ct)&&i.every((r)=>r.tagName.toLowerCase()===n);if(n==="none"||s){for(let r of i)if(ct(r))Jo(r);e.updateUndo("new");return}let o=[];for(let r of i){let l=o[o.length-1];if(l&&l[l.length-1].nextElementSibling===r)l.push(r);else o.push([r])}for(let r of o){let l=document.createElement(n);l.classList.add("selected-block");for(let a of r)if(ct(a))while(a.firstChild)l.appendChild(a.firstChild);else{let c=document.createElement("li");while(a.firstChild)c.appendChild(a.firstChild);l.appendChild(c)}r[0].parentNode?.insertBefore(l,r[0]);for(let a of r)a.remove();Zo(l)}e.updateUndo("new")},setLink(e,t,n="_blank"){if(!t)return;if(!Ie(t)){console.error("setLink: refusing unsafe URL scheme",t);return}e.selectable.resetBounds(),k(e.root,!1),e.selectable.markBounds(),e.normalize();let i=e.selectedLeafNodes();e.selectable.removeBounds();for(let s of i){if(s.nodeType!==3)continue;let o=Mt(s,"a");if(o instanceof Element)o.setAttribute("href",t),Mi(o,n);else{let r=document.createElement("a");r.setAttribute("href",t),Mi(r,n),s.parentNode?.insertBefore(r,s),r.appendChild(s)}}e.selectable.resetBounds(),e.focus(),e.updateUndo("new")},removeLink(e){e.selectable.resetBounds(),k(e.root,!1),e.selectable.markBounds();let t=e.selectedLeafNodes();e.selectable.removeBounds();let n=new Set;for(let i of t){let s=i.parentElement?.closest("a")??(i instanceof Element?i.closest("a"):null);if(s&&e.root.contains(s))n.add(s)}for(let i of n){let s=i.parentNode;if(!s)continue;while(i.firstChild)s.insertBefore(i.firstChild,i);s.removeChild(i)}e.selectable.resetBounds(),e.focus(),e.updateUndo("new")},insertImage(e,t,...n){let i=e.insertionPoint();if(!i||!t)return;let s=document.createElement("img");s.setAttribute("src",t),s.setAttribute("alt",n.join(" ")),i.before(s),e.normalize(),e.focus(),e.updateUndo("new")},insertFootnote(e,...t){let n=e.insertionPoint();if(!n)return;let i=Qo();ot();let s=document.createElement(Re);s.className="footnote-ref",s.setAttribute("data-footnote",i);let o=document.createElement("a");o.setAttribute("href",`#${i}`),o.textContent="?",s.appendChild(o),n.before(s);let r=e.root.querySelector("ol.footnotes");if(!r)r=document.createElement("ol"),r.className="footnotes",e.root.appendChild(r);let l=document.createElement("li");l.className="footnote",l.setAttribute("data-footnote",i),l.id=i,l.textContent=t.length?t.join(" "):"Footnote text",r.appendChild(l),rt(e.root),e.normalize(),e.focus(),e.updateUndo("new")},renumberFootnotes(e){rt(e.root),e.updateUndo("new")},setBlocks(e,...t){let n=an(t);if(!n)return;for(let i of e.selectedBlocks())ln(i,n);e.updateUndo("new")},updateUndo(e,t){e.updateUndo(t)},setDebug(e){e.root.classList.toggle("debug")},annotate(e,t){let n=e.insertionPoint();if(!n)return;let i=document.querySelector(`.annotation-template .${t}`);if(!i)return;let s=document.createElement("span");s.className="annotation do-not-spanify not-selectable not-editable";let o=i.cloneNode(!0);o.classList.add("annotation-body"),s.appendChild(o),n.after(s),e.updateUndo("new")},insertTable(e,...t){let n=parseInt(t[0])||3,i=parseInt(t[1])||2,s=parseInt(t[2])||1,o=e.insertionPoint();if(!o)return;let r=e.block(o),l=rn(n,i,s);if(r)r.after(l);else e.root.appendChild(l);let a=l.querySelector("li");if(a)a.innerHTML="",a.appendChild(e.selectable.createBounds()),e.selectable.normalize(),e.focus();e.updateUndo("new")},insertTableRow(e,t="after"){let n=e.insertionPoint();if(!n)return;let i=J(n);if(!i)return;let s=P(i);if(!s)return;let o=O(s),r=ie(i,o),l=t==="before"&&r===0&&at(i),a=V(s,r,o),c=t==="before"?a[0]:a[a.length-1];for(let d=0;d<o;d++){let u=se(l);if(t==="before")c.before(u);else c.after(u)}e.updateUndo("new")},insertTableCol(e,t="after"){let n=e.insertionPoint();if(!n)return;let i=J(n);if(!i)return;let s=P(i);if(!s)return;let o=O(s),r=Pe(i,o),l=Bt(s);for(let d=l-1;d>=0;d--){let h=V(s,d,o)[r],f=at(h),p=se(f);if(t==="before")h.before(p);else h.after(p)}let a=St(s),c=t==="before"?r:r+1;a.splice(c,0,"1fr"),_e(s,a),e.updateUndo("new")},deleteTableRow(e){if(e.tracksChanges()&&e.refuseStructural("delete-table-row"))return;let t=e.insertionPoint();if(!t)return;let n=J(t);if(!n)return;let i=P(n);if(!i)return;let s=O(i);if(Bt(i)<=1)return;let r=ie(n,s),l=V(i,r,s),a=r>0?r-1:1,c=V(i,a,s);if(c.length>0)c[0].appendChild(e.selectable.createBounds()),e.selectable.normalize(),e.focus();for(let d of l)d.remove();e.updateUndo("new")},deleteTableCol(e){if(e.tracksChanges()&&e.refuseStructural("delete-table-col"))return;let t=e.insertionPoint();if(!t)return;let n=J(t);if(!n)return;let i=P(n);if(!i)return;let s=O(i);if(s<=1)return;let o=Pe(n,s),r=ie(n,s),l=o>0?o-1:1,a=V(i,r,s);if(a[l])a[l].appendChild(e.selectable.createBounds()),e.selectable.normalize(),e.focus();let c=on(i,o,s);for(let u=c.length-1;u>=0;u--)c[u].remove();let d=St(i);d.splice(o,1),_e(i,d),e.updateUndo("new")},toggleHeaderRow(e){let t=e.insertionPoint();if(!t)return;let n=J(t);if(!n)return;let i=P(n);if(!i)return;let s=O(i),o=ie(n,s),r=V(i,o,s),l=!at(r[0]);for(let a of r)a.classList.toggle("table-header",l);e.updateUndo("new")}};function cn(e,t,...n){let s=(e.commands??dt)[t];if(s)s(e,...n);else console.error("unrecognized command",t)}function dn(e,t){let n=e.commands??dt,i=t.split(/;\s*/);for(let s of i){let o=s.trim().split(/\s+/),r=o.shift();if(!r)continue;let l=n[r];if(l)l(e,...o);else console.error("unrecognized command",r)}}var Te={debug:!1,perf:!1,quiet:!1};function le(e,t){if(e==null||typeof e!=="object")return e;if(e instanceof Date)return new Date(e.getTime());if(t===void 0)t=new WeakMap;else if(t.has(e))return t.get(e);if(e instanceof Set){let i=new Set;t.set(e,i);for(let s of e)i.add(le(s,t));return i}if(e instanceof Map){let i=new Map;t.set(e,i);for(let[s,o]of e)i.set(le(s,t),le(o,t));return i}if(Array.isArray(e)){let i=[];t.set(e,i);for(let s of e)i.push(le(s,t));return i}let n={};t.set(e,n);for(let i in e)n[i]=le(e[i],t);return n}var ce={},vn=null,er=(e)=>{vn=e},$n=()=>{if(vn===null)throw Error("xin proxy not initialized");return vn},bn=null,xn=null,tr=(e,t)=>{bn=e,xn=t},nr=()=>{if(bn===null)throw Error("bind not initialized");return bn},ir=()=>{if(xn===null)throw Error("on not initialized");return xn},be="-tosi-data",wn=`.${be}`,U=Symbol.for("xin-path"),Le=Symbol.for("xin-value"),sr="xinObserve",or="xinBind",rr="xinOn",lr=Symbol.for("tosi-accessor"),Nn=Symbol.for("tosi-take"),Dt=Symbol("list-binding"),We=Symbol("list-instance"),Cn=new Map;function ar(e,t){let n=Cn.get(e);if(n===void 0)n=new Set,Cn.set(e,n);n.add(t)}function cr(e){return Cn.get(e)}var Si=new Set;function ae(e,t){if(!Si.has(e)){if(Si.add(e),Te.quiet!==!0)console.warn(t)}}function _t(e,t){let n=!1;return(...i)=>{if(!n)console.warn(t),n=!0;return e(...i)}}var de=(e)=>e&&e[U]||void 0;function B(e){if(typeof e==="object"&&e!==null){let t=e[Le];return t!==void 0?t:e}return e}var Fa=_t(de,"xinPath is deprecated. Use tosiPath instead."),qa=_t(B,"xinValue is deprecated. Use tosiValue instead."),is=(e,t)=>{let{take:n}=e;if(n==null)return;n.paths=n.paths.map((i)=>i.startsWith("^")?`${t}${i.substring(1)}`:i)},ss=(e,t,n)=>{let{binding:i,options:s,take:o}=t,{toDOM:r}=i;if(r==null)return;let l=$n();if(o==null){r(e,l[n],s);return}let a=o.paths.map((d)=>l[d]),c=o.lastInputs;if(c!=null&&a.every((d,u)=>d===c[u]))return;o.lastInputs=a,r(e,o.transform(...a),s)},Ue=new WeakMap,ue=new WeakMap,It=new WeakMap,dr=0;var ur=0,zn=()=>{ur++},hr=(e,t)=>{if(!It.has(e))dr++;It.set(e,t)};var ft=(e)=>{let t=e.cloneNode();if(t instanceof Element){let i=ue.get(e),s=Ue.get(e);if(i!=null)ue.set(t,i.map((r)=>({...r,options:r.options!=null?{...r.options}:void 0,take:r.take!=null?{...r.take,paths:[...r.take.paths]}:void 0})));if(s!=null)Ue.set(t,le(s));let o=It.get(e);if(o!=null)It.set(t,o)}let n=t instanceof HTMLTemplateElement?t.content:t;for(let i of Array.from(e instanceof HTMLTemplateElement?e.content.childNodes:e.childNodes))if(i instanceof Element||i instanceof DocumentFragment)n.appendChild(ft(i));else n.appendChild(i.cloneNode());return t},fr=(e)=>{try{return JSON.stringify(e)}catch(t){return"{has circular references}"}},os=(...e)=>Error(e.map(fr).join(" ")),pr=()=>new Date(parseInt("1000000000",36)+Date.now()).valueOf().toString(36).slice(1),gr=0,mr=()=>(parseInt("10000",36)+ ++gr).toString(36).slice(-5),yr=()=>pr()+mr(),kn=Symbol("delete"),rs=Symbol("new-object"),un=Symbol("automatic-index");function ls(e){if(e==="")return[];if(Array.isArray(e))return e;else{let t=[];while(e.length>0){let n=e.search(/\[[^\]]+\]/);if(n===-1){t.push(e.split("."));break}else{let i=e.slice(0,n);if(e=e.slice(n),i!=="")t.push(i.split("."));if(n=e.indexOf("]")+1,t.push(e.slice(1,n-1)),e.slice(n,n+1)===".")n+=1;e=e.slice(n)}}return t}}var Ae=new WeakMap;function as(e,t){if(Ae.get(e)===void 0)Ae.set(e,{});let n={};if(Ae.get(e)[t]=n,t==="_auto_")e.forEach((i,s)=>{if(i[un]===void 0)i[un]=yr();n[i[un]+""]=s});else e.forEach((i,s)=>{n[_(i,t)+""]=s});return n}function vr(e,t){if(Ae.get(e)===void 0||Ae.get(e)[t]===void 0)return as(e,t);else return Ae.get(e)[t]}function br(e,t,n){n=n+"";let i=vr(e,t)[n];if(i===void 0||_(e[i],t)+""!==n)i=as(e,t)[n];return i}var xr=new Set(["__proto__","constructor","prototype"]);class On extends Error{constructor(e){super(`unsafe path segment "${e}": it would escape the object graph into the prototype chain`);this.name="UnsafePathError"}}function wr(e){if(xr.has(e))throw new On(e)}function Cr(e){if(e==="__proto__")throw new On(e)}function kr(e,t,n){if(wr(t),(!Object.prototype.hasOwnProperty.call(e,t)||e[t]===void 0)&&n!==void 0)e[t]=n;return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function cs(e,t,n,i){let s=t!==""?br(e,t,n):n;if(i===kn){if(s!==void 0)e.splice(s,1),Ae.delete(e);return Symbol("deleted")}else if(i===rs){if(t===""&&e[s]===void 0)e[s]={}}else if(i!==void 0)if(s!==void 0)e[s]=i;else if(t!==""&&_(i,t)+""===n+"")e.push(i),s=e.length-1;else throw Error(`byIdPath insert failed at [${t}=${n}]`);return e[s]}function Ai(e){if(!Array.isArray(e))throw os("setByPath failed: expected array, found",e)}function Ti(e){if(e==null||!(e instanceof Object))throw os("setByPath failed: expected Object, found",e)}function _(e,t){let n=ls(t),i=e,s,o,r,l;for(s=0,o=n.length;i!==void 0&&s<o;s++){let a=n[s];if(Array.isArray(a))for(r=0,l=a.length;i!==void 0&&r<l;r++){let c=a[r];i=i[c]}else if(i.length===0){if(i=i[Number(a.slice(1))],a[0]!=="=")return}else if(a.includes("=")){let[c,...d]=a.split("=");i=cs(i,c,d.join("="))}else r=parseInt(a,10),i=i[r]}return i}function ds(e,t,n){let i=e;if(t==="")throw Error("setByPath cannot be used to set the root object");let s=ls(t);while(i!=null&&s.length>0){let o=s.shift();if(typeof o==="string"){let r=o.indexOf("=");if(r>-1){if(r===0)Ti(i);else Ai(i);let l=o.slice(0,r),a=o.slice(r+1);if(i=cs(i,l,a,s.length>0?rs:n),s.length===0)return!0}else{Ai(i);let l=parseInt(o,10);if(s.length>0)i=i[l];else{if(n!==kn){if(i[l]===n)return!1;i[l]=n}else i.splice(l,1);return!0}}}else if(Array.isArray(o)&&o.length>0){Ti(i);while(o.length>0){let r=o.shift();if(o.length>0||s.length>0){if(i=kr(i,r,o.length>0?{}:[]),i==null)throw Error(`setByPath failed at "${r}" in "${t}": not a container`)}else{if(Cr(r),n!==kn){if(i[r]===n)return!1;i[r]=n}else{if(!Object.prototype.hasOwnProperty.call(i,r))return!1;delete i[r]}return!0}}}else throw Error(`setByPath failed, bad path ${t}`)}throw Error(`setByPath(${e}, ${t}, ${n}) failed`)}var Li=Symbol("observer should be removed"),Ht=[],Fe=[],Mn=!1,Mr,En;function Er(e,t,n,i){let s=cr(e);if(s===void 0)return[];let o=[];for(let r of s){let l=_(n,r);if(l!==void 0)o.push(`${e}[${r}=${l}]${i}`)}return o}var pt=(e,t)=>{if(!t.startsWith(e))return!1;if(t.length===e.length)return!0;let n=t.charAt(e.length);return n==="."||n==="["};class us{description;test;callback;constructor(e,t){let n=typeof t==="string"?`"${t}"`:`function ${t.name}`,i;if(typeof e==="string")this.test=(s)=>typeof s==="string"&&s!==""&&(pt(s,e)||pt(e,s)),i=`test = "${e}"`;else if(e instanceof RegExp)this.test=e.test.bind(e),i=`test = "${e.toString()}"`;else if(e instanceof Function)this.test=e,i=`test = function ${e.name}`;else throw Error("expect listener test to be a string, RegExp, or test function");if(this.description=`${i}, ${n}`,typeof t==="function")this.callback=t;else throw Error("expect callback to be a path or function");Ht.push(this)}}var Sr=()=>{if(Te.perf)console.time("xin async update");let e=Array.from(Fe);Fe.length=0,Mn=!1;let t=En;En=void 0;try{for(let n of e)Ht.filter((i)=>{let s;try{s=i.test(n)}catch(o){return console.error(`Listener ${i.description} threw "${o}" at "${n}"`),!1}if(s===Li)return Sn(i),!1;return s}).forEach((i)=>{let s;try{s=i.callback(n)}catch(o){console.error(`Listener ${i.description} threw "${o}" handling "${n}"`)}if(s===Li)Sn(i)})}finally{if(typeof t==="function")t();if(Te.perf)console.timeEnd("xin async update")}},Ke=(e)=>{let t=typeof e==="string"?e:de(e);if(t===void 0)throw console.error("touch was called on an invalid target",e),Error("touch was called on an invalid target");if(Mn===!1)Mr=new Promise((i)=>{En=i}),Mn=setTimeout(Sr);if(Fe.find((i)=>pt(i,t))==null)Fe.push(t);let n=t.match(/^(.+)\[(\d+)\](.*)$/);if(n!==null){let[,i,s,o]=n,r=parseInt(s,10),l=_(ce,`${i}[${r}]`);if(l!=null){let a=Er(i,r,l,o);for(let c of a)if(Fe.find((d)=>pt(d,c))==null)Fe.push(c)}}},Dn=(e,t)=>new us(e,t),Sn=(e)=>{let t=Ht.indexOf(e);if(t>-1)Ht.splice(t,1);else throw Error("unobserve failed, listener not found")},hs=(e,t,{bubbles:n=!1,composed:i=!1}={})=>{let s=new Event(t,{bubbles:n,composed:i});e.dispatchEvent(s)},fs=(e)=>{if(e instanceof HTMLInputElement)return e.type;else if(e instanceof HTMLSelectElement&&e.hasAttribute("multiple"))return"multi-select";else return"other"},R=(e,t=2)=>String(e).padStart(t,"0"),Ar=(e,t)=>{switch(e){case"date":return`${t.getUTCFullYear()}-${R(t.getUTCMonth()+1)}-${R(t.getUTCDate())}`;case"month":return`${t.getUTCFullYear()}-${R(t.getUTCMonth()+1)}`;case"datetime-local":return`${t.getFullYear()}-${R(t.getMonth()+1)}-${R(t.getDate())}T${R(t.getHours())}:${R(t.getMinutes())}`;default:return t.toISOString()}},Tr=(e)=>{let t=Math.floor(e/1000),n=`${R(Math.floor(t/3600))}:${R(Math.floor(t/60)%60)}`;return t%60===0?n:`${n}:${R(t%60)}`},Lr=(e)=>{let t=e.match(/^(\d\d):(\d\d)(?::(\d\d)(?:\.(\d+))?)?$/);if(t==null)return NaN;let[,n,i,s,o]=t;return(Number(n)*60+Number(i))*60000+Number(s??0)*1000+Number(o??0)},An=0,Br=()=>An>0,$r=(e,t)=>{An++;try{Nr(e,t)}finally{An--}},Nr=(e,t)=>{let n=fs(e);switch(n){case"radio":e.checked=t!=null&&e.value===String(t);break;case"checkbox":e.checked=!!t;break;case"date":case"datetime-local":case"month":case"week":{let i=e;if(t==null||t==="")i.value="";else if(t instanceof Date||typeof t==="number"){let s=t instanceof Date?t:new Date(t);if(n==="week")try{i.valueAsDate=s}catch(o){}else i.value=Ar(n,s)}else i.value=String(t);break}case"time":{let i=e;if(t==null||t==="")i.value="";else if(typeof t==="number")i.value=Tr(t);else if(t instanceof Date)i.value=`${R(t.getHours())}:${R(t.getMinutes())}:${R(t.getSeconds())}`;else i.value=String(t);break}case"multi-select":for(let i of Array.from(e.querySelectorAll("option")))i.selected=Array.isArray(t)?t.map(String).includes(i.value):t!=null?!!t[i.value]:!1;break;default:e.value=t==null?"":t}},zr=(e)=>{switch(fs(e)){case"radio":{let t=e.parentElement?.querySelector(`[name="${e.name}"]:checked`);return t!=null?t.value:null}case"checkbox":return e.checked;case"number":case"range":{let t=e,n=typeof t.valueAsNumber==="number"?t.valueAsNumber:Number(t.value);return Number.isNaN(n)?t.value:n}case"date":case"datetime-local":case"month":case"week":{let t=e,n=t.valueAsDate??(t.value!==""?new Date(t.value):null);return n!=null&&!Number.isNaN(n.getTime())?n:t.value}case"time":{let t=e,n=typeof t.valueAsNumber==="number"?t.valueAsNumber:NaN;if(Number.isNaN(n))n=Lr(t.value);return Number.isNaN(n)?t.value:n}case"multi-select":return Array.from(e.querySelectorAll("option")).reduce((t,n)=>(t[n.value]=n.selected,t),{});default:return e.value}},{ResizeObserver:Bi}=globalThis,Tn=Bi!=null?new Bi((e)=>{for(let t of e){let n=t.target;hs(n,"resize")}}):{observe(){},unobserve(){}},$i=(e,t,n=!0)=>{if(e!=null&&t!=null)if(typeof t==="string")e.textContent=t;else if(Array.isArray(t))t.forEach((i)=>{e.append(i instanceof Node&&n?ft(i):i)});else if(t instanceof Node)e.append(n?ft(t):t);else throw Error("expect text content or document node")};var jt=(e,t=250)=>{let n,i=Date.now()-t;return function(...s){clearTimeout(n);let o=Date.now()-i;if(o>=t)i=Date.now(),e.apply(this,s);else n=setTimeout(()=>{i=Date.now(),e.apply(this,s)},t-o)}},Or=16,Dr=100;function Ni(e,t){let n=Array.from(e.getElementsByClassName(be));if(e.classList.contains(be))n.unshift(e);for(let i of n){let s=ue.get(i);for(let o of s){if(o.path.startsWith("^"))o.path=`${t}${o.path.substring(1)}`;is(o,t),ss(i,o,o.path)}}}var zi=!1;class ps{boundElement;listTop;listBottom;isNamespaced;templates;options;itemToElement;idToElement=new Map;array=[];_filteredCache;_update;_previousSlice;static filterBoundObservers=new WeakMap;constructor(e,t,n={}){if(this.boundElement=e,this.itemToElement=new WeakMap,n.idPath!=null){let l=de(t);if(l!=null)ar(l,n.idPath)}let i=n.virtual?.itemsPerRow??1,s=Array.from(e.children).find((l)=>l instanceof HTMLTemplateElement),o=null;if(s!=null){let l=i;if(s.content.children.length<1||s.content.children.length!==l)throw Error(`ListBinding expects a template with exactly ${l} child element(s)`);this.templates=Array.from(s.content.children).map((a)=>ft(a)),o=s.nextElementSibling,s.remove()}else if(e.children.length===1)this.templates=[e.children[0]],this.templates[0].remove();else throw Error("ListBinding expects a <template> child or exactly one child element");this.options=n;let r=e.namespaceURI;if(this.isNamespaced=r==="http://www.w3.org/2000/svg"||r==="http://www.w3.org/1998/Math/MathML",this.isNamespaced)this.listTop=null,this.listBottom=null;else if(this.listTop=document.createElement("div"),this.listBottom=document.createElement("div"),this.listTop.classList.add("virtual-list-padding"),this.listBottom.classList.add("virtual-list-padding"),this.listTop.setAttribute("role","presentation"),this.listBottom.setAttribute("role","presentation"),this.listTop.setAttribute("aria-hidden","true"),this.listBottom.setAttribute("aria-hidden","true"),o!=null)this.boundElement.insertBefore(this.listTop,o),this.boundElement.insertBefore(this.listBottom,o);else this.boundElement.append(this.listTop),this.boundElement.append(this.listBottom);if(i>1){this.boundElement.classList.add("tosi-virtual-grid");let l=this.boundElement.style;if(l!=null)l.setProperty("--tosi-columns",String(i)),l.display=l.display||"grid",l.gridTemplateColumns=l.gridTemplateColumns||"repeat(var(--tosi-columns), 1fr)";if(this.listTop!=null&&this.listBottom!=null)this.listTop.style.gridColumn="1 / -1",this.listBottom.style.gridColumn="1 / -1"}if(n.virtual!=null&&!this.boundElement.getAttribute("role"))this.boundElement.setAttribute("role",i>1?"grid":"list");if(this.boundElement[Dt]=this,this.isNamespaced&&n.virtual!=null)console.warn("ListBinding: virtual scrolling is not supported in SVG/MathML containers, ignoring virtual option");if(!this.isNamespaced&&n.virtual!=null)if(Tn.observe(this.boundElement),this._update=jt(()=>{this.update(this.array,!0)},Or),this.boundElement.addEventListener("resize",this._update),n.virtual.scrollContainer==="window")window.addEventListener("scroll",this._update),window.addEventListener("resize",this._update);else this.boundElement.addEventListener("scroll",this._update)}filteredArray(){if(this._filteredCache!=null)return this._filteredCache;let{hiddenProp:e,visibleProp:t}=this.options,n=this.array;if(e!==void 0)n=n.filter((i)=>i[e]!==!0);if(t!==void 0)n=n.filter((i)=>i[t]===!0);if(this.options.filter&&this.needle!==void 0)n=this.options.filter(n,this.needle);return this._filteredCache=n,n}visibleSlice(){let{virtual:e}=this.options,t=this.filteredArray(),n=0,i=t.length-1,s=0,o=0;if(e!=null&&this.boundElement instanceof HTMLElement){let r=this.boundElement.offsetWidth,l=e.scrollContainer==="window",a,c;if(l){a=window.innerHeight;let h=this.boundElement.getBoundingClientRect();c=Math.max(0,-h.top)}else a=this.boundElement.offsetHeight,c=this.boundElement.scrollTop;let d=e.width!=null?Math.max(1,Math.floor(r/e.width)):e.visibleColumns??1,u=Math.ceil(t.length/d);if(e.minHeight!=null){let h=e.minHeight,f=Math.ceil(a/h)+(e.rowChunkSize||1),p=d*f,b=u*h,v=Math.max(0,b-a),G=v>0?Math.min(1,Math.max(0,c/v)):0,ee=Math.max(0,u-f+1),Me=G*ee,X=Math.floor(Me);if(e.rowChunkSize)X-=X%e.rowChunkSize;return n=X*d,i=n+p-1,s=c,o=Math.max(0,b-c-a),{items:t,firstItem:n,lastItem:i,topBuffer:s,bottomBuffer:o,interpolation:{t:G,position:Me,scrollTop:c,viewportHeight:a,totalScrollHeight:b,rowHeight:e.height}}}else{let h=Math.ceil(a/e.height)+(e.rowChunkSize||1),f=d*h,p=Math.floor(c/e.height);if(p>u-h+1)p=Math.max(0,u-h+1);if(e.rowChunkSize)p-=p%e.rowChunkSize;n=p*d,i=n+f-1,s=p*e.height,o=Math.max((u-h)*e.height-s,0)}}return{items:t,firstItem:n,lastItem:i,topBuffer:s,bottomBuffer:o}}needle;filter=jt((e)=>{if(this.needle!==e)this.needle=e,this.update(this.array)},Dr);update(e,t){if(e==null)e=[];if(this.array=e,!t)this._filteredCache=void 0;let{hiddenProp:n,visibleProp:i}=this.options,s=de(e),o=this.visibleSlice();if(this.boundElement.classList.toggle("-xin-empty-list",o.items.length===0),this.options.virtual!=null)this.boundElement.setAttribute("aria-rowcount",String(o.items.length));let r=this._previousSlice,{firstItem:l,lastItem:a,topBuffer:c,bottomBuffer:d}=o,u=n===void 0&&i===void 0&&t===!0&&r!=null&&l===r.firstItem&&a===r.lastItem;if(u&&o.interpolation==null&&c===r.topBuffer&&d===r.bottomBuffer)return;if(u&&o.interpolation!=null){this._updateInterpolatedBuffers(o);return}this._previousSlice=o;let h=0,f=0,p=0,{idPath:b}=this.options,v=this.options.virtual?.itemsPerRow??1,G;if(b!=null){G=new Set;for(let A=l;A<=a;A++){let S=o.items[A];if(S!==void 0)G.add(String(S[b]))}}let ee=new Set;for(let A of Array.from(this.boundElement.children)){if(A===this.listTop||A===this.listBottom)continue;let S=A[We];if(S==null)continue;else if(S===!0)A.remove(),h++;else{if(ee.has(S))continue;let T;if(b!=null)T=!G.has(String(S[b]));else{let z=o.items.indexOf(S);T=z<l||z>a}if(T){ee.add(S);let z=this.itemToElement.get(S);if(z!=null)for(let M of z)M.remove();else A.remove();if(this.itemToElement.delete(S),b!=null)this.idToElement.delete(String(S[b]));h++}}}if(this.listTop!=null&&this.listBottom!=null)this.listTop.style.height=String(c)+"px",this.listBottom.style.height=String(d)+"px";let Me=[],X=b!=null?new Set:null;for(let A=l;A<=a;A++){let S=o.items[A];if(S===void 0)continue;if(X!=null&&b!=null){let z=String(S[b]);if(X.has(z)){if(!zi)zi=!0,console.error(`tosijs list binding: duplicate idPath value "${z}" (idPath: "${b}"). `+"id-path values must be unique — items sharing an id collapse to a single "+"row and updates target the wrong item. Warned once per session.")}else X.add(z)}let T=this.itemToElement.get(B(S));if(T==null&&b!=null){let z=String(S[b]);if(T=this.idToElement.get(z),T!=null){let M=B(S);this.itemToElement.set(M,T);for(let te of T)te[We]=M}}if(T==null){p++;let z=B(S);if(T=this.templates.map((M)=>ft(M)),typeof S==="object")this.itemToElement.set(z,T);for(let M of T)M[We]=typeof S==="object"?z:!0;for(let M of T)if(this.listBottom!=null)this.boundElement.insertBefore(M,this.listBottom);else this.boundElement.append(M);if(b!=null){let M=S[b],te=`${s}[${b}=${M}]`;for(let Bo of T)Ni(Bo,te);this.idToElement.set(String(M),T)}else{let M=`${s}[${A}]`;for(let te of T)Ni(te,M)}}if(this.options.virtual!=null){let z=String(A+1);if(v>1)for(let M=0;M<T.length;M++){let te=T[M];te.setAttribute("role","gridcell"),te.setAttribute("aria-rowindex",z),te.setAttribute("aria-colindex",String(M+1))}else for(let M of T)M.setAttribute("role","listitem"),M.setAttribute("aria-rowindex",z)}Me.push(...T)}let wt=this.listTop;for(let A of Me){if(A.previousElementSibling!==wt)if(f++,wt?.nextElementSibling!=null)this.boundElement.insertBefore(A,wt.nextElementSibling);else if(this.listBottom!=null)this.boundElement.insertBefore(A,this.listBottom);else this.boundElement.append(A);wt=A}if(o.interpolation!=null)this._updateInterpolatedBuffers(o);if(Te.perf)console.log(s,"updated",{removed:h,created:p,moved:f})}_updateInterpolatedBuffers(e){let{t,position:n,scrollTop:i,viewportHeight:s,totalScrollHeight:o,rowHeight:r}=e.interpolation,l=0;for(let u of Array.from(this.boundElement.children)){if(u===this.listTop||u===this.listBottom)continue;l+=u.offsetHeight||r}let a=i,c=i+s-l,d=Math.max(0,t*c+(1-t)*a-n%1*r);if(this.listTop!=null&&this.listBottom!=null)this.listTop.style.height=String(d)+"px",this.listBottom.style.height=String(Math.max(0,o-d-l))+"px"}}var Ir=(e,t,n)=>{let i=e[Dt];if(t&&i===void 0)i=new ps(e,t,n),e[Dt]=i;return i},Hr=(e)=>{let t;while(!(t=e[We])&&e&&e.parentElement)e=e.parentElement;return t?{element:e,item:t}:void 0},jr=(e)=>{let t=Hr(e);return t?t.item:void 0};var{document:gt,MutationObserver:Oi}=globalThis,gs=(e,t)=>{let n=ue.get(e);if(n==null)return;for(let i of n){let{binding:s}=i,{path:o}=i,{toDOM:r}=s;if(r!=null){if(o.startsWith("^")){let l=jr(e);if(l!=null&&l[U]!=null){let a=l[U];o=i.path=`${a}${o.substring(1)}`,is(i,a)}else{if(e instanceof HTMLElement)console.warn(`Unresolved relative binding "${o}" —`,e,"is not part of a list. If this is a list template, wrap it in a <template>.");continue}}if(t==null||pt(t,o))ss(e,i,o)}}},Di=new Set;function ms(e,t,n){let i=`${e}:${t.tagName}:${n?.message??n}`;if(Di.has(i))return;Di.add(i),console.error(`tosijs: a binding threw while ${e} this element; the rest of the `+"pass continued. (Reported once per element type and message — fix the "+"binding, the transform, or the state it reads.)",t,n)}function Rr(e){zn();let t=Array.from(e.getElementsByClassName(be));if(e.classList.contains(be))t.unshift(e);t.forEach((n)=>{try{gs(n)}catch(i){ms("hydrating",n,i)}})}if(Oi!=null)new Oi((e)=>{e.forEach((t)=>{Array.from(t.addedNodes).forEach((n)=>{if(n instanceof Element)Rr(n)})})}).observe(gt.body,{subtree:!0,childList:!0});Dn(()=>!0,(e)=>{if(globalThis.document==null)return;let t=Array.from(gt.getElementsByClassName(be));for(let n of t)try{gs(n,e)}catch(i){ms("updating",n,i)}});var ys=(e)=>{let t=e.composed&&e.composedPath!=null?e.composedPath()[0]:e.target;return t instanceof Element?t:null},Ln=(e,t)=>{while(e!=null){let n=e.closest(t);if(n!=null)return n;let i=e.getRootNode();e=typeof ShadowRoot<"u"&&i instanceof ShadowRoot?i.host:null}return null},_r=(e,t)=>{if(e.parentElement!=null)return Ln(e.parentElement,t);let n=e.getRootNode();if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot)return Ln(n.host,t);return null},vs=(e)=>{if(e.parentElement!=null)return e.parentElement;let t=e.getRootNode();return typeof ShadowRoot<"u"&&t instanceof ShadowRoot?t.host:null},Ii=(e)=>{while(e!=null&&!Ue.has(e))e=vs(e);return e},Hi=(e)=>{let t=Ln(ys(e),wn);while(t!=null){let n=ue.get(t);for(let i of n??[]){let{binding:s,path:o}=i,{fromDOM:r}=s;if(r!=null){let l;try{l=r(t,i.options)}catch(a){throw console.error("Cannot get value from",t,"via",i),Error("Cannot obtain value fromDOM",{cause:a})}if(l!=null){let a=$n(),c=a[o];if(c==null)a[o]=l;else{let d=c[U]!=null?c[Le]:c,u=l[U]!=null?l[Le]:l;if(typeof d==="number"&&typeof u==="string"){let h=u.trim();if(h!==""){let f=Number(h);if(!Number.isNaN(f))u=f}}else if(u instanceof Date){if(typeof d==="number")u=u.getTime();else if(typeof d==="string")u=t.value}if(d instanceof Date&&u instanceof Date?d.getTime()!==u.getTime():d!==u)a[o]=u}}}}t=_r(t,wn)}};if(globalThis.document!=null)gt.body.addEventListener("change",Hi,!0),gt.body.addEventListener("input",Hi,!0);function Pr(e,t,n,i){let{paths:s,transform:o}=t,{toDOM:r}=n;if(r==null)return e;e.classList?.add(be);let l=ue.get(e);if(l==null)l=[],ue.set(e,l),zn();let a={paths:[...s],transform:o};for(let c of a.paths)l.push({path:c,binding:n,options:i,take:a});if(!s[0].startsWith("^"))Ke(s[0]);return e}var ji=!1,Vr=(e,t)=>{if(ji)return;if(typeof ShadowRoot<"u"&&e.getRootNode!=null&&e.getRootNode()instanceof ShadowRoot)ji=!0,console.warn(`tosijs: ${t} targets an element inside a shadow root, where data bindings do not operate (documented Component design boundary). A shadow-DOM component is bound like an <input>: bind its VALUE from outside (bindings.value) and implement render() to reflect value into the shadow DOM. Warned once per session.`,e)};function ye(e,t,n,i){if(e instanceof DocumentFragment)throw Error("bind cannot bind to a DocumentFragment");if(Vr(e,"bind()"),t!=null&&typeof t==="object"&&t[Nn])return Pr(e,t,n,i);let s;if(typeof t==="object"&&t[U]===void 0&&i===void 0){let{value:l}=t;s=typeof l==="string"?l:l[U],i={...t},delete i.value}else s=typeof t==="string"?t:t[U];if(s==null)throw Error("bind requires a path or object with xin Proxy");let{toDOM:o}=n;e.classList?.add(be);let r=ue.get(e);if(r==null)r=[],ue.set(e,r),zn();if(r.push({path:s,binding:n,options:i}),o!=null&&!s.startsWith("^"))Ke(s);if(i?.filter&&i?.needle)ye(e,i.needle,{toDOM(l,a){l[Dt]?.filter(a)}});return e}var Ri=new Set,Fr=(e)=>{let t=Ii(ys(e)),n=!1,i=new Proxy(e,{get(o,r){if(r==="stopPropagation")return()=>{e.stopPropagation(),n=!0};else{let l=o[r];return typeof l==="function"?l.bind(o):l}}}),s=new Set;while(!n&&t!=null){let o=Ue.get(t)?.[e.type]??s;for(let r of o){if(typeof r==="function")r(i);else{let l=$n()[r];if(typeof l==="function")l(i);else throw Error(`no event handler found at path ${r}`)}if(n)continue}t=Ii(vs(t))}};function In(e,t,n){let i=de(n);if(i!=null)n=i;let s=Ue.get(e);if(s==null)s={},Ue.set(e,s);if(!s[t])s[t]=new Set;if(s[t].add(n),!Ri.has(t))Ri.add(t),gt.body.addEventListener(t,Fr,!0);return()=>{s[t].delete(n)}}tr(ye,In);var Rt={value:{toDOM:$r,fromDOM(e){return zr(e)}},text:{toDOM(e,t){e.textContent=t}},enabled:{toDOM(e,t){e.disabled=!t}},disabled:{toDOM(e,t){e.disabled=Boolean(t)}},list:{toDOM(e,t,n){Ir(e,t,n).update(t)}}},Wa=180/Math.PI,Ua=Math.PI/180;function oe(e,t,n){return n<e?NaN:t<e?e:t>n?n:t}function Ee(e,t,n,i=!0){if(i)n=oe(0,n,1);return n*(t-e)+e}function qr(e,t=document.body){let n=getComputedStyle(t);if(e.endsWith(")")&&e.startsWith("var("))e=e.slice(4,-1);return n.getPropertyValue(e).trim()}var Wr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Ur=(e,t,n)=>(0.299*e+0.587*t+0.114*n)/255,Se=(e)=>("00"+Math.round(Number(e)).toString(16)).slice(-2);class bs{h;s;l;constructor(e,t,n){e/=255,t/=255,n/=255;let i=Math.max(e,t,n),s=i-Math.min(e,t,n),o=s!==0?i===e?(t-n)/s:i===t?2+(n-e)/s:4+(e-t)/s:0;this.h=60*o<0?60*o+360:60*o,this.s=s!==0?i<=0.5?s/(2*i-s):s/(2-(2*i-s)):0,this.l=(2*i-s)/2}}var me=globalThis.document!==void 0?globalThis.document.createElement("span"):void 0;if(me)me.style.display="none";class g{r;g;b;a;static fromVar(e,t=document.body){return g.fromCss(qr(e,t))}static fromCss(e){let t=Wr[String(e).trim().toLowerCase()];if(t!==void 0)e=t;let n=e.match(/^#([0-9a-fA-F]+)$/);if(n){let c=n[1],d=(u,h)=>parseInt(c.slice(u,u+h),16);if(c.length===3||c.length===4){let u=(h)=>d(h,1)*17;return new g(u(0),u(1),u(2),c.length===4?u(3)/255:1)}if(c.length===6||c.length===8)return new g(d(0,2),d(2,2),d(4,2),c.length===8?d(6,2)/255:1)}let i=e;if(me instanceof HTMLSpanElement)me.style.color="black",me.style.color=e,document.body.appendChild(me),i=getComputedStyle(me).color,me.remove();let[s,o,r,l]=i.match(/[\d.]+/g)||["0","0","0","0"],a=i.startsWith("color(srgb")?255:1;return new g(Number(s)*a,Number(o)*a,Number(r)*a,l==null?1:Number(l))}static fromHsl(e,t,n,i=1){let s,o,r;if(t===0)s=o=r=n;else{let a=(h,f,p)=>{if(p<0)p+=1;if(p>1)p-=1;if(p<0.16666666666666666)return h+(f-h)*6*p;if(p<0.5)return f;if(p<0.6666666666666666)return h+(f-h)*(0.6666666666666666-p)*6;return h},c=n<0.5?n*(1+t):n+t-n*t,d=2*n-c,u=(e%360+360)%360/360;s=a(d,c,u+0.3333333333333333),o=a(d,c,u),r=a(d,c,u-0.3333333333333333)}let l=new g(s*255,o*255,r*255,i);return l.hslCached={h:(e%360+360)%360,s:t,l:n},l}static black=new g(0,0,0);static white=new g(255,255,255);constructor(e,t,n,i=1){this.r=oe(0,e,255),this.g=oe(0,t,255),this.b=oe(0,n,255),this.a=oe(0,i,1)}get inverse(){return new g(255-this.r,255-this.g,255-this.b,this.a)}get inverseLuminance(){let{h:e,s:t,l:n}=this._hsl;return g.fromHsl(e,t,1-n,this.a)}get opaque(){return this.a===1?this:new g(this.r,this.g,this.b,1)}contrasting(e=1){return this.opaque.blend(this.brightness>0.5?g.black:g.white,e)}get rgb(){let{r:e,g:t,b:n}=this;return`rgb(${e.toFixed(0)},${t.toFixed(0)},${n.toFixed(0)})`}get rgba(){let{r:e,g:t,b:n,a:i}=this;return`rgba(${e.toFixed(0)},${t.toFixed(0)},${n.toFixed(0)},${i.toFixed(2)})`}get RGBA(){return[this.r/255,this.g/255,this.b/255,this.a]}get ARGB(){return[this.a,this.r/255,this.g/255,this.b/255]}hslCached;get _hsl(){if(this.hslCached==null)this.hslCached=new bs(this.r,this.g,this.b);return this.hslCached}get hsl(){let{h:e,s:t,l:n}=this._hsl;return`hsl(${e.toFixed(0)}deg ${(t*100).toFixed(0)}% ${(n*100).toFixed(0)}%)`}get hsla(){let{h:e,s:t,l:n}=this._hsl;return`hsl(${e.toFixed(0)}deg ${(t*100).toFixed(0)}% ${(n*100).toFixed(0)}% / ${(this.a*100).toFixed(0)}%)`}get mono(){let e=this.brightness*255;return new g(e,e,e)}get brightness(){return Ur(this.r,this.g,this.b)}get html(){return this.toString()}toString(){return this.a===1?"#"+Se(this.r)+Se(this.g)+Se(this.b):"#"+Se(this.r)+Se(this.g)+Se(this.b)+Se(255*this.a)}brighten(e){let{h:t,s:n,l:i}=this._hsl,s=oe(0,i+e*(1-i),1);return g.fromHsl(t,n,s,this.a)}darken(e){let{h:t,s:n,l:i}=this._hsl,s=oe(0,i*(1-e),1);return g.fromHsl(t,n,s,this.a)}saturate(e){let{h:t,s:n,l:i}=this._hsl,s=oe(0,n+e*(1-n),1);return g.fromHsl(t,s,i,this.a)}desaturate(e){let{h:t,s:n,l:i}=this._hsl,s=oe(0,n*(1-e),1);return g.fromHsl(t,s,i,this.a)}rotate(e){let{h:t,s:n,l:i}=this._hsl,s=(t+360+e)%360;return g.fromHsl(s,n,i,this.a)}opacity(e){let{h:t,s:n,l:i}=this._hsl;return g.fromHsl(t,n,i,e)}swatch(){return console.log(`%c %c ${this.html}, ${this.rgba}`,`background-color: ${this.html}`,"background-color: transparent"),this}blend(e,t){return new g(Ee(this.r,e.r,t),Ee(this.g,e.g,t),Ee(this.b,e.b,t),Ee(this.a,e.a,t))}static blendHue(e,t,n){let i=(t-e+720)%360;if(i<180)return e+n*i;else return e-(360-i)*n}mix(e,t){let n=this._hsl,i=e._hsl;return g.fromHsl(n.s===0?i.h:i.s===0?n.h:g.blendHue(n.h,i.h,t),Ee(n.s,i.s,t),Ee(n.l,i.l,t),Ee(this.a,e.a,t))}colorMix(e,t){return g.fromCss(`color-mix(in hsl, ${this.html}, ${e.html} ${(t*100).toFixed(0)}%)`)}static computedColorStylesheet=null;static computedColors=new Map;static recomputeQueued=!1;static registerComputedColor(e,t,n,i){if(!g.computedColors.has(e))g.computedColors.set(e,{varName:t,scale:n,method:i}),g.queueRecompute()}static queueRecompute(){if(g.recomputeQueued)return;g.recomputeQueued=!0,queueMicrotask(()=>{g.recomputeQueued=!1,g.recomputeColors()})}static recomputeColors(){if(g.computedColors.size===0)return;let e=[];for(let[n,{varName:i,scale:s,method:o}]of g.computedColors)try{let r=g.fromVar(i),l;switch(o){case"b":l=s>0?r.brighten(s):r.darken(-s);break;case"s":l=s>0?r.saturate(s):r.desaturate(-s);break;case"h":l=r.rotate(s*100);break;case"o":l=r.opacity(s);break;default:continue}e.push(` ${n}: ${l.rgba};`)}catch(r){}if(e.length===0)return;let t=`:root {
|
|
2
2
|
${e.join(`
|
|
3
3
|
`)}
|
|
4
|
-
}`;if(g.computedColorStylesheet===null)g.computedColorStylesheet=document.createElement("style"),g.computedColorStylesheet.id="tosijs-computed-colors",document.head.append(g.computedColorStylesheet);g.computedColorStylesheet.textContent=t}}function W(e){return e.replace(/[A-Z]/g,(t)=>`-${t.toLocaleLowerCase()}`)}function bs(e){return e.replace(/-([a-z])/g,(t,n)=>n.toLocaleUpperCase())}var Ur="http://www.w3.org/1998/Math/MathML",Kr="http://www.w3.org/2000/svg",Bt={},xs=(e,t,n)=>{let i=Ss(W(t),n);if(i.prop.startsWith("--"))e.style.setProperty(i.prop,i.value);else e.style[t]=i.value},Gr=(e)=>({toDOM(t,n){xs(t,e,n)}}),Ri=new WeakMap,ws=(e,t,n)=>{if(t==="style")if(typeof n==="object")for(let i of Object.keys(n))if(ce(n[i]))me(e,n[i],Gr(i));else xs(e,i,n[i]);else e.setAttribute("style",n);else{let i=W(t),s=e.constructor.observedAttributes;if(s?.includes(t)||s?.includes(i)){let o=e.constructor._resolveInitAttributes?.(),r=o?.[t]??o?.[i];if(r!==void 0&&r!==null&&n!==null&&n!==void 0&&typeof n!==typeof r)e[t]=n;else if(typeof n==="boolean")if(n)e.setAttribute(i,"");else e.removeAttribute(i);else e.setAttribute(i,n)}else if(e[t]!==void 0){let{MathMLElement:o}=globalThis;if(e instanceof SVGElement||o!==void 0&&e instanceof o)e.setAttribute(t,n);else e[t]=n}else if(i==="class"){let o=(c)=>String(c||"").split(/\s+/).filter(Boolean),r=new Set,l=new Set;if(Array.isArray(n))for(let c of n)for(let d of o(c))r.add(d);else if(n!=null&&typeof n==="object")for(let[c,d]of Object.entries(n))for(let u of o(c))(d?r:l).add(u);else for(let c of o(n))r.add(c);let a=Ri.get(e);if(a){for(let c of a)if(!r.has(c))e.classList.remove(c)}for(let c of l)e.classList.remove(c);for(let c of r)e.classList.add(c);Ri.set(e,r)}else if(e[i]!==void 0)e[i]=n;else if(typeof n==="boolean")if(n)e.setAttribute(i,"");else e.removeAttribute(i);else e.setAttribute(i,n)}},un={};var _i=(e)=>{if(!un[e])un[e]={toDOM(t,n){ws(t,e,n)}};return un[e]},Xr=(e)=>{if(typeof e!=="object")return!1;if(e instanceof Map)return!0;let t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null)return!0;return Object.keys(e).length>0},Yr=(e)=>{if(Array.isArray(e))return!1;if(typeof e==="function")return!1;let t=e.toString;return typeof t==="function"&&t!==Object.prototype.toString},Jr=(e)=>{let t=globalThis.Node;if(t!=null&&e instanceof t||typeof e==="string"||typeof e==="number")return"child";if(ce(e))return"proxy";if(Array.isArray(e))return"array";if(e==null)return"props";if(Xr(e))return"props";if(Yr(e))return"text";return"unusable"},Zr=(e,t)=>{let n=t.toLowerCase();if(e==="array")return`<${n}> was passed an array as a child. Arrays are not flattened — `+`did you mean to spread it? \`${n}(...items.map(…))\``;if(e==="unusable")return`<${n}> was passed a value that is neither a child nor a props `+"object — it has no text form and no properties to apply, so it was "+"ignored.";return},In=(e,t,n,i)=>{let s=Jr(e),o=Zr(s,t);if(o!=null){console.warn(o,e);return}if(s==="child")n(e);else if(s==="text")n(String(e));else if(s==="proxy")n(C.span({bind:{value:e,binding:"text"}}));else if(i!=null)i(e instanceof Map?Object.fromEntries(e):e);else if(e!=null)console.warn("fragment() was passed a props object, which has no element to apply "+"to — it was ignored.",e)},Cs=(e,t)=>{if(t?.bind!=null&&e.bind!=null){e.bind=[].concat(e.bind,t.bind);let{bind:n,...i}=t;Object.assign(e,i);return}Object.assign(e,t)},Hn=(e,t,n)=>{if(t==="apply")n(e);else if(t==="contract")ur(e,n);else if(t.match(/^on[A-Z]/)!=null){let i=e[t];if(e.tagName.includes("-")&&typeof i==="function"&&typeof n==="function")e[t]=n;else{let s=t.substring(2).toLowerCase();Dn(e,s,n)}}else if(t==="bind"){if(Array.isArray(n)){for(let s of n)Hn(e,"bind",s);return}let i=typeof n.binding==="string"?jt[n.binding]:n.binding;if(i!==void 0&&n.value!==void 0)me(e,n.value,i instanceof Function?{toDOM:i}:i,n.options);else throw Error("bad binding")}else if(t.match(/^bind[A-Z]/)!=null){let i=t.substring(4,5).toLowerCase()+t.substring(5),s=jt[i];if(s!==void 0)me(e,n,s);else throw Error(`${t} is not allowed, bindings.${i} is not defined`)}else if(n!=null&&typeof n==="object"&&n[$n])me(e,n,_i(t));else if(ce(n))me(e,n,_i(t));else ws(e,t,n)},jn=(e,...t)=>{if(Bt[e]===void 0){let[s,o]=e.split("|");if(o===void 0)Bt[e]=globalThis.document.createElement(s);else Bt[e]=globalThis.document.createElementNS(o,s)}let n=Bt[e].cloneNode(),i={};for(let s of t)In(s,n.tagName,(o)=>{if(n instanceof HTMLTemplateElement)n.content.append(o);else n.append(o)},(o)=>Cs(i,o));for(let s of Object.keys(i)){let o=i[s];Hn(n,s,o)}return n},Rn=(...e)=>{let t=globalThis.document.createDocumentFragment();for(let n of e)In(n,"fragment",(i)=>t.append(i));return t},C=new Proxy({fragment:Rn},{get(e,t){if(t=t.replace(/[A-Z]/g,(n)=>`-${n.toLocaleLowerCase()}`),e[t]===void 0)e[t]=(...n)=>jn(t,...n);return e[t]},set(){throw Error("You may not add new properties to elements")}}),_n=new Proxy({fragment:Rn},{get(e,t){if(e[t]===void 0)e[t]=(...n)=>jn(`${t}|${Kr}`,...n);return e[t]},set(){throw Error("You may not add new properties to elements")}}),Qr=new Proxy({fragment:Rn},{get(e,t){if(e[t]===void 0)e[t]=(...n)=>jn(`${t}|${Ur}`,...n);return e[t]},set(){throw Error("You may not add new properties to elements")}});var el=["sort","splice","copyWithin","fill","pop","push","reverse","shift","unshift"],tl=!0,nl=/^\.?([^.[\](),])+(\.[^.[\](),]+|\[\d+\]|\[[^=[\](),]*=[^[\]()]+\])*$/,il=(e)=>nl.test(e),pe=(e="",t="")=>{if(e==="")return t;else if(t.startsWith("[")&&t.endsWith("]"))return`${e}${t}`;else if(t.match(/^\d+$/)!==null||t.includes("="))return`${e}[${t}]`;else return`${e}.${t}`},Pn={};function hn(e,t){if(e!==null&&(typeof e==="object"||typeof e==="function"))return e;return new Proxy(Pn,ye(t,!0))}var ks=()=>new Proxy({},ye("^",!0)),fn=(e)=>{let t=e(ks())?.path;if(!t?.startsWith("^."))throw Error("selector must return a property of the item");return t.substring(2)},pn=(e,t,n)=>{for(let i=0;i<e.length;i++)if(`${_(e[i],t)}`===`${n}`)return i;return-1},sl=(e,t)=>({listFind(n,i){if(n instanceof Element){let r=n;while(r&&!r[qe]&&r.parentElement)r=r.parentElement;let l=r?.[qe];if(l==null)return;let a=t.indexOf(l);return a!==-1?oe[e][a]:void 0}let s=fn(n),o=pn(t,s,i);return o!==-1?oe[e][o]:void 0},listUpdate(n,i){let s=fn(n),o=_(i,s),r=pn(t,s,o);if(r!==-1){let l=oe[e][r];for(let a of Object.keys(i))l[a]=i[a];return l}return oe[e].push(i),oe[e][t.length-1]},listRemove(n,i){let s=fn(n),o=pn(t,s,i);if(o===-1)return!1;return oe[e].splice(o,1),!0}}),Pi=!1;function ol(){if(!Pi)console.warn("xinValue, tosiValue, xinPath, tosiPath, etc. are deprecated. Use .tosi.value, .tosi.path, .tosi.observe(), etc. instead."),Pi=!0}var Vi=(e)=>e===Pn,rl=(e,t)=>({get(n,i){switch(i){case"value":return _(ae,e);case"path":return e;case"touch":return()=>Ue(e);case"observe":return(s)=>{let o=On(e,s);return()=>En(o)};case"bind":return(s,o,r)=>{tr()(s,e,o,r)};case"on":{let s=t===Pn?_(ae,e):t.valueOf?t.valueOf():t;return(o,r)=>nr()(o,r,s)}case"binding":return(s)=>({bind:{value:e,binding:s}});case"listBinding":return(s=({span:r})=>r({bind:{value:"^",binding:"text"}}),o={})=>{let r=o.virtual?.itemsPerRow??1,l=[];for(let a=0;a<r;a++)l.push(s(C,ks(),a));return[{bindList:{value:e,...o}},C.template(...l)]};case"listFind":case"listUpdate":case"listRemove":return sl(e,Array.isArray(t)?t:[])[i];case"take":return(...s)=>{let o=s[s.length-1],r=s.slice(0,-1).map((l)=>typeof l==="string"?l:l[U]);return{[$n]:!0,paths:[e,...r],transform:o}}}return},set(n,i,s){if(i==="value"){if(s=B(s),B(Le[e])!==s&&cs(ae,e,s))Ue(e);return!0}return!1}}),Pe=(e,t)=>new Proxy(t,rl(e,t)),ll=["path","value","touch","observe","bind","on","binding","listBinding","listFind","listUpdate","listRemove","take"],Fi=new Set(ll),al=new Map([[U,"path"],[Te,"value"]]),qi=new Map([[U,"path"],["xinPath","path"],["tosiPath","path"],[Te,"value"],["xinValue","value"],["tosiValue","value"],[ir,"observe"],["xinObserve","observe"],["tosiObserve","observe"],[or,"on"],["xinOn","on"],["tosiOn","on"],[sr,"bind"],["xinBind","bind"],["tosiBind","bind"],["tosiBinding","binding"],["tosiListBinding","listBinding"]]),ye=(e,t)=>({get(n,i){if((i==="tosi"||i===rr)&&t)return Pe(e,n);if(Vi(n)){let a=()=>_(ae,e);switch(i){case"valueOf":case"toJSON":return()=>a();case Symbol.toPrimitive:return(h)=>{let f=a();if(h==="number")return Number(f);if(h==="string")return String(f);return f};case"toString":return()=>String(a())}if(Fi.has(i))return Pe(e,n)[i];let c=typeof i==="symbol"?al.get(i):void 0;if(c!==void 0)return Pe(e,n)[c];let d=qi.get(i);if(d!==void 0)return ol(),Pe(e,n)[d];let u=a();if(u!=null){let h=Object(u);if(i in h){let f=h[i];return typeof f==="function"?f.bind(h):f}}return}if(t&&(i==="valueOf"||i==="toJSON"))return()=>_(ae,e);if(t&&!(i in n)&&Fi.has(i))return Pe(e,n)[i];let s=qi.get(i);if(s!==void 0)return Pe(e,n)[s];if(typeof i==="symbol")return n[i];let o=Object.getOwnPropertyDescriptor(n,i);if(o&&!o.configurable&&!o.writable&&"value"in o)return o.value;let r=i,l=r.match(/^([^.[]+)\.(.+)$/)??r.match(/^([^\]]+)(\[.+)/)??r.match(/^(\[[^\]]+\])\.(.+)$/)??r.match(/^(\[[^\]]+\])\[(.+)$/);if(l!==null){let[,a,c]=l,d=pe(e,a),u=B(_(n,a));return u!==null&&typeof u==="object"?new Proxy(u,ye(d,t))[c]:u}if(r.startsWith("[")&&r.endsWith("]"))r=r.substring(1,r.length-1);if(!Array.isArray(n)&&n[r]!==void 0||Array.isArray(n)&&r.includes("=")){let a;if(r.includes("=")){let[c,d]=r.split("=");a=n.find((u)=>`${_(u,c)}`===d)}else a=n[r];if(a instanceof Object){a=B(a);let c=pe(e,r);return new Proxy(a instanceof Function?a.bind(n):a,ye(c,t))}else return t?hn(a,pe(e,r)):a}else if(Array.isArray(n)){let a=n[r];return typeof a==="function"?(...c)=>{let d=c.map((h)=>B(h)),u=a.apply(n,d);if(el.includes(r))Ue(e);if(u!=null&&typeof u==="object"){if(r==="find"||r==="findLast"||r==="at"){let h=n.indexOf(u);if(h!==-1)return new Proxy(u,ye(pe(e,String(h)),t))}}return u}:typeof a==="object"?new Proxy(B(a),ye(pe(e,r),t)):t?hn(a,pe(e,r)):a}else{let a=n[r];if(a!==null&&typeof a==="object")a=B(a);return t?hn(a,pe(e,r)):a}},set(n,i,s){if(s=B(s),typeof i==="symbol"&&i!==Te)return n[i]=s,!0;if(s!==null&&typeof s==="object")if(Array.isArray(s))for(let r=0;r<s.length;r++){let l=Object.getOwnPropertyDescriptor(s,r);if(l===void 0||l.writable!==!0)continue;if(l.value!==null&&typeof l.value==="object")s[r]=B(l.value)}else for(let r of Object.keys(s)){let l=Object.getOwnPropertyDescriptor(s,r);if(l===void 0||l.writable!==!0)continue;if(l.value!==null&&typeof l.value==="object")s[r]=B(l.value)}let o=i===Te||i==="xinValue"||i==="tosiValue"||i==="value"&&(Vi(n)||t&&!("value"in n))?e:pe(e,i);if(tl&&!il(o))throw Error(`setting invalid path ${o}`);if(B(Le[o])!==s&&cs(ae,o,s))Ue(o);return!0}}),cl=(e,t)=>{let n=typeof t==="function"?t:Le[t];if(typeof n!=="function")throw Error(`observe expects a function or path to a function, ${t} is neither`);return On(e,n)},Le=new Proxy(ae,ye("",!1));Qo(Le);var oe=new Proxy(ae,ye("",!0)),Ms=new Set,Wi=!1;function dl(){if(!Wi)Wi=!0,Ms.add(()=>g.queueRecompute())}function ul(){dl();for(let e of Ms)e()}function Es(e,t){let n=B(t),i=C.style(gt(n));i.id=e,document.head.append(i);let s=ce(t);if(s!==void 0)cl(s,()=>{i.textContent=gt(B(t)),ul()});return i}var hl=/^(animation-iteration-count|column-count|flex(-grow|-shrink)?|font-weight|opacity|order|orphans|scale|tab-size|widows|z-index|zoom)$/,fl=/^line-height$/,Ss=(e,t)=>{let n=e.replace(/^_+/,""),i=e.startsWith("_"),s=hl.test(n)||!i&&fl.test(n);if(typeof t==="number"&&!s)t=`${t}px`;if(e.startsWith("_"))if(e.startsWith("__"))e="--"+e.substring(2),t=`var(${e}-default, ${t})`;else e="--"+e.substring(1);return{prop:e,value:String(t)}},pl=(e,t,n)=>{if(n===void 0)return"";if(n instanceof g)n=n.html;let i=Ss(t,n);return`${e} ${i.prop}: ${i.value};`},As=(e,t,n="")=>{let i=W(e);if(typeof t==="object"&&!(t instanceof g)){let s=Object.keys(t).map((o)=>As(o,t[o],`${n} `)).join(`
|
|
4
|
+
}`;if(g.computedColorStylesheet===null)g.computedColorStylesheet=document.createElement("style"),g.computedColorStylesheet.id="tosijs-computed-colors",document.head.append(g.computedColorStylesheet);g.computedColorStylesheet.textContent=t}}function W(e){return e.replace(/[A-Z]/g,(t)=>`-${t.toLocaleLowerCase()}`)}function xs(e){return e.replace(/-([a-z])/g,(t,n)=>n.toLocaleUpperCase())}var Kr="http://www.w3.org/1998/Math/MathML",Gr="http://www.w3.org/2000/svg",$t={},ws=(e,t,n)=>{let i=As(W(t),n);if(i.prop.startsWith("--"))e.style.setProperty(i.prop,i.value);else e.style[t]=i.value},Xr=(e)=>({toDOM(t,n){ws(t,e,n)}}),_i=new WeakMap,Cs=(e,t,n)=>{if(t==="style")if(typeof n==="object")for(let i of Object.keys(n))if(de(n[i]))ye(e,n[i],Xr(i));else ws(e,i,n[i]);else e.setAttribute("style",n);else{let i=W(t),s=e.constructor.observedAttributes;if(s?.includes(t)||s?.includes(i)){let o=e.constructor._resolveInitAttributes?.(),r=o?.[t]??o?.[i];if(r!==void 0&&r!==null&&n!==null&&n!==void 0&&typeof n!==typeof r)e[t]=n;else if(typeof n==="boolean")if(n)e.setAttribute(i,"");else e.removeAttribute(i);else e.setAttribute(i,n)}else if(e[t]!==void 0){let{MathMLElement:o}=globalThis;if(e instanceof SVGElement||o!==void 0&&e instanceof o)e.setAttribute(t,n);else e[t]=n}else if(i==="class"){let o=(c)=>String(c||"").split(/\s+/).filter(Boolean),r=new Set,l=new Set;if(Array.isArray(n))for(let c of n)for(let d of o(c))r.add(d);else if(n!=null&&typeof n==="object")for(let[c,d]of Object.entries(n))for(let u of o(c))(d?r:l).add(u);else for(let c of o(n))r.add(c);let a=_i.get(e);if(a){for(let c of a)if(!r.has(c))e.classList.remove(c)}for(let c of l)e.classList.remove(c);for(let c of r)e.classList.add(c);_i.set(e,r)}else if(e[i]!==void 0)e[i]=n;else if(typeof n==="boolean")if(n)e.setAttribute(i,"");else e.removeAttribute(i);else e.setAttribute(i,n)}},hn={};var Pi=(e)=>{if(!hn[e])hn[e]={toDOM(t,n){Cs(t,e,n)}};return hn[e]},Yr=(e)=>{if(typeof e!=="object")return!1;if(e instanceof Map)return!0;let t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null)return!0;return Object.keys(e).length>0},Jr=(e)=>{if(Array.isArray(e))return!1;if(typeof e==="function")return!1;let t=e.toString;return typeof t==="function"&&t!==Object.prototype.toString},Zr=(e)=>{let t=globalThis.Node;if(t!=null&&e instanceof t||typeof e==="string"||typeof e==="number")return"child";if(de(e))return"proxy";if(Array.isArray(e))return"array";if(e==null)return"props";if(Yr(e))return"props";if(Jr(e))return"text";return"unusable"},Qr=(e,t)=>{let n=t.toLowerCase();if(e==="array")return`<${n}> was passed an array as a child. Arrays are not flattened — `+`did you mean to spread it? \`${n}(...items.map(…))\``;if(e==="unusable")return`<${n}> was passed a value that is neither a child nor a props `+"object — it has no text form and no properties to apply, so it was "+"ignored.";return},Hn=(e,t,n,i)=>{let s=Zr(e),o=Qr(s,t);if(o!=null){console.warn(o,e);return}if(s==="child")n(e);else if(s==="text")n(String(e));else if(s==="proxy")n(C.span({bind:{value:e,binding:"text"}}));else if(i!=null)i(e instanceof Map?Object.fromEntries(e):e);else if(e!=null)console.warn("fragment() was passed a props object, which has no element to apply "+"to — it was ignored.",e)},ks=(e,t)=>{if(t?.bind!=null&&e.bind!=null){e.bind=[].concat(e.bind,t.bind);let{bind:n,...i}=t;Object.assign(e,i);return}Object.assign(e,t)},jn=(e,t,n)=>{if(t==="apply")n(e);else if(t==="contract")hr(e,n);else if(t.match(/^on[A-Z]/)!=null){let i=e[t];if(e.tagName.includes("-")&&typeof i==="function"&&typeof n==="function")e[t]=n;else{let s=t.substring(2).toLowerCase();In(e,s,n)}}else if(t==="bind"){if(Array.isArray(n)){for(let s of n)jn(e,"bind",s);return}let i=typeof n.binding==="string"?Rt[n.binding]:n.binding;if(i!==void 0&&n.value!==void 0)ye(e,n.value,i instanceof Function?{toDOM:i}:i,n.options);else throw Error("bad binding")}else if(t.match(/^bind[A-Z]/)!=null){let i=t.substring(4,5).toLowerCase()+t.substring(5),s=Rt[i];if(s!==void 0)ye(e,n,s);else throw Error(`${t} is not allowed, bindings.${i} is not defined`)}else if(n!=null&&typeof n==="object"&&n[Nn])ye(e,n,Pi(t));else if(de(n))ye(e,n,Pi(t));else Cs(e,t,n)},Rn=(e,...t)=>{if($t[e]===void 0){let[s,o]=e.split("|");if(o===void 0)$t[e]=globalThis.document.createElement(s);else $t[e]=globalThis.document.createElementNS(o,s)}let n=$t[e].cloneNode(),i={};for(let s of t)Hn(s,n.tagName,(o)=>{if(n instanceof HTMLTemplateElement)n.content.append(o);else n.append(o)},(o)=>ks(i,o));for(let s of Object.keys(i)){let o=i[s];jn(n,s,o)}return n},_n=(...e)=>{let t=globalThis.document.createDocumentFragment();for(let n of e)Hn(n,"fragment",(i)=>t.append(i));return t},C=new Proxy({fragment:_n},{get(e,t){if(t=t.replace(/[A-Z]/g,(n)=>`-${n.toLocaleLowerCase()}`),e[t]===void 0)e[t]=(...n)=>Rn(t,...n);return e[t]},set(){throw Error("You may not add new properties to elements")}}),Pn=new Proxy({fragment:_n},{get(e,t){if(e[t]===void 0)e[t]=(...n)=>Rn(`${t}|${Gr}`,...n);return e[t]},set(){throw Error("You may not add new properties to elements")}}),el=new Proxy({fragment:_n},{get(e,t){if(e[t]===void 0)e[t]=(...n)=>Rn(`${t}|${Kr}`,...n);return e[t]},set(){throw Error("You may not add new properties to elements")}});var tl=["sort","splice","copyWithin","fill","pop","push","reverse","shift","unshift"],nl=!0,il=/^\.?([^.[\](),])+(\.[^.[\](),]+|\[\d+\]|\[[^=[\](),]*=[^[\]()]+\])*$/,sl=(e)=>il.test(e),ge=(e="",t="")=>{if(e==="")return t;else if(t.startsWith("[")&&t.endsWith("]"))return`${e}${t}`;else if(t.match(/^\d+$/)!==null||t.includes("="))return`${e}[${t}]`;else return`${e}.${t}`},Vn={};function fn(e,t){if(e!==null&&(typeof e==="object"||typeof e==="function"))return e;return new Proxy(Vn,ve(t,!0))}var Ms=()=>new Proxy({},ve("^",!0)),pn=(e)=>{let t=e(Ms())?.path;if(!t?.startsWith("^."))throw Error("selector must return a property of the item");return t.substring(2)},gn=(e,t,n)=>{for(let i=0;i<e.length;i++)if(`${_(e[i],t)}`===`${n}`)return i;return-1},ol=(e,t)=>({listFind(n,i){if(n instanceof Element){let r=n;while(r&&!r[We]&&r.parentElement)r=r.parentElement;let l=r?.[We];if(l==null)return;let a=t.indexOf(l);return a!==-1?re[e][a]:void 0}let s=pn(n),o=gn(t,s,i);return o!==-1?re[e][o]:void 0},listUpdate(n,i){let s=pn(n),o=_(i,s),r=gn(t,s,o);if(r!==-1){let l=re[e][r];for(let a of Object.keys(i))l[a]=i[a];return l}return re[e].push(i),re[e][t.length-1]},listRemove(n,i){let s=pn(n),o=gn(t,s,i);if(o===-1)return!1;return re[e].splice(o,1),!0}}),Vi=!1;function rl(){if(!Vi)console.warn("xinValue, tosiValue, xinPath, tosiPath, etc. are deprecated. Use .tosi.value, .tosi.path, .tosi.observe(), etc. instead."),Vi=!0}var Fi=(e)=>e===Vn,ll=(e,t)=>({get(n,i){switch(i){case"value":return _(ce,e);case"path":return e;case"touch":return()=>Ke(e);case"observe":return(s)=>{let o=Dn(e,s);return()=>Sn(o)};case"bind":return(s,o,r)=>{nr()(s,e,o,r)};case"on":{let s=t===Vn?_(ce,e):t.valueOf?t.valueOf():t;return(o,r)=>ir()(o,r,s)}case"binding":return(s)=>({bind:{value:e,binding:s}});case"listBinding":return(s=({span:r})=>r({bind:{value:"^",binding:"text"}}),o={})=>{let r=o.virtual?.itemsPerRow??1,l=[];for(let a=0;a<r;a++)l.push(s(C,Ms(),a));return[{bindList:{value:e,...o}},C.template(...l)]};case"listFind":case"listUpdate":case"listRemove":return ol(e,Array.isArray(t)?t:[])[i];case"take":return(...s)=>{let o=s[s.length-1],r=s.slice(0,-1).map((l)=>typeof l==="string"?l:l[U]);return{[Nn]:!0,paths:[e,...r],transform:o}}}return},set(n,i,s){if(i==="value"){if(s=B(s),B(Be[e])!==s&&ds(ce,e,s))Ke(e);return!0}return!1}}),Ve=(e,t)=>new Proxy(t,ll(e,t)),al=["path","value","touch","observe","bind","on","binding","listBinding","listFind","listUpdate","listRemove","take"],qi=new Set(al),cl=new Map([[U,"path"],[Le,"value"]]),Wi=new Map([[U,"path"],["xinPath","path"],["tosiPath","path"],[Le,"value"],["xinValue","value"],["tosiValue","value"],[sr,"observe"],["xinObserve","observe"],["tosiObserve","observe"],[rr,"on"],["xinOn","on"],["tosiOn","on"],[or,"bind"],["xinBind","bind"],["tosiBind","bind"],["tosiBinding","binding"],["tosiListBinding","listBinding"]]),ve=(e,t)=>({get(n,i){if((i==="tosi"||i===lr)&&t)return Ve(e,n);if(Fi(n)){let a=()=>_(ce,e);switch(i){case"valueOf":case"toJSON":return()=>a();case Symbol.toPrimitive:return(h)=>{let f=a();if(h==="number")return Number(f);if(h==="string")return String(f);return f};case"toString":return()=>String(a())}if(qi.has(i))return Ve(e,n)[i];let c=typeof i==="symbol"?cl.get(i):void 0;if(c!==void 0)return Ve(e,n)[c];let d=Wi.get(i);if(d!==void 0)return rl(),Ve(e,n)[d];let u=a();if(u!=null){let h=Object(u);if(i in h){let f=h[i];return typeof f==="function"?f.bind(h):f}}return}if(t&&(i==="valueOf"||i==="toJSON"))return()=>_(ce,e);if(t&&!(i in n)&&qi.has(i))return Ve(e,n)[i];let s=Wi.get(i);if(s!==void 0)return Ve(e,n)[s];if(typeof i==="symbol")return n[i];let o=Object.getOwnPropertyDescriptor(n,i);if(o&&!o.configurable&&!o.writable&&"value"in o)return o.value;let r=i,l=r.match(/^([^.[]+)\.(.+)$/)??r.match(/^([^\]]+)(\[.+)/)??r.match(/^(\[[^\]]+\])\.(.+)$/)??r.match(/^(\[[^\]]+\])\[(.+)$/);if(l!==null){let[,a,c]=l,d=ge(e,a),u=B(_(n,a));return u!==null&&typeof u==="object"?new Proxy(u,ve(d,t))[c]:u}if(r.startsWith("[")&&r.endsWith("]"))r=r.substring(1,r.length-1);if(!Array.isArray(n)&&n[r]!==void 0||Array.isArray(n)&&r.includes("=")){let a;if(r.includes("=")){let[c,d]=r.split("=");a=n.find((u)=>`${_(u,c)}`===d)}else a=n[r];if(a instanceof Object){a=B(a);let c=ge(e,r);return new Proxy(a instanceof Function?a.bind(n):a,ve(c,t))}else return t?fn(a,ge(e,r)):a}else if(Array.isArray(n)){let a=n[r];return typeof a==="function"?(...c)=>{let d=c.map((h)=>B(h)),u=a.apply(n,d);if(tl.includes(r))Ke(e);if(u!=null&&typeof u==="object"){if(r==="find"||r==="findLast"||r==="at"){let h=n.indexOf(u);if(h!==-1)return new Proxy(u,ve(ge(e,String(h)),t))}}return u}:typeof a==="object"?new Proxy(B(a),ve(ge(e,r),t)):t?fn(a,ge(e,r)):a}else{let a=n[r];if(a!==null&&typeof a==="object")a=B(a);return t?fn(a,ge(e,r)):a}},set(n,i,s){if(s=B(s),typeof i==="symbol"&&i!==Le)return n[i]=s,!0;if(s!==null&&typeof s==="object")if(Array.isArray(s))for(let r=0;r<s.length;r++){let l=Object.getOwnPropertyDescriptor(s,r);if(l===void 0||l.writable!==!0)continue;if(l.value!==null&&typeof l.value==="object")s[r]=B(l.value)}else for(let r of Object.keys(s)){let l=Object.getOwnPropertyDescriptor(s,r);if(l===void 0||l.writable!==!0)continue;if(l.value!==null&&typeof l.value==="object")s[r]=B(l.value)}let o=i===Le||i==="xinValue"||i==="tosiValue"||i==="value"&&(Fi(n)||t&&!("value"in n))?e:ge(e,i);if(nl&&!sl(o))throw Error(`setting invalid path ${o}`);if(B(Be[o])!==s&&ds(ce,o,s))Ke(o);return!0}}),dl=(e,t)=>{let n=typeof t==="function"?t:Be[t];if(typeof n!=="function")throw Error(`observe expects a function or path to a function, ${t} is neither`);return Dn(e,n)},Be=new Proxy(ce,ve("",!1));er(Be);var re=new Proxy(ce,ve("",!0)),Es=new Set,Ui=!1;function ul(){if(!Ui)Ui=!0,Es.add(()=>g.queueRecompute())}function hl(){ul();for(let e of Es)e()}function Ss(e,t){let n=B(t),i=C.style(mt(n));i.id=e,document.head.append(i);let s=de(t);if(s!==void 0)dl(s,()=>{i.textContent=mt(B(t)),hl()});return i}var fl=/^(animation-iteration-count|column-count|flex(-grow|-shrink)?|font-weight|opacity|order|orphans|scale|tab-size|widows|z-index|zoom)$/,pl=/^line-height$/,As=(e,t)=>{let n=e.replace(/^_+/,""),i=e.startsWith("_"),s=fl.test(n)||!i&&pl.test(n);if(typeof t==="number"&&!s)t=`${t}px`;if(e.startsWith("_"))if(e.startsWith("__"))e="--"+e.substring(2),t=`var(${e}-default, ${t})`;else e="--"+e.substring(1);return{prop:e,value:String(t)}},gl=(e,t,n)=>{if(n===void 0)return"";if(n instanceof g)n=n.html;let i=As(t,n);return`${e} ${i.prop}: ${i.value};`},Ts=(e,t,n="")=>{let i=W(e);if(typeof t==="object"&&!(t instanceof g)){let s=Object.keys(t).map((o)=>Ts(o,t[o],`${n} `)).join(`
|
|
5
5
|
`);return`${n} ${e} {
|
|
6
6
|
${s}
|
|
7
|
-
${n} }`}else return
|
|
7
|
+
${n} }`}else return gl(n,i,t)},mt=(e,t="")=>Object.keys(e).map((n)=>{let i=e[n];if(typeof i==="string"){if(n==="@import")return`@import url('${i}');`;throw Error("top-level string value only allowed for `@import`")}let s=Object.keys(i).map((o)=>Ts(o,i[o])).join(`
|
|
8
8
|
`);return`${t}${n} {
|
|
9
9
|
${s}
|
|
10
10
|
}`}).join(`
|
|
11
11
|
|
|
12
|
-
`);var m=new Proxy({},{get(e,t){if(e[t]===void 0){let n="--"+W(t);e[t]=(i)=>`var(${n}, ${i})`}return e[t]}}),L=new Proxy({},{get(e,t){if(t==="default")return m;if(e[t]==null){t=W(t);let[,n,,i,s,o]=t.match(/^([-\w]*?)((_)?(\d+)(\w?))?$/)||["",t],r=`--${n}`;if(s!=null){let l=i==null?Number(s)/100:-Number(s)/100;switch(o){case"b":case"s":case"h":case"o":{let a=`--${t}`;g.registerComputedColor(a,r,l,o),e[t]=`var(${a})`}break;case"":e[t]=`calc(var(${r}) * ${l})`;break;default:throw console.error(o),Error(`Unrecognized method ${o} for css variable ${r}`)}}else e[t]=`var(${r})`}return e[t]}});function
|
|
13
|
-
`+i:i}function Ml(e){if(ut[e])document.head.append(C.style({id:e+"-component"},ut[e]));delete ut[e]}function El(e){let t=Object.create(null),n=(i)=>{if(Array.isArray(i)){i.forEach(n);return}if(!(i instanceof Element))return;let s=i.getAttribute("part");if(s!=null&&!(s in t))t[s]=i;for(let o of Array.from(i.children))n(o)};return n(e),t}var w=(e)=>e,Sl=(e)=>{class t extends E{static initAttributes=e}return t};class E extends HTMLElement{static elements=C;static _elementCreator;static initAttributes;static formAssociated;static preferredTagName;static shadowStyleSpec;static lightStyleSpec;static extends;internals;get validity(){return this.internals?.validity}get validationMessage(){return this.internals?.validationMessage??""}get willValidate(){return this.internals?.willValidate??!1}checkValidity(){return this.internals?.checkValidity()??!0}reportValidity(){return this.internals?.reportValidity()??!0}setCustomValidity(e){if(this.internals)if(e)this.internals.setValidity({customError:!0},e);else this.internals.setValidity({})}setValidity(e,t,n){this.internals?.setValidity(e,t,n)}setFormValue(e,t){this.internals?.setFormValue(e,t)}static _resolveInitAttributes(){let e=Fe(this),t=Object.prototype.hasOwnProperty.call(this,"initAttributes")?this.initAttributes:void 0;if(e?.attributes!=null){let r=Nt.get(this);if(r!=null)return r;let l={...t??{}},a=[];for(let[h,f]of Object.entries(e.attributes))if(f!=null&&"default"in f)l[h]=f.default;else if(!(h in l))a.push(h);if(a.length>0)throw Error(`${this.name} contract.attributes entries missing 'default': ${a.join(", ")} — the attribute machinery infers `+"each attribute's runtime type from its default, so every declared attribute needs one, either here or in static initAttributes.");let c=Object.getPrototypeOf(this),d=typeof c?._resolveInitAttributes==="function"?c._resolveInitAttributes():void 0,u=d!=null?{...d,...l}:l;return Nt.set(this,u),u}if(t==null){let r=Object.getPrototypeOf(this);return typeof r?._resolveInitAttributes==="function"?r._resolveInitAttributes():this.initAttributes}let n=Nt.get(this);if(n!=null)return n;let i=Object.getPrototypeOf(this),s=typeof i?._resolveInitAttributes==="function"?i._resolveInitAttributes():void 0;if(s==null||s===t)return t;let o={...s,...t};return Nt.set(this,o),o}static computed(e=""){return{[Ts]:!0,shape:e}}static _describedAttributes(){let e=this._resolveInitAttributes(),t=Fe(this)?.attributes;if(e==null)return t;let n={};for(let[i,s]of Object.entries(e)){let o=Xi(s)?s.shape:s;n[i]={type:typeof o,default:o}}return t!=null?{...n,...t}:n}static get observedAttributes(){let e=this._resolveInitAttributes();if(e)return["hidden",...Object.keys(e).map(W)];return["hidden"]}instanceId;styleNode;static styleSpec;static styleNode;content=C.slot();isSlotted;static _tagName=null;static get tagName(){return this._tagName}_legacyTrackedAttrs;_attrValues;_valueChanged=!1;_pendingAttrOps;static StyleNode(e){return console.warn("StyleNode is deprecated, use static shadowStyleSpec instead"),C.style(gt(e))}static elementCreator(e={}){let t=this;if(!Object.prototype.hasOwnProperty.call(t,"_elementCreator")){if(e.tag!==void 0)le("elementCreator-tag","Passing tag to elementCreator() is deprecated. Use static preferredTagName instead.");if(e.styleSpec!==void 0)le("elementCreator-styleSpec","Passing styleSpec to elementCreator() is deprecated. Use static lightStyleSpec instead.");if(e.extends!==void 0)le("elementCreator-extends","Passing extends to elementCreator() is deprecated. Use static extends instead.");let n=e.tag??t.preferredTagName;if(n==null)if(typeof t.name==="string"&&t.name!==""){if(n=W(t.name),n.startsWith("-"))n=n.slice(1)}else n=gn();if(customElements.get(n)!=null)console.warn(`${n} is already defined`);if(n.match(/\w+(-\w+)+/)==null)console.warn(`${n} is not a legal tag for a custom-element`),n=gn();while(customElements.get(n)!==void 0)n=gn();t._tagName=n;let i=e.styleSpec??t.lightStyleSpec;if(i!==void 0)kl(n,i);let s=e.extends??t.extends,o=s?{extends:s}:void 0,r=this.prototype;if(r!=null&&!Object.prototype.hasOwnProperty.call(r,Qi)){let l=r.connectedCallback;r.connectedCallback=function(){if(this._drainPendingAttrOps(),l)l.call(this)},Object.defineProperty(r,Qi,{value:!0,enumerable:!1})}window.customElements.define(n,this,o),t._elementCreator=C[n]}return t._elementCreator}initAttributes(...e){if(le("initAttributes","initAttributes() is deprecated. Use static initAttributes = { ... } instead."),!this._legacyTrackedAttrs)this._legacyTrackedAttrs=new Set;for(let i of e)this._legacyTrackedAttrs.add(i);Cl().observe(this,{attributes:!0});let t={},n={};e.forEach((i)=>{t[i]=re(w(this)[i]);let s=W(i);Object.defineProperty(this,i,{enumerable:!1,get(){if(typeof t[i]==="boolean")return this.hasAttribute(s);else if(this.hasAttribute(s))return typeof t[i]==="number"?parseFloat(this.getAttribute(s)):this.getAttribute(s);else if(n[i]!==void 0)return n[i];else return t[i]},set(o){if(typeof t[i]==="boolean"){if(o!==this[i]){if(o)this.setAttribute(s,"");else this.removeAttribute(s);this.queueRender()}}else if(typeof t[i]==="number"){if(o!==parseFloat(this[i]))this.setAttribute(s,o),this.queueRender()}else if(typeof o==="object"||`${o}`!==`${this[i]}`){if(o===null||o===void 0||typeof o==="object")this.removeAttribute(s);else this.setAttribute(s,o);this.queueRender(),n[i]=o}}})})}initValue(){let e=Object.getOwnPropertyDescriptor(this,"value");if(e!==void 0&&(e.get!==void 0||e.set!==void 0))return;if(e===void 0){let n=this.constructor;if(Fe(n)?.value==null)return;let i;for(let s=Object.getPrototypeOf(this);s!=null&&i===void 0;s=Object.getPrototypeOf(s))i=Object.getOwnPropertyDescriptor(s,"value");if(i?.get!==void 0||i?.set!==void 0){let s=this.tagName?.toLowerCase();if(!Ki.has(s))Ki.add(s),console.error(`<${s}> declares contract.value, but implements \`value\` as its own getter/setter, so tosijs cannot enforce the contract `+"there — and describe() still publishes it. Call "+"exerciseComponent in your tests, check the value in your own setter, or drop contract.value so the map stops advertising a rule nothing checks.");return}this.value=this.hasAttribute("value")?this.getAttribute("value"):void 0}let t=this.hasAttribute("value")?this.getAttribute("value"):re(w(this).value);delete w(this).value,Object.defineProperty(this,"value",{enumerable:!1,get(){return t},set(n){if(t!==n)wl(this,n),t=n,this._valueChanged=!0,this.queueRender(!0)}})}_parts;_partsCache=Object.create(null);get parts(){let e=this;if(this._parts==null)this._parts=new Proxy({},{get(t,n){if(typeof n!=="string")return;let i=e._partsCache,s=i[n]??null,o=s;if(o!=null&&!o.isConnected)o=null;if(o==null){let r=e.shadowRoot!=null?e.shadowRoot:e;if(o=r.querySelector(`[part="${n}"]`),o==null)o=r.querySelector(n);if(o==null&&s!=null)return s;if(o==null)throw Error(`elementRef "${n}" does not exist!`);i[n]=o}return o}});return this._parts}attributeChangedCallback(e,t,n){let i=bs(e);if(n===null&&this._attrValues?.has(i))this._attrValues.delete(i);let s=this._computedAttrShapes?.get(i);if(s!==void 0&&!this._applyingComputedAttr?.has(i)){this._applyingComputedAttr??=new Set,this._applyingComputedAttr.add(i);try{this[i]=s==="boolean"?n!==null:n??""}finally{this._applyingComputedAttr.delete(i)}return}if(!this._legacyTrackedAttrs?.has(i))this.queueRender(!1)}_applyingComputedAttr;constructor(){super();if(Yi+=1,this._installAttributeQueue(),this.constructor.formAssociated&&typeof this.attachInternals==="function"&&!this.internals)this.internals=this.attachInternals();let e=this.constructor._resolveInitAttributes();if(e)this._setupAttributeAccessors(e);this.instanceId=`${this.tagName.toLocaleLowerCase()}-${Yi}`,w(this)._value=re(w(this).defaultValue),this._warnOnHandlerCollisions()}_warnOnHandlerCollisions(){let e=this.constructor;if(es.has(e))return;es.add(e),queueMicrotask(()=>{let t=new Set;for(let r of Object.keys(this))if(/^on[A-Z]/.test(r))t.add(r);let n=Object.getPrototypeOf(this);while(n&&n!==E.prototype){for(let r of Object.getOwnPropertyNames(n))if(/^on[A-Z]/.test(r))t.add(r);n=Object.getPrototypeOf(n)}let i=this.tagName.toLowerCase();if(t.delete("onResize")&&w(this).handleResize===void 0)console.warn(`<${i}> defines 'onResize', which is deprecated. Rename it to 'handleResize'. The on<Event> prefix is reserved for event-handler sugar in the elements factory (creator({ onResize }) would attach a 'resize' listener) and is being retired for component callbacks in favor of the handle<Event> convention.`);if(t.size===0)return;let s=Array.from(t,(r)=>`'${r}'`).join(", "),o=Array.from(t)[0];if(Ae.quiet===!0)return;console.warn(`<${i}> defines ${s} — on<Event>-shaped member name(s), which `+`collide with the elements factory's event-handler sugar. Since 1.8.0, IF the member holds a function when the creator runs, it wins: creator({ ${o}: fn }) assigns it rather than attaching a '${o.slice(2).toLowerCase()}' listener `+"(tosijs#22) — and then that name can no longer carry event sugar. "+"A member declared but left undefined/null still gets event sugar, so the meaning depends on initialisation: give it a function default, or rename to handle<Event> for a component callback / add<Event>Listener for something that registers a listener.")})}_installAttributeQueue(){let e=this.constructor._resolveInitAttributes();if(!e)return;let t=new Set(Object.keys(e).map(W)),n=[];this._pendingAttrOps=n;let i=HTMLElement.prototype;this.setAttribute=(s,o)=>{if(t.has(s))n.push(["set",s,String(o)]);else i.setAttribute.call(this,s,o)},this.removeAttribute=(s)=>{if(t.has(s))n.push(["remove",s]);else i.removeAttribute.call(this,s)},queueMicrotask(()=>this._drainPendingAttrOps())}_drainPendingAttrOps(){let e=this._pendingAttrOps;if(e===void 0)return;this._pendingAttrOps=void 0,delete this.setAttribute,delete this.removeAttribute;let t=new Set;for(let n of e)if(this.hasAttribute(n[1]))t.add(n[1]);for(let n of e)if(n[0]==="set"){if(!t.has(n[1]))this.setAttribute(n[1],n[2])}else t.delete(n[1]),this.removeAttribute(n[1])}_installedAttrAccessors;_attrTypedOverride;_installComputedAttribute(e,t){let n=Object.getPrototypeOf(this),i;while(n!=null&&n!==E.prototype&&i===void 0)if(i=Object.getOwnPropertyDescriptor(n,e),i===void 0)n=Object.getPrototypeOf(n);if(i?.get==null)throw Error(`${this.tagName}: initAttributes.${e} is Component.computed(), `+"which declares that this class implements the attribute itself — "+`but no \`get ${e}()\` was found on the class. Define get/set for it, or give the attribute an ordinary default value instead. (If "${e}" is a native DOM property — title, `+"id, hidden, lang, slot, tabIndex … — it cannot be a computed "+"attribute: tosijs will not shadow the platform's accessor, because doing so corrupts it for every element on the page.)");if(this._computedAttrShapes??=new Map,this._computedAttrShapes.set(e,typeof t==="boolean"?"boolean":"string"),i.set==null||n==null)return;if(Gi.has(i.set))return;let{get:s,set:o}=i,r=function(l){let a;try{a=s.call(this)}catch{a=void 0}o.call(this,l);let c;try{c=s.call(this)}catch{c=void 0}if(c!==a)this.queueRender()};Gi.add(r),Object.defineProperty(n,e,{configurable:!0,enumerable:i.enumerable,get:i.get,set:r})}_computedAttrShapes;_setupAttributeAccessors(e){if(!this._attrValues)this._attrValues=new Map;if(!this._installedAttrAccessors)this._installedAttrAccessors=new Set;for(let t of Object.keys(e)){let n=W(t),i=e[t];if(t==="value"){console.warn(`${this.tagName}: 'value' cannot be an attribute. Use the Component value property instead.`);continue}if(Xi(i)){this._installComputedAttribute(t,i.shape);continue}if(typeof i==="object"&&i!==null){console.warn(`${this.tagName}: initAttributes.${t} is an object. Use a regular property instead.`);continue}if(i===!0)throw Error(`${this.tagName}: static initAttributes.${t} defaults a boolean attribute to true, but HTML boolean attributes are false-by-default (presence = true, absence = false) and `+`cannot reflect a true default — it would silently become false. Use { ${t}: false }, or model it as a string/number attribute or a plain (non-attribute) property.`);let s=this,o=!1;while(s){let r=Object.getOwnPropertyDescriptor(s,t);if(r){if(!r.configurable||r.get||r.set){o=!0;break}break}s=Object.getPrototypeOf(s)}if(o)continue;this._installAttrAccessor(t,n,i)}}_installAttrAccessor(e,t,n){Object.defineProperty(this,e,{enumerable:!1,configurable:!0,get:()=>{let i=()=>{let s=this._attrTypedOverride?.get(e);return s!==void 0&&s.reflected===this.getAttribute(t)?{value:s.value}:void 0};if(typeof n==="boolean"){if(this.hasAttribute(t))return i()?.value??!0;if(this._attrValues.has(e))return this._attrValues.get(e);return!1}else if(this.hasAttribute(t)){if(typeof n==="number")return i()?.value??parseFloat(this.getAttribute(t));let s=this._attrTypedOverride?.get(e);if(s!==void 0&&s.reflected===this.getAttribute(t))return s.value;return this.getAttribute(t)}else if(this._attrValues.has(e))return this._attrValues.get(e);else return n},set:(i)=>{if(i!=null&&typeof i!==typeof n&&typeof i!=="object")this._attrTypedOverride??=new Map,this._attrTypedOverride.set(e,{reflected:typeof n==="boolean"&&i?"":String(i),value:i});else this._attrTypedOverride?.delete(e);if(i!=null&&typeof i!==typeof n&&typeof n!=="object"){let s=`${this.tagName.toLowerCase()}.${e}`;if(!ts.has(s))ts.add(s),console.error(`<${this.tagName.toLowerCase()}>: ${e} is declared ${typeof n} (default ${JSON.stringify(n)}), but was written ${typeof i} ${JSON.stringify(i)}. `+"The value is applied as given — nothing is coerced — but this "+"is usually a call site left behind by a type change. (tosijs#24)")}if(typeof n==="boolean"){if(i!==w(this)[e]){if(i)this.setAttribute(t,"");else this.removeAttribute(t);this.queueRender(),this._attrValues.set(e,!!i)}}else if(typeof n==="number"){if(i!==parseFloat(w(this)[e]))this.setAttribute(t,i),this.queueRender(),this._attrValues.set(e,i)}else if(typeof i==="object"||`${i}`!==`${w(this)[e]}`){if(i===null||i===void 0||typeof i==="object")this.removeAttribute(t);else this.setAttribute(t,i);this.queueRender(),this._attrValues.set(e,i)}}}),this._installedAttrAccessors.add(e)}_recoverShadowedAttrAccessors(){let e=this._installedAttrAccessors,t=this.constructor._resolveInitAttributes();if(e==null||t==null)return;let n=[];for(let i of e){let s=Object.getOwnPropertyDescriptor(this,i);if(s==null||s.get!=null||s.set!=null)continue;let o=s.value;delete this[i],this._installAttrAccessor(i,W(i),t[i]),this[i]=o,n.push(i)}if(n.length>0&&!Zi.has(this.tagName)){Zi.add(this.tagName);let i=n.map((s)=>`'${s}'`).join(", ");console.warn(`<${this.tagName.toLowerCase()}> declares instance field(s) ${i} that shadow static initAttributes accessors (class fields use [[Define]] semantics). The field value was adopted and the `+"reactive accessor restored — delete the field declaration; "+"static initAttributes already defines the property.")}}connectedCallback(){if(this._recoverShadowedAttrAccessors(),this._drainPendingAttrOps(),Ml(this.constructor.tagName),this.hydrate(),this.role!=null)this.setAttribute("role",this.role);{let t=this.constructor,n=Fe(t),i=n?.description;if(typeof i==="string"&&i!==""&&!this.hasAttribute("aria-description")&&!this.hasAttribute("aria-describedby"))this.setAttribute("aria-description",i);let s=n?.role;if(typeof s==="string"&&s!==""&&!this.getAttribute("role"))this.setAttribute("role",s)}if(this.constructor.formAssociated&&!this.hasAttribute("tabindex"))this.setAttribute("tabindex","0");let e=w(this).handleResize??w(this).onResize;if(e!==void 0){if(An.observe(this),w(this)._onResize==null)w(this)._onResize=e.bind(this);this.addEventListener("resize",w(this)._onResize)}if(w(this).value!=null&&this.getAttribute("value")!=null)w(this)._value=this.getAttribute("value");if(this.internals&&w(this).value!==void 0)this.internals.setFormValue(w(this).value),this.validateValue();this.queueRender()}disconnectedCallback(){An.unobserve(this)}formResetCallback(){if(w(this).value!==void 0)w(this).value=w(this).defaultValue??""}formDisabledCallback(e){if(e)this.setAttribute("disabled","");else this.removeAttribute("disabled")}formStateRestoreCallback(e){if(w(this).value!==void 0&&typeof e==="string")w(this).value=e}_changeQueued=!1;_renderQueued=!1;queueRender(e=!1){if(!this._hydrated)return;if(!this._changeQueued)this._changeQueued=e;if(!this._renderQueued)this._renderQueued=!0,requestAnimationFrame(()=>{if(this._changeQueued){if(us(this,"change",{bubbles:!0,composed:!0}),this.internals&&w(this).value!==void 0)this.internals.setFormValue(w(this).value)}this._changeQueued=!1,this._renderQueued=!1,this.render()})}_hydrated=!1;_whenHydrated;_resolveHydrated;get hydrated(){return this._hydrated}get whenHydrated(){if(this._hydrated)return Promise.resolve();if(this._whenHydrated==null)this._whenHydrated=new Promise((e)=>{this._resolveHydrated=e});return this._whenHydrated}hydrate(){if(!this._hydrated){this.initValue();let e=typeof this.content!=="function",t=typeof this.content==="function"?this.content(C):this.content;if(t!=null&&!Array.isArray(t)&&!(t instanceof Node)&&typeof t!=="string")t=[t];if(Array.isArray(t)){let o={},r=[];for(let l of t)In(l,this.tagName,(a)=>r.push(a),(a)=>Cs(o,a));t=r;for(let l of Object.keys(o))Hn(this,l,o[l])}let n=this.constructor,i=n.shadowStyleSpec??n.styleSpec;if(n.styleSpec&&!n.shadowStyleSpec)le("static-styleSpec","static styleSpec is deprecated. Use static shadowStyleSpec instead.");let{styleNode:s}=n;if(i)s=n.styleNode=C.style(gt(i)),delete n.styleNode;if(this.styleNode)console.warn(this,"styleNode is deprecated, use static shadowStyleSpec instead"),s=this.styleNode;if(s){let o=this.attachShadow({mode:"open"});if(o.appendChild(s.cloneNode(!0)),Bi(o,t,e),!Ji.has(this.tagName)&&o.querySelector(xn)!=null)Ji.add(this.tagName),console.warn(`<${this.tagName.toLowerCase()}> has data-binding sugar in its shadow-DOM content, where bindings do not operate. A shadow-DOM component is bound like an <input>: bind its VALUE from outside (bindings.value) and implement render() to reflect value into `+"the shadow DOM — setting value queues render() and emits change "+"automatically. on() event handlers are fine. Warned once per component class.")}else if(t!==null){let o=Array.from(this.childNodes);if(!e)this._partsCache=El(t);Bi(this,t,e),this.isSlotted=this.querySelector("slot,tosi-slot,xin-slot")!==null;let r=Array.from(this.querySelectorAll("slot"));if(r.length>0)r.forEach(_t.replaceSlot);if(o.length>0){let l={"":this};Array.from(this.querySelectorAll("tosi-slot,xin-slot")).forEach((a)=>{l[a.name]=a}),o.forEach((a)=>{let c=l[""],d=a instanceof Element?l[a.slot]:c;(d!==void 0?d:c).append(a)})}}this._hydrated=!0,this._parts=void 0,this._resolveHydrated?.()}}render(){if(this._valueChanged&&this.internals&&w(this).value!==void 0)this.internals.setFormValue(w(this).value),this.validateValue();this._valueChanged=!1}validateValue(){if(!this.internals||w(this).value===void 0)return;let e=typeof w(this).value==="string"?w(this).value:String(w(this).value);gl(this,e)}}class _t extends E{static preferredTagName="tosi-slot";static initAttributes={name:""};content=null;static replaceSlot(e){let t=document.createElement("tosi-slot");if(e.name!=="")t.setAttribute("name",e.name);while(e.firstChild!=null)t.appendChild(e.firstChild);e.replaceWith(t)}}var Ua=_t.elementCreator();class Ls extends _t{static preferredTagName="xin-slot";connectedCallback(){super.connectedCallback(),le("xin-slot","<xin-slot> is deprecated and will be REMOVED IN 2.0 — rename it to "+"<tosi-slot> (same attributes, same composition). It is registered only so your content keeps landing in the right place until you do.")}}Ls.elementCreator();var Al="1.10.1";function Pt(e){return Object.assign(oe,e),oe}function Bs(e){return le("boxedProxy","boxedProxy is deprecated, please use tosi() instead"),Pt(e)}var Ka=new FinalizationRegistry((e)=>{e()});function Tl(e,t=!1){if(t)return le("xinProxy-boxed","xinProxy(..., true) is deprecated; use tosi(...) instead"),Bs(e);return Object.keys(e).forEach((n)=>{Le[n]=e[n]}),Le}var Ll={};async function $s(e,t){let n=await t(e,{Color:g,Component:E,withAttributes:Sl,elements:C,svgElements:_n,mathML:Qr,varDefault:m,vars:L,xin:Le,boxed:oe,xinProxy:Tl,boxedProxy:Bs,tosi:Pt,makeComponent:$s,bind:me,on:Dn,version:Al}),{type:i}=n;if(i.preferredTagName=e,n.contract!=null&&Fe(i)===void 0)i.contract=n.contract;let s=n.lightStyleSpec??n.styleSpec;if(s)i.lightStyleSpec=s;let o={type:i,creator:i.elementCreator()};return Ll[e]=o,o}var Vn={":host":{display:"none"}},zt={},Bl=(e)=>import(e),$l=["javascript","data","vbscript"];function Nl(e){let t=e.replace(/[\u0000-\u0020]/g,""),n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);return n?n[1].toLowerCase():""}function zl(e,t){let n=Nl(e);if($l.includes(n))return`${n}: is never an honest blueprint module`;let i=Ae.blueprintSrcCheck;if(typeof i==="function"&&i(e,t)===!1)return"settings.blueprintSrcCheck returned false";return null}async function Ol(e,t,n){let i=Array.from(e.querySelectorAll(t)).filter((o)=>o.src),s=await Promise.allSettled(i.map((o)=>o.packaged()));for(let o=0;o<s.length;o++){let r=s[o];if(r.status==="rejected")console.error(`<${n}> failed to load blueprint from "${i[o].src}":`,r.reason)}}class Ns extends E{static preferredTagName="tosi-blueprint";static lightStyleSpec=Vn;static initAttributes={tag:"anon-elt",src:"",property:"default"};loaded;blueprintLoaded=(e)=>{};async packaged(){let{tag:e,src:t,property:n}=this,i=`${e}.${n}:${t}`;if(!this.loaded){let s=zl(t,this);if(s!==null){let o=`<tosi-blueprint> refused "${t}" — ${s}. These tags EXECUTE the module they name: strip them from user-supplied HTML, or set settings.blueprintSrcCheck to allow this source.`;throw console.error(o),Error(o)}if(zt[i]===void 0)zt[i]=Bl(t).then((o)=>{let r=o[n];return $s(e,r)});else if(Ae.debug)console.log(`using cached ${e} with signature ${i}`);try{this.loaded=await zt[i]}catch(o){throw delete zt[i],o}this.blueprintLoaded(this.loaded)}return this.loaded}}var Ga=Ns.elementCreator();class zs extends E{static preferredTagName="tosi-loader";static lightStyleSpec=Vn;allLoaded=()=>{};async load(){await Ol(this,"tosi-blueprint","tosi-loader"),this.allLoaded()}connectedCallback(){super.connectedCallback(),this.load()}}var Xa=zs.elementCreator();class Fn extends E{static lightStyleSpec=Vn;content=null;connectedCallback(){super.connectedCallback();let e=this.tagName.toLowerCase(),t=e.replace("xin-","tosi-");le(e,`<${e}> was removed in tosijs 1.8.0 and does NOTHING — this element `+`will not hydrate. Rename it to <${t}> (same attributes, same behaviour). Deprecated since 1.7; the tag is registered only so this message can exist, and goes away in 2.0.`)}}class Os extends Fn{static preferredTagName="xin-blueprint"}Os.elementCreator();class Ds extends Fn{static preferredTagName="xin-loader"}Ds.elementCreator();var Dl=["input","textarea","select"],Il=["cc-","current-password","new-password","one-time-code"],Hl=["password","hidden"],Ya=["[data-tosi-secret]",...Hl.map((e)=>`input[type="${e}"]`),...Dl.flatMap((e)=>Il.map((t)=>`${e}[autocomplete^="${t}"]`))].join(",");var be={blueprint:'<svg class="color" viewBox="0 0 24 24"><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M10.5,14.5 C10.5,14.5,7.5,15.5,7.5,17.5 C7.5,19.5,10.5,19.5,10.5,19.5"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M18.5,14.5 C18.5,14.5,21.5,15.5,21.5,17.5 C21.5,19.5,18.5,19.5,18.5,19.5"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M7,5.09 C7,3.94,7.9,3,9,3 C9,3,20,3,20,3 C21.1,3,22,3.94,22,5.09 C22,5.09,22,12.41,22,12.41 C22,13.56,21.1,14.5,20,14.5 C20,14.5,9,14.5,9,14.5 C7.9,14.5,7,13.56,7,12.41 C7,12.41,7,5.09,7,5.09 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M14.5,5.5 C14.5,5.5,14.5,11.5,14.5,11.5"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M16.5,7.5 C16.5,7.5,16.5,8.5,16.5,8.5"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12.5,7.5 C12.5,7.5,12.5,8.5,12.5,8.5"/><g/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M18.5,21.5 C18.5,21.5,17.5,20.5,17.5,20.5 C17.5,20.5,16.5,21.5,16.5,21.5"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12.5,21.5 C12.5,21.5,11.5,20.5,11.5,20.5 C11.5,20.5,10.5,21.5,10.5,21.5"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M10.5,14.5 C10.5,14.5,18.5,14.5,18.5,14.5 C18.5,14.5,18.5,19.5,18.5,19.5 C18.5,19.5,10.5,19.5,10.5,19.5 C10.5,19.5,10.5,14.5,10.5,14.5 z"/><g><g><path style="fill:#5e78ca;fill-rule:nonzero;stroke:#f2f2f2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M14,16.5 C14,16.5,16,16.5,16,16.5 C16,16.5,14.53,19.5,14.53,19.5"/><path style="fill:#5e78ca;fill-rule:evenodd;stroke:none;" d="M3.59,8.5 C3.59,8.5,12.59,8.5,12.59,8.5 C12.59,8.5,14.53,19.5,14.53,19.5 C14.53,19.5,5.53,19.5,5.53,19.5 C5.53,19.5,3.59,8.5,3.59,8.5 z"/><path style="fill:#5e78ca;fill-rule:nonzero;stroke:#f2f2f2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12.59,8.5 C12.59,8.5,11.12,11.5,11.12,11.5 C11.12,11.5,2.12,11.5,2.12,11.5 C2.12,11.5,3.59,8.5,3.59,8.5"/><path style="fill:#5e78ca;fill-rule:nonzero;stroke:#f2f2f2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12.59,8.5 C12.59,8.5,14.53,19.5,14.53,19.5"/><path style="fill:#5e78ca;fill-rule:nonzero;stroke:#f2f2f2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M4.12,11.5 C4.12,11.5,5.53,19.5,5.53,19.5"/></g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M9.24,12.5 C10.75,12.5,12.2,13.73,12.46,15.24 C12.46,15.24,12.46,15.24,12.46,15.24 C12.68,16.49,11.85,17.5,10.6,17.5 C10.6,17.5,10.55,17.5,10.55,17.5 C10.17,17.5,9.92,17.81,9.98,18.19 C9.98,18.19,9.98,18.19,9.98,18.19 C10.21,19.47,9.36,20.5,8.08,20.5 C8.08,20.5,6.39,20.5,6.39,20.5 C5.1,20.5,3.87,19.45,3.64,18.16 C3.64,18.16,3.12,15.21,3.12,15.21 C2.86,13.71,3.86,12.5,5.35,12.5 C5.35,12.5,9.24,12.5,9.24,12.5 z"/></g></g></svg> ',earth:'<svg class="color" viewBox="0 0 48 48"><g><g><g><path style="fill:#a3d9ff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M7,13.46 C5.1,16.52,4,20.13,4,24 C4,31.81,8.47,38.57,15,41.87 C15,41.87,15,31,15,31 C15,31,9,29,9,29 C9,29,9,19,9,19 C9,19,7,15,7,15 C7,15,7,13.46,7,13.46 z"/><path style="fill:#a3d9ff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M18.4,4.79 C20.18,4.28,22.06,4,24,4 C27.57,4,30.92,4.93,33.82,6.57 C33.82,6.57,29,13,29,13 C29,13,31,19,31,19 C31,19,37,21,37,21 C37,21,39,29,39,29 C39,29,37.35,38.89,37.35,38.89 C33.81,42.07,29.13,44,24,44 C21.03,44,18.22,43.35,15.69,42.2 C15.69,42.2,27,29,27,29 C27,29,27,25,27,25 C27,25,21,23,21,23 C21,23,15,19,15,19 C15,19,11,19,11,19 C11,19,11,13,11,13 C11,13,13,11,13,11 C13,11,15,15,15,15 C15,15,17,15,17,15 C17,15,17,9,17,9 C17,9,18.4,4.79,18.4,4.79 z"/><path style="fill:#274e42;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M18.4,4.79 C18.4,4.79,17,9,17,9 C17,9,17,15,17,15 C17,15,15,15,15,15 C15,15,13,11,13,11 C13,11,11,13,11,13 C11,13,11,19,11,19 C11,19,15,19,15,19 C15,19,21,23,21,23 C21,23,27,25,27,25 C27,25,27,29,27,29 C27,29,15.69,42.2,15.69,42.2 C15.46,42.09,15.23,41.98,15,41.87 C15,41.87,15,31,15,31 C15,31,9,29,9,29 C9,29,9,19,9,19 C9,19,7,15,7,15 C7,15,7,13.46,7,13.46 C9.57,9.32,13.62,6.19,18.4,4.79 z"/><path style="fill:#274e42;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M33.82,6.57 C33.82,6.57,29,13,29,13 C29,13,31,19,31,19 C31,19,37,21,37,21 C37,21,39,29,39,29 C39,29,37.35,38.89,37.35,38.89 C41.43,35.23,44,29.91,44,24 C44,16.52,39.9,10,33.82,6.57 z"/></g></g></g></svg> ',cmy:'<svg class="color filled" viewBox="0 0 24 24"><g><g><path style="fill:#00ff00;fill-rule:evenodd;" d="M12,10.88 C10.9,10.01,9.51,9.5,8,9.5 C7.22,9.5,6.47,9.64,5.78,9.89 C6.37,11.85,7.87,13.42,9.78,14.11 C10.17,12.81,10.96,11.69,12,10.88 z"/><path style="fill:#0000ff;fill-rule:evenodd;" d="M12,10.88 C13.1,10.01,14.49,9.5,16,9.5 C16.78,9.5,17.53,9.64,18.22,9.89 C17.63,11.85,16.13,13.42,14.22,14.11 C13.83,12.81,13.04,11.69,12,10.88 C12,10.88,12,10.88,12,10.88 z"/><path style="fill:#000000;fill-rule:evenodd;" d="M9.78,14.11 C10.17,12.81,10.96,11.69,12,10.88 C13.04,11.69,13.83,12.81,14.22,14.11 C13.53,14.36,12.78,14.5,12,14.5 C11.22,14.5,10.47,14.36,9.78,14.11 C9.78,14.11,9.78,14.11,9.78,14.11 z"/><path style="fill:#ff0000;fill-rule:evenodd;" d="M9.78,14.11 C9.6,14.71,9.5,15.34,9.5,16 C9.5,18.08,10.48,19.93,12,21.12 C13.52,19.93,14.5,18.08,14.5,16 C14.5,15.34,14.4,14.71,14.22,14.11 C13.53,14.36,12.78,14.5,12,14.5 C11.22,14.5,10.47,14.36,9.78,14.11 C9.78,14.11,9.78,14.11,9.78,14.11 z"/><path style="fill:#02fefe;fill-rule:evenodd;" d="M5.78,9.89 C5.6,9.29,5.5,8.66,5.5,8 C5.5,4.41,8.41,1.5,12,1.5 C15.59,1.5,18.5,4.41,18.5,8 C18.5,8.66,18.4,9.29,18.22,9.89 C17.53,9.64,16.78,9.5,16,9.5 C14.49,9.5,13.1,10.01,12,10.88 C10.9,10.01,9.51,9.5,8,9.5 C7.22,9.5,6.47,9.64,5.78,9.89 C5.78,9.89,5.78,9.89,5.78,9.89 z"/><path style="fill:#fffe00;fill-rule:evenodd;" d="M5.78,9.89 C3.28,10.8,1.5,13.19,1.5,16 C1.5,19.59,4.41,22.5,8,22.5 C9.51,22.5,10.9,21.99,12,21.12 C10.48,19.93,9.5,18.08,9.5,16 C9.5,15.34,9.6,14.71,9.78,14.11 C7.87,13.42,6.37,11.85,5.78,9.89 C5.78,9.89,5.78,9.89,5.78,9.89 z"/><path style="fill:#ff00ff;fill-rule:evenodd;" d="M18.22,9.89 C20.72,10.8,22.5,13.19,22.5,16 C22.5,19.59,19.59,22.5,16,22.5 C14.49,22.5,13.1,21.99,12,21.12 C13.52,19.93,14.5,18.08,14.5,16 C14.5,15.34,14.4,14.71,14.22,14.11 C16.13,13.42,17.63,11.85,18.22,9.89 z"/></g></g></svg> ',rgb:'<svg class="color filled" viewBox="0 0 24 24"><g><g><path style="fill:#ff00ff;fill-rule:evenodd;" d="M12,10.88 C10.9,10.01,9.51,9.5,8,9.5 C7.22,9.5,6.47,9.64,5.78,9.89 C6.37,11.85,7.87,13.42,9.78,14.11 C10.17,12.81,10.96,11.69,12,10.88 z"/><path style="fill:#ffff00;fill-rule:evenodd;" d="M12,10.88 C13.1,10.01,14.49,9.5,16,9.5 C16.78,9.5,17.53,9.64,18.22,9.89 C17.63,11.85,16.13,13.42,14.22,14.11 C13.83,12.81,13.04,11.69,12,10.88 C12,10.88,12,10.88,12,10.88 z"/><path style="fill:#ffffff;fill-rule:evenodd;" d="M9.78,14.11 C10.17,12.81,10.96,11.69,12,10.88 C13.04,11.69,13.83,12.81,14.22,14.11 C13.53,14.36,12.78,14.5,12,14.5 C11.22,14.5,10.47,14.36,9.78,14.11 C9.78,14.11,9.78,14.11,9.78,14.11 z"/><path style="fill:#00ffff;fill-rule:evenodd;" d="M9.78,14.11 C9.6,14.71,9.5,15.34,9.5,16 C9.5,18.08,10.48,19.93,12,21.12 C13.52,19.93,14.5,18.08,14.5,16 C14.5,15.34,14.4,14.71,14.22,14.11 C13.53,14.36,12.78,14.5,12,14.5 C11.22,14.5,10.47,14.36,9.78,14.11 C9.78,14.11,9.78,14.11,9.78,14.11 z"/><path style="fill:#ff0000;fill-rule:evenodd;" d="M5.78,9.89 C5.6,9.29,5.5,8.66,5.5,8 C5.5,4.41,8.41,1.5,12,1.5 C15.59,1.5,18.5,4.41,18.5,8 C18.5,8.66,18.4,9.29,18.22,9.89 C17.53,9.64,16.78,9.5,16,9.5 C14.49,9.5,13.1,10.01,12,10.88 C10.9,10.01,9.51,9.5,8,9.5 C7.22,9.5,6.47,9.64,5.78,9.89 C5.78,9.89,5.78,9.89,5.78,9.89 z"/><path style="fill:#0000ff;fill-rule:evenodd;" d="M5.78,9.89 C3.28,10.8,1.5,13.19,1.5,16 C1.5,19.59,4.41,22.5,8,22.5 C9.51,22.5,10.9,21.99,12,21.12 C10.48,19.93,9.5,18.08,9.5,16 C9.5,15.34,9.6,14.71,9.78,14.11 C7.87,13.42,6.37,11.85,5.78,9.89 C5.78,9.89,5.78,9.89,5.78,9.89 z"/><path style="fill:#00ff00;fill-rule:evenodd;" d="M18.22,9.89 C20.72,10.8,22.5,13.19,22.5,16 C22.5,19.59,19.59,22.5,16,22.5 C14.49,22.5,13.1,21.99,12,21.12 C13.52,19.93,14.5,18.08,14.5,16 C14.5,15.34,14.4,14.71,14.22,14.11 C16.13,13.42,17.63,11.85,18.22,9.89 z"/></g></g></svg> ',xrColor:'<svg class="color filled" viewBox="0 0 40 24"><g><g><g><path style="fill:#000000;fill-rule:evenodd;" d="M20,2 C19.99,2,19.98,2,19.98,2 C8.39,2,2,3.61,2,12 C2,18.41,5.32,22,10.54,22 C15.77,22,17.37,17.85,19.98,17.85 C19.98,17.85,19.99,17.85,20,17.85 C20.01,17.85,20.02,17.85,20.02,17.85 C22.63,17.85,24.23,22,29.46,22 C34.68,22,38,18.41,38,12 C38,3.61,31.61,2,20.02,2 C20.02,2,20.01,2,20,2 C20,2,20,2,20,2 z"/></g><path style="fill:#fbed21;fill-rule:evenodd;" d="M12.2,19.84 C15.79,19.39,17.07,16.46,19.07,16.46 C19.07,16.46,19.08,16.46,19.09,16.46 C19.09,16.46,19.1,16.46,19.11,16.46 C19.44,16.46,19.75,16.54,20.06,16.68 C20.37,16.54,20.68,16.46,21.01,16.46 C21.02,16.46,21.02,16.46,21.03,16.46 C21.04,16.46,21.04,16.46,21.05,16.46 C23.05,16.46,24.33,19.39,27.92,19.84 C31.66,19.4,33.98,16.5,33.98,11.62 C33.98,4.91,29.04,3.44,20.06,3.35 C11.07,3.44,6.14,4.91,6.14,11.62 C6.14,16.5,8.46,19.4,12.2,19.84 z"/><path style="fill:#8cc63f;fill-rule:evenodd;" d="M12.2,19.84 C12.52,19.87,12.86,19.89,13.21,19.89 C16.86,19.89,18.37,17.43,20.06,16.68 C19.75,16.54,19.44,16.46,19.11,16.46 C19.1,16.46,19.09,16.46,19.09,16.46 C19.08,16.46,19.07,16.46,19.07,16.46 C17.07,16.46,15.79,19.39,12.2,19.84 z"/><path style="fill:#8cc63f;fill-rule:evenodd;" d="M20.06,3.35 C20.37,3.35,20.69,3.35,21.01,3.35 C21.02,3.35,21.02,3.35,21.03,3.35 C21.03,3.35,21.03,3.35,21.03,3.35 C21.04,3.35,21.04,3.35,21.05,3.35 C30.64,3.35,35.92,4.68,35.92,11.62 C35.92,16.92,33.18,19.89,28.86,19.89 C28.53,19.89,28.22,19.87,27.92,19.84 C31.66,19.4,33.98,16.5,33.98,11.62 C33.98,4.91,29.04,3.44,20.06,3.35 C20.06,3.35,20.06,3.35,20.06,3.35 z"/><path style="fill:#ff1c23;fill-rule:evenodd;" d="M20.06,16.68 C21.74,17.43,23.25,19.89,26.91,19.89 C27.26,19.89,27.59,19.87,27.92,19.84 C24.33,19.39,23.05,16.46,21.05,16.46 C21.04,16.46,21.04,16.46,21.03,16.46 C21.02,16.46,21.02,16.46,21.01,16.46 C20.68,16.46,20.37,16.54,20.06,16.68 z"/><path style="fill:#ff1c23;fill-rule:evenodd;" d="M12.2,19.84 C11.9,19.87,11.59,19.89,11.26,19.89 C6.94,19.89,4.19,16.92,4.19,11.62 C4.19,4.68,9.48,3.35,19.07,3.35 C19.07,3.35,19.08,3.35,19.09,3.35 C19.09,3.35,19.09,3.35,19.09,3.35 C19.09,3.35,19.1,3.35,19.11,3.35 C19.43,3.35,19.75,3.35,20.06,3.35 C11.07,3.44,6.14,4.91,6.14,11.62 C6.14,16.5,8.46,19.4,12.2,19.84 z"/></g><g><path style="fill:#8cc63e;fill-rule:nonzero;" d="M22.55,8.63 C22.55,9.05,22.55,9.46,22.55,9.88 C22.54,10.25,22.85,10.56,23.2,10.55 C23.54,10.56,23.85,10.25,23.85,9.88 C23.85,9.46,23.85,9.05,23.85,8.63 C23.85,8.26,23.54,7.95,23.2,7.96 C22.85,7.95,22.54,8.26,22.55,8.63 z"/><path style="fill:#8cc63e;fill-rule:nonzero;" d="M17.32,8.63 C17.32,9.05,17.32,9.46,17.32,9.88 C17.31,10.25,17.62,10.56,17.97,10.55 C18.31,10.56,18.62,10.25,18.62,9.88 C18.62,9.46,18.62,9.05,18.62,8.63 C18.62,8.26,18.31,7.95,17.97,7.96 C17.62,7.95,17.31,8.26,17.32,8.63 z"/><path style="fill:#8cc63e;fill-rule:nonzero;" d="M19.99,4.39 C19.99,8.09,19.99,11.8,19.99,15.5 C19.99,15.87,20.3,16.18,20.64,16.17 C20.99,16.18,21.3,15.87,21.29,15.5 C21.29,11.8,21.29,8.09,21.29,4.39 C21.3,4.02,20.99,3.71,20.64,3.72 C20.3,3.71,19.99,4.02,19.99,4.39 z"/><path style="fill:#fe1a22;fill-rule:nonzero;" d="M21.43,8.63 C21.43,9.05,21.43,9.46,21.43,9.88 C21.42,10.25,21.73,10.56,22.08,10.55 C22.42,10.56,22.73,10.25,22.73,9.88 C22.73,9.46,22.73,9.05,22.73,8.63 C22.73,8.26,22.42,7.95,22.08,7.96 C21.73,7.95,21.42,8.26,21.43,8.63 z"/><path style="fill:#fe1a22;fill-rule:nonzero;" d="M16.2,8.63 C16.2,9.05,16.2,9.46,16.2,9.88 C16.19,10.25,16.5,10.56,16.85,10.55 C17.19,10.56,17.5,10.25,17.5,9.88 C17.5,9.46,17.5,9.05,17.5,8.63 C17.5,8.26,17.19,7.95,16.85,7.96 C16.5,7.95,16.19,8.26,16.2,8.63 z"/><path style="fill:#fe1a22;fill-rule:nonzero;" d="M18.87,4.39 C18.87,8.09,18.87,11.8,18.87,15.5 C18.87,15.87,19.18,16.18,19.52,16.17 C19.86,16.18,20.18,15.87,20.17,15.5 C20.17,11.8,20.17,8.09,20.17,4.39 C20.18,4.02,19.86,3.71,19.52,3.72 C19.18,3.71,18.87,4.02,18.87,4.39 z"/><path style="fill:#000000;fill-rule:nonzero;" d="M21.97,8.63 C21.97,9.05,21.97,9.46,21.97,9.88 C21.97,10.25,22.28,10.56,22.62,10.55 C22.97,10.56,23.28,10.25,23.27,9.88 C23.27,9.46,23.27,9.05,23.27,8.63 C23.28,8.26,22.97,7.95,22.62,7.96 C22.28,7.95,21.97,8.26,21.97,8.63 z"/><path style="fill:#000000;fill-rule:nonzero;" d="M16.74,8.63 C16.74,9.05,16.74,9.46,16.74,9.88 C16.74,10.25,17.05,10.56,17.39,10.55 C17.74,10.56,18.05,10.25,18.04,9.88 C18.04,9.46,18.04,9.05,18.04,8.63 C18.05,8.26,17.74,7.95,17.39,7.96 C17.05,7.95,16.74,8.26,16.74,8.63 z"/><path style="fill:#000000;fill-rule:nonzero;" d="M19.41,4.39 C19.41,8.09,19.41,11.8,19.41,15.5 C19.41,15.87,19.72,16.18,20.07,16.17 C20.41,16.18,20.72,15.87,20.72,15.5 C20.72,11.8,20.72,8.09,20.72,4.39 C20.72,4.02,20.41,3.71,20.07,3.72 C19.72,3.71,19.41,4.02,19.41,4.39 z"/></g></g></svg> ',tosiFavicon:'<svg class="color" viewBox="0 0 48 48"><g><g><path style="fill:#ed247b;fill-rule:evenodd;stroke:none;" d="M1,9 C1,4.58,4.58,1,9,1 C9,1,39,1,39,1 C43.42,1,47,4.58,47,9 C47,9,47,39,47,39 C47,43.42,43.42,47,39,47 C39,47,9,47,9,47 C4.58,47,1,43.42,1,39 C1,39,1,9,1,9 z"/><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M16,29 C16,29,10,31,10,35 C10,39,16,39,16,39"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M32,29 C32,29,38,31,38,35 C38,39,32,39,32,39"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M9,10.18 C9,7.87,10.79,6,13,6 C13,6,35,6,35,6 C37.21,6,39,7.87,39,10.18 C39,10.18,39,24.82,39,24.82 C39,27.13,37.21,29,35,29 C35,29,13,29,13,29 C10.79,29,9,27.13,9,24.82 C9,24.82,9,10.18,9,10.18 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M24,11 C24,11,24,23,24,23"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M28,15 C28,15,28,17,28,17"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20,15 C20,15,20,17,20,17"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M32,43 C32,43,30,41,30,41 C30,41,28,43,28,43"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20,43 C20,43,18,41,18,41 C18,41,16,43,16,43"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M16,29 C16,29,32,29,32,29 C32,29,32,39,32,39 C32,39,16,39,16,39 C16,39,16,29,16,29 z"/></g></g></g></svg> ',tosiPlatform:'<svg class="color" viewBox="0 0 48 48"><g><g><g><path style="fill:#3ea9f5;fill-rule:evenodd;stroke:none;" d="M23.97,47 C23.97,47,39,47,39,47 C43.42,47,47,43.42,47,39 C47,39,47,9,47,9 C47,4.58,43.42,1,39,1 C39,1,9,1,9,1 C4.58,1,1,4.58,1,9 C1,9,1,39,1,39 C1,41.64,2.28,43.98,4.25,45.44 C4.09,44.82,4,44.17,4,43.5 C4,39.36,7.36,36,11.5,36 C15.14,36,18.18,38.6,18.86,42.05 C19.07,42.02,19.28,42,19.5,42 C21.99,42,24,44.01,24,46.5 C24,46.67,23.99,46.84,23.97,47 z"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:none;" d="M4.25,45.44 C4.09,44.82,4,44.17,4,43.5 C4,39.36,7.36,36,11.5,36 C15.14,36,18.18,38.6,18.86,42.05 C19.07,42.02,19.28,42,19.5,42 C21.99,42,24,44.01,24,46.5 C24,46.67,23.99,46.84,23.97,47 C23.97,47,9,47,9,47 C7.22,47,5.58,46.42,4.25,45.44 z"/></g><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M35,35 C35,35,32.17,35,32.17,35 C32.17,35,32.17,37.83,32.17,37.83"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M31,39 C31,39,28.17,39,28.17,39 C28.17,39,28.17,41.83,28.17,41.83"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M7.48,16 C4.45,16,2,18.45,2,21.48 C2,21.48,2,21.48,2,21.48 C2,23.98,4.02,26,6.52,26 C6.52,26,6.62,26,6.62,26 C7.38,26,8,26.62,8,27.38 C8,27.38,8,27.38,8,27.38 C8,29.93,10.07,32,12.62,32 C12.62,32,16,32,16,32 C18.58,32,20.68,29.91,20.68,27.32 C20.68,27.32,20.68,21.42,20.68,21.42 C20.68,18.43,18.25,16,15.26,16 C15.26,16,7.48,16,7.48,16 z"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M17,29 C17,29,33,29,33,29 C33,29,33,29,33,29 C33,34.52,28.52,39,23,39 C23,39,23,39,23,39 C19.69,39,17,36.31,17,33 C17,33,17,29,17,29 z"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M40.52,16 C43.55,16,46,18.45,46,21.48 C46,21.48,46,21.48,46,21.48 C46,23.98,43.98,26,41.48,26 C41.48,26,41.38,26,41.38,26 C40.62,26,40,26.62,40,27.38 C40,27.38,40,27.38,40,27.38 C40,29.93,37.93,32,35.38,32 C35.38,32,32,32,32,32 C29.42,32,27.32,29.91,27.32,27.32 C27.32,27.32,27.32,21.42,27.32,21.42 C27.32,18.43,29.75,16,32.74,16 C32.74,16,40.52,16,40.52,16 z"/><g><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M6,10.18 C6,7.87,7.79,6,10,6 C10,6,32,6,32,6 C34.21,6,36,7.87,36,10.18 C36,10.18,36,24.82,36,24.82 C36,27.13,34.21,29,32,29 C32,29,10,29,10,29 C7.79,29,6,27.13,6,24.82 C6,24.82,6,10.18,6,10.18 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M21,11 C21,11,21,23,21,23"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M25,15 C25,15,25,17,25,17"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M17,15 C17,15,17,17,17,17"/></g></g></g></svg> ',tosiUi:'<svg class="color" viewBox="0 0 48 48"><g><g><g><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M3,33 C3,31.9,3.9,31,5,31 C5,31,43,31,43,31 C44.1,31,45,31.9,45,33 C45,33,45,43,45,43 C45,44.1,44.1,45,43,45 C43,45,5,45,5,45 C3.9,45,3,44.1,3,43 C3,43,3,33,3,33 z"/><g><path style="fill:#ffffff;fill-rule:evenodd;stroke:#ed247b;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M7,35 C7,35,7,36.34,7,38 C7,39.66,8.34,41,10,41 C11.66,41,13,39.66,13,38 C13,36.34,13,35,13,35"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#ed247b;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M17,35 C17,35,17,41,17,41"/></g><g><path style="fill:#ed247b;fill-rule:evenodd;stroke:none;" d="M38,33 C40.76,33,43,35.24,43,38 C43,40.76,40.76,43,38,43 C35.24,43,33,40.76,33,38 C33,35.24,35.24,33,38,33 z"/><path style="fill:#ed247b;fill-rule:nonzero;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M40,36 C40,36,36,40,36,40"/><path style="fill:#ed247b;fill-rule:nonzero;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M36,36 C36,36,40,40,40,40"/></g></g><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M15.97,21.01 C15.97,21.01,9.97,23.01,9.97,27.01 C9.97,31.01,15.97,31.01,15.97,31.01"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M31.97,21.01 C31.97,21.01,37.97,23.01,37.97,27.01 C37.97,31.01,31.97,31.01,31.97,31.01"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M31,33 C31,33,29.49,31,29.49,31 C29.49,31,27.97,33,27.97,33"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M19.97,33 C19.97,33,17.97,31,17.97,31 C17.97,31,15.97,33,15.97,33"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M15.97,21 C15.97,21,31.97,21,31.97,21 C31.97,21,31.97,31,31.97,31 C31.97,31,15.97,31,15.97,31 C15.97,31,15.97,21,15.97,21 z"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M9,7.18 C9,4.87,10.79,3,13,3 C13,3,35.02,3,35.02,3 C37.23,3,39.03,4.87,39.03,7.18 C39.03,7.18,39.03,21.82,39.03,21.82 C39.03,24.13,37.23,26,35.02,26 C35.02,26,13,26,13,26 C10.79,26,9,24.13,9,21.82 C9,21.82,9,7.18,9,7.18 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M24,11 C24,11,24,23,24,23"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M28,15 C28,15,28,17,28,17"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20,15 C20,15,20,17,20,17"/></g></g></g></svg> ',tosiXr:'<svg class="color" viewBox="0 0 24 24"><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M8,14.25 C8,14.25,5,15.25,5,17.25 C5,19.25,8,19.25,8,19.25"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M16,14.25 C16,14.25,19,15.25,19,17.25 C19,19.25,16,19.25,16,19.25"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M4.5,4.85 C4.5,3.69,5.4,2.75,6.5,2.75 C6.5,2.75,17.5,2.75,17.5,2.75 C18.61,2.75,19.5,3.69,19.5,4.85 C19.5,4.85,19.5,12.16,19.5,12.16 C19.5,13.32,18.61,14.25,17.5,14.25 C17.5,14.25,6.5,14.25,6.5,14.25 C5.4,14.25,4.5,13.32,4.5,12.16 C4.5,12.16,4.5,4.85,4.5,4.85 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12,5.25 C12,5.25,12,11.25,12,11.25"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M14,7.25 C14,7.25,14,8.25,14,8.25"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M10,7.25 C10,7.25,10,8.25,10,8.25"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M16,21.25 C16,21.25,15,20.25,15,20.25 C15,20.25,14,21.25,14,21.25"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M10,21.25 C10,21.25,9,20.25,9,20.25 C9,20.25,8,21.25,8,21.25"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M8,14.25 C8,14.25,16,14.25,16,14.25 C16,14.25,16,19.25,16,19.25 C16,19.25,8,19.25,8,19.25 C8,19.25,8,14.25,8,14.25 z"/><path style="fill:#ff7bac;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-width:1;" d="M12,4 C12,4,11.99,4,11.99,4 C6.19,4,3,4.73,3,8.5 C3,11.39,4.66,13,7.27,13 C9.88,13,10.68,11.13,11.99,11.13 C11.99,11.13,12,11.13,12,11.13 C12,11.13,12.01,11.13,12.01,11.13 C13.32,11.13,14.12,13,16.73,13 C19.34,13,21,11.39,21,8.5 C21,4.73,17.81,4,12.01,4 C12.01,4,12,4,12,4 C12,4,12,4,12,4 z"/></g></svg> ',tosi:'<svg class="color" viewBox="0 0 48 48"><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M38.35,31.7 C39.78,34.37,38.78,37.69,36.11,39.13 C36.11,39.13,36.11,39.13,36.11,39.13 C33.92,40.31,31.18,39.48,29.99,37.29 C29.99,37.29,29.95,37.2,29.95,37.2 C29.58,36.53,28.75,36.27,28.08,36.64 C28.08,36.64,28.08,36.64,28.08,36.64 C25.83,37.84,23.03,37,21.82,34.76 C21.82,34.76,20.22,31.78,20.22,31.78 C18.99,29.5,19.85,26.67,22.12,25.44 C22.12,25.44,27.32,22.65,27.32,22.65 C29.96,21.23,33.24,22.22,34.66,24.85 C34.66,24.85,38.35,31.7,38.35,31.7 z"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M10.65,31.7 C9.22,34.37,10.22,37.69,12.89,39.13 C12.89,39.13,12.89,39.13,12.89,39.13 C15.08,40.31,17.82,39.48,19.01,37.29 C19.01,37.29,19.05,37.2,19.05,37.2 C19.42,36.53,20.25,36.27,20.92,36.64 C20.92,36.64,20.92,36.64,20.92,36.64 C23.17,37.84,25.97,37,27.18,34.76 C27.18,34.76,28.78,31.78,28.78,31.78 C30.01,29.5,29.15,26.67,26.88,25.44 C26.88,25.44,21.68,22.65,21.68,22.65 C19.04,21.23,15.76,22.22,14.34,24.85 C14.34,24.85,10.65,31.7,10.65,31.7 z"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M32.5,43 C32.5,43,30.5,41,30.5,41 C30.5,41,28.5,43,28.5,43"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20.5,43 C20.5,43,18.5,41,18.5,41 C18.5,41,16.5,43,16.5,43"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M16.5,29 C16.5,29,32.5,29,32.5,29 C32.5,29,32.5,36,32.5,36 C32.5,37.66,31.16,39,29.5,39 C29.5,39,19.5,39,19.5,39 C17.84,39,16.5,37.66,16.5,36 C16.5,36,16.5,29,16.5,29 z"/><g><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M9.5,10.18 C9.5,7.87,11.29,6,13.5,6 C13.5,6,35.5,6,35.5,6 C37.71,6,39.5,7.87,39.5,10.18 C39.5,10.18,39.5,24.82,39.5,24.82 C39.5,27.13,37.71,29,35.5,29 C35.5,29,13.5,29,13.5,29 C11.29,29,9.5,27.13,9.5,24.82 C9.5,24.82,9.5,10.18,9.5,10.18 z"/><g><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M24.5,11 C24.5,11,24.5,23,24.5,23"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M28.5,15 C28.5,15,28.5,17,28.5,17"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20.5,15 C20.5,15,20.5,17,20.5,17"/></g></g></g></svg> ',discord:'<svg class="filled" version="1" viewBox="0 0 1013 768"><path d="M858 64c-60-28-131-51-204-64l-5-1c-8 14-17 32-25 51l-1 4c-35-6-75-9-116-9s-81 3-120 9l4-1c-9-22-18-40-28-57l1 3c-79 14-149 36-214 67l5-2c-132 196-168 387-150 575v0c73 55 158 99 250 127l6 2c19-26 38-55 53-85l2-3c-33-13-62-27-89-43l2 1c7-5 14-11 21-16 75 36 163 57 256 57s181-21 260-59l-4 2c7 6 14 11 21 16-25 15-53 29-83 40l-4 1c17 34 36 63 56 90l-1-2c98-30 183-74 259-130l-2 2c21-218-36-407-151-575zM338 524c-50 0-91-45-91-101s40-102 91-102 92 46 91 102-40 101-91 101zM675 524c-50 0-91-45-91-101s40-102 91-102 92 46 91 102-40 101-91 101z"></path></svg> ',facebook:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg>',game:'<svg class="filled" version="1" viewBox="0 0 704 512"><path d="M528 97v-1h-336c-88 0-160 72-160 160s72 160 160 160c52 0 99-25 128-64h64c29 39 76 64 128 64 88 0 160-72 160-160 0-83-63-151-144-159zM288 288h-64v64h-64v-64h-64v-64h64v-64h64v64h64v64zM480 288c-18 0-32-14-32-32s14-32 32-32 32 14 32 32-14 32-32 32zM576 288c-18 0-32-14-32-32 0-18 14-32 32-32s32 14 32 32c0 18-14 32-32 32z"></path></svg> ',google:'<svg class="filled" version="1" viewBox="0 0 512 512"><path d="M256 0c-141 0-256 115-256 256s115 256 256 256 256-115 256-256-115-256-256-256zM260 448c-106 0-192-86-192-192s86-192 192-192c52 0 95 19 129 50l-52 50c-14-14-39-30-77-30-66 0-119 54-119 121s54 121 119 121c76 0 105-55 109-83h-109v-66h181c2 10 3 19 3 32 0 110-73 188-184 188z"></path></svg> ',npm:'<svg class="filled" version="1" viewBox="0 0 512 512"><path d="M0 0v512h512v-512h-512zM416 416h-64v-256h-96v256h-160v-320h320v320z"></path></svg> ',youtube:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"></path><polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"></polygon></svg>',blog:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,10.02 C21,10.02,21,15,21,15 C21,15.53,20.79,16.04,20.41,16.41 C20.04,16.79,19.53,17,19,17 C19,17,7,17,7,17 C5.67,18.33,4.33,19.67,3,21 C3,21,3,5,3,5 C3,4.47,3.21,3.96,3.59,3.59 C3.96,3.21,4.47,3,5,3 C8.53,3,10.49,3,14.02,3"/><path style="" d="M19,2 C19.54,1.46,20.32,1.25,21.05,1.45 C21.78,1.65,22.35,2.22,22.55,2.95 C22.75,3.68,22.54,4.46,22,5 C22,5,15.5,11.5,15.5,11.5 C14.17,11.83,12.83,12.17,11.5,12.5 C11.83,11.17,12.17,9.83,12.5,8.5 C15.67,5.33,15.83,5.17,19,2 z"/><path style="" d="M14.6,3"/><path style="" d="M21,8.77"/><path style="" d="M7,7 C7,7,10,7,10,7"/><path style="" d="M7,10 C7,10,9,10,9,10"/></g></svg> ',bug:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M8,6 C8,3.79,9.79,2,12,2 C14.21,2,16,3.79,16,6 C16,6,8,6,8,6 z"/><path style="" d="M20,7 C20,7,18,9,18,9"/><path style="" d="M20,19 C20,19,18,17,18,17"/><path style="" d="M21,13 C21,13,18,13,18,13"/><path style="" d="M16.44,9 C17.3,9,18,9.7,18,10.56 C18,10.56,18,15,18,15 C18,18.31,15.31,21,12,21 C8.69,21,6,18.31,6,15 C6,15,6,10.56,6,10.56 C6,9.7,6.7,9,7.56,9 C7.56,9,16.44,9,16.44,9 z"/><path style="" d="M4,7 C4,7,6,9,6,9"/><path style="" d="M4,19 C4,19,6,17,6,17"/><path style="" d="M3,13 C3,13,6,13,6,13"/><path style="" d="M12,12 C12,12,12,17,12,17"/></g></svg> ',activity:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg>',airplay:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>',alertCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>',alertOctagon:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>',alertTriangle:'<svg class="stroked" viewBox="0 0 24 24"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',alignCenter:'<svg class="stroked" viewBox="0 0 24 24"><line x1="18" y1="10" x2="6" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="18" y1="18" x2="6" y2="18"></line></svg>',alignJustify:'<svg class="stroked" viewBox="0 0 24 24"><line x1="21" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="3" y2="18"></line></svg>',alignLeft:'<svg class="stroked" viewBox="0 0 24 24"><line x1="17" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="17" y1="18" x2="3" y2="18"></line></svg>',alignRight:'<svg class="stroked" viewBox="0 0 24 24"><line x1="21" y1="10" x2="7" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="7" y2="18"></line></svg>',anchor:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="5" r="3"></circle><line x1="12" y1="22" x2="12" y2="8"></line><path d="M5 12H2a10 10 0 0 0 20 0h-3"></path></svg>',aperture:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="14.31" y1="8" x2="20.05" y2="17.94"></line><line x1="9.69" y1="8" x2="21.17" y2="8"></line><line x1="7.38" y1="12" x2="13.12" y2="2.06"></line><line x1="9.69" y1="16" x2="3.95" y2="6.06"></line><line x1="14.31" y1="16" x2="2.83" y2="16"></line><line x1="16.62" y1="12" x2="10.88" y2="21.94"></line></svg>',archive:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line></svg>',arrowUpRight:'<svg class="stroked" viewBox="0 0 24 24"><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"></polyline></svg>',atSign:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"></circle><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"></path></svg>',award:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="8" r="7"></circle><polyline points="8.21 13.89 7 23 12 20 17 23 15.79 13.88"></polyline></svg>',barChart2:'<svg class="stroked" viewBox="0 0 24 24"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line></svg>',barChart:'<svg class="stroked" viewBox="0 0 24 24"><line x1="12" y1="20" x2="12" y2="10"></line><line x1="18" y1="20" x2="18" y2="4"></line><line x1="6" y1="20" x2="6" y2="16"></line></svg>',batteryCharging:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 18H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3.19M15 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-3.19"></path><line x1="23" y1="13" x2="23" y2="11"></line><polyline points="11 6 7 12 13 12 9 18"></polyline></svg>',battery:'<svg class="stroked" viewBox="0 0 24 24"><rect x="1" y="6" width="18" height="12" rx="2" ry="2"></rect><line x1="23" y1="13" x2="23" y2="11"></line></svg>',bellOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M13.73 21a2 2 0 0 1-3.46 0"></path><path d="M18.63 13A17.89 17.89 0 0 1 18 8"></path><path d="M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h14"></path><path d="M18 8a6 6 0 0 0-9.33-5"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',bell:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg>',bluetooth:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="6.5 6.5 17.5 17.5 12 23 12 1 17.5 6.5 6.5 17.5"></polyline></svg>',bold:'<svg class="stroked" viewBox="0 0 24 24"><path d="M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"></path><path d="M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"></path></svg>',bookOpen:'<svg class="stroked" viewBox="0 0 24 24"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg>',book:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg>',bookmark:'<svg class="stroked" viewBox="0 0 24 24"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path></svg>',box:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>',briefcase:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"></rect><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"></path></svg>',calendar:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>',cameraOff:'<svg class="stroked" viewBox="0 0 24 24"><line x1="1" y1="1" x2="23" y2="23"></line><path d="M21 21H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3m3-3h6l2 3h4a2 2 0 0 1 2 2v9.34m-7.72-2.06a4 4 0 1 1-5.56-5.56"></path></svg>',camera:'<svg class="stroked" viewBox="0 0 24 24"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path><circle cx="12" cy="13" r="4"></circle></svg>',cast:'<svg class="stroked" viewBox="0 0 24 24"><path d="M2 16.1A5 5 0 0 1 5.9 20M2 12.05A9 9 0 0 1 9.95 20M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"></path><line x1="2" y1="20" x2="2.01" y2="20"></line></svg>',checkCircle:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>',checkSquare:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="9 11 12 14 22 4"></polyline><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg>',check:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"></polyline></svg>',chrome:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="21.17" y1="8" x2="12" y2="8"></line><line x1="3.95" y1="6.06" x2="8.54" y2="14"></line><line x1="10.88" y1="21.94" x2="15.46" y2="14"></line></svg>',circle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle></svg>',clipboard:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect></svg>',clock:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>',cloudDrizzle:'<svg class="stroked" viewBox="0 0 24 24"><line x1="8" y1="19" x2="8" y2="21"></line><line x1="8" y1="13" x2="8" y2="15"></line><line x1="16" y1="19" x2="16" y2="21"></line><line x1="16" y1="13" x2="16" y2="15"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="12" y1="15" x2="12" y2="17"></line><path d="M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25"></path></svg>',cloudLightning:'<svg class="stroked" viewBox="0 0 24 24"><path d="M19 16.9A5 5 0 0 0 18 7h-1.26a8 8 0 1 0-11.62 9"></path><polyline points="13 11 9 17 15 17 11 23"></polyline></svg>',cloudOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',cloudRain:'<svg class="stroked" viewBox="0 0 24 24"><line x1="16" y1="13" x2="16" y2="21"></line><line x1="8" y1="13" x2="8" y2="21"></line><line x1="12" y1="15" x2="12" y2="23"></line><path d="M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25"></path></svg>',cloudSnow:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20 17.58A5 5 0 0 0 18 8h-1.26A8 8 0 1 0 4 16.25"></path><line x1="8" y1="16" x2="8.01" y2="16"></line><line x1="8" y1="20" x2="8.01" y2="20"></line><line x1="12" y1="18" x2="12.01" y2="18"></line><line x1="12" y1="22" x2="12.01" y2="22"></line><line x1="16" y1="16" x2="16.01" y2="16"></line><line x1="16" y1="20" x2="16.01" y2="20"></line></svg>',cloud:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"></path></svg>',code:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>',codepen:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2"></polygon><line x1="12" y1="22" x2="12" y2="15.5"></line><polyline points="22 8.5 12 15.5 2 8.5"></polyline><polyline points="2 15.5 12 8.5 22 15.5"></polyline><line x1="12" y1="2" x2="12" y2="8.5"></line></svg>',codesandbox:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="7.5 4.21 12 6.81 16.5 4.21"></polyline><polyline points="7.5 19.79 7.5 14.6 3 12"></polyline><polyline points="21 12 16.5 14.6 16.5 19.79"></polyline><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>',coffee:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 8h1a4 4 0 0 1 0 8h-1"></path><path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z"></path><line x1="6" y1="1" x2="6" y2="4"></line><line x1="10" y1="1" x2="10" y2="4"></line><line x1="14" y1="1" x2="14" y2="4"></line></svg>',columns:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 3h7a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-7m0-18H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7m0-18v18"></path></svg>',command:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"></path></svg>',compass:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"></polygon></svg>',copy:'<svg class="stroked" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>',cpu:'<svg class="stroked" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect><rect x="9" y="9" width="6" height="6"></rect><line x1="9" y1="1" x2="9" y2="4"></line><line x1="15" y1="1" x2="15" y2="4"></line><line x1="9" y1="20" x2="9" y2="23"></line><line x1="15" y1="20" x2="15" y2="23"></line><line x1="20" y1="9" x2="23" y2="9"></line><line x1="20" y1="14" x2="23" y2="14"></line><line x1="1" y1="9" x2="4" y2="9"></line><line x1="1" y1="14" x2="4" y2="14"></line></svg>',creditCard:'<svg class="stroked" viewBox="0 0 24 24"><rect x="1" y="4" width="22" height="16" rx="2" ry="2"></rect><line x1="1" y1="10" x2="23" y2="10"></line></svg>',crop:'<svg class="stroked" viewBox="0 0 24 24"><path d="M6.13 1L6 16a2 2 0 0 0 2 2h15"></path><path d="M1 6.13L16 6a2 2 0 0 1 2 2v15"></path></svg>',crosshair:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="22" y1="12" x2="18" y2="12"></line><line x1="6" y1="12" x2="2" y2="12"></line><line x1="12" y1="6" x2="12" y2="2"></line><line x1="12" y1="22" x2="12" y2="18"></line></svg>',database:'<svg class="stroked" viewBox="0 0 24 24"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"></path><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"></path></svg>',delete:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"></path><line x1="18" y1="9" x2="12" y2="15"></line><line x1="12" y1="9" x2="18" y2="15"></line></svg>',disc:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="3"></circle></svg>',divideCircle:'<svg class="stroked" viewBox="0 0 24 24"><line x1="8" y1="12" x2="16" y2="12"></line><line x1="12" y1="16" x2="12" y2="16"></line><line x1="12" y1="8" x2="12" y2="8"></line><circle cx="12" cy="12" r="10"></circle></svg>',divideSquare:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="8" y1="12" x2="16" y2="12"></line><line x1="12" y1="16" x2="12" y2="16"></line><line x1="12" y1="8" x2="12" y2="8"></line></svg>',divide:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="6" r="2"></circle><line x1="5" y1="12" x2="19" y2="12"></line><circle cx="12" cy="18" r="2"></circle></svg>',dollarSign:'<svg class="stroked" viewBox="0 0 24 24"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg>',downloadCloud:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="8 17 12 21 16 17"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"></path></svg>',download:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>',dribbble:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M8.56 2.75c4.37 6.03 6.02 9.42 8.03 17.72m2.54-15.38c-3.72 4.35-8.94 5.66-16.88 5.85m19.5 1.9c-3.5-.93-6.63-.82-8.94 0-2.58.92-5.01 2.86-7.44 6.32"></path></svg>',droplet:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"></path></svg>',edit2:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>',edit3:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 20h9"></path><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>',edit:'<svg class="stroked" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>',externalLink:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>',eyeOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',eye:'<svg class="stroked" viewBox="0 0 24 24"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>',fastForward:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="13 19 22 12 13 5 13 19"></polygon><polygon points="2 19 11 12 2 5 2 19"></polygon></svg>',feather:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z"></path><line x1="16" y1="8" x2="2" y2="22"></line><line x1="17.5" y1="15" x2="9" y2="15"></line></svg>',figma:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 5.5A3.5 3.5 0 0 1 8.5 2H12v7H8.5A3.5 3.5 0 0 1 5 5.5z"></path><path d="M12 2h3.5a3.5 3.5 0 1 1 0 7H12V2z"></path><path d="M12 12.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 1 1-7 0z"></path><path d="M5 19.5A3.5 3.5 0 0 1 8.5 16H12v3.5a3.5 3.5 0 1 1-7 0z"></path><path d="M5 12.5A3.5 3.5 0 0 1 8.5 9H12v7H8.5A3.5 3.5 0 0 1 5 12.5z"></path></svg>',fileMinus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="9" y1="15" x2="15" y2="15"></line></svg>',filePlus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="12" y1="18" x2="12" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></svg>',fileText:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>',file:'<svg class="stroked" viewBox="0 0 24 24"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg>',film:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18"></rect><line x1="7" y1="2" x2="7" y2="22"></line><line x1="17" y1="2" x2="17" y2="22"></line><line x1="2" y1="12" x2="22" y2="12"></line><line x1="2" y1="7" x2="7" y2="7"></line><line x1="2" y1="17" x2="7" y2="17"></line><line x1="17" y1="17" x2="22" y2="17"></line><line x1="17" y1="7" x2="22" y2="7"></line></svg>',filter:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon></svg>',flag:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path><line x1="4" y1="22" x2="4" y2="15"></line></svg>',folderMinus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path><line x1="9" y1="14" x2="15" y2="14"></line></svg>',folderPlus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path><line x1="12" y1="11" x2="12" y2="17"></line><line x1="9" y1="14" x2="15" y2="14"></line></svg>',folder:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg>',framer:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 16V9h14V2H5l14 14h-7m-7 0l7 7v-7m-7 0h7"></path></svg>',frown:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M16 16s-1.5-2-4-2-4 2-4 2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line></svg>',gift:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="20 12 20 22 4 22 4 12"></polyline><rect x="2" y="7" width="20" height="5"></rect><line x1="12" y1="22" x2="12" y2="7"></line><path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"></path><path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"></path></svg>',gitBranch:'<svg class="stroked" viewBox="0 0 24 24"><line x1="6" y1="3" x2="6" y2="15"></line><circle cx="18" cy="6" r="3"></circle><circle cx="6" cy="18" r="3"></circle><path d="M18 9a9 9 0 0 1-9 9"></path></svg>',gitCommit:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg>',gitMerge:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="18" cy="18" r="3"></circle><circle cx="6" cy="6" r="3"></circle><path d="M6 21V9a9 9 0 0 0 9 9"></path></svg>',gitPullRequest:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="18" cy="18" r="3"></circle><circle cx="6" cy="6" r="3"></circle><path d="M13 6h3a2 2 0 0 1 2 2v7"></path><line x1="6" y1="9" x2="6" y2="21"></line></svg>',github:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>',gitlab:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"></path></svg>',globe:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>',grid:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>',hardDrive:'<svg class="stroked" viewBox="0 0 24 24"><line x1="22" y1="12" x2="2" y2="12"></line><path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"></path><line x1="6" y1="16" x2="6.01" y2="16"></line><line x1="10" y1="16" x2="10.01" y2="16"></line></svg>',hash:'<svg class="stroked" viewBox="0 0 24 24"><line x1="4" y1="9" x2="20" y2="9"></line><line x1="4" y1="15" x2="20" y2="15"></line><line x1="10" y1="3" x2="8" y2="21"></line><line x1="16" y1="3" x2="14" y2="21"></line></svg>',headphones:'<svg class="stroked" viewBox="0 0 24 24"><path d="M3 18v-6a9 9 0 0 1 18 0v6"></path><path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"></path></svg>',heart:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>',helpCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',hexagon:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path></svg>',home:'<svg class="stroked" viewBox="0 0 24 24"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>',image:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>',inbox:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="22 12 16 12 14 15 10 15 8 12 2 12"></polyline><path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"></path></svg>',info:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12" y2="7.75"></line></svg>',instagram:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line></svg>',italic:'<svg class="stroked" viewBox="0 0 24 24"><line x1="19" y1="4" x2="10" y2="4"></line><line x1="14" y1="20" x2="5" y2="20"></line><line x1="15" y1="4" x2="9" y2="20"></line></svg>',key:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.78 7.78 5.5 5.5 0 0 1 7.78-7.78zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"></path></svg>',layers:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></svg>',layout:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="3" y1="9" x2="21" y2="9"></line><line x1="9" y1="21" x2="9" y2="9"></line></svg>',lifeBuoy:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="4.93" y1="4.93" x2="9.17" y2="9.17"></line><line x1="14.83" y1="14.83" x2="19.07" y2="19.07"></line><line x1="14.83" y1="9.17" x2="19.07" y2="4.93"></line><line x1="14.83" y1="9.17" x2="18.36" y2="5.64"></line><line x1="4.93" y1="19.07" x2="9.17" y2="14.83"></line></svg>',link2:'<svg class="stroked" viewBox="0 0 24 24"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg>',link:'<svg class="stroked" viewBox="0 0 24 24"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>',linkedin:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"></path><rect x="2" y="9" width="4" height="12"></rect><circle cx="4" cy="4" r="2"></circle></svg>',list:'<svg class="stroked" viewBox="0 0 24 24"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',loader:'<svg class="stroked" viewBox="0 0 24 24"><line x1="12" y1="2" x2="12" y2="6"></line><line x1="12" y1="18" x2="12" y2="22"></line><line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line><line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line><line x1="2" y1="12" x2="6" y2="12"></line><line x1="18" y1="12" x2="22" y2="12"></line><line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line><line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line></svg>',lock:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg> ',logIn:'<svg class="stroked" viewBox="0 0 24 24"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"></path><polyline points="10 17 15 12 10 7"></polyline><line x1="15" y1="12" x2="3" y2="12"></line></svg>',logOut:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>',mail:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>',mapPin:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>',map:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"></polygon><line x1="8" y1="2" x2="8" y2="18"></line><line x1="16" y1="6" x2="16" y2="22"></line></svg>',maximize2:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>',maximize:'<svg class="stroked" viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg>',meh:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="8" y1="15" x2="16" y2="15"></line><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line></svg>',menu:'<svg class="stroked" viewBox="0 0 24 24"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>',messageCircle:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path></svg>',messageSquare:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>',micOff:'<svg class="stroked" viewBox="0 0 24 24"><line x1="1" y1="1" x2="23" y2="23"></line><path d="M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"></path><path d="M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line></svg>',mic:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line></svg>',minimize2:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="4 14 10 14 10 20"></polyline><polyline points="20 10 14 10 14 4"></polyline><line x1="14" y1="10" x2="21" y2="3"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>',minimize:'<svg class="stroked" viewBox="0 0 24 24"><path d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"></path></svg>',minusCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="8" y1="12" x2="16" y2="12"></line></svg>',minusSquare:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="8" y1="12" x2="16" y2="12"></line></svg>',minus:'<svg class="stroked" viewBox="0 0 24 24"><line x1="5" y1="12" x2="19" y2="12"></line></svg>',monitor:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect><line x1="8" y1="21" x2="16" y2="21"></line><line x1="12" y1="17" x2="12" y2="21"></line></svg>',moon:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>',moreHorizontal:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg>',moreVertical:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="5" r="1"></circle><circle cx="12" cy="19" r="1"></circle></svg>',mousePointer:'<svg class="stroked" viewBox="0 0 24 24"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path><path d="M13 13l6 6"></path></svg>',move:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="5 9 2 12 5 15"></polyline><polyline points="9 5 12 2 15 5"></polyline><polyline points="15 19 12 22 9 19"></polyline><polyline points="19 9 22 12 19 15"></polyline><line x1="2" y1="12" x2="22" y2="12"></line><line x1="12" y1="2" x2="12" y2="22"></line></svg>',music:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg>',navigation2:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="12 2 19 21 12 17 5 21 12 2"></polygon></svg>',navigation:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="3 11 22 2 13 21 11 13 3 11"></polygon></svg>',octagon:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon></svg>',package:'<svg class="stroked" viewBox="0 0 24 24"><line x1="16.5" y1="9.4" x2="7.5" y2="4.21"></line><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>',paperclip:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"></path></svg>',pauseCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="10" y1="15" x2="10" y2="9"></line><line x1="14" y1="15" x2="14" y2="9"></line></svg>',pause:'<svg class="stroked" viewBox="0 0 24 24"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>',penTool:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 19l7-7 3 3-7 7-3-3z"></path><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"></path><path d="M2 2l7.59 7.59"></path><circle cx="11" cy="11" r="2"></circle></svg>',percent:'<svg class="stroked" viewBox="0 0 24 24"><line x1="19" y1="5" x2="5" y2="19"></line><circle cx="6.5" cy="6.5" r="2.5"></circle><circle cx="17.5" cy="17.5" r="2.5"></circle></svg>',phoneCall:'<svg class="stroked" viewBox="0 0 24 24"><path d="M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phoneForwarded:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="19 1 23 5 19 9"></polyline><line x1="15" y1="5" x2="23" y2="5"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phoneIncoming:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="16 2 16 8 22 8"></polyline><line x1="23" y1="1" x2="16" y2="8"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phoneMissed:'<svg class="stroked" viewBox="0 0 24 24"><line x1="23" y1="1" x2="17" y2="7"></line><line x1="17" y1="1" x2="23" y2="7"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phoneOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"></path><line x1="23" y1="1" x2="1" y2="23"></line></svg>',phoneOutgoing:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 7 23 1 17 1"></polyline><line x1="16" y1="8" x2="23" y2="1"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phone:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',pieChart:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21.21 15.89A10 10 0 1 1 8 2.83"></path><path d="M22 12A10 10 0 0 0 12 2v10z"></path></svg>',playCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><polygon points="10 8 16 12 10 16 10 8"></polygon></svg>',play:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',plusCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg>',plusSquare:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg>',plus:'<svg class="stroked" viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>',pocket:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 3h16a2 2 0 0 1 2 2v6a10 10 0 0 1-10 10A10 10 0 0 1 2 11V5a2 2 0 0 1 2-2z"></path><polyline points="8 10 12 14 16 10"></polyline></svg>',power:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path><line x1="12" y1="2" x2="12" y2="12"></line></svg>',printer:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg>',radio:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="2"></circle><path d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"></path></svg>',repeat:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="17 1 21 5 17 9"></polyline><path d="M3 11V9a4 4 0 0 1 4-4h14"></path><polyline points="7 23 3 19 7 15"></polyline><path d="M21 13v2a4 4 0 0 1-4 4H3"></path></svg>',rewind:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 19 2 12 11 5 11 19"></polygon><polygon points="22 19 13 12 22 5 22 19"></polygon></svg>',cornerDownRight:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="15 10 20 15 15 20"></polyline><path d="M4 4v7a4 4 0 0 0 4 4h12"></path></svg>',cornerRightDown:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="10 15 15 20 20 15"></polyline><path d="M4 4h7a4 4 0 0 1 4 4v12"></path></svg>',cornerRightUp:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="10 9 15 4 20 9"></polyline><path d="M4 20h7a4 4 0 0 0 4-4V4"></path></svg>',cornerUpRight:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="15 14 20 9 15 4"></polyline><path d="M4 20v-7a4 4 0 0 1 4-4h12"></path></svg>',refreshCw:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg>',rotateCw:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>',skipForward:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="5 4 15 12 5 20 5 4"></polygon><line x1="19" y1="5" x2="19" y2="19"></line></svg>',toggleRight:'<svg class="stroked" viewBox="0 0 24 24"><rect x="1" y="5" width="22" height="14" rx="7" ry="7"></rect><circle cx="16" cy="12" r="3"></circle></svg>',rss:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg>',save:'<svg class="stroked" viewBox="0 0 24 24"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"></path><polyline points="17 21 17 13 7 13 7 21"></polyline><polyline points="7 3 7 8 15 8"></polyline></svg>',scissors:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="6" cy="6" r="3"></circle><circle cx="6" cy="18" r="3"></circle><line x1="20" y1="4" x2="8.12" y2="15.88"></line><line x1="14.47" y1="14.48" x2="20" y2="20"></line><line x1="8.12" y1="8.12" x2="12" y2="12"></line></svg>',search:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',send:'<svg class="stroked" viewBox="0 0 24 24"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>',server:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6.01" y2="6"></line><line x1="6" y1="18" x2="6.01" y2="18"></line></svg>',settings:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M4.78,6.75 C6.02,7.26,7.26,6.02,6.75,4.78 C6.75,4.78,6.24,3.57,6.24,3.57 C5.93,2.8,6.29,1.92,7.06,1.6 C7.06,1.6,8.14,1.15,8.14,1.15 C8.91,0.83,9.79,1.2,10.11,1.96 C10.11,1.96,10.61,3.18,10.61,3.18 C11.12,4.42,12.88,4.42,13.39,3.18 C13.39,3.18,13.89,1.97,13.89,1.97 C14.21,1.2,15.09,0.83,15.86,1.15 C15.86,1.15,16.94,1.6,16.94,1.6 C17.71,1.92,18.08,2.8,17.76,3.57 C17.76,3.57,17.15,5.03,17.15,5.03 C16.64,6.27,17.88,7.51,19.12,7 C19.12,7,20.51,6.42,20.51,6.42 C21.28,6.1,22.16,6.47,22.47,7.23 C22.47,7.23,22.92,8.32,22.92,8.32 C23.24,9.09,22.88,9.96,22.11,10.28 C22.11,10.28,21.07,10.71,21.07,10.71 C19.83,11.23,19.83,12.98,21.07,13.49 C21.07,13.49,22.04,13.89,22.04,13.89 C22.8,14.21,23.17,15.09,22.85,15.86 C22.85,15.86,22.4,16.94,22.4,16.94 C22.08,17.71,21.2,18.07,20.43,17.76 C20.43,17.76,19.22,17.25,19.22,17.25 C17.98,16.74,16.74,17.98,17.25,19.22 C17.25,19.22,17.76,20.43,17.76,20.43 C18.07,21.2,17.71,22.08,16.94,22.4 C16.94,22.4,15.86,22.85,15.86,22.85 C15.09,23.17,14.21,22.8,13.89,22.04 C13.89,22.04,13.39,20.82,13.39,20.82 C12.88,19.58,11.12,19.58,10.61,20.82 C10.61,20.82,10.11,22.04,10.11,22.04 C9.79,22.8,8.91,23.17,8.14,22.85 C8.14,22.85,7.06,22.4,7.06,22.4 C6.29,22.08,5.93,21.2,6.24,20.44 C6.24,20.44,6.64,19.47,6.64,19.47 C7.16,18.23,5.92,16.99,4.68,17.5 C4.68,17.5,3.64,17.93,3.64,17.93 C2.87,18.25,1.99,17.89,1.67,17.12 C1.67,17.12,1.22,16.04,1.22,16.04 C0.91,15.27,1.27,14.39,2.04,14.07 C2.04,14.07,3.43,13.49,3.43,13.49 C4.67,12.98,4.67,11.23,3.43,10.71 C3.43,10.71,1.96,10.11,1.96,10.11 C1.2,9.79,0.83,8.91,1.15,8.14 C1.15,8.14,1.6,7.06,1.6,7.06 C1.92,6.29,2.8,5.93,3.57,6.24 C3.57,6.24,4.78,6.75,4.78,6.75 z M14.31,11.04 C14.84,12.32,14.23,13.78,12.96,14.31 C11.68,14.84,10.22,14.23,9.69,12.96 C9.16,11.68,9.77,10.22,11.04,9.69 C12.32,9.16,13.78,9.77,14.31,11.04 z"/></g></svg> ',share2:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg>',share:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path><polyline points="16 6 12 2 8 6"></polyline><line x1="12" y1="2" x2="12" y2="15"></line></svg>',shieldOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M19.69 14a6.9 6.9 0 0 0 .31-2V5l-8-3-3.16 1.18"></path><path d="M4.73 4.73L4 5v7c0 6 8 10 8 10a20.29 20.29 0 0 0 5.62-4.38"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',shield:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg>',shoppingBag:'<svg class="stroked" viewBox="0 0 24 24"><path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"></path><line x1="3" y1="6" x2="21" y2="6"></line><path d="M16 10a4 4 0 0 1-8 0"></path></svg>',shoppingCart:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>',shuffle:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="16 3 21 3 21 8"></polyline><line x1="4" y1="20" x2="21" y2="3"></line><polyline points="21 16 21 21 16 21"></polyline><line x1="15" y1="15" x2="21" y2="21"></line><line x1="4" y1="4" x2="9" y2="9"></line></svg>',sidebar:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="3" x2="9" y2="21"></line></svg>',slack:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14.5 10c-.83 0-1.5-.67-1.5-1.5v-5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5z"></path><path d="M20.5 10H19V8.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"></path><path d="M9.5 14c.83 0 1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5S8 21.33 8 20.5v-5c0-.83.67-1.5 1.5-1.5z"></path><path d="M3.5 14H5v1.5c0 .83-.67 1.5-1.5 1.5S2 16.33 2 15.5 2.67 14 3.5 14z"></path><path d="M14 14.5c0-.83.67-1.5 1.5-1.5h5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-5c-.83 0-1.5-.67-1.5-1.5z"></path><path d="M15.5 19H14v1.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z"></path><path d="M10 9.5C10 8.67 9.33 8 8.5 8h-5C2.67 8 2 8.67 2 9.5S2.67 11 3.5 11h5c.83 0 1.5-.67 1.5-1.5z"></path><path d="M8.5 5H10V3.5C10 2.67 9.33 2 8.5 2S7 2.67 7 3.5 7.67 5 8.5 5z"></path></svg>',slash:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"></line></svg>',sliders:'<svg class="stroked" viewBox="0 0 24 24"><line x1="4" y1="21" x2="4" y2="14"></line><line x1="4" y1="10" x2="4" y2="3"></line><line x1="12" y1="21" x2="12" y2="12"></line><line x1="12" y1="8" x2="12" y2="3"></line><line x1="20" y1="21" x2="20" y2="16"></line><line x1="20" y1="12" x2="20" y2="3"></line><line x1="1" y1="14" x2="7" y2="14"></line><line x1="9" y1="8" x2="15" y2="8"></line><line x1="17" y1="16" x2="23" y2="16"></line></svg>',smartphone:'<svg class="stroked" viewBox="0 0 24 24"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"></rect><line x1="12" y1="18" x2="12.01" y2="18"></line></svg>',smile:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M8 14s1.5 2 4 2 4-2 4-2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line></svg>',speaker:'<svg class="stroked" viewBox="0 0 24 24"><rect x="4" y="2" width="16" height="20" rx="2" ry="2"></rect><circle cx="12" cy="14" r="4"></circle><line x1="12" y1="6" x2="12.01" y2="6"></line></svg>',square:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect></svg>',star:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>',stopCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><rect x="9" y="9" width="6" height="6"></rect></svg>',sun:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>',sunrise:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17 18a5 5 0 0 0-10 0"></path><line x1="12" y1="2" x2="12" y2="9"></line><line x1="4.22" y1="10.22" x2="5.64" y2="11.64"></line><line x1="1" y1="18" x2="3" y2="18"></line><line x1="21" y1="18" x2="23" y2="18"></line><line x1="18.36" y1="11.64" x2="19.78" y2="10.22"></line><line x1="23" y1="22" x2="1" y2="22"></line><polyline points="8 6 12 2 16 6"></polyline></svg>',sunset:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17 18a5 5 0 0 0-10 0"></path><line x1="12" y1="9" x2="12" y2="2"></line><line x1="4.22" y1="10.22" x2="5.64" y2="11.64"></line><line x1="1" y1="18" x2="3" y2="18"></line><line x1="21" y1="18" x2="23" y2="18"></line><line x1="18.36" y1="11.64" x2="19.78" y2="10.22"></line><line x1="23" y1="22" x2="1" y2="22"></line><polyline points="16 5 12 9 8 5"></polyline></svg>',table:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"></path></svg>',tablet:'<svg class="stroked" viewBox="0 0 24 24"><rect x="4" y="2" width="16" height="20" rx="2" ry="2"></rect><line x1="12" y1="18" x2="12.01" y2="18"></line></svg>',tag:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7.01" y2="7"></line></svg>',target:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="6"></circle><circle cx="12" cy="12" r="2"></circle></svg>',terminal:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg>',thermometer:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 14.76V3.5a2.5 2.5 0 0 0-5 0v11.26a4.5 4.5 0 1 0 5 0z"></path></svg>',tool:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg>',trash2:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>',trash:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>',trello:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><rect x="7" y="7" width="3" height="9"></rect><rect x="14" y="7" width="3" height="5"></rect></svg>',trendingDown:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 18 13.5 8.5 8.5 13.5 1 6"></polyline><polyline points="17 18 23 18 23 12"></polyline></svg>',trendingUp:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline></svg>',triangle:'<svg class="stroked" viewBox="0 0 24 24"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path></svg>',truck:'<svg class="stroked" viewBox="0 0 24 24"><rect x="1" y="3" width="15" height="13"></rect><polygon points="16 8 20 8 23 11 23 16 16 16 16 8"></polygon><circle cx="5.5" cy="18.5" r="2.5"></circle><circle cx="18.5" cy="18.5" r="2.5"></circle></svg>',tv:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="7" width="20" height="15" rx="2" ry="2"></rect><polyline points="17 2 12 7 7 2"></polyline></svg>',twitch:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 2H3v16h5v4l4-4h5l4-4V2zm-10 9V7m5 4V7"></path></svg>',twitter:'<svg class="stroked" viewBox="0 0 24 24"><path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path></svg>',type:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="4 7 4 4 20 4 20 7"></polyline><line x1="9" y1="20" x2="15" y2="20"></line><line x1="12" y1="4" x2="12" y2="20"></line></svg>',umbrella:'<svg class="stroked" viewBox="0 0 24 24"><path d="M23 12a11.05 11.05 0 0 0-22 0zm-5 7a3 3 0 0 1-6 0v-7"></path></svg>',underline:'<svg class="stroked" viewBox="0 0 24 24"><path d="M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3"></path><line x1="4" y1="21" x2="20" y2="21"></line></svg>',unlock:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 9.9-1"></path></svg>',thumbsUp:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>',arrowRightCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><polyline points="12 16 16 12 12 8"></polyline><line x1="8" y1="12" x2="16" y2="12"></line></svg>',arrowRight:'<svg class="stroked" viewBox="0 0 24 24"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>',chevronRight:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="9 18 15 12 9 6"></polyline></svg>',chevronsRight:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="13 17 18 12 13 7"></polyline><polyline points="6 17 11 12 6 7"></polyline></svg>',uploadCloud:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="16 16 12 12 8 16"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16"></polyline></svg>',upload:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg>',userCheck:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><polyline points="17 11 19 13 23 9"></polyline></svg>',userMinus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="23" y1="11" x2="17" y2="11"></line></svg>',userPlus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="20" y1="8" x2="20" y2="14"></line><line x1="23" y1="11" x2="17" y2="11"></line></svg>',userX:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="18" y1="8" x2="23" y2="13"></line><line x1="23" y1="8" x2="18" y2="13"></line></svg>',user:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>',users:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>',videoOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 16v1a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2m5.66 0H14a2 2 0 0 1 2 2v3.34l1 1L23 7v10"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',video:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>',voicemail:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="5.5" cy="11.5" r="4.5"></circle><circle cx="18.5" cy="11.5" r="4.5"></circle><line x1="5.5" y1="16" x2="18.5" y2="16"></line></svg>',volume1:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><path d="M15.54 8.46a5 5 0 0 1 0 7.07"></path></svg>',volume2:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"></path></svg>',volumeX:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><line x1="23" y1="9" x2="17" y2="15"></line><line x1="17" y1="9" x2="23" y2="15"></line></svg>',volume:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon></svg>',watch:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="7"></circle><polyline points="12 9 12 12 13.5 13.5"></polyline><path d="M16.51 17.35l-.35 3.83a2 2 0 0 1-2 1.82H9.83a2 2 0 0 1-2-1.82l-.35-3.83m.01-10.7l.35-3.83A2 2 0 0 1 9.83 1h4.35a2 2 0 0 1 2 1.82l.35 3.83"></path></svg>',wifiOff:'<svg class="stroked" viewBox="0 0 24 24"><line x1="1" y1="1" x2="23" y2="23"></line><path d="M16.72 11.06A10.94 10.94 0 0 1 19 12.55"></path><path d="M5 12.55a10.94 10.94 0 0 1 5.17-2.39"></path><path d="M10.71 5.05A16 16 0 0 1 22.58 9"></path><path d="M1.42 9a15.91 15.91 0 0 1 4.7-2.88"></path><path d="M8.53 16.11a6 6 0 0 1 6.95 0"></path><line x1="12" y1="20" x2="12.01" y2="20"></line></svg>',wifi:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 12.55a11 11 0 0 1 14.08 0"></path><path d="M1.42 9a16 16 0 0 1 21.16 0"></path><path d="M8.53 16.11a6 6 0 0 1 6.95 0"></path><line x1="12" y1="20" x2="12.01" y2="20"></line></svg>',wind:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2"></path></svg>',xCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',xOctagon:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',xSquare:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="9" x2="15" y2="15"></line><line x1="15" y1="9" x2="9" y2="15"></line></svg>',x:'<svg class="stroked" viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',zapOff:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="12.41 6.75 13 2 10.57 4.92"></polyline><polyline points="18.57 12.91 21 10 15.66 10"></polyline><polyline points="8 8 3 14 12 14 11 22 16 16"></polyline><line x1="1" y1="1" x2="23" y2="23"></line></svg>',zap:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg>',zoomIn:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="11" y1="8" x2="11" y2="14"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>',zoomOut:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>',fontBold:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M13.5,11 C15.71,11,17.5,12.68,17.5,14.75 C17.5,16.82,15.71,18.5,13.5,18.5 C13.5,18.5,8.5,18.5,8.5,18.5 C8.5,18.5,8.5,3.5,8.5,3.5 C8.5,3.5,13.5,3.5,13.5,3.5 C15.71,3.5,17.5,5.18,17.5,7.25 C17.5,9.32,15.71,11,13.5,11 C13.5,11,13.5,11,13.5,11 z"/><path style="" d="M13.5,11 C13.5,11,8.5,11,8.5,11"/><path style="" d="M12.5,11 C14.71,11,16.5,12.68,16.5,14.75 C16.5,16.82,14.71,18.5,12.5,18.5 C12.5,18.5,7.5,18.5,7.5,18.5 C7.5,18.5,7.5,3.5,7.5,3.5 C7.5,3.5,12.5,3.5,12.5,3.5 C14.71,3.5,16.5,5.18,16.5,7.25 C16.5,9.32,14.71,11,12.5,11 C12.5,11,12.5,11,12.5,11 z"/><path style="" d="M12.5,11 C12.5,11,7.5,11,7.5,11"/></g></svg> ',fontItalic:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M17,4.5 C17,4.5,13,4.5,13,4.5"/><path style="" d="M11,19.5 C11,19.5,7,19.5,7,19.5"/><path style="" d="M15,4.5 C15,4.5,9,19.5,9,19.5"/></g></svg> ',fontUnderline:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M7.5,3.5 C7.5,3.5,7.5,10.74,7.5,13.5 C7.5,16.26,9.74,18.5,12.5,18.5 C15.26,18.5,17.5,16.26,17.5,13.5 C17.5,10.74,17.5,3.5,17.5,3.5"/><path style="" d="M7.5,21.5 C7.5,21.5,17.5,21.5,17.5,21.5"/></g></svg> ',indent:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,10 C21,10,8,10,8,10"/><path style="" d="M21,6 C21,6,8,6,8,6"/><path style="" d="M21,14 C21,14,8,14,8,14"/><path style="" d="M21,18 C21,18,8,18,8,18"/><path style="" d="M2.5,9 C2.5,9,5.5,12,5.5,12 C5.5,12,2.5,15,2.5,15"/></g></svg> ',listBullet:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,6 C21,6,10,6,10,6"/><path style="" d="M21,12 C21,12,10,12,10,12"/><path style="" d="M21,18 C21,18,10,18,10,18"/><path style="" d="M5.5,5 C6.05,5,6.5,5.45,6.5,6 C6.5,6.55,6.05,7,5.5,7 C4.95,7,4.5,6.55,4.5,6 C4.5,5.45,4.95,5,5.5,5 z"/><path style="" d="M5.5,11 C6.05,11,6.5,11.45,6.5,12 C6.5,12.55,6.05,13,5.5,13 C4.95,13,4.5,12.55,4.5,12 C4.5,11.45,4.95,11,5.5,11 z"/><path style="" d="M5.5,17 C6.05,17,6.5,17.45,6.5,18 C6.5,18.55,6.05,19,5.5,19 C4.95,19,4.5,18.55,4.5,18 C4.5,17.45,4.95,17,5.5,17 z"/></g></svg> ',listNumber:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,6 C21,6,10,6,10,6"/><path style="" d="M21,12 C21,12,10,12,10,12"/><path style="" d="M21,18 C21,18,10,18,10,18"/><path style="" d="M4.5,5 C4.5,5,5.5,4,5.5,4 C5.5,4,5.5,8,5.5,8"/><path style="" d="M4.5,10 C4.5,10,5.5,10,5.5,10 C6.05,10,6.5,10.45,6.5,11 C6.5,11,6.5,11,6.5,11 C6.5,11.55,6.05,12,5.5,12 C5.5,12,5.5,12,5.5,12 C4.95,12,4.5,12.45,4.5,13 C4.5,13,4.5,14,4.5,14 C4.5,14,6.5,14,6.5,14"/><path style="" d="M4.5,16 C4.5,16,5.5,16,5.5,16 C6.05,16,6.5,16.45,6.5,17 C6.5,17,6.5,17,6.5,17 C6.5,17.55,6.05,18,5.5,18 C5.5,18,4.5,18,4.5,18 C4.5,18,5.5,18,5.5,18 C6.05,18,6.5,18.45,6.5,19 C6.5,19,6.5,19,6.5,19 C6.5,19.55,6.05,20,5.5,20 C5.5,20,4.5,20,4.5,20"/></g></svg> ',outdent:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,10 C21,10,8,10,8,10"/><path style="" d="M21,6 C21,6,8,6,8,6"/><path style="" d="M21,14 C21,14,8,14,8,14"/><path style="" d="M21,18 C21,18,8,18,8,18"/><path style="" d="M5.5,9 C5.5,9,2.5,12,2.5,12 C2.5,12,5.5,15,5.5,15"/></g></svg> ',pin:'<svg class="stroked" viewBox="0 0 24 24"><g><g><path style="" d="M16.23,4.73 C16.23,4.73,19.42,7.9,19.42,7.9 C19.42,7.9,14.46,15.69,14.46,15.69 C14.46,15.69,8.45,9.68,8.45,9.68 C8.45,9.68,16.23,4.73,16.23,4.73 z"/><path style="" d="M20.84,9.32 C20.84,9.32,14.47,2.95,14.47,2.95"/><path style="" d="M16.6,17.8 C16.6,17.8,6.7,7.9,6.7,7.9"/><path style="" d="M10.23,11.44 C10.23,11.44,5.99,18.51,5.99,18.51 C5.99,18.51,13.06,14.27,13.06,14.27"/></g></g></svg> ',resize:'<svg class="stroked" version="1.1" viewBox="0, 0, 24, 24"><g><path d="M9,3 L3,3 L3,9"/><path d="M15,21 L21,21 L21,15"/><path d="M3,3 L10,10"/><path d="M21,21 L14,14"/></g></svg> ',shift:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 4 4 12h4v8h8v-8h4z"></path></svg> ',sortAscending:'<svg class="stroked" viewBox="0 0 24 24"><g><path d="M16.5,10.5 C16.5,10.5,7.5,10.5,7.5,10.5"/><path d="M14.5,6.5 C14.5,6.5,9.5,6.5,9.5,6.5"/><path d="M18.5,14.5 C18.5,14.5,5.5,14.5,5.5,14.5"/><path d="M20.5,18.5 C20.5,18.5,3.5,18.5,3.5,18.5"/></g></svg> ',sortDescending:'<svg class="stroked" viewBox="0 0 24 24"><g><path d="M16.5,14.5 C16.5,14.5,7.5,14.5,7.5,14.5"/><path d="M14.5,18.5 C14.5,18.5,9.5,18.5,9.5,18.5"/><path d="M18.5,10.5 C18.5,10.5,5.5,10.5,5.5,10.5"/><path d="M20.5,6.5 C20.5,6.5,3.5,6.5,3.5,6.5"/></g></svg> ',tab:'<svg class="stroked" viewBox="0 0 24 24"><line x1="3" y1="12" x2="16" y2="12"></line><polyline points="10 6 16 12 10 18"></polyline><line x1="20" y1="5" x2="20" y2="19"></line></svg> ',cornerDownLeft:"cornerDownRight0f",cornerLeftDown:"cornerRightDown0f",cornerLeftUp:"cornerRightUp0f",cornerUpLeft:"cornerUpRight0f",refreshCcw:"refreshCw0f",rotateCcw:"rotateCw0f",skipBack:"skipForward0f",toggleLeft:"toggleRight0f",thumbsDown:"thumbsUp1f",arrowDownCircle:"arrowRightCircle90r",arrowLeftCircle:"arrowRightCircle180r",arrowUpCircle:"arrowRightCircle270r",arrowDown:"arrowRight90r",arrowLeft:"arrowRight180r",arrowUp:"arrowRight270r",chevronDown:"chevronRight90r",chevronLeft:"chevronRight180r",chevronUp:"chevronRight270r",chevronsDown:"chevronsRight90r",chevronsLeft:"chevronsRight180r",chevronsUp:"chevronsRight270r",arrowDownRight:"arrowUpRight90r",arrowDownLeft:"arrowUpRight180r",arrowUpLeft:"arrowUpRight270r",fatArrowUp:"shift",fatArrowRight:"shift90r",fatArrowDown:"shift180r",fatArrowLeft:"shift270r"};var js=(e)=>{Object.assign(be,e)};var jl=(e)=>/\d$/.test(e)?e+"_":e,Rs=[{prefix:/^spin(_?\d+)/,apply(e,t,n){let i=t[1].replace("_","-"),s=360/Math.abs(parseFloat(i)),o=i.startsWith("-")?"reverse":"normal",r=Be(e,[]),l=r;if(l.animate){let a=l.style.transform||"";l.animate([{transform:`${a} rotate(0deg)`},{transform:`${a} rotate(360deg)`}],{duration:s*1000,iterations:1/0,direction:o})}return _s(e,n,r)}},{prefix:"un",apply:(e)=>`slash25o$${e}75s75o`},{prefix:"check",apply:(e)=>`check75o_00aa00S$${e}75s50o`},{prefix:"cancel",apply:(e)=>`x75o_cc0000S$${e}75s50o`},{prefix:"search",apply:(e)=>`search80s30x30y$${e}50o`}],Rl=0;function Is(e,t){let n=C.div();n.innerHTML=e;let i=n.querySelector("svg"),s=i.querySelectorAll("[id]");if(s.length>0){let l=new Map;for(let d of s){let u=d.id,h=`tosi_svg_id_${++Rl}`;l.set(u,h),d.id=h}let a=i.innerHTML,c=a;for(let[d,u]of l){let h=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");c=c.replace(new RegExp(`url\\(#${h}\\)`,"g"),`url(#${u})`).replace(new RegExp(`href="#${h}"`,"g"),`href="#${u}"`)}if(c!==a)i.innerHTML=c}let o=new Set(i.classList);o.add("tosi-icon");let r=_n.svg({class:Array.from(o).join(" "),viewBox:i.getAttribute("viewBox")},...t,...i.children);if(r.style.strokeWidth=m.tosiIconStrokeWidth("2px"),o.has("filled"))r.style.stroke="none",r.style.fill="currentColor";else if(o.has("stroked"))r.style.stroke=m.tosiIconStroke("currentColor"),r.style.fill=m.tosiIconFill("none");else r.style.stroke=m.tosiIconStroke("currentColor"),r.style.fill=m.tosiIconFill("currentColor");return r.style.height=m.tosiIconSize("16px"),r}function _s(e,t,...n){let i=C.span({class:"tosi-icon-composite",dataIcon:e,style:{display:"inline-flex",position:"relative",pointerEvents:"none"}},...n);for(let s of t)if(s&&typeof s==="object"&&!("nodeType"in s)){let o=s;if(o.style&&typeof o.style==="object")Object.assign(i.style,o.style);if(o.class)i.classList.add(...String(o.class).split(" "))}return i}function _l(e){let t=be;if(t[e])return!0;let n=qn(e);return n!=null&&!!t[n.baseName]}function Hs(e,t){for(let n of Rs){let i,s;if(n.prefix instanceof RegExp){let r=new RegExp(n.prefix.source+"(.+)$"),l=e.match(r);if(!l)continue;i=l[l.length-1],i=i[0].toLowerCase()+i.slice(1),s=l}else{if(!e.startsWith(n.prefix)||e.length<=n.prefix.length)continue;i=e[n.prefix.length].toLowerCase()+e.slice(n.prefix.length+1),s=n.prefix}if(!_l(i))continue;let o=n.apply(jl(i),s,t);if(typeof o==="string")return Be(o,t);if(o)return o}return null}var Pl=10,Vl=/(?:(?<=[a-zA-Z_])(?:_?\d+[osxyr]|[01]f|\d+W)|_[a-zA-Z0-9]+[FS])+$/;function qn(e){let t=e.match(Vl);if(!t)return null;let n=e.slice(0,t.index);if(!n)return null;if(n.endsWith("_"))n=n.slice(0,-1);if(!n)return null;if(!be[n]){if(!Rs.some((a)=>{if(a.prefix instanceof RegExp)return a.prefix.test(n);return n.startsWith(a.prefix)&&n.length>a.prefix.length}))return null}let s={},o=t[0].match(/_?\d+[osxyr]|[01]f|_[a-zA-Z0-9]+[FS]|\d+W/g);if(!o)return null;let r=[];for(let l of o){let a=l[l.length-1];if(a==="F"||a==="S"){let c=l.slice(1,-1),u=/^[0-9a-fA-F]{3,8}$/.test(c)?"#"+c:L[c];if(a==="F")s.fill=u;else s.stroke=u}else if(a==="W")s.strokeWidth=l.slice(0,-1);else{let c=parseInt(l.replace("_","-"));switch(a){case"o":s.opacity=String(c/100);break;case"s":r.push(`scale(${c/100})`);break;case"x":r.push(`translateX(${c}%)`);break;case"y":r.push(`translateY(${c}%)`);break;case"r":r.push(`rotate(${c}deg)`);break;case"f":r.push(c===0?"scaleX(-1)":"scaleY(-1)");break}}}if(r.length>0)s.transform=r.join(" "),s.transformOrigin="50% 50%";return{baseName:n,style:s}}function Be(e,t){if(e.endsWith("_"))e=e.slice(0,-1);let n=be,i=e;for(let r=0;r<Pl;r++){let l=n[i];if(!l)break;if(l.startsWith("<"))return Is(l,t);i=l}if(i!==e){let r=Hs(i,t);if(r)return r;let l=qn(i);if(l){let a=Be(l.baseName,t);return Object.assign(a.style,l.style),a}}if(e.includes("$")){let r=e.split("$"),l=Be(r[r.length-1],[]),a=r.slice(0,-1).reverse().map((c)=>{let d=Be(c,[]);return Object.assign(d.style,{position:"absolute",inset:"0",width:"100%",height:"100%"}),d});return _s(e,t,l,...a)}let s=Hs(e,t);if(s)return s;let o=qn(e);if(o){let r=Be(o.baseName,t);return Object.assign(r.style,o.style),r}if(e)console.warn(`icon ${e} does not exist`);return Is(be.square,t)}var x=new Proxy(be,{get(e,t){return(...n)=>Be(t,n)}});class Ps extends E{static preferredTagName="tosi-icon";static lightStyleSpec={":host":{"--tosi-icon-size":"var(--xin-icon-size, 16px)","--tosi-icon-stroke-width":"var(--xin-icon-stroke-width, var(--icon-stroke-width, 2px))","--tosi-icon-stroke-linejoin":"var(--icon-stroke-linejoin, round)","--tosi-icon-stroke-linecap":"var(--icon-stroke-linecap, round)","--tosi-icon-fill":"var(--xin-icon-fill, var(--icon-fill, none))",display:"inline-flex",verticalAlign:"text-bottom",stroke:"currentColor",strokeWidth:m.tosiIconStrokeWidth("2px"),strokeLinejoin:m.tosiIconStrokeLinejoin("round"),strokeLinecap:m.tosiIconStrokeLinecap("round"),fill:m.tosiIconFill("none"),height:L.tosiIconSize},":host svg, :host .tosi-icon-composite":{height:m.tosiIconSize("16px")}};static initAttributes={icon:"",size:0,fill:"",stroke:"",strokeWidth:1};render(){super.render(),this.textContent="";let e={};if(this.size)e.height=this.size+"px",this.style.setProperty("--tosi-icon-size",`${this.size}px`),this.style.setProperty("--xin-icon-size",`${this.size}px`);if(this.stroke)e.stroke=this.stroke,e.strokeWidth=this.strokeWidth;if(this.fill)e.fill=this.fill;this.append(x[this.icon]({style:e}))}}var oc=Ps.elementCreator();var ue="tosi-ins",K="tosi-del",Fl=0,$e=()=>`chg-${Date.now().toString(36)}-${(Fl++).toString(36)}`;class Kn extends HTMLElement{}class Gn extends HTMLElement{}function Ke(){if(typeof customElements>"u")return;if(!customElements.get("tosi-ins"))customElements.define("tosi-ins",Kn);if(!customElements.get("tosi-del"))customElements.define("tosi-del",Gn)}function ql(e,t,n){let i=document.createElement(e==="insert"?"tosi-ins":"tosi-del");if(i.setAttribute("data-change",$e()),i.setAttribute("data-author",n.id),n.name)i.setAttribute("data-author-name",n.name);return i.setAttribute("data-time",new Date().toISOString()),i.textContent=t,i}function Xn(e){return Array.from(e.querySelectorAll("tosi-ins[data-change], tosi-del[data-change]")).map((t)=>({id:t.getAttribute("data-change")||"",kind:t.tagName.toLowerCase()==="tosi-ins"?"insert":"delete",author:t.getAttribute("data-author")||"",authorName:t.getAttribute("data-author-name")||"",time:t.getAttribute("data-time")||"",text:t.textContent||"",element:t}))}function Vs(e){let t=e.parentNode;if(!t)return;while(e.firstChild)t.insertBefore(e.firstChild,e);e.remove()}function Yn(e){if(e.tagName.toLowerCase()==="tosi-del")e.remove();else Vs(e)}function Jn(e){if(e.tagName.toLowerCase()==="tosi-ins")e.remove();else Vs(e)}function Wn(e){return e.match(/\s*\S+|\s+$/g)||[]}var Un=4000;function Fs(e,t){let n=Wn(e),i=Wn(t);if(n.length>Un||i.length>Un){let u=[];if(e)u.push({op:"delete",text:e});if(t)u.push({op:"insert",text:t});return u}let s=n.length,o=i.length,r=Array.from({length:s+1},()=>Array(o+1).fill(0));for(let u=s-1;u>=0;u--)for(let h=o-1;h>=0;h--)r[u][h]=n[u]===i[h]?r[u+1][h+1]+1:Math.max(r[u+1][h],r[u][h+1]);let l=[],a=(u,h)=>{let f=l[l.length-1];if(f&&f.op===u)f.text+=h;else l.push({op:u,text:h})},c=0,d=0;while(c<s&&d<o)if(n[c]===i[d])a("same",n[c]),c++,d++;else if(r[c+1][d]>=r[c][d+1])a("delete",n[c]),c++;else a("insert",i[d]),d++;while(c<s)a("delete",n[c++]);while(d<o)a("insert",i[d++]);return l}function Zn(e,t,n){let i=Fs(e.data,t);if(!i.some((r)=>r.op!=="same"))return 0;Ke();let s=document.createDocumentFragment(),o=0;for(let r of i)if(r.op==="same")s.appendChild(document.createTextNode(r.text));else s.appendChild(ql(r.op,r.text,n)),o++;return e.parentNode?.replaceChild(s,e),o}var Vt="tosi-misspelling";class ei extends HTMLElement{connectedCallback(){this.setAttribute("data-spelling","error")}}function Ft(){if(typeof customElements>"u")return;if(customElements.get("tosi-misspelling"))return;customElements.define("tosi-misspelling",ei)}var Qn='.not-selectable, .do-not-spanify, code, kbd, samp, pre, [spellcheck="false"]';function qt(e,t=""){if(e.nodeType!==3)return!1;let n=e.parentElement;if(!n)return!1;return!n.closest(t?`${Qn}, ${t}`:Qn)}function Wl(e){return qt(e,"tosi-del")}function ti(e){let t=[],n=Intl.Segmenter,i=n?new n(void 0,{granularity:"word"}):null,s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),o;while(o=s.nextNode()){if(!Wl(o))continue;let r=o;if(i)for(let l of i.segment(r.data)){if(!l.isWordLike)continue;t.push({word:l.segment,node:r,start:l.index,end:l.index+l.segment.length})}else{let l=/[^\s.,;:!?()[\]{}"“”‘’—–]+/g,a;while(a=l.exec(r.data))t.push({word:a[0],node:r,start:a.index,end:a.index+a[0].length})}}return t}function mt(e){for(let t of Array.from(e.querySelectorAll("tosi-misspelling"))){let n=t.parentNode;if(!n)continue;while(t.firstChild)n.insertBefore(t.firstChild,t);t.remove()}e.normalize()}function Ul(e){let t=[];for(let n=e.length-1;n>=0;n--){let{node:i,start:s,end:o}=e[n];if(s>=i.data.length)continue;let r=document.createRange();r.setStart(i,s),r.setEnd(i,Math.min(o,i.data.length));let l=document.createElement("tosi-misspelling");try{r.surroundContents(l),t.push(l)}catch{}}return t.reverse()}async function ni(e,t,n=new Set,i=(s)=>s()){Ft();let s=i(()=>{mt(e);let r=ti(e);return[...new Set(r.map((l)=>l.word))].filter((l)=>!n.has(l))});if(s.length===0)return[];let o=await t(s);if(!o||o.size===0)return[];return i(()=>Kl(e,o,n))}function Kl(e,t,n){mt(e);let s=ti(e).filter((r)=>t.has(r.word)&&!n.has(r.word));if(s.length===0)return[];let o=new Map;for(let r of s){let l=o.get(r.node);if(l)l.push(r);else o.set(r.node,[r])}for(let r of o.values())Ul(r.sort((l,a)=>l.start-a.start));return Array.from(e.querySelectorAll("tosi-misspelling")).map((r)=>({word:r.textContent||"",element:r}))}var xe=C.div({style:{content:" ",position:"fixed",top:0,left:0,right:0,bottom:0}}),Wt={passive:!0},qs=(e,t,n="move")=>{if(!e.type.startsWith("touch")){e.preventDefault();let{clientX:s,clientY:o}=e;xe.style.cursor=n,Ge(xe),document.body.append(xe);let r=(l)=>{let a=l.clientX-s,c=l.clientY-o;if(t(a,c,l)===!0)xe.removeEventListener("mousemove",r),xe.removeEventListener("mouseup",r),xe.remove()};xe.addEventListener("mousemove",r,Wt),xe.addEventListener("mouseup",r,Wt)}else if(e instanceof TouchEvent){let s=e.changedTouches[0],o=s.identifier,r=s.clientX,l=s.clientY,a=e.target,c=0,d=0,u=(h)=>{let f=[...h.touches].find((p)=>p.identifier===o);if(f!==void 0)c=f.clientX-r,d=f.clientY-l;if(h.type==="touchmove")h.stopPropagation(),h.preventDefault();if(t(c,d,h)===!0||f===void 0)a.removeEventListener("touchmove",u),a.removeEventListener("touchend",u),a.removeEventListener("touchcancel",u)};a.addEventListener("touchmove",u),a.addEventListener("touchend",u,Wt),a.addEventListener("touchcancel",u,Wt)}},Gl=(e="body *")=>[...document.querySelectorAll(e)].map((t)=>parseFloat(getComputedStyle(t).zIndex)).reduce((t,n)=>isNaN(t)||Number(t)<n?n:Number(t),0),Ge=(e,t="body *")=>{e.style.zIndex=String(Gl(t)+1)};var{slot:Xl}=C;class he extends E{static preferredTagName="tosi-float";static floats=new Set;static initAttributes={drag:!1,remainOnResize:"remove",remainOnScroll:"remain"};content=Xl();static shadowStyleSpec={":host":{position:"fixed"}};reposition=(e)=>{if(e instanceof MouseEvent&&e.button!==0)return;if(e.target?.closest(".no-drag"))return;if(this.drag){Ge(this);let n=this.offsetLeft,i=this.offsetTop;qs(e,(s,o,r)=>{if(this.style.left=`${n+s}px`,this.style.top=`${i+o}px`,this.style.right="auto",this.style.bottom="auto",r.type==="mouseup")return!0})}};connectedCallback(){super.connectedCallback(),Yl(),he.floats.add(this);let e={passive:!0};this.addEventListener("touchstart",this.reposition,e),this.addEventListener("mousedown",this.reposition),Ge(this)}disconnectedCallback(){super.disconnectedCallback(),he.floats.delete(this)}}var ii=he.elementCreator();var Ws=!1;function Yl(){if(Ws)return;Ws=!0,window.addEventListener("resize",()=>{Array.from(he.floats).forEach((e)=>{if(e.remainOnResize==="hide")e.hidden=!0;else if(e.remainOnResize==="remove")e.remove()})},{passive:!0}),document.addEventListener("scroll",(e)=>{if(e.target instanceof HTMLElement&&e.target.closest(he.tagName))return;Array.from(he.floats).forEach((t)=>{if(t.remainOnScroll==="hide")t.hidden=!0;else if(t.remainOnScroll==="remove")t.remove()})},{passive:!0,capture:!0})}var Us=(e)=>{let{content:t,target:n,position:i,remainOnScroll:s,remainOnResize:o,draggable:r}=e,l=Array.isArray(t)?ii(...t):ii(t);if(Jl(l,n,i,s,o,r),e.class)l.setAttribute("class",e.class);return document.body.append(l),l},Jl=(e,t,n,i,s,o=!1)=>{{let{position:p}=getComputedStyle(e);if(p!=="fixed")e.style.position="fixed";if(e instanceof he){if(s)e.remainOnResize=s;if(i)e.remainOnScroll=i;e.drag=o}Ge(e)}let{left:r,top:l,width:a,height:c}=t.getBoundingClientRect(),d=r+a*0.5,u=l+c*0.5,h=window.innerWidth,f=window.innerHeight;if(n==="side")n=(d<h*0.5?"e":"w")+(u<f*0.5?"s":"n");else if(n==="auto"||n===void 0)n=(u<f*0.5?"s":"n")+(d<h*0.5?"e":"w");if(e.style.top=e.style.left=e.style.right=e.style.bottom=e.style.transform="",n.length===2){let[p,b]=n;switch(p){case"n":e.style.bottom=(f-l).toFixed(2)+"px";break;case"e":e.style.left=(r+a).toFixed(2)+"px";break;case"s":e.style.top=(l+c).toFixed(2)+"px";break;case"w":e.style.right=(h-r).toFixed(2)+"px";break}switch(b){case"n":e.style.bottom=(f-l-c).toFixed(2)+"px";break;case"e":e.style.left=r.toFixed(2)+"px";break;case"s":e.style.top=l.toFixed(2)+"px";break;case"w":e.style.right=(h-r-a).toFixed(2)+"px";break}e.style.transform=""}else if(n==="n")e.style.bottom=(f-l).toFixed(2)+"px",e.style.left=d.toFixed(2)+"px",e.style.transform="translateX(-50%)";else if(n==="s")e.style.top=(l+c).toFixed(2)+"px",e.style.left=d.toFixed(2)+"px",e.style.transform="translateX(-50%)";else if(n==="e")e.style.left=(r+a).toFixed(2)+"px",e.style.top=u.toFixed(2)+"px",e.style.transform="translateY(-50%)";else if(n==="w")e.style.right=(h-r).toFixed(2)+"px",e.style.top=u.toFixed(2)+"px",e.style.transform="translateY(-50%)";e.style.setProperty("--max-height",`calc(100vh - ${e.style.top||e.style.bottom})`),e.style.setProperty("--max-width",`calc(100vw - ${e.style.left||e.style.right})`)};function Ks(e,t=!0){return(n,i)=>{let s=e(n),o=e(i);for(let r in s)if(s[r]!==o[r])return(Array.isArray(t)?t[r]!==!1:t)?s[r]>o[r]?1:-1:s[r]>o[r]?-1:1;return 0}}var{button:Zl,span:Gs,input:Ql}=C,Xs=(e,t)=>!!e.find((n)=>{if(n===null||t==null)return!1;else if(Array.isArray(n))return Xs(n,t);else if(n.value===t||n===t)return!0});class Xe extends E{static preferredTagName="tosi-select";static formAssociated=!0;static lightStyleSpec={":host":{"--tosi-select-gap":"var(--tosi-spacing-sm, 8px)","--tosi-select-touch-size":"var(--tosi-touch-size, 44px)","--tosi-select-padding":"0 var(--tosi-spacing-sm, 8px)","--tosi-select-value-padding":"0 var(--tosi-spacing-sm, 8px)","--tosi-select-icon-width":"24px","--tosi-select-field-width":"140px","--gap":"var(--tosi-select-gap)","--touch-size":"var(--tosi-select-touch-size)","--padding":"var(--tosi-select-padding)","--value-padding":"var(--tosi-select-value-padding)","--icon-width":"var(--tosi-select-icon-width)","--fieldWidth":"var(--tosi-select-field-width)",display:"inline-flex",position:"relative"},":host button":{display:"flex",alignItems:"center",justifyItems:"center",gap:L.tosiSelectGap,textAlign:"left",height:L.tosiSelectTouchSize,padding:L.tosiSelectPadding,position:"relative",width:"100%"},":host:not([show-icon]) button > :first-child":{display:"none"},":host[hide-caption] button > :nth-child(2)":{display:"none"},':host [part="value"]':{width:L.tosiSelectFieldWidth,padding:L.tosiSelectValuePadding,height:L.tosiSelectTouchSize,lineHeight:L.tosiSelectTouchSize,boxShadow:"none",whiteSpace:"nowrap",outline:"none",background:"transparent",flex:"1"},':host [part="value"]:not(:focus)':{overflow:"hidden",textOverflow:"ellipsis",background:"transparent"}};static initAttributes={editable:!1,placeholder:"",showIcon:!1,hideCaption:!1,localized:!1,disabled:!1,required:!1,name:"",menuClass:""};_options=[];get options(){return this._options}set options(e){if(typeof e==="string")this._options=Xe.parseOptionsString(e);else this._options=e;this.queueRender()}static parseOptionsString(e){return e.split(",").map((t)=>{let n=t.trim();if(n==="")return null;let[i,s]=n.split("=").map((l)=>l.trim());if(!s)return{value:i,caption:i};let[o,r]=s.split(":").map((l)=>l.trim());return{value:i,caption:o||i,icon:r||void 0}})}value="";filter="";isExpanded=!1;formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=""}setValue=(e,t=!1)=>{if(this.value!==e)this.value=e,this.queueRender(!0);if(t)this.dispatchEvent(new Event("action"))};getValue=()=>this.value;get selectOptions(){return this.options}buildOptionMenuItem=(e)=>{if(e===null)return null;let{setValue:t,getValue:n}=this,i,s,o,r,l;if(typeof e==="string")s=o=e;else({icon:i,caption:s,value:o,tooltip:r,properties:l}=e);if(this.localized)s=H(s);let{options:a}=e;if(a)return{icon:i,caption:s,tooltip:r,properties:l,checked:()=>Xs(a,n()),menuItems:a.map(this.buildOptionMenuItem)};return{icon:i,caption:s,tooltip:r,properties:l,checked:()=>n()===o,action:typeof o==="function"?async()=>{let c=await o();if(c!==void 0)t(c,!0)}:()=>{if(typeof o==="string")t(o,!0)}}};poppedOptions=[];get optionsMenu(){let e=this.selectOptions.map(this.buildOptionMenuItem);if(this.filter==="")return e;let t=(n)=>{if(n===null||typeof n==="function")return!0;else if(n.menuItems){let i=fe(n.menuItems);return n.menuItems=i.filter(t),i.length>0}else return n.caption.toLocaleLowerCase().includes(this.filter)};return e.filter(t)}handleChange=(e)=>{let{value:t}=this.parts,n=t.value||"";if(this.value!==String(n))this.value=n,this.dispatchEvent(new Event("change"));this.filter="",e.stopPropagation(),e.preventDefault()};handleKey=(e)=>{if(e.key==="Enter")e.preventDefault()};filterMenu=Ht(()=>{this.filter=this.parts.value.value.toLocaleLowerCase(),j(0),this.popOptions()});popOptions=(e)=>{if(e&&e.type==="click")this.filter="";this.poppedOptions=this.optionsMenu,this.isExpanded=!0,this.updateAriaExpanded(),we({target:this,menuItems:this.poppedOptions,showChecked:!0,role:"listbox",menuClass:this.menuClass,onClose:()=>{this.isExpanded=!1,this.updateAriaExpanded()}})};updateAriaExpanded(){let{value:e}=this.parts;e.setAttribute("aria-expanded",String(this.isExpanded))}content=()=>[Zl({type:"button",part:"button",onClick:this.popOptions},Gs(),Ql({part:"value",value:this.value,tabindex:0,role:"combobox",ariaHaspopup:"listbox",ariaExpanded:"false",ariaAutocomplete:this.editable?"list":"none",onKeydown:this.handleKey,onInput:this.filterMenu,onChange:this.handleChange}),x.chevronDown())];get allOptions(){let e=[];function t(n){for(let i of n)if(typeof i==="string")e.push({caption:i,value:i});else if(i?.value)e.push(i);else if(i?.options)t(i.options)}return t(this.selectOptions),e}findOption(){return this.allOptions.find((t)=>t.value===this.value)||{caption:this.value,value:this.value}}localeChanged=()=>{this.queueRender()};connectedCallback(){super.connectedCallback();let e=this.getAttribute("options");if(e&&this._options.length===0)this._options=Xe.parseOptionsString(e);if(this.localized)si.allInstances.add(this)}disconnectedCallback(){if(super.disconnectedCallback(),this.localized)si.allInstances.delete(this)}render(){super.render();let{value:e,button:t}=this.parts;t.disabled=this.disabled;let n=e.previousElementSibling,i=this.findOption(),s=Gs();if(e.value=this.localized?H(i.caption):i.caption,i.icon)if(i.icon instanceof HTMLElement)s=i.icon.cloneNode(!0);else s=x[i.icon]();n.replaceWith(s),e.setAttribute("placeholder",this.localized?H(this.placeholder):this.placeholder),e.style.pointerEvents=this.editable?"":"none",e.readOnly=!this.editable}}var oi=Xe.elementCreator(),kc=Rt((...e)=>oi(...e),"xinSelect is deprecated, use tosiSelect instead (tag is now <tosi-select>)");var{span:ea}=C,{i18n:Ye}=Pt({i18n:{locale:window.navigator.language,locales:[window.navigator.language],languages:[window.navigator.language],emoji:[""],stringMap:{},localeOptions:[{icon:ea(),caption:window.navigator.language,value:window.navigator.language}]}});jt.localeOptions={toDOM(e,t){if(e instanceof Xe)e.options=t}};var ta=()=>{let e=Array.from(Je.allInstances);for(let t of e)t.localeChanged();Qs()};Ye.locale.observe(ta);var yt="data-tosi-localized";function Ut(e){let t=e.getAttribute(yt);if(!t)return;let n;try{n=JSON.parse(t)}catch(i){console.warn(`[data-tosi-localized] invalid JSON: ${t}`,i);return}if(!n||typeof n!=="object")return;for(let[i,s]of Object.entries(n)){if(typeof s!=="string")continue;e.setAttribute(i,H(s))}}function*Zs(e){for(let t of Array.from(e.querySelectorAll(`[${yt}]`)))yield t;for(let t of Array.from(e.querySelectorAll("*"))){let n=t.shadowRoot;if(n)yield*Zs(n)}}function Qs(){if(typeof document>"u")return;for(let e of Zs(document))Ut(e)}var Ys=null;if(typeof document<"u"&&typeof MutationObserver<"u"){let e=()=>{if(!document.body){queueMicrotask(e);return}Ys=new MutationObserver((t)=>{for(let n of t){if(n.type==="attributes"&&n.target instanceof Element){Ut(n.target);continue}for(let i of Array.from(n.addedNodes)){if(!(i instanceof Element))continue;if(i.hasAttribute(yt))Ut(i);for(let s of Array.from(i.querySelectorAll(`[${yt}]`)))Ut(s)}}}),Ys.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[yt]}),Qs()};e()}var Tc=Ks((e)=>[e.caption.toLocaleLowerCase()]);var na=/(?<=[^\s\\])#[A-Za-z0-9_-]+$/;function eo(e){let t=na.exec(e);return t?t.index:-1}function Js(e){let t=eo(e);return(t===-1?e:e.slice(0,t)).replace(/\\#/g,"#")}function ia(e,t){return e.replace(/\{([A-Za-z0-9_]+)\}/g,(n,i)=>Object.prototype.hasOwnProperty.call(t,i)?String(t[i]):n)}function H(e,t){if(t)return ia(H(e),t);if(e.endsWith("…"))return H(e.substring(0,e.length-1))+"…";let n=Ye.locales.value.indexOf(Ye.locale.value);if(n>-1){let i=B(Ye.stringMap),s=e.toLocaleLowerCase(),o=i[s],r=o&&o[n],l=eo(s);if((!r||r==='"')&&l>-1){let a=i[s.substring(0,l)];r=a&&a[n]}if(r){if(l>-1){let a=s.slice(l);if(r.toLocaleLowerCase().endsWith(a))r=r.slice(0,-a.length)}r=r.replace(/\\#/g,"#"),e=e.toLocaleLowerCase()===e?r.toLocaleLowerCase():r}else e=Js(e)}else e=Js(e);return e}class to extends E{static preferredTagName="tosi-locale-picker";static initAttributes={hideCaption:!1};content=()=>oi({part:"select",showIcon:!0,title:H("Language"),bindValue:Ye.locale,bindLocaleOptions:Ye.localeOptions});render(){super.render(),this.parts.select.toggleAttribute("hide-caption",this.hideCaption)}}var no=to.elementCreator();class Je extends E{static preferredTagName="tosi-localized";static lightStyleSpec={":host":{pointerEvents:"none"}};static allInstances=new Set;static initAttributes={refString:""};contents=()=>C.tosiSlot();connectedCallback(){super.connectedCallback(),Je.allInstances.add(this)}disconnectedCallback(){super.disconnectedCallback(),Je.allInstances.delete(this)}localeChanged(){if(!this.refString)this.refString=this.textContent||"";this.textContent=this.refString?H(this.refString):""}render(){super.render(),this.localeChanged()}}var si=Je,io=Je.elementCreator();var sa=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||"");var oa=[[/\^|ctrl-?/i,"ctrlKey"],[/⌘|meta-?/i,"metaKey"],[/⌥|⎇|alt-?|option-?/i,"altKey"],[/⇧|shift-?/i,"shiftKey"]],so=(e)=>{let t=e.trim(),n={ctrlKey:!1,metaKey:!1,altKey:!1,shiftKey:!1,key:""};for(let[i,s]of oa)if(i.test(t))n[s]=!0,t=t.replace(i,"");return t=t.replace(/^-+/,""),n.key=t.toLowerCase(),n},oo=(e,t)=>{let n=so(t);return e.key.toLowerCase()===n.key&&e.metaKey===n.metaKey&&e.ctrlKey===n.ctrlKey&&e.altKey===n.altKey&&e.shiftKey===n.shiftKey};var ri=(e)=>{let t=so(e);if(sa){let i=[];if(t.ctrlKey)i.push("⌃");if(t.altKey)i.push("⌥");if(t.shiftKey)i.push("⇧");if(t.metaKey)i.push("⌘");return i.push(t.key.toUpperCase()),i.join("")}let n=[];if(t.ctrlKey)n.push("Ctrl");if(t.altKey)n.push("Alt");if(t.shiftKey)n.push("Shift");if(t.metaKey)n.push("Meta");return n.push(t.key.toUpperCase()),n.join("+")};var li=(e,t)=>{if(!e)return!1;for(let n of e)if(n==="special/any")return!0;else if(n.indexOf("*")>-1){let[i,s]=n.split("/"),[o,r]=t.split("/");if((i==="*"||i===o)&&(s==="*"||s===r))return!0}else if(n===t)return!0};var ro=(e,t=";")=>(e||"").split(t).map((n)=>n.trim()).filter((n)=>n!=="");var fe=(e)=>typeof e==="function"?e():e,{div:lo,button:bt,span:N,a:ra,tosiSlot:la}=C,aa=(e)=>{let t=[];for(let n of e)if(n===null){if(t.length>0&&t[t.length-1]!==null)t.push(n)}else t.push(n);while(t.length>0&&t[t.length-1]===null)t.pop();return t},Kt=(e,t,n=!1)=>{let i=[];for(let s of e){if(s===null){i.push(s);continue}if(typeof s==="function"){i.push(s);continue}let{acceptsDrop:o}=s;if(!o){if(!n)i.push({...s,enabled:()=>!1});continue}if(!t.some((a)=>li(o,a))){if(!n)i.push({...s,enabled:()=>!1});continue}let l=s;if(l.menuItems){let a=Kt(fe(l.menuItems),t,!0);if(a.length>0||l.dropAction){let c=n?a:Kt(fe(l.menuItems),t,!1);i.push({...l,menuItems:c})}else if(!n)i.push({...l,enabled:()=>!1})}else i.push(s)}return aa(i)};var ca={overflow:"hidden auto",maxHeight:`calc(${L.maxHeight} - ${m.menuInset("8px")})`,borderRadius:L.spacing50,background:m.menuBg("#fafafa"),boxShadow:m.menuShadow(`${L.spacing13} ${L.spacing50} ${L.spacing} #0004`)},da={boxShadow:"none",border:"none !important",display:"grid",alignItems:"center",justifyContent:"flex-start",textDecoration:"none",gridTemplateColumns:"0px 1fr max-content",width:"100%",gap:0,background:"transparent",padding:m.menuItemPadding("0 8px"),height:m.menuItemHeight("48px"),lineHeight:m.menuItemHeight("48px"),textAlign:"left"},ua={color:m.menuItemColor("#222")},ha={boxShadow:"none !important",background:m.menuItemHoverBg("#eee")},ao={boxShadow:"none !important",background:m.menuItemActiveBg("#aaa"),color:m.menuItemActiveColor("#000")},fa={background:`${m.menuDropOverBg("#2196F3")} !important`,color:`${m.menuDropOverColor("#fff")} !important`},pa={color:`${m.menuDropOverColor("#fff")} !important`},ga={stroke:`${m.menuDropOverColor("#fff")} !important`},co={boxShadow:`inset 0 0 0 2px color-mix(in srgb, ${m.menuDropOverBg("#2196F3")} 50%, transparent) !important`},ma={".xin-menu, .tosi-menu":ca,".xin-menu > div, .tosi-menu > div":{width:m.menuWidth("auto")},".xin-menu-trigger, .tosi-menu-trigger":{paddingLeft:0,paddingRight:0,minWidth:m.touchSize("48px")},".xin-menu-separator, .tosi-menu-separator":{display:"inline-block",content:" ",height:"1px",width:"100%",background:m.menuSeparatorColor("#2224"),margin:m.menuSeparatorMargin("8px 0")},".xin-menu-element, .tosi-menu-element":{minHeight:m.menuItemHeight("48px")},".xin-menu-item, .tosi-menu-item":da,".xin-menu-item, .xin-menu-item > span, .tosi-menu-item, .tosi-menu-item > span":ua,".xin-menu-with-icons .xin-menu-item, .tosi-menu-with-icons .tosi-menu-item":{gridTemplateColumns:"24px 1fr max-content",gap:m.menuItemGap("8px")},".xin-menu-shortcut, .tosi-menu-shortcut":{whiteSpace:"nowrap",paddingLeft:"1em",textAlign:"right",opacity:"0.65"},".xin-menu-item > :first-child, .tosi-menu-item > :first-child":{justifySelf:"center",alignSelf:"center"},".xin-menu-item svg, .tosi-menu-item svg":{stroke:m.menuItemIconColor("#222")},".xin-menu-item.xin-menu-item-checked, .tosi-menu-item.tosi-menu-item-checked":{background:m.menuItemHoverBg("#eee")},".xin-menu-item > span:nth-child(2), .tosi-menu-item > span:nth-child(2)":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:"left"},".xin-menu-item:hover, .tosi-menu-item:hover":ha,".xin-menu-item.drag-target:hover, .tosi-menu-item.drag-target:hover":co,".xin-menu-item:active, .tosi-menu-item:active":ao,".xin-menu-item:active svg, .tosi-menu-item:active svg":{stroke:m.menuItemIconActiveColor("#000")},".xin-menu-item-highlight, .tosi-menu-item-highlight":ao,".xin-menu-item-highlight svg, .tosi-menu-item-highlight svg":{stroke:m.menuItemIconActiveColor("#000")},".xin-drop-over, .tosi-drop-over":fa,".xin-drop-over > span, .tosi-drop-over > span":pa,".xin-drop-over svg, .tosi-drop-over svg":ga,".drag-target":co},uo=!1;function ai(){if(uo)return;uo=!0,Es("xin-menu-helper",ma),document.addEventListener("mousedown",(e)=>{if(D.length===0)return;let t=e.composedPath();if(!D.find((n)=>t.includes(n.target)||t.includes(n.menu)))j(0)}),document.body.addEventListener("keydown",(e)=>{if(e.key==="Escape")j(0)})}var ya=(e,t)=>{let n=e.checked&&e.checked()&&"check"||!1,i=e?.icon||n||N(" ");if(typeof i==="string")i=x[i]();let s=t.role==="listbox"?"option":"menuitem",o,r=e.properties||{};if(typeof e?.action==="string")o=ra(r,{role:s,href:e.action},i,t.localized?N(H(e.caption)):N(e.caption),N({class:"tosi-menu-shortcut"},e.shortcut?ri(e.shortcut):" "));else o=bt(r,{role:s,onClick:e.action},i,t.localized?N(H(e.caption)):N(e.caption),N({class:"tosi-menu-shortcut"},e.shortcut?ri(e.shortcut):" "));if(o.classList.add("xin-menu-item","tosi-menu-item"),o.classList.toggle("xin-menu-item-checked",n!==!1),o.classList.toggle("tosi-menu-item-checked",n!==!1),e.tooltip)o.dataset.tooltip=e.tooltip;if(t.role==="listbox")o.toggleAttribute("aria-selected",n!==!1);if(e?.enabled&&!e.enabled())o.setAttribute("disabled",""),o.setAttribute("aria-disabled","true");return o},va=(e,t)=>{let n=e?.icon||N(" ");if(typeof n==="string")n=x[n]();let i=e.properties||{},s=bt(i,{onDragenter(o){Qe(),s.classList.add("xin-drop-over","tosi-drop-over"),o.preventDefault()},onDragover(o){if(o.preventDefault(),o.dataTransfer)o.dataTransfer.dropEffect="copy"},onDragleave(o){let r=o.relatedTarget;if(r&&s.contains(r))return;s.classList.remove("xin-drop-over","tosi-drop-over")},onDrop(o){if(o.preventDefault(),o.stopPropagation(),s.classList.remove("xin-drop-over","tosi-drop-over"),e.dropAction&&o.dataTransfer)e.dropAction(o.dataTransfer);j(0)}},n,t.localized?N(H(e.caption)):N(e.caption),N(" "));if(s.classList.add("xin-menu-item","tosi-menu-item"),e.tooltip)s.dataset.tooltip=e.tooltip;if(e.dropAction&&e.acceptsDrop)s.dataset.drop=e.acceptsDrop.join(";");if(e?.enabled&&!e.enabled())s.setAttribute("disabled",""),s.setAttribute("aria-disabled","true");return s},ho=(e,t)=>{let n=e.checked&&e.checked()&&"check"||!1,i=e?.icon||n||N(" ");if(typeof i==="string")i=x[i]();let s=null,o=!1,r=e.properties||{},l=bt(r,{disabled:!(!e.enabled||e.enabled()),onClick(a){if(t._dropMode)return;we(Object.assign({},t,{menuItems:fe(e.menuItems),target:l,submenuDepth:(t.submenuDepth||0)+1,position:"side"})),a.stopPropagation(),a.preventDefault()},onDragenter(a){if(!t._dropMode)return;Qe(),a.preventDefault(),a.stopPropagation();let c=a.relatedTarget;if(c&&l.contains(c))return;if(l.classList.add("xin-drop-over","tosi-drop-over"),o){if(j((t.submenuDepth||0)+1),o=!1,s)clearTimeout(s);s=null;return}if(s)clearTimeout(s);s=setTimeout(()=>{o=!0;let d=fe(e.menuItems),u=t._dataTypes?Kt(d,t._dataTypes,t.hideDisabled):d;if(u.length>0)we(Object.assign({},t,{menuItems:u,target:l,submenuDepth:(t.submenuDepth||0)+1,position:"side",_dropMode:!0,_dataTypes:t._dataTypes}))},t.disclosureDelay??200)},onDragover(a){if(!t._dropMode)return;if(a.preventDefault(),a.stopPropagation(),a.dataTransfer)a.dataTransfer.dropEffect=e.dropAction?"copy":"link"},onDragleave(a){if(!t._dropMode)return;let c=a.relatedTarget;if(c&&l.contains(c))return;if(o&&c&&D.some((d)=>d.menu.contains(c)||d.target.contains(c)))return;if(l.classList.remove("xin-drop-over","tosi-drop-over"),s)clearTimeout(s),s=null},onDrop(a){if(!t._dropMode||!e.dropAction)return;if(a.preventDefault(),a.stopPropagation(),l.classList.remove("xin-drop-over","tosi-drop-over"),a.dataTransfer)e.dropAction(a.dataTransfer);j(0)}},i,t.localized?N(H(e.caption)):N(e.caption),x.chevronRight({style:{justifySelf:"flex-end"}}));if(l.classList.add("xin-menu-item","tosi-menu-item"),e.tooltip)l.dataset.tooltip=e.tooltip;if(t._dropMode&&e.dropAction&&e.acceptsDrop)l.dataset.drop=e.acceptsDrop.join(";");return l},ba=(e,t)=>{if(e===null)return N({class:"xin-menu-separator tosi-menu-separator"});else if(typeof e==="function"){let n=e();return n.classList.add("xin-menu-element","tosi-menu-element"),n}else if(t._dropMode){let n=e;if(n.menuItems&&fe(n.menuItems).length>0)return ho(n,t);else if(e.dropAction)return va(e,t);else{let s=e?.icon||N(" ");if(typeof s==="string")s=x[s]();return bt({class:"xin-menu-item tosi-menu-item",disabled:!0},s,t.localized?N(H(e.caption)):N(e.caption),N(" "))}}else{let n=e?.action?ya(e,t):ho(e,t);if(t.showChecked&&e.checked&&e.checked())requestAnimationFrame(()=>{n.scrollIntoView({block:"center"})});return n}},xa=(e)=>{let{target:t,width:n,menuItems:i,role:s="menu"}=e,o=i.find((a)=>a!=null&&typeof a!=="function"&&(a.icon||a.checked)),r=e.submenuDepth||0,l=lo({class:[o?"xin-menu tosi-menu xin-menu-with-icons tosi-menu-with-icons":"xin-menu tosi-menu",e.menuClass??""].filter(Boolean).join(" "),role:s,onClick(){if(!e._dropMode)j(0)},onDragover(a){if(!e._dropMode)return;a.preventDefault()},onDragenter(){if(!e._dropMode)return;Qe()},onDragleave(a){if(!e._dropMode)return;let c=a.relatedTarget;if(c&&l.contains(c))return;if(c&&D.some((d)=>d.menu.contains(c)||d.target.contains(c)))return;fo(r)}},lo({style:{minWidth:t.offsetWidth+"px",width:typeof n==="number"?`${n}px`:n},onMousedown(a){a.preventDefault(),a.stopPropagation()}},...i.map((a)=>ba(a,e))));return l},Ze,D=[],vt=null,Qe=()=>{if(vt)clearTimeout(vt),vt=null},fo=(e)=>{Qe(),vt=setTimeout(()=>{vt=null,j(e)},500)},j=(e=0)=>{if(Qe(),e===0)document.querySelectorAll("tosi-menu.xin-drop-over, tosi-menu.tosi-drop-over").forEach((n)=>n.classList.remove("xin-drop-over","tosi-drop-over"));let t=D.splice(e);for(let n of t)if(n.menu.remove(),n.onClose)n.onClose();return Ze=t[0],e>0?D[e-1]:void 0},we=(e)=>{ai(),e=Object.assign({submenuDepth:0},e);let{target:t,position:n,submenuDepth:i}=e;if(Ze&&!document.body.contains(Ze?.menu))Ze=void 0;if(D.length&&!document.body.contains(D[0].menu))D.splice(0);if(e._dropMode){if(D.length>i&&D[i]?.target===t)return;j(i)}else{if(i===0&&Ze?.target===t)return;let r=j(i);if(Ze?.target===t)return;if(r&&r.target===t){j();return}}if(!e.menuItems?.length)return;let s=xa(e),o=Us({content:s,target:t,position:n});o.remainOnScroll=e._dropMode?"remain":"remove",D.push({target:t,menu:o,onClose:e.onClose})},wa=(e)=>{ai();let{dataTypes:t,...n}=e,i=Kt(e.menuItems,t,e.hideDisabled);if(!i.length)return;we({...n,menuItems:i,_dropMode:!0,_dataTypes:t})};function po(e,t,n=[]){for(let i of e){if(!i)continue;if(typeof i==="function")continue;let{shortcut:s}=i,{menuItems:o}=i;if(s){if(oo(t,s)){let r=i;if(r.enabled&&!r.enabled())return;if(n.some((l)=>l.enabled&&!l.enabled()))return;return{action:r,path:n}}}else if(o){let r=po(fe(o),t,[...n,i]);if(r)return r}}return}class go extends E{static preferredTagName="tosi-menu";static lightStyleSpec={":host":{display:"inline-flex",minWidth:L.touchSize,minHeight:L.touchSize},":host button":{margin:0,padding:0,alignSelf:"stretch",flex:"1",textAlign:"center"},":host button > tosi-slot":{display:"flex",alignItems:"center",gap:m.tosiMenuTriggerGap("10px")}};static initAttributes={menuWidth:"auto",localized:!1,icon:"",acceptsDrop:"",disclosureDelay:0,hideDisabled:!1,menuClass:""};menuItems=[];dropAction=null;_dragMatches=!1;_matchesDrag(e){if(!this.acceptsDrop)return!1;let t=ro(this.acceptsDrop);return[...e.dataTransfer?.types||[]].some((i)=>t.some((s)=>li([s],i)))}showMenu=(e)=>{if(e.type==="click"||e.code==="Space")we({target:this.parts.trigger,width:this.menuWidth,localized:this.localized,menuItems:this.menuItems,menuClass:this.menuClass}),e.stopPropagation(),e.preventDefault()};handleDragEnter=(e)=>{if(this._dragMatches=this._matchesDrag(e),!this._dragMatches)return;Qe(),this.classList.add("xin-drop-over","tosi-drop-over");let t=[...e.dataTransfer?.types||[]];if(this.menuItems.length)wa({target:this.parts.trigger,menuItems:this.menuItems,dataTypes:t,width:this.menuWidth,localized:this.localized,disclosureDelay:this.disclosureDelay||void 0,hideDisabled:this.hideDisabled,menuClass:this.menuClass});e.preventDefault()};handleDragOver=(e)=>{if(!this._dragMatches)return;if(e.preventDefault(),e.dataTransfer)e.dataTransfer.dropEffect=this.dropAction?"copy":"link"};handleDragLeave=(e)=>{if(!this._dragMatches)return;let t=e.relatedTarget;if(t&&this.contains(t))return;if(t&&D.some((n)=>n.menu.contains(t)||n.target.contains(t))){this.classList.remove("xin-drop-over","tosi-drop-over");return}this.classList.remove("xin-drop-over","tosi-drop-over"),fo(0)};handleDrop=(e)=>{if(!this._dragMatches||!this.dropAction)return;if(e.preventDefault(),e.stopPropagation(),this.classList.remove("xin-drop-over","tosi-drop-over"),e.dataTransfer)this.dropAction(e.dataTransfer);j(0)};content=()=>bt({tabindex:0,part:"trigger",onClick:this.showMenu},la());handleShortcut=async(e)=>{let t=po(this.menuItems,e);if(!t)return;e.preventDefault(),e.stopImmediatePropagation();let{action:n,path:i}=t;if(this.isConnected&&document.body.contains(this))await this.animateShortcut(i,n);if(n.action instanceof Function)n.action()};findMenuItemByCaption(e,t){for(let n of e.querySelectorAll(".xin-menu-item")){let i=n.children[1];if(i&&i.textContent===t)return n}return null}async animateShortcut(e,t){j(0),we({target:this.parts.trigger,width:this.menuWidth,localized:this.localized,menuItems:this.menuItems}),await new Promise((i)=>setTimeout(i,80));for(let i=0;i<e.length;i++){let s=i+1,o=D[i]?.menu;if(!o)break;let r=this.findMenuItemByCaption(o,e[i].caption);if(!r)break;we({target:r,width:this.menuWidth,localized:this.localized,menuItems:fe(e[i].menuItems),submenuDepth:s,position:"side"}),await new Promise((l)=>setTimeout(l,80))}let n=D[D.length-1]?.menu;if(n){let i=this.findMenuItemByCaption(n,t.caption);if(i)i.classList.add("xin-menu-item-highlight","tosi-menu-item-highlight")}await new Promise((i)=>setTimeout(i,300)),j(0)}constructor(){super();this.addEventListener("keydown",this.showMenu),this.addEventListener("dragenter",this.handleDragEnter),this.addEventListener("dragover",this.handleDragOver),this.addEventListener("dragleave",this.handleDragLeave),this.addEventListener("drop",this.handleDrop)}connectedCallback(){if(super.connectedCallback(),ai(),document.addEventListener("keydown",this.handleShortcut,!0),this.acceptsDrop)this.dataset.drop=this.acceptsDrop}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleShortcut)}}var Ce=go.elementCreator();var{button:Ca,span:mo}=C;js({highlighter:'<svg class="stroked" viewBox="0 0 24 24"><path d="m9 11-6 6v3h9l3-3"></path><path d="m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"></path></svg>'});var yo="tosijs-styled-editor-menu";function ze(){return()=>{let e=mo({style:{display:"none"}});return queueMicrotask(()=>{e.closest(".tosi-menu")?.classList.add(yo)}),e}}function I(e,t,n,i){let s={title:e,value:t,dataTosiLocalized:JSON.stringify({title:e})};if(i)s.dataShortcut=i;return Ca(s,n)}function Ne(e="8px"){return mo({style:{display:"inline-block",width:e}})}function Oe(e){return io({refString:e})}function ci(){return no({slot:"menubar",hideCaption:!0})}function y(e,t,n){return{caption:t,action(){e.doCommand(n)}}}function vo(e){return Ce({slot:"menubar",localized:!0,menuItems:[ze(),y(e,"Title","setBlockType h1"),y(e,"Heading","setBlockType h2"),y(e,"Subheading","setBlockType h3"),y(e,"Minor Heading","setBlockType h4"),null,y(e,"Body","setBlockType p"),y(e,"Code Block","setBlockType pre"),y(e,"Blockquote","setBlockType blockquote"),null,y(e,"Bulleted List","setList ul"),y(e,"Numbered List","setList ol"),y(e,"No List","setList none")]},x.type()," ",Oe("Style"))}function bo(e){return Ce({slot:"menubar",localized:!0,menuItems:[ze(),y(e,"Left","setBlocks text-align left"),y(e,"Center","setBlocks text-align center"),y(e,"Right","setBlocks text-align right"),y(e,"Justify","setBlocks text-align justify")]},x.alignLeft()," ",Oe("Align"))}function xo(e){return Ce({slot:"menubar",localized:!0,menuItems:[ze(),y(e,"Times New Roman","setText font-family Times+New+Roman"),y(e,"Georgia","setText font-family Georgia"),y(e,"Helvetica","setText font-family Helvetica"),y(e,"Arial","setText font-family Arial"),null,y(e,"Serif","setText font-family serif"),y(e,"Sans-serif","setText font-family sans-serif"),y(e,"Monospace","setText font-family monospace")]},x.type()," ",Oe("Font"))}function wo(e){return Ce({slot:"menubar",localized:!0,menuItems:[ze(),y(e,"10","setText font-size 10px"),y(e,"12","setText font-size 12px"),y(e,"14","setText font-size 14px"),y(e,"18","setText font-size 18px"),y(e,"24","setText font-size 24px"),y(e,"36","setText font-size 36px")]}," ",Oe("Size"))}function Co(e){return Ce({slot:"menubar",localized:!0,menuItems:[ze(),y(e,"Single","setBlocks line-height unset"),y(e,"1.5","setBlocks line-height 1.875"),y(e,"Double","setBlocks line-height 2.5")]}," ",Oe("Spacing"))}function di(){return[I("Bold","setText font-weight bold",x.fontBold(),"ctrl+b"),I("Italic","setText font-style italic",x.fontItalic(),"ctrl+i"),I("Underline","setText text-decoration underline",x.underline(),"ctrl+u"),I("Highlight","setText background-color rgba(255,255,64,0.5)",x.highlighter())]}function ko(){return[I("Align Left","setBlocks text-align left",x.alignLeft()),I("Center","setBlocks text-align center",x.alignCenter()),I("Align Right","setBlocks text-align right",x.alignRight()),I("Justify","setBlocks text-align justify",x.alignJustify()),Ne(),I("Bulleted List","setList ul",x.listBullet()),I("Numbered List","setList ol",x.listNumber()),Ne(),I("Indent","setBlocks margin-left 40px",x.indent()),I("Outdent","setBlocks margin-left 0px",x.outdent())]}function ui(){return[I("Undo","updateUndo undo",x.rotateCcw(),"ctrl+z"),I("Redo","updateUndo redo",x.rotateCw(),"ctrl+y")]}function Mo(){return I("Toggle Debug","setDebug",x.bug())}function hi(){return[...di(),Ne(),...ui()]}function fi(){return[...di(),Ne(),...ko(),Ne(),...ui(),Ne(),Mo()]}function Eo(e){return Ce({slot:"menubar",localized:!0,menuItems:[ze(),{caption:"Link…",action(){let t=prompt("Link URL");if(!t)return;let n=prompt("Target (blank for a new tab)","_blank");e.doCommandWith("setLink",t,n||"_blank")}},{caption:"Remove Link",action:()=>e.doCommand("removeLink")},null,{caption:"Image…",action(){let t=prompt("Image URL");if(!t)return;let n=prompt("Alt text (describe the image)")||"";e.doCommandWith("insertImage",t,n)}},null,{caption:"Footnote",action:()=>e.doCommand("insertFootnote")},{caption:"Renumber Footnotes",action:()=>e.doCommand("renumberFootnotes")}]},x.link()," ",Oe("Insert"))}function So(e){return Ce({slot:"menubar",localized:!0,menuItems:[ze(),{caption:"Insert Table",menuItems:[y(e,"2 Columns","insertTable 2"),y(e,"3 Columns","insertTable 3"),y(e,"4 Columns","insertTable 4"),y(e,"5 Columns","insertTable 5")]},null,y(e,"Insert Row After","insertTableRow after"),y(e,"Insert Row Before","insertTableRow before"),y(e,"Insert Column After","insertTableCol after"),y(e,"Insert Column Before","insertTableCol before"),null,y(e,"Delete Row","deleteTableRow"),y(e,"Delete Column","deleteTableCol"),null,y(e,"Toggle Header Row","toggleHeaderRow")]},x.grid()," ",Oe("Table"))}function pi(e){return[vo(e),Eo(e),bo(e),xo(e),wo(e),Co(e),So(e)]}var{slot:Ao,div:gi}=C,ka=/[\u0591-\u07FF\u08A0-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Ma=/[A-Za-z\u00C0-\u024F\u0370-\u04FF]/;function Ea(e){if(ka.test(e))return"rtl";if(Ma.test(e))return"ltr";return null}function Z(e){if(e instanceof Element)return!e.classList.contains("sel-start")&&!e.classList.contains("sel-end");return e.nodeType!==3||e.textContent!==""}class mi extends E{static formAssociated=!0;static preferredTagName="tosijs-styled-editor";static initAttributes={widgets:"none",localized:!1,name:"",required:!1};static shadowStyleSpec={":host":{display:"flex",flexDirection:"column",position:"relative","--editor-ink":"#27488c","--editor-surface":"Canvas","--editor-text":"CanvasText","--editor-menubar-bg":"color-mix(in oklab, var(--editor-ink) 14%, var(--editor-surface))","--editor-toolbar-bg":"color-mix(in oklab, var(--editor-ink) 6%, var(--editor-surface))","--editor-edge":"color-mix(in oklab, var(--editor-ink) 25%, transparent)","--editor-chrome-text":"color-mix(in oklab, var(--editor-ink) 30%, var(--editor-text))",background:"var(--editor-surface)",color:"var(--editor-text)",colorScheme:"light dark"},":host ::slotted(*)":{flex:"0 0 auto"},':host [part="menubar"]':{flexShrink:"0",padding:"0 2px",display:"flex",gap:"0",flex:"0 0 auto",flexWrap:"wrap",alignItems:"center",background:"var(--editor-menubar-bg)",borderBottom:"1px solid var(--editor-edge)"},':host(:not([has-menubar])) [part="menubar"]':{display:"none"},':host [part="toolbar"]':{flexShrink:"0",padding:"1px 3px",display:"flex",gap:"1px",flex:"0 0 auto",flexWrap:"wrap",alignItems:"center",background:"var(--editor-toolbar-bg)",borderBottom:"1px solid var(--editor-edge)"},':host(:not([has-toolbar])) [part="toolbar"]':{display:"none"},':host [part="doc"]':{flex:"1 1 auto",minHeight:"0",background:"var(--editor-surface)",padding:"8px",cursor:"text",overflowY:"auto",position:"relative",touchAction:"manipulation",transition:"padding-top 0.15s ease-out, padding-bottom 0.15s ease-out"},':host [part="doc"] > *':{position:"relative",padding:"4px 8px",margin:"0"},':host [part="doc"] > blockquote':{padding:"4px 40px"},':host [part="doc"] img':{maxWidth:"100%",height:"auto",verticalAlign:"bottom"},':host [part="doc"] a':{color:"color-mix(in oklab, var(--editor-ink) 65%, var(--editor-text))",textDecoration:"underline"},':host [part="doc"] .footnote-ref':{fontSize:"0.75em",lineHeight:"0",verticalAlign:"super"},':host [part="doc"] .footnote-ref a':{textDecoration:"none",padding:"0 1px"},':host [part="doc"] ol.footnotes':{marginTop:"16px",paddingTop:"8px",borderTop:"1px solid var(--editor-edge)",fontSize:"0.85em"},':host [part="doc"] code:not([dir]), :host [part="doc"] kbd:not([dir]), :host [part="doc"] samp:not([dir])':{direction:"ltr",unicodeBidi:"isolate"},":host .sel-start, :host .sel-end":{display:"contents"},':host [part="caret"]':{position:"absolute",display:"none",width:"2px",padding:"0",margin:"0",border:"0",outline:"none",fontSize:"16px",lineHeight:"1",background:"var(--editor-text)",color:"transparent",caretColor:"transparent",pointerEvents:"none",zIndex:"3"},':host [part="caret"].-collapsed':{animation:"blink 1s steps(2, start) infinite"},":host .selection-edge":{position:"absolute",display:"none",width:"2px",pointerEvents:"none",zIndex:"3"},":host .selection-edge.-start":{background:"color-mix(in oklab, green 70%, var(--editor-text))"},":host .selection-edge.-end":{background:"color-mix(in oklab, red 70%, var(--editor-text))"},":host tosi-ins":{textDecoration:"underline",textDecorationColor:"color-mix(in oklab, green 60%, var(--editor-text))",background:"color-mix(in oklab, green 12%, transparent)"},":host tosi-del":{textDecoration:"line-through",textDecorationColor:"color-mix(in oklab, red 60%, var(--editor-text))",background:"color-mix(in oklab, red 12%, transparent)",opacity:"0.75"},":host tosi-misspelling":{textDecoration:"underline wavy",textDecorationColor:"color-mix(in oklab, red 70%, var(--editor-text))",textDecorationSkipInk:"none",textUnderlineOffset:"2px"},":host .selected":{background:"color-mix(in oklab, var(--editor-ink) 42%, color-mix(in oklab, white 38%, var(--editor-surface)))"},":host .selected-block":{background:"color-mix(in oklab, var(--editor-ink) 12%, color-mix(in oklab, white 21%, var(--editor-surface)))"},":host .first-block":{position:"relative"},":host .last-block":{position:"relative"},".debug .spanified":{boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.15)"},":host .spanified-word":{display:"inline"},":host .annotation::after":{position:"relative",top:"-4px",content:'"\\2020"'},":host .annotation > span":{display:"block",padding:"4px 8px",fontWeight:"normal",fontStyle:"normal",fontSize:"12px",background:"#ffc",position:"absolute",right:"0",maxWidth:"200px"},':host [part="doc"] *':{userSelect:"none",webkitUserSelect:"none"},":host ul, :host ol":{paddingLeft:"30px"},".debug .sel-start":{background:"green",opacity:"0.5",width:"2px",minHeight:"1em",display:"inline-block"},".debug .sel-end":{background:"red",opacity:"0.5",width:"2px",minHeight:"1em",display:"inline-block"},".debug .selected-block":{outline:"1px dashed blue"},":host .editor-table":{display:"grid",listStyle:"none",padding:"0",margin:"8px 0",border:"1px solid #ccc",borderRadius:"2px"},":host .editor-table > li":{padding:"4px 8px",borderRight:"1px solid #ddd",borderBottom:"1px solid #ddd",minHeight:"1.5em",outline:"none"},":host .editor-table > li.table-header":{fontWeight:"bold",background:"#f0f0f0"},":host .touch-affordances":{display:"none",position:"absolute",pointerEvents:"none",zIndex:"1000",top:"0",left:"0",width:"0",height:"0",transition:"opacity 0.1s ease-out"},":host .touch-affordance":{position:"absolute",width:"44px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto",touchAction:"none",background:"transparent",transition:"left 0.1s ease-out, top 0.1s ease-out"},":host .touch-affordances.dragging .touch-affordance":{transition:"none"},":host .touch-icon":{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",background:"#0078ff",color:"white",fontSize:"13px",fontWeight:"bold",border:"2px solid white",boxShadow:"0 1px 6px rgba(0,0,0,0.4)"},":host .touch-icon svg":{width:"16px",height:"16px",stroke:"white",fill:"none"},":host .touch-handle-start .touch-icon":{borderRadius:"4px 4px 0 4px"},":host .touch-handle-end .touch-icon":{borderRadius:"0 4px 4px 4px"},":host .touch-context-menu .touch-icon":{borderRadius:"4px"},":host .touch-menu":{position:"absolute",display:"flex",gap:"0",background:"rgba(0,0,0,0.85)",borderRadius:"8px",padding:"0",zIndex:"1001",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",overflow:"hidden"},":host .touch-menu-item":{background:"transparent",color:"white",border:"none",padding:"12px 16px",fontSize:"15px",borderRadius:"0",whiteSpace:"nowrap",margin:"0"}};static lightStyleSpec={".tosijs-styled-editor-menu":{"--menu-item-height":"30px","--menu-item-padding":"0 16px","--menu-separator-margin":"4px 0","--menu-inset":"4px"},'tosijs-styled-editor button[slot="toolbar"]':{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"26px",height:"26px",padding:"0",border:"0",borderRadius:"4px",background:"transparent",boxShadow:"none",color:"var(--editor-chrome-text) !important",cursor:"pointer"},'tosijs-styled-editor button[slot="toolbar"]:hover:not([disabled])':{background:"color-mix(in oklab, currentColor 16%, transparent)"},'tosijs-styled-editor button[slot="toolbar"]:active:not([disabled])':{background:"color-mix(in oklab, currentColor 28%, transparent)"},'tosijs-styled-editor button[slot="toolbar"][disabled]':{opacity:"0.35",cursor:"default",background:"transparent"},'tosijs-styled-editor button[slot="toolbar"] svg':{width:"18px",height:"18px"},'tosijs-styled-editor [slot="menubar"] button':{background:"transparent",border:"0",boxShadow:"none",borderRadius:"4px",padding:"4px 10px",color:"var(--editor-chrome-text) !important",cursor:"pointer"},'tosijs-styled-editor [slot="menubar"] button:hover':{background:"color-mix(in oklab, currentColor 16%, transparent)"},'tosijs-styled-editor [slot="menubar"] button svg':{width:"16px",height:"16px"}};selectable;active=!0;pastemode="merge";undo=[];undoDepth=0;reasonForLastUndo;lastKey=0;lastCursorX=0;isInitialized=!1;touchAffordances=null;touchHandleStart=null;touchContextMenu=null;touchHandleEnd=null;touchMenuEl=null;isTouchInteraction=!1;touchDrags=new Map;resizeTable=null;resizeCol=-1;resizeStartX=0;resizeStartWidths=[];_value="";get docHTML(){this.touchAffordances?.remove();let e=Array.from(this.parts.doc.querySelectorAll(Vt)).map((n)=>({el:n,parent:n.parentNode,next:n.nextSibling,children:Array.from(n.childNodes)}));for(let{el:n,parent:i}of e){while(n.firstChild)i.insertBefore(n.firstChild,n);n.remove()}let t=this.parts.doc.innerHTML;for(let{el:n,parent:i,next:s,children:o}of e.reverse()){i.insertBefore(n,s&&s.parentNode===i?s:null);for(let r of o)n.appendChild(r)}if(this.touchAffordances)this.parts.doc.appendChild(this.touchAffordances);return t}set docHTML(e){if(this.touchAffordances?.remove(),this.parts.doc.innerHTML=e,this.touchAffordances)this.parts.doc.appendChild(this.touchAffordances);this.syncSpellingValidity()}get value(){return this.isInitialized?this.docHTML:this._value}set value(e){let t=this._value;if(this._value=e,this.isInitialized&&this.docHTML!==e)this.docHTML=e;if(t!==e&&this.internals)this.internals.setFormValue(e)}commands={...ct};changeAuthor={id:"user",name:"You"};async reviseWith(e,t=this.changeAuthor){Ke(),this.selectable.removeBounds(),this.normalize();let n=[],i=document.createTreeWalker(this.parts.doc,NodeFilter.SHOW_TEXT),s;while(s=i.nextNode()){let r=s;if(!r.data.trim())continue;if(!qt(r,`${ue}, ${K}`))continue;n.push(r)}let o=0;try{for(let r of n){if(!r.isConnected)continue;let l=await e(r.data);if(typeof l!=="string")continue;o+=Zn(r,l,t)}}finally{if(o>0)this.normalize(),this.updateUndo("new","revise")}return o}trackChanges=!1;sessionId=`s-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;currentInsertion(){let t=this.insertionPoint()?.closest(ue);if(!t)return null;if(t.getAttribute("data-author")!==this.changeAuthor.id)return null;if(t.getAttribute("data-session")!==this.sessionId)return null;return t}enterInsertion(){if(!this.trackChanges)return;if(this.currentInsertion())return;let e=this.insertionPoint();if(!e||e.closest(K))return;let t=this.openInsertion();if(t)t.appendChild(e)}openInsertion(){let e=this.insertionPoint();if(!e||e.closest(K))return null;Ke();let t=document.createElement(ue);if(t.setAttribute("data-change",$e()),t.setAttribute("data-author",this.changeAuthor.id),this.changeAuthor.name)t.setAttribute("data-author-name",this.changeAuthor.name);t.setAttribute("data-session",this.sessionId),t.setAttribute("data-time",new Date().toISOString());let n=e.closest(ue);if(!n?.parentNode)return e.before(t),t;let i=document.createElement(ue);for(let o of Array.from(n.attributes))i.setAttribute(o.name,o.value);let s=document.createRange();if(s.setStartAfter(e),s.setEnd(n,n.childNodes.length),i.appendChild(s.extractContents()),n.after(t),i.firstChild&&!nt(i))t.after(i);return t}trackDeletion(e,t){if(!this.trackChanges)return!1;Ke();let n=t??$e();for(let i of e){let s=i.nodeType===3?i.parentElement:i;if(s?.closest(K))continue;let o=s?.closest(ue);if(o&&o.getAttribute("data-author")===this.changeAuthor.id&&o.getAttribute("data-session")===this.sessionId){i.parentNode?.removeChild(i);continue}let r=i.nodeType===1&&i.parentNode===this.parts.doc?i:null;if(r&&!r.firstChild)continue;if(r?.firstElementChild?.matches?.(K)&&r.children.length===1)continue;let l=document.createElement(K);if(l.setAttribute("data-change",n),l.setAttribute("data-author",this.changeAuthor.id),this.changeAuthor.name)l.setAttribute("data-author-name",this.changeAuthor.name);if(l.setAttribute("data-session",this.sessionId),l.setAttribute("data-time",new Date().toISOString()),r){l.setAttribute("data-block-delete","");while(r.firstChild)l.appendChild(r.firstChild);r.appendChild(l)}else i.parentNode?.insertBefore(l,i),l.appendChild(i)}return!0}deletionTarget(e,t,n){let i=n==="back"?q:F,s=i(e,t,Z);if(!this.trackChanges)return s;let o=(r)=>!!(r.nodeType===3?r.parentElement:r)?.closest(K);while(s&&o(s))s=i(s,t,Z);return s}removeNode(e,t){if(!this.trackDeletion([e],t))e.parentNode?.removeChild(e)}deleteEdgeCharacter(e,t){if(!this.trackChanges){e.data=t==="end"?e.data.slice(0,-1):e.data.slice(1);return}if(e.parentElement?.closest(K))return;let n=t==="end"?e.splitText(e.data.length-1):e;if(t==="start")n.splitText(1);this.trackDeletion([n])}get refusesStructuralDelete(){return this.trackChanges}asUntracked(e){let t=this.trackChanges;this.trackChanges=!1;try{return e()}finally{this.trackChanges=t}}refuseStructural(e){let t=new CustomEvent("structural-edit-refused",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,author:this.changeAuthor}});return this.dispatchEvent(t)}get changes(){return Xn(this.parts.doc)}acceptChanges(e){if(e==="")return;let t=this.changes.filter((i)=>!e||i.id===e),n=t.filter((i)=>i.kind==="delete"&&i.element.hasAttribute("data-block-delete")).map((i)=>i.element.parentElement).filter((i)=>!!i&&i.parentNode===this.parts.doc);for(let i of t)Yn(i.element);for(let i of n)if(i.isConnected&&!i.querySelector(".caret, .sel-end, .sel-start")&&nt(i))i.remove();if(t.length)this.normalize(),this.updateUndo("new","accept-changes")}rejectChanges(e){if(e==="")return;let t=this.changes.filter((n)=>!e||n.id===e);for(let n of t)Jn(n.element);if(t.length)this.normalize(),this.updateUndo("new","reject-changes")}spellChecker=null;documentWords=new Set;userDictionary=new Set;handleWordAccepted=null;get acceptedWords(){return new Set([...this.documentWords,...this.userDictionary])}async checkSpelling(){if(!this.spellChecker)return[];Ft();let e=await ni(this.parts.doc,this.spellChecker,this.acceptedWords,(t)=>this.selectable.withoutBounds(t));return this.applySpellingValidity(e),e}get spellingErrors(){return Array.from(this.parts.doc.querySelectorAll(Vt)).map((e)=>({word:e.textContent||"",element:e}))}acceptWord(e,t="document"){if(t==="dictionary")this.userDictionary.add(e);else this.documentWords.add(e);this.handleWordAccepted?.(e,t),this.dropMarksFor(e)}dropMarksFor(e){for(let t of this.spellingErrors){if(t.word!==e)continue;let n=t.element.parentNode;if(!n)continue;while(t.element.firstChild)n.insertBefore(t.element.firstChild,t.element);t.element.remove()}this.parts.doc.normalize(),this.applySpellingValidity(this.spellingErrors)}clearSpelling(){mt(this.parts.doc),this.applySpellingValidity([])}syncSpellingValidity(){if(!this.spellChecker&&!this.internals)return;this.applySpellingValidity(this.spellingErrors)}applySpellingValidity(e){if(!this.internals)return;if(e.length===0){this.internals.setValidity({});return}let t=e[0];this.internals.setValidity({customError:!0},e.length===1?`"${t.word}" may be misspelled`:`${e.length} words may be misspelled, starting with "${t.word}"`,t.element)}sanitize=wt;content=[Ao({name:"menubar",part:"menubar"}),Ao({name:"toolbar",part:"toolbar"}),gi({part:"doc",tabindex:"0"}),C.input({part:"caret",class:"caret-paint"}),gi({part:"edgeStart",class:"selection-edge -start"}),gi({part:"edgeEnd",class:"selection-edge -end"})];formResetCallback(){this.value=""}connectedCallback(){super.connectedCallback();let{doc:e}=this.parts;if(e.innerHTML==="")if(this._value.trim()!=="")e.innerHTML=this._value;else{let o=Array.from(this.childNodes).filter((r)=>!(r instanceof Element&&r.hasAttribute("slot")));if(o.length>0){let r=document.createDocumentFragment();for(let l of o)r.appendChild(l);e.appendChild(r)}}this.isInitialized=!0,this.selectable=new it(e);let t=e.querySelector("p,h1,h2,h3,h4,h5,h6,div,blockquote,pre")||e.firstElementChild;if(t)t.appendChild(this.selectable.createBounds());this.selectable.normalize(),e.addEventListener("keydown",this.handleKeydown,!0),e.addEventListener("keypress",this.handleKeypress),e.addEventListener("copy",this.handleCopy),e.addEventListener("cut",this.handleCut),e.addEventListener("paste",this.handlePaste),e.addEventListener("pointerdown",this.handleResizePointerDown),e.addEventListener("pointermove",this.handleResizePointerMove),e.addEventListener("pointerup",this.handleResizePointerUp),this.touchAffordances=document.createElement("div"),this.touchAffordances.className="touch-affordances not-selectable do-not-spanify",this.touchHandleStart=document.createElement("div"),this.touchHandleStart.className="touch-affordance touch-handle-start not-selectable do-not-spanify";let n=document.createElement("span");n.className="touch-icon",n.appendChild(x.chevronLeft()),this.touchHandleStart.appendChild(n),this.touchContextMenu=document.createElement("div"),this.touchContextMenu.className="touch-affordance touch-context-menu not-selectable do-not-spanify";let i=document.createElement("span");i.className="touch-icon",i.innerHTML="⋮",this.touchContextMenu.appendChild(i),this.touchHandleEnd=document.createElement("div"),this.touchHandleEnd.className="touch-affordance touch-handle-end not-selectable do-not-spanify";let s=document.createElement("span");s.className="touch-icon",s.appendChild(x.chevronRight()),this.touchHandleEnd.appendChild(s),this.touchAffordances.append(this.touchHandleStart,this.touchContextMenu,this.touchHandleEnd),e.appendChild(this.touchAffordances);for(let o of[this.touchHandleStart,this.touchHandleEnd])o.addEventListener("pointerdown",this.handleAffordanceDragStart),o.addEventListener("pointermove",this.handleAffordanceDragMove),o.addEventListener("pointerup",this.handleAffordanceDragEnd);this.touchContextMenu.addEventListener("pointerdown",this.handleTouchContextMenu),e.addEventListener("selectionchanged",()=>{if(this.isTouchInteraction=this.selectable.touchMode,!this.touchMenuEl)this.updateUndo("new","selectionchanged");this.updateTouchAffordances()}),e.addEventListener("click",this.handleDocClick),e.addEventListener("dragstart",this.handleDragStart),e.addEventListener("dragover",this.handleDragOver),e.addEventListener("drop",this.handleDrop),e.addEventListener("dragend",this.handleDragEnd),e.setAttribute("data-drop","text/html;text/plain;Files;image/*"),this.addEventListener("click",this.handleToolbarClick),this.addEventListener("change",this.handleToolbarChange),this.selectable.focusTarget=this.parts.caret,this.selectable.onBoundsChanged=()=>this.syncCaret(),this.syncCaret(),this.parts.doc.addEventListener("scroll",this.handleGeometryChange,{capture:!0,passive:!0}),window.addEventListener("resize",this.handleGeometryChange,{passive:!0}),this.geometryObserver=new ResizeObserver(this.handleGeometryChange),this.geometryObserver.observe(this.parts.doc,{box:"content-box"}),this.geometryObserver.observe(this,{box:"border-box"}),this.applyWidgets(),this.trackBar(this.parts.menubar,"has-menubar"),this.trackBar(this.parts.toolbar,"has-toolbar"),this.updateUndo("init"),this.focus()}trackBar(e,t){let n=()=>this.toggleAttribute(t,e.assignedNodes({flatten:!0}).length>0);e.addEventListener("slotchange",n),n()}applyWidgets(){let e=this.widgets;if(e!=="default"&&e!=="minimal")return;if(this.querySelector('[slot="toolbar"], [slot="menubar"]'))return;if(e==="default"){for(let t of pi(this))this.appendChild(t);if(this.localized)this.appendChild(ci())}for(let t of e==="minimal"?hi():fi())t.setAttribute("slot","toolbar"),this.appendChild(t)}disconnectedCallback(){super.disconnectedCallback(),this.selectable?.destroy(),this.parts?.doc?.removeEventListener("scroll",this.handleGeometryChange,{capture:!0}),window.removeEventListener("resize",this.handleGeometryChange),this.geometryObserver?.disconnect()}geometryObserver=null;handleGeometryChange=()=>{if(this.syncCaret(),this.touchAffordances?.style.display==="block")this.positionAffordances()};markerRect(e){let t=Mt(e,this.parts.doc);if(t)return{left:t.left,top:t.top,right:t.left,bottom:t.top+t.height,width:0,height:t.height};return e.getBoundingClientRect()}syncCaret(){let e=this.parts.caret,t=this.parts.edgeStart,n=this.parts.edgeEnd,i=this.parts.doc,s=i.querySelector(".sel-start"),o=i.querySelector(".sel-end"),r=o||s,l=i.querySelector(".selected")===null,a=this.getBoundingClientRect(),c=i.getBoundingClientRect(),d=getComputedStyle(this),u=a.top+parseFloat(d.borderTopWidth||"0"),h=a.left+parseFloat(d.borderLeftWidth||"0"),f=(p,b)=>{if(!b){p.style.display="none";return}let v=Mt(b,i);if(!v){p.style.display="none";return}if(v.top+v.height<c.top||v.top>c.bottom){p.style.display="none";return}p.style.display="block",p.style.left=`${v.left-h}px`,p.style.top=`${v.top-u}px`,p.style.height=`${v.height}px`};f(e,r),e.classList.toggle("-collapsed",l),f(t,l?null:s),f(n,l?null:o)}getContext(){return{root:this.parts.doc,selectable:this.selectable,commands:this.commands,find:(e)=>this.parts.doc.querySelector(e),findAll:(e)=>Array.from(this.parts.doc.querySelectorAll(e)),selectedLeafNodes:()=>this.selectedLeafNodes(),selectedBlocks:()=>this.selectedBlocks(),insertionPoint:()=>this.insertionPoint(),block:(e)=>this.block(e),normalize:()=>this.normalize(),focus:()=>this.focus(),updateUndo:(e,t)=>this.updateUndo(e,t),removeNode:(e)=>this.removeNode(e),refuseStructural:(e)=>this.refuseStructural(e),tracksChanges:()=>this.trackChanges}}doCommand(e){cn(this.getContext(),e)}doCommandWith(e,...t){an(this.getContext(),e,...t)}focus(){this.selectable?.focus()}normalize(){this.selectable?.normalize()}selectedLeafNodes(){return He(this.parts.doc).filter((e)=>e.parentElement?.closest(".selected")!==null)}selectedBlocks(){return Array.from(this.parts.doc.querySelectorAll(".selected-block"))}insertionPoint(){return this.parts.doc.querySelector(".sel-end")}block(e){let t=e;while(t&&t.parentNode!==this.parts.doc)t=t.parentNode;return t instanceof Element?t:null}caretCell(){let e=this.insertionPoint();return e?J(e):null}listItemOf(e){let t=e;while(t&&t!==this.parts.doc){if(t instanceof Element&&t.tagName==="LI"&&t.parentElement&&(t.parentElement.tagName==="UL"||t.parentElement.tagName==="OL")&&!t.parentElement.classList.contains("editor-table"))return t;t=t.parentNode}return null}moveCaretToCell(e){this.selectable.unmark(),this.selectable.removeBounds();let t=this.selectable.createBounds(),n=t.lastChild,i=t.firstChild;e.insertBefore(i,e.firstChild),e.appendChild(n),this.selectable.normalize(),this.selectable.markBounds(),this.selectable.selectionChanged()}tableMoveUp(e){let t=P(e);if(!t)return;let n=O(t),i=ne(e,n),o=V(t,i,n)[0];for(let l=0;l<n;l++)o.before(ie());let r=At(e);if(r)this.moveCaretToCell(r);this.updateUndo("new")}tableMoveDown(e){let t=P(e);if(!t)return;let n=O(t),i=ne(e,n),s=V(t,i,n),o=s[s.length-1];for(let l=0;l<n;l++)o.after(ie());let r=St(e);if(r)this.moveCaretToCell(r);this.updateUndo("new")}exitTable(e,t){let n=P(e);if(!n)return;let i=this.block(n);if(!i)return;let s=t==="before"?i.previousElementSibling:i.nextElementSibling;if(s){if(this.selectable.unmark(),this.selectable.removeBounds(),t==="before")s.appendChild(this.selectable.createBounds());else s.insertBefore(this.selectable.createBounds(),s.firstChild);this.selectable.normalize(),this.selectable.markBounds(),this.selectable.selectionChanged()}else{let o=document.createElement("p");if(o.textContent=" ",t==="before")i.before(o);else i.after(o);this.selectable.unmark(),this.selectable.removeBounds(),o.appendChild(this.selectable.createBounds()),this.selectable.normalize(),this.selectable.markBounds(),this.selectable.selectionChanged(),this.updateUndo("new")}}splitListItem(e){let t=this.insertionPoint();if(!t)return;let n=e.parentElement;if(!n)return;if(!e.textContent?.replace(/\u00A0/g,"").trim()){let a=document.createElement("p");if(a.textContent=" ",this.selectable.removeBounds(),a.appendChild(this.selectable.createBounds()),n.children.length<=1)n.after(a),n.remove();else if(!e.previousElementSibling)n.before(a),e.remove();else if(!e.nextElementSibling)n.after(a),e.remove();else{let c=document.createElement(n.tagName),d=e.nextElementSibling;while(d){let u=d.nextElementSibling;c.appendChild(d),d=u}n.after(a),a.after(c),e.remove()}this.selectable.normalize(),this.selectable.markBounds(),this.updateUndo("new");return}let s=document.createElement("li"),o=t.nextSibling;while(o){let a=o.nextSibling;s.appendChild(o),o=a}let r=e.querySelector(".sel-start"),l=e.querySelector(".sel-end");if(l)s.insertBefore(l,s.firstChild);if(r)s.insertBefore(r,s.firstChild);if(!s.textContent?.trim()){let a=document.createTextNode(" ");if(r)r.before(a);else s.appendChild(a)}if(!e.textContent?.trim())e.appendChild(document.createTextNode(" "));e.after(s),this.selectable.markBounds(),this.updateUndo("new")}isListItemEmpty(e){return!e.textContent?.replace(/\u00A0/g,"").trim()}removeListItem(e){let t=e.parentElement;if(!t)return;if(this.refusesStructuralDelete&&this.refuseStructural("remove-list-item"))return;let n=e.previousElementSibling;if(n&&n.tagName==="LI"){while(e.firstChild)n.appendChild(e.firstChild);e.remove()}else{let i=document.createElement("p");while(e.firstChild)i.appendChild(e.firstChild);if(t.before(i),e.remove(),t.children.length===0)t.remove()}this.normalize(),this.selectable.markBounds(),this.updateUndo("new")}listBackspace(e){if(!this.deleteSelection()){let t=this.insertionPoint();if(!t)return;if(this.isListItemEmpty(e)){this.removeListItem(e);return}let n=this.deletionTarget(t,e,"back");if(n){if(n.nodeType===3&&(n.textContent||"").length>1)this.deleteEdgeCharacter(n,"end");else{let i=Y(n);if(e.contains(i))this.removeNode(i)}this.normalize(),this.updateUndo()}else this.removeListItem(e)}}listForwardDelete(e){if(!this.deleteSelection()){let t=this.insertionPoint();if(!t)return;let n=this.deletionTarget(t,e,"forward");if(n){if(n.nodeType===3&&(n.textContent||"").length>1)this.deleteEdgeCharacter(n,"start");else{let i=Y(n);if(e.contains(i))this.removeNode(i)}this.normalize(),this.updateUndo()}else{let i=e.nextElementSibling;if(i&&i.tagName==="LI"&&(!this.refusesStructuralDelete||!this.refuseStructural("merge-list-items"))){while(i.firstChild)e.appendChild(i.firstChild);i.remove(),this.normalize(),this.selectable.markBounds(),this.updateUndo("new")}}}}groupByLine(e){let t=new Map;for(let i of e){let s=i.getBoundingClientRect(),o=Math.round(s.top),r=t.get(o);if(!r)r=[],t.set(o,r);r.push(i)}return Array.from(t.keys()).sort((i,s)=>i-s).map((i)=>t.get(i))}closestCharOnLine(e,t){let n=e[0],i=1/0;for(let s of e){let o=s.getBoundingClientRect(),r=o.left+o.width/2,l=Math.abs(r-t);if(l<i)i=l,n=s}return n}positionAtSpanChar(e,t,n,i){let s=e.getBoundingClientRect(),o=this.selectable.find(".sel-start"),r=this.selectable.find(".sel-end");if(!o||!r)return;if(t<s.left+s.width/2)e.before(r);else e.after(r);if(!n)r.parentNode?.insertBefore(o,r);k(i,!1),this.selectable.markBounds(),this.focus()}moveVertical(e,t){let n=this.insertionPoint();if(!n)return;let i=this.block(n);if(!i)return;if(!(this.lastKey===38||this.lastKey===40)){let d=this.markerRect(n);this.lastCursorX=d.left}let o=this.lastCursorX,r=this.listItemOf(n),l=r||i;k(l,!0);let a=Array.from(l.querySelectorAll(".spanified"));if(a.length>0){let d=this.groupByLine(a),u=this.markerRect(n),h=Math.round(u.top),f=0,p=1/0;for(let v=0;v<d.length;v++){let G=Math.round(d[v][0].getBoundingClientRect().top),Q=Math.abs(G-h);if(Q<p)p=Q,f=v}let b=e==="up"?f-1:f+1;if(b>=0&&b<d.length){let v=this.closestCharOnLine(d[b],o);this.positionAtSpanChar(v,o,t,l);return}}if(k(l,!1),r){let d=e==="up"?r.previousElementSibling:r.nextElementSibling;if(d&&d.tagName==="LI"){k(d,!0);let h=Array.from(d.querySelectorAll(".spanified"));if(h.length===0){k(d,!1),this.moveCaretToEmptyContainer(d,e,t);return}let f=this.groupByLine(h),p=e==="up"?f[f.length-1]:f[0],b=this.closestCharOnLine(p,o);this.positionAtSpanChar(b,o,t,d);return}let u=e==="up"?i.previousElementSibling:i.nextElementSibling;if(!u)return;this.moveVerticalToBlock(u,e,o,t);return}let c=e==="up"?i.previousElementSibling:i.nextElementSibling;if(!c)return;this.moveVerticalToBlock(c,e,o,t)}moveCaretToEmptyContainer(e,t,n){let i=this.selectable.find(".sel-start"),s=this.selectable.find(".sel-end");if(!i||!s)return;if(t==="up")e.appendChild(s);else e.insertBefore(s,e.firstChild);if(!n)s.parentNode?.insertBefore(i,s);this.selectable.markBounds(),this.focus()}moveVerticalToBlock(e,t,n,i){let o=(e.tagName==="UL"||e.tagName==="OL")&&!e.classList.contains("editor-table")?(t==="up"?e.querySelector(":scope > li:last-child"):e.querySelector(":scope > li:first-child"))||e:e;k(o,!0);let r=Array.from(o.querySelectorAll(".spanified"));if(r.length===0){k(o,!1),this.moveCaretToEmptyContainer(o,t,i);return}let l=this.groupByLine(r),a=t==="up"?l[l.length-1]:l[0],c=this.closestCharOnLine(a,n);this.positionAtSpanChar(c,n,i,o)}contentKey(e){if(!this.insertionPoint())return;this.enterInsertion(),this.isolateForTyping(e);let t=this.insertionPoint();if(t)t.before(document.createTextNode(e)),this.normalize(),this.updateUndo()}isolateForTyping(e){let t=this.insertionPoint(),n=Ea(e);if(!t||!n)return null;let i=this.block(t);if(!i)return null;let s=i.getAttribute("dir")??(getComputedStyle(i).direction||"ltr");if(n===s)return null;let o=t.parentElement;if(o?.dataset.bidiRun===n)return o;let r=document.createElement("span");return r.dataset.bidiRun=n,r.setAttribute("dir",n),t.parentNode?.insertBefore(r,t),r.appendChild(t),r}backspace(){if(!this.deleteSelection()){let e=this.insertionPoint();if(!e)return;let t=this.deletionTarget(e,this.parts.doc,"back");if(!t)return;let n=this.block(e),i=this.block(t),s=!!(i&&n&&i!==n);if(this.refusesStructuralDelete&&s&&this.refuseStructural("merge-blocks-backward"))return;let o=this.refusesStructuralDelete&&s;((l)=>o?this.asUntracked(l):l())(()=>{if(t.nodeType===3&&(t.textContent||"").length>1)this.deleteEdgeCharacter(t,"end");else this.removeNode(Y(t));if(this.normalize(),i&&n&&this.parts.doc.contains(i)&&i!==n){while(n.firstChild)i.appendChild(n.firstChild);n.remove()}}),this.updateUndo()}}forwardDelete(){if(!this.deleteSelection()){let e=this.insertionPoint();if(!e)return;let t=this.deletionTarget(e,this.parts.doc,"forward");if(!t)return;let n=this.block(e),i=this.block(t),s=!!(i&&n&&i!==n);if(this.refusesStructuralDelete&&s&&this.refuseStructural("merge-blocks-forward"))return;let o=this.refusesStructuralDelete&&s;((l)=>o?this.asUntracked(l):l())(()=>{if(t.nodeType===3&&(t.textContent||"").length>1)this.deleteEdgeCharacter(t,"start");else this.removeNode(Y(t));if(this.normalize(),i&&n&&this.parts.doc.contains(i)&&i!==n){while(i.firstChild)n.appendChild(i.firstChild);i.remove()}}),this.updateUndo()}}deleteSelection(){let e=this.selectedBlocks(),t=e.length>1,n=this.refusesStructuralDelete&&t;return n&&!this.refuseStructural("merge-blocks-selection")?this.asUntracked(()=>this.runDeleteSelection(e,!0)):this.runDeleteSelection(e,!n)}runDeleteSelection(e,t){let n=!1,i=this.trackChanges?$e():void 0;for(let a of e)if(!a.classList.contains("first-block")&&!a.classList.contains("last-block"))this.removeNode(a,i),n=!0;let s=this.insertionPoint(),o=this.selectedLeafNodes().filter((a)=>a!==s);if(o.length){let a=Y(o[0]);if(s&&a.parentNode)a.parentNode.insertBefore(s,a);for(let c of o)this.removeNode(Y(c),i);n=!0}let r=this.parts.doc.querySelector(".sel-start");if(r&&!r.classList.contains("caret"))r.remove();this.selectable.unmark();let l=this.parts.doc.querySelector(".caret");for(let a of e)if(this.parts.doc.contains(a)&&(!l||!a.contains(l))&&nt(a))this.removeNode(a,i);if(e.length>1){let a=e[0],c=e[e.length-1];if(t&&this.parts.doc.contains(a)&&this.parts.doc.contains(c)&&!a.classList.contains("editor-table")&&!c.classList.contains("editor-table")){let d=c.firstChild;for(let u of Array.from(a.childNodes))c.insertBefore(u,d);a.remove()}this.selectable.markBounds(),this.focus()}else if(n)this.updateUndo(),this.selectable.selectionChanged();return n}splitAtCaret(){let e=this.insertionPoint();if(!e)return!1;let t=this.block(e);if(!t)return!1;let n=document.createElement(t.tagName),i=e.nextSibling;while(i){let r=i.nextSibling;n.appendChild(i),i=r}let s=t.querySelector(".sel-start"),o=t.querySelector(".sel-end");if(o)n.insertBefore(o,n.firstChild);if(s)n.insertBefore(s,n.firstChild);if(!n.textContent?.trim()){let r=document.createTextNode(" ");if(s)s.before(r);else n.appendChild(r)}if(!t.textContent?.trim())t.appendChild(document.createTextNode(" "));return t.after(n),this.selectable.markBounds(),this.updateUndo("new"),!0}arrowLeft(e){let t=this.selectable.find(".sel-start");if(!t)return;if(e.altKey)this.moveWordLeft(e.shiftKey);else{let n=q(t,this.parts.doc,Z);if(n)this.moveBoundsBefore(n,e.shiftKey)}}arrowRight(e){let t=this.selectable.find(".sel-end");if(!t)return;if(e.altKey)this.moveWordRight(e.shiftKey);else{let n=F(t,this.parts.doc,Z);if(n)this.moveBoundsAfter(n,e.shiftKey)}}moveWordLeft(e){let t=this.selectable.find(".sel-start");if(!t)return;let n=this.block(t);if(!n)return;k(n,!0);let i=q(t,n,Z);if(!i){k(n,!1);return}while(i&&i.nodeType===3&&/^\s$/.test(i.textContent||""))i=q(i,n,Z);let s=i;while(i&&i.nodeType===3&&/^\S$/.test(i.textContent||"")){s=i;let o=q(i,n,Z);if(o&&o.nodeType===3&&/^\S$/.test(o.textContent||""))i=o;else break}if(s){let o=this.selectable.find(".sel-start"),r=this.selectable.find(".sel-end");if(o&&r){if(s.parentNode?.insertBefore(o,s),!e)o.after(r)}}k(n,!1),this.selectable.markBounds(),this.focus()}moveWordRight(e){let t=this.selectable.find(".sel-end");if(!t)return;let n=this.block(t);if(!n)return;k(n,!0);let i=F(t,n,Z);if(!i){k(n,!1);return}while(i&&i.nodeType===3&&/^\s$/.test(i.textContent||""))i=F(i,n,Z);let s=i;while(i&&i.nodeType===3&&/^\S$/.test(i.textContent||"")){s=i;let o=F(i,n,Z);if(o&&o.nodeType===3&&/^\S$/.test(o.textContent||""))i=o;else break}if(s){let o=this.selectable.find(".sel-start"),r=this.selectable.find(".sel-end");if(o&&r){if(s.parentNode?.insertBefore(r,s.nextSibling),!e)r.parentNode?.insertBefore(o,r)}}k(n,!1),this.selectable.markBounds(),this.focus()}moveBoundsBefore(e,t){let n=this.selectable.find(".sel-start"),i=this.selectable.find(".sel-end");if(!n||!i)return;if(e.nodeType===3&&(e.textContent||"").length>1){let s=e.splitText((e.textContent||"").length-1);s.parentNode?.insertBefore(n,s)}else e.parentNode?.insertBefore(n,e);if(!t)n.after(i);this.selectable.markBounds(),this.focus()}moveBoundsAfter(e,t){let n=this.selectable.find(".sel-start"),i=this.selectable.find(".sel-end");if(!n||!i)return;if(e.nodeType===3&&(e.textContent||"").length>1)e.splitText(1);if(e.parentNode?.insertBefore(i,e.nextSibling),!t)i.parentNode?.insertBefore(n,i);this.selectable.markBounds(),this.focus()}signatureOf(e){let t=document.createElement("div");t.innerHTML=e;for(let n of Array.from(t.querySelectorAll(".sel-start, .sel-end")))n.remove();for(let n of Array.from(t.querySelectorAll("[class], [draggable], [data-drag]"))){if(n.classList.remove("selected","selected-block","first-block","last-block"),n.classList.length===0)n.removeAttribute("class");n.removeAttribute("draggable"),n.removeAttribute("data-drag")}for(let n of Array.from(t.querySelectorAll("span")))if(n.attributes.length===0)n.replaceWith(...Array.from(n.childNodes));return t.normalize(),t.innerHTML}updateUndo(e,t){if(this.undo.length===0)e="init";if(t&&this.reasonForLastUndo===t)e=void 0;this.reasonForLastUndo=t,this.syncSpellingValidity();let n=this.docHTML;switch(e){case"init":this.undo=[n],this.undoDepth=0;break;case"new":if(this.undoDepth)this.undo=this.undo.slice(this.undoDepth),this.undoDepth=0;if(this.undo.length&&this.signatureOf(this.undo[0])===this.signatureOf(n)){this.undo[0]=n;break}this.undo.unshift(n);break;case"undo":if(this.undoDepth<this.undo.length-1)this.undoDepth++,this.docHTML=this.undo[this.undoDepth],this.focus();break;case"redo":if(this.undoDepth>0)this.undoDepth--,this.docHTML=this.undo[this.undoDepth],this.focus();break;default:if(this.undoDepth||this.undo.length===1){if(this.undo.length&&this.signatureOf(this.undo[0])===this.signatureOf(n)){this.undo[0]=n;break}this.undo=this.undo.slice(this.undoDepth),this.undoDepth=0,this.undo.unshift(n)}else this.undo[0]=n}if(this.selectable?.onBoundsChanged?.(),this.updateUndoButtons(),this.internals)this.internals.setFormValue(n)}updateUndoButtons(){let e=this.parts.toolbar,t=e.querySelector('[value="updateUndo undo"]'),n=e.querySelector('[value="updateUndo redo"]');if(t)t.disabled=this.undoDepth>=this.undo.length-1;if(n)n.disabled=this.undoDepth===0}handleDocClick=(e)=>{if(!this.active)return;let t=e.target?.closest?.("a");if(!t||!this.parts.doc.contains(t))return;if(e.metaKey||e.ctrlKey){let n=t.getAttribute("href")||"";if(De(n))window.open(n,"_blank","noopener")}e.preventDefault()};handleShortcut(e){let t=e.key.toLowerCase(),n=`${e.ctrlKey||e.metaKey?"ctrl+":""}${t}`,i=typeof CSS<"u"&&CSS.escape?CSS.escape(n):n.replace(/["\\]/g,"\\$&"),s=this.parts.toolbar.querySelector(`[data-shortcut="${i}"]`);if(s){let o=s.getAttribute("value");if(o)this.doCommand(o),e.preventDefault(),e.stopPropagation()}}handleKeydown=(e)=>{if(!this.active)return;if(e.target.closest(".not-editable"))return;let n=this.caretCell(),i=this.insertionPoint(),s=i?this.listItemOf(i):null;switch(e.key){case"Tab":if(e.preventDefault(),n)if(e.shiftKey){let o=nn(n);if(o)this.moveCaretToCell(o)}else{let o=Tt(n);if(o)this.moveCaretToCell(o);else{let r=P(n);if(r){let l=O(r);for(let c=0;c<l;c++)r.appendChild(ie());let a=Tt(n);if(a)this.moveCaretToCell(a);this.updateUndo("new")}}}break;case"Backspace":if(e.preventDefault(),this.deleteSelection())this.updateUndo("new");else if(n){if(i){let o=this.deletionTarget(i,n,"back");if(o){if(o.nodeType===3&&(o.textContent||"").length>1)this.deleteEdgeCharacter(o,"end");else{let r=Y(o);if(n.contains(r))this.removeNode(r)}this.normalize(),this.updateUndo()}}}else if(s)this.listBackspace(s);else this.backspace();break;case"Delete":if(e.preventDefault(),this.deleteSelection())this.updateUndo("new");else if(n){if(i){let o=this.deletionTarget(i,n,"forward");if(o){if(o.nodeType===3&&(o.textContent||"").length>1)this.deleteEdgeCharacter(o,"start");else{let r=Y(o);if(n.contains(r))this.removeNode(r)}this.normalize(),this.updateUndo()}}}else if(s)this.listForwardDelete(s);else this.forwardDelete();break;case"Enter":if(e.preventDefault(),n){if(e.shiftKey)this.tableMoveDown(n);else if(i)i.before(document.createElement("br")),this.normalize(),this.updateUndo()}else if(s)this.deleteSelection(),this.splitListItem(s);else this.deleteSelection(),this.splitAtCaret();break;case"ArrowLeft":e.preventDefault(),this.arrowLeft(e);break;case"ArrowRight":e.preventDefault(),this.arrowRight(e);break;case"ArrowUp":if(e.preventDefault(),n)if(e.shiftKey)this.tableMoveUp(n);else{let o=At(n);if(o)this.moveCaretToCell(o);else this.exitTable(n,"before")}else this.moveVertical("up",e.shiftKey);break;case"ArrowDown":if(e.preventDefault(),n)if(e.shiftKey)this.tableMoveDown(n);else{let o=St(n);if(o)this.moveCaretToCell(o);else this.exitTable(n,"after")}else this.moveVertical("down",e.shiftKey);break}this.lastKey=e.keyCode};handleKeypress=(e)=>{if(!this.active)return;if(e.target.closest(".not-editable"))return;if(e.ctrlKey||e.metaKey)this.handleShortcut(e);else if(this.deleteSelection(),e.key.length===1)this.contentKey(e.key);e.preventDefault(),e.stopPropagation()};handleCopy=(e)=>{let t=Array.from(this.parts.doc.querySelectorAll(".selected"));if(t.length===0)return;let n="",i="";for(let s of t)n+=s.outerHTML,i+=s.textContent;e.clipboardData?.setData("text/html",n),e.clipboardData?.setData("text/plain",i),e.preventDefault()};handleCut=(e)=>{this.handleCopy(e),this.deleteSelection()};insertTransfer(e,t){let n=this.insertionPoint();if(!n)return!1;let i=this.trackChanges?this.openInsertion():null,s=(o)=>{if(i)i.appendChild(o);else n.before(o)};if(this.pastemode==="remove"||!e){if(!t)return i?.remove(),!1;s(document.createTextNode(t))}else{let o=document.createElement("div");o.innerHTML=e,this.sanitize(o),this.restampPastedChanges(o);while(o.firstChild)s(o.firstChild)}if(i&&!i.firstChild)i.remove();return!0}restampPastedChanges(e){let t=e.querySelectorAll(`${ue}, ${K}`);if(!t.length)return;let n=$e();for(let i of Array.from(t)){if(i.setAttribute("data-change",n),i.setAttribute("data-author",this.changeAuthor.id),this.changeAuthor.name)i.setAttribute("data-author-name",this.changeAuthor.name);else i.removeAttribute("data-author-name");i.setAttribute("data-session",this.sessionId),i.setAttribute("data-time",new Date().toISOString()),i.removeAttribute("data-block-delete")}}handlePaste=(e)=>{if(!this.active)return;let t=e.clipboardData?.getData("text/html"),n=e.clipboardData?.getData("text/plain");this.deleteSelection(),this.insertTransfer(t,n),this.normalize(),this.updateUndo("new"),e.preventDefault()};draggingSelection=!1;handleDragStart=(e)=>{if(!this.active||!e.dataTransfer)return;let t=this.selectable.findAll(".selected");if(t.length===0)return;let n=document.createElement("div");for(let i of t)n.appendChild(i.cloneNode(!0));e.dataTransfer.setData("text/html",n.innerHTML),e.dataTransfer.setData("text/plain",n.textContent||""),e.dataTransfer.effectAllowed="copyMove",this.draggingSelection=!0};handleDragOver=(e)=>{if(!this.active)return;if(e.preventDefault(),e.dataTransfer)e.dataTransfer.dropEffect=e.altKey?"copy":"move";if(e.target instanceof Element)this.selectable.placeCaretAt(e.clientX,e.clientY)};handleDrop=(e)=>{if(!this.active||!e.dataTransfer)return;e.preventDefault();let t=this.draggingSelection;this.draggingSelection=!1;let n=this.insertionPoint();if(t&&n?.closest(".selected")){this.clearDraggable();return}let s=Array.from(e.dataTransfer.files||[]).filter((l)=>l.type.startsWith("image/"));if(s.length){this.insertDroppedImages(s),this.clearDraggable();return}let o=e.dataTransfer.getData("text/html"),r=e.dataTransfer.getData("text/plain");if(t&&!e.altKey)this.deleteSelection();else this.selectable.unmark();this.clearDraggable(),this.insertTransfer(o,r),this.normalize(),this.updateUndo("new"),this.focus()};handleDragEnd=()=>{this.draggingSelection=!1,this.clearDraggable()};clearDraggable(){for(let e of Array.from(this.parts.doc.querySelectorAll("[draggable]")))e.removeAttribute("draggable"),e.removeAttribute("data-drag")}async insertDroppedImages(e){for(let t of e){let n=await new Promise((i)=>{let s=new FileReader;s.onload=()=>i(String(s.result||"")),s.readAsDataURL(t)});if(n)this.doCommandWith("insertImage",n,t.name)}}cellEdgeAt(e){let n=e.target.closest(".editor-table > li");if(!n)return null;let i=n.parentElement;if(!i||!i.classList.contains("editor-table"))return null;let s=n.getBoundingClientRect(),o=O(i),r=_e(n,o),l=4;if(Math.abs(e.clientX-s.right)<l&&r<o-1)return[i,r];if(Math.abs(e.clientX-s.left)<l&&r>0)return[i,r-1];return null}updateTouchAffordances(){if(!this.touchAffordances)return;if(!this.isTouchInteraction&&!this.touchMenuEl){this.touchAffordances.style.display="none",this.parts.doc.style.paddingTop="",this.parts.doc.style.paddingBottom="",this.syncCaret();return}let e=this.parts.doc.querySelector(".sel-start"),t=this.parts.doc.querySelector(".sel-end");if(!e||!t){this.touchAffordances.style.display="none",this.parts.doc.style.paddingTop="",this.parts.doc.style.paddingBottom="",this.syncCaret();return}let n=this.parts.doc.getBoundingClientRect(),i=this.markerRect(e),s=this.markerRect(t);if(this.touchDrags.size===0){let o=parseFloat(this.parts.doc.style.paddingTop)||0,r=parseFloat(this.parts.doc.style.paddingBottom)||0,l=Math.min(i.top,s.top)-48-o,a=Math.max(i.bottom,s.bottom)+48+r,c=l<n.top?"52px":"",d=a>n.bottom?"52px":"",u=this.parts.doc.style.paddingTop,h=this.parts.doc.style.paddingBottom;if(c!==u||d!==h)this.parts.doc.style.paddingTop=c,this.parts.doc.style.paddingBottom=d}this.positionAffordances(),this.touchAffordances.style.display="block",this.touchAffordances.style.opacity="1"}positionAffordances(){let e=this.parts.doc.querySelector(".sel-start"),t=this.parts.doc.querySelector(".sel-end");if(!e||!t)return;let n=this.parts.doc.getBoundingClientRect(),i=this.markerRect(e),s=this.markerRect(t),o=i.left-n.left+this.parts.doc.scrollLeft,r=i.top-n.top+this.parts.doc.scrollTop,l=s.right-n.left+this.parts.doc.scrollLeft,a=s.bottom-n.top+this.parts.doc.scrollTop;if(e.nextElementSibling===t)this.touchHandleStart.style.left=`${o-44}px`,this.touchHandleStart.style.top=`${r-44}px`,this.touchContextMenu.style.left=`${o}px`,this.touchContextMenu.style.top=`${r-44}px`,this.touchHandleEnd.style.left=`${l}px`,this.touchHandleEnd.style.top=`${a}px`;else{this.touchHandleStart.style.left=`${o-44}px`,this.touchHandleStart.style.top=`${r-44}px`,this.touchHandleEnd.style.left=`${l}px`,this.touchHandleEnd.style.top=`${a}px`;let d=(o+l)/2-22,u=Math.min(r,a)-44;this.touchContextMenu.style.left=`${d}px`,this.touchContextMenu.style.top=`${u}px`}}handleAffordanceDragStart=(e)=>{let t=e.currentTarget,n=t===this.touchHandleStart?"start":"end";t.setPointerCapture(e.pointerId);let i=t.getBoundingClientRect(),s=n==="start"?".sel-start":".sel-end",o=this.parts.doc.querySelector(s),r=o?parseFloat(getComputedStyle(o).lineHeight):NaN,l=isNaN(r)?10:r/2,a,c;if(n==="start")a=i.right-e.clientX,c=i.bottom+l-e.clientY;else a=i.left-e.clientX,c=i.top-l-e.clientY;this.touchDrags.set(e.pointerId,{target:n,offsetX:a,offsetY:c}),this.hideTouchMenu(),this.touchAffordances.classList.add("dragging"),e.preventDefault(),e.stopPropagation()};handleAffordanceDragMove=(e)=>{let t=this.touchDrags.get(e.pointerId);if(!t)return;let n=e.clientX+t.offsetX,i=e.clientY+t.offsetY,s=e.currentTarget;s.style.pointerEvents="none",this.touchAffordances.style.pointerEvents="none";let o=this.shadowRoot.elementFromPoint(n,i);if(s.style.pointerEvents="auto",this.touchAffordances.style.pointerEvents="",!o||o.closest(".not-selectable")||o.classList.contains("not-selectable"))return;let r=te(this.parts.doc,n,i);if(!r)return;let l=t.target==="start"?".sel-start":".sel-end",a=this.parts.doc.querySelector(l);if(a){let c=document.createRange();c.setStart(r.node,r.after?r.offset+1:r.offset),c.collapse(!0),c.insertNode(a),this.parts.doc.normalize(),this.selectable.markBounds();let d=this.parts.doc.getBoundingClientRect(),u=e.currentTarget,h=e.clientX-d.left+this.parts.doc.scrollLeft,f=e.clientY-d.top+this.parts.doc.scrollTop;u.style.left=`${h-22}px`,u.style.top=`${f-22}px`}e.preventDefault(),e.stopPropagation()};handleAffordanceDragEnd=(e)=>{if(!this.touchDrags.has(e.pointerId))return;if(e.currentTarget.releasePointerCapture(e.pointerId),this.touchDrags.delete(e.pointerId),this.touchDrags.size===0)this.selectable.despanify(),this.selectable.selectionChanged(),requestAnimationFrame(()=>{this.touchAffordances.classList.remove("dragging")});e.preventDefault(),e.stopPropagation()};handleTouchContextMenu=(e)=>{if(e.preventDefault(),e.stopPropagation(),this.touchMenuEl){this.hideTouchMenu();return}this.showTouchMenu(e)};showTouchMenu(e){this.hideTouchMenu();let t=document.createElement("div");t.className="touch-menu not-selectable do-not-spanify";let n=()=>this.selectable.findAll(".selected").map((d)=>d.textContent).join(""),i=[{label:"Cut",action:()=>{let d=n();if(!d)return;navigator.clipboard.writeText(d),this.deleteSelection(),this.updateUndo("new")}},{label:"Copy",action:()=>{navigator.clipboard.writeText(n())}},{label:"Paste",action:()=>{navigator.clipboard.readText().then((d)=>{if(d){this.deleteSelection();let u=this.insertionPoint();if(u)u.before(document.createTextNode(d)),this.normalize(),this.updateUndo("new")}})}},{label:"Delete",action:()=>{this.deleteSelection(),this.updateUndo("new")}},{label:"Bold",action:()=>this.doCommand("setText font-weight bold")},{label:"Italic",action:()=>this.doCommand("setText font-style italic")},{label:"Plain",action:()=>this.doCommand("setText font-weight normal; setText font-style normal; setText text-decoration none")}];for(let{label:d,action:u}of i){let h=document.createElement("button");h.className="touch-menu-item not-selectable",h.textContent=d,h.addEventListener("pointerdown",(f)=>{f.stopPropagation(),f.preventDefault(),u(),this.hideTouchMenu()}),t.appendChild(h)}let s=document.createElement("button");s.className="touch-menu-item touch-menu-close not-selectable",s.textContent="×",s.addEventListener("pointerdown",(d)=>{d.stopPropagation(),d.preventDefault(),this.hideTouchMenu()}),t.appendChild(s);let o=this.touchContextMenu.getBoundingClientRect(),r=this.parts.doc.getBoundingClientRect(),l=(i.length+1)*70,a=o.left-r.left+this.parts.doc.scrollLeft+22-l/2;if(a<0)a=4;if(a+l>r.width)a=r.width-l-4;t.style.left=`${a}px`;let c=o.top-r.top+this.parts.doc.scrollTop-44;if(c<0)c=o.bottom-r.top+this.parts.doc.scrollTop+4;t.style.top=`${c}px`,this.touchMenuEl=t,this.touchAffordances.appendChild(t),this.touchMenuDismiss=(d)=>{if(d===e)return;if(this.touchMenuEl&&!this.touchMenuEl.contains(d.target))this.hideTouchMenu()},this.parts.doc.addEventListener("pointerdown",this.touchMenuDismiss)}touchMenuDismiss=null;hideTouchMenu(){if(this.touchMenuDismiss)this.parts.doc.removeEventListener("pointerdown",this.touchMenuDismiss),this.touchMenuDismiss=null;if(this.touchMenuEl)this.touchMenuEl.remove(),this.touchMenuEl=null}handleResizePointerDown=(e)=>{let t=this.cellEdgeAt(e);if(!t)return;let[n,i]=t;this.resizeTable=n,this.resizeCol=i,this.resizeStartX=e.clientX;let s=V(n,0,O(n));this.resizeStartWidths=s.map((o)=>o.getBoundingClientRect().width),e.preventDefault(),e.stopPropagation(),this.parts.doc.setPointerCapture(e.pointerId)};handleResizePointerMove=(e)=>{if(!this.resizeTable){let i=this.cellEdgeAt(e);this.parts.doc.style.cursor=i?"col-resize":"";return}let t=e.clientX-this.resizeStartX,n=[...this.resizeStartWidths];n[this.resizeCol]=Math.max(30,n[this.resizeCol]+t),n[this.resizeCol+1]=Math.max(30,n[this.resizeCol+1]-t),Re(this.resizeTable,n.map((i)=>`${i}px`))};handleResizePointerUp=(e)=>{if(this.resizeTable)this.updateUndo("new"),this.resizeTable=null,this.resizeCol=-1,this.parts.doc.style.cursor="",this.parts.doc.releasePointerCapture(e.pointerId)};isToolbarEvent(e){return e.closest('[slot="toolbar"]')!==null||e.closest('[slot="menubar"]')!==null}handleToolbarClick=(e)=>{let t=e.target;if(!this.isToolbarEvent(t))return;let n=t.closest("button");if(!n)return;let i=n.getAttribute("value");if(i)this.doCommand(i)};handleToolbarChange=(e)=>{let t=e.target;if(!this.isToolbarEvent(t))return;let n=t.closest("select")||t.closest("tosi-select");if(!n)return;let i=n.value;if(!i)return;let s=i.trim().split(/[\s;]/)[0];if(!s||!(s in this.commands))return;this.doCommand(i)}}st();var Sa=mi.elementCreator();var To="0.5.0";})();
|
|
12
|
+
`);var m=new Proxy({},{get(e,t){if(e[t]===void 0){let n="--"+W(t);e[t]=(i)=>`var(${n}, ${i})`}return e[t]}}),L=new Proxy({},{get(e,t){if(t==="default")return m;if(e[t]==null){t=W(t);let[,n,,i,s,o]=t.match(/^([-\w]*?)((_)?(\d+)(\w?))?$/)||["",t],r=`--${n}`;if(s!=null){let l=i==null?Number(s)/100:-Number(s)/100;switch(o){case"b":case"s":case"h":case"o":{let a=`--${t}`;g.registerComputedColor(a,r,l,o),e[t]=`var(${a})`}break;case"":e[t]=`calc(var(${r}) * ${l})`;break;default:throw console.error(o),Error(`Unrecognized method ${o} for css variable ${r}`)}}else e[t]=`var(${r})`}return e[t]}});function ml(e,t){if(!e.internals)return;let n={},i="";if(e.hasAttribute("required")&&t==="")n.valueMissing=!0,i="Please fill out this field.";let s=e.getAttribute("minlength");if(s&&t.length<parseInt(s,10))n.tooShort=!0,i=`Please use at least ${s} characters.`;let o=e.getAttribute("maxlength");if(o&&t.length>parseInt(o,10))n.tooLong=!0,i=`Please use no more than ${o} characters.`;let r=e.getAttribute("pattern");if(r&&t!=="")try{if(!new RegExp(`^(?:${r})$`).test(t))n.patternMismatch=!0,i="Please match the requested format."}catch{}if(Object.keys(n).length>0)e.internals.setValidity(n,i,e);else e.internals.setValidity({})}var qe=(e)=>e!=null&&Object.prototype.hasOwnProperty.call(e,"contract")?e.contract:void 0,Bn=null;var yl=new Set(["type","enum","const"]),vl=new Set(["description","title","default","examples","$counterexamples","$comment","$id","$schema"]),Ki=new Set,bl=(e)=>{if(Bn!=null)return;let t=Object.keys(e).filter((i)=>!yl.has(i)&&!vl.has(i));if(t.length===0)return;let n=t.sort().join(",");if(Ki.has(n))return;Ki.add(n),console.warn(`tosijs contracts: ${t.join(", ")} ${t.length===1?"is":"are"} NOT enforced by the built-in checker, which understands only `+"type/enum/const — those constraints are currently inert. Register a "+"full schema engine with setContractValidator(validate) (e.g. from tosijs-schema) to enforce them. Warned once per keyword set.")},xl=(e,t)=>{if(bl(t),t.const!==void 0&&e!==t.const)return`expected const ${JSON.stringify(t.const)}`;if(Array.isArray(t.enum)&&!t.enum.includes(e))return`expected one of ${JSON.stringify(t.enum)}`;if(typeof t.type==="string"){let n=t.type;if(!(n==="array"?Array.isArray(e):n==="null"?e===null:n==="integer"?typeof e==="number"&&Number.isInteger(e):n==="object"?typeof e==="object"&&e!==null&&!Array.isArray(e):typeof e===n))return`expected type ${n}, got ${Array.isArray(e)?"array":typeof e}`}if(Bn!=null){let n=Bn(e,t);if(n!==!0)return n.message}return null},wl=0,ut=new Set,Gi=new Set,Ls=Symbol("tosi-computed-attribute"),Xi=new WeakSet,Yi=(e)=>e!=null&&typeof e==="object"&&e[Ls]===!0,Nt=new WeakMap,Cl=(e,t)=>{let n=e.constructor,i=qe(n)?.value;if(i==null)return;let s=xl(t,i);if(s==null){Nt.delete(e);let r=e.tagName?.toLowerCase();for(let l of[...ut])if(l.startsWith(`${r}: `))ut.delete(l);return}let o=e.tagName?.toLowerCase();if(Br()){if(t==null||t===""){Nt.delete(e),ut.delete(`${o}: ${s}`);return}let r=`${o}: ${s}`;if(!ut.has(r))ut.add(r),console.error(`<${o}> value contract violation from a BINDING: ${s}. The value `+"was applied anyway (state is authoritative on this path) — fix the "+"state, the contract, or the binding. Direct writes still throw.");let l=Nt.get(e)??new Set;if(!l.has(s))l.add(s),Nt.set(e,l),e.dispatchEvent?.(new CustomEvent("contractviolation",{bubbles:!0,detail:{reason:s,value:t,schema:i}}));return}throw TypeError(`<${o}> value contract violation: ${s}`)},zt=new WeakMap;function mn(){return`custom-elt${(wl++).toString(36)}`}var Ji=0,Zi=new Set,Qi=new Set,es=Symbol("tosiDrainWrapped"),ts=new WeakSet,ns=new Set,yn=null;function kl(){if(yn===null)yn=new MutationObserver((e)=>{let t=new Set;for(let n of e)if(n.type==="attributes"&&n.target instanceof E){let i=n.target,s=xs(n.attributeName);if(i._legacyTrackedAttrs?.has(s))t.add(i)}for(let n of t)n.queueRender(!1)});return yn}var ht={};function Ml(e,t){let n=ht[e],i=mt(t).replace(/:host\(([^)]+)\)/g,`${e}$1`).replace(/:host\b/g,e);ht[e]=n?n+`
|
|
13
|
+
`+i:i}function El(e){if(ht[e])document.head.append(C.style({id:e+"-component"},ht[e]));delete ht[e]}function Sl(e){let t=Object.create(null),n=(i)=>{if(Array.isArray(i)){i.forEach(n);return}if(!(i instanceof Element))return;let s=i.getAttribute("part");if(s!=null&&!(s in t))t[s]=i;for(let o of Array.from(i.children))n(o)};return n(e),t}var w=(e)=>e,Al=(e)=>{class t extends E{static initAttributes=e}return t};class E extends HTMLElement{static elements=C;static _elementCreator;static initAttributes;static formAssociated;static preferredTagName;static shadowStyleSpec;static lightStyleSpec;static extends;internals;get validity(){return this.internals?.validity}get validationMessage(){return this.internals?.validationMessage??""}get willValidate(){return this.internals?.willValidate??!1}checkValidity(){return this.internals?.checkValidity()??!0}reportValidity(){return this.internals?.reportValidity()??!0}setCustomValidity(e){if(this.internals)if(e)this.internals.setValidity({customError:!0},e);else this.internals.setValidity({})}setValidity(e,t,n){this.internals?.setValidity(e,t,n)}setFormValue(e,t){this.internals?.setFormValue(e,t)}static _resolveInitAttributes(){let e=qe(this),t=Object.prototype.hasOwnProperty.call(this,"initAttributes")?this.initAttributes:void 0;if(e?.attributes!=null){let r=zt.get(this);if(r!=null)return r;let l={...t??{}},a=[];for(let[h,f]of Object.entries(e.attributes))if(f!=null&&"default"in f)l[h]=f.default;else if(!(h in l))a.push(h);if(a.length>0)throw Error(`${this.name} contract.attributes entries missing 'default': ${a.join(", ")} — the attribute machinery infers `+"each attribute's runtime type from its default, so every declared attribute needs one, either here or in static initAttributes.");let c=Object.getPrototypeOf(this),d=typeof c?._resolveInitAttributes==="function"?c._resolveInitAttributes():void 0,u=d!=null?{...d,...l}:l;return zt.set(this,u),u}if(t==null){let r=Object.getPrototypeOf(this);return typeof r?._resolveInitAttributes==="function"?r._resolveInitAttributes():this.initAttributes}let n=zt.get(this);if(n!=null)return n;let i=Object.getPrototypeOf(this),s=typeof i?._resolveInitAttributes==="function"?i._resolveInitAttributes():void 0;if(s==null||s===t)return t;let o={...s,...t};return zt.set(this,o),o}static computed(e=""){return{[Ls]:!0,shape:e}}static _describedAttributes(){let e=this._resolveInitAttributes(),t=qe(this)?.attributes;if(e==null)return t;let n={};for(let[i,s]of Object.entries(e)){let o=Yi(s)?s.shape:s;n[i]={type:typeof o,default:o}}return t!=null?{...n,...t}:n}static get observedAttributes(){let e=this._resolveInitAttributes();if(e)return["hidden",...Object.keys(e).map(W)];return["hidden"]}instanceId;styleNode;static styleSpec;static styleNode;content=C.slot();isSlotted;static _tagName=null;static get tagName(){return this._tagName}_legacyTrackedAttrs;_attrValues;_valueChanged=!1;_pendingAttrOps;static StyleNode(e){return console.warn("StyleNode is deprecated, use static shadowStyleSpec instead"),C.style(mt(e))}static elementCreator(e={}){let t=this;if(!Object.prototype.hasOwnProperty.call(t,"_elementCreator")){if(e.tag!==void 0)ae("elementCreator-tag","Passing tag to elementCreator() is deprecated. Use static preferredTagName instead.");if(e.styleSpec!==void 0)ae("elementCreator-styleSpec","Passing styleSpec to elementCreator() is deprecated. Use static lightStyleSpec instead.");if(e.extends!==void 0)ae("elementCreator-extends","Passing extends to elementCreator() is deprecated. Use static extends instead.");let n=e.tag??t.preferredTagName;if(n==null)if(typeof t.name==="string"&&t.name!==""){if(n=W(t.name),n.startsWith("-"))n=n.slice(1)}else n=mn();if(customElements.get(n)!=null)console.warn(`${n} is already defined`);if(n.match(/\w+(-\w+)+/)==null)console.warn(`${n} is not a legal tag for a custom-element`),n=mn();while(customElements.get(n)!==void 0)n=mn();t._tagName=n;let i=e.styleSpec??t.lightStyleSpec;if(i!==void 0)Ml(n,i);let s=e.extends??t.extends,o=s?{extends:s}:void 0,r=this.prototype;if(r!=null&&!Object.prototype.hasOwnProperty.call(r,es)){let l=r.connectedCallback;r.connectedCallback=function(){if(this._drainPendingAttrOps(),l)l.call(this)},Object.defineProperty(r,es,{value:!0,enumerable:!1})}window.customElements.define(n,this,o),t._elementCreator=C[n]}return t._elementCreator}initAttributes(...e){if(ae("initAttributes","initAttributes() is deprecated. Use static initAttributes = { ... } instead."),!this._legacyTrackedAttrs)this._legacyTrackedAttrs=new Set;for(let i of e)this._legacyTrackedAttrs.add(i);kl().observe(this,{attributes:!0});let t={},n={};e.forEach((i)=>{t[i]=le(w(this)[i]);let s=W(i);Object.defineProperty(this,i,{enumerable:!1,get(){if(typeof t[i]==="boolean")return this.hasAttribute(s);else if(this.hasAttribute(s))return typeof t[i]==="number"?parseFloat(this.getAttribute(s)):this.getAttribute(s);else if(n[i]!==void 0)return n[i];else return t[i]},set(o){if(typeof t[i]==="boolean"){if(o!==this[i]){if(o)this.setAttribute(s,"");else this.removeAttribute(s);this.queueRender()}}else if(typeof t[i]==="number"){if(o!==parseFloat(this[i]))this.setAttribute(s,o),this.queueRender()}else if(typeof o==="object"||`${o}`!==`${this[i]}`){if(o===null||o===void 0||typeof o==="object")this.removeAttribute(s);else this.setAttribute(s,o);this.queueRender(),n[i]=o}}})})}initValue(){let e=Object.getOwnPropertyDescriptor(this,"value");if(e!==void 0&&(e.get!==void 0||e.set!==void 0))return;if(e===void 0){let n=this.constructor;if(qe(n)?.value==null)return;let i;for(let s=Object.getPrototypeOf(this);s!=null&&i===void 0;s=Object.getPrototypeOf(s))i=Object.getOwnPropertyDescriptor(s,"value");if(i?.get!==void 0||i?.set!==void 0){let s=this.tagName?.toLowerCase();if(!Gi.has(s))Gi.add(s),console.error(`<${s}> declares contract.value, but implements \`value\` as its own getter/setter, so tosijs cannot enforce the contract `+"there — and describe() still publishes it. Call "+"exerciseComponent in your tests, check the value in your own setter, or drop contract.value so the map stops advertising a rule nothing checks.");return}this.value=this.hasAttribute("value")?this.getAttribute("value"):void 0}let t=this.hasAttribute("value")?this.getAttribute("value"):le(w(this).value);delete w(this).value,Object.defineProperty(this,"value",{enumerable:!1,get(){return t},set(n){if(t!==n)Cl(this,n),t=n,this._valueChanged=!0,this.queueRender(!0)}})}_parts;_partsCache=Object.create(null);get parts(){let e=this;if(this._parts==null)this._parts=new Proxy({},{get(t,n){if(typeof n!=="string")return;let i=e._partsCache,s=i[n]??null,o=s;if(o!=null&&!o.isConnected)o=null;if(o==null){let r=e.shadowRoot!=null?e.shadowRoot:e;if(o=r.querySelector(`[part="${n}"]`),o==null)o=r.querySelector(n);if(o==null&&s!=null)return s;if(o==null)throw Error(`elementRef "${n}" does not exist!`);i[n]=o}return o}});return this._parts}attributeChangedCallback(e,t,n){let i=xs(e);if(n===null&&this._attrValues?.has(i))this._attrValues.delete(i);let s=this._computedAttrShapes?.get(i);if(s!==void 0&&!this._applyingComputedAttr?.has(i)){this._applyingComputedAttr??=new Set,this._applyingComputedAttr.add(i);try{this[i]=s==="boolean"?n!==null:n??""}finally{this._applyingComputedAttr.delete(i)}return}if(!this._legacyTrackedAttrs?.has(i))this.queueRender(!1)}_applyingComputedAttr;constructor(){super();if(Ji+=1,this._installAttributeQueue(),this.constructor.formAssociated&&typeof this.attachInternals==="function"&&!this.internals)this.internals=this.attachInternals();let e=this.constructor._resolveInitAttributes();if(e)this._setupAttributeAccessors(e);this.instanceId=`${this.tagName.toLocaleLowerCase()}-${Ji}`,w(this)._value=le(w(this).defaultValue),this._warnOnHandlerCollisions()}_warnOnHandlerCollisions(){let e=this.constructor;if(ts.has(e))return;ts.add(e),queueMicrotask(()=>{let t=new Set;for(let r of Object.keys(this))if(/^on[A-Z]/.test(r))t.add(r);let n=Object.getPrototypeOf(this);while(n&&n!==E.prototype){for(let r of Object.getOwnPropertyNames(n))if(/^on[A-Z]/.test(r))t.add(r);n=Object.getPrototypeOf(n)}let i=this.tagName.toLowerCase();if(t.delete("onResize")&&w(this).handleResize===void 0)console.warn(`<${i}> defines 'onResize', which is deprecated. Rename it to 'handleResize'. The on<Event> prefix is reserved for event-handler sugar in the elements factory (creator({ onResize }) would attach a 'resize' listener) and is being retired for component callbacks in favor of the handle<Event> convention.`);if(t.size===0)return;let s=Array.from(t,(r)=>`'${r}'`).join(", "),o=Array.from(t)[0];if(Te.quiet===!0)return;console.warn(`<${i}> defines ${s} — on<Event>-shaped member name(s), which `+`collide with the elements factory's event-handler sugar. Since 1.8.0, IF the member holds a function when the creator runs, it wins: creator({ ${o}: fn }) assigns it rather than attaching a '${o.slice(2).toLowerCase()}' listener `+"(tosijs#22) — and then that name can no longer carry event sugar. "+"A member declared but left undefined/null still gets event sugar, so the meaning depends on initialisation: give it a function default, or rename to handle<Event> for a component callback / add<Event>Listener for something that registers a listener.")})}_installAttributeQueue(){let e=this.constructor._resolveInitAttributes();if(!e)return;let t=new Set(Object.keys(e).map(W)),n=[];this._pendingAttrOps=n;let i=HTMLElement.prototype;this.setAttribute=(s,o)=>{if(t.has(s))n.push(["set",s,String(o)]);else i.setAttribute.call(this,s,o)},this.removeAttribute=(s)=>{if(t.has(s))n.push(["remove",s]);else i.removeAttribute.call(this,s)},queueMicrotask(()=>this._drainPendingAttrOps())}_drainPendingAttrOps(){let e=this._pendingAttrOps;if(e===void 0)return;this._pendingAttrOps=void 0,delete this.setAttribute,delete this.removeAttribute;let t=new Set;for(let n of e)if(this.hasAttribute(n[1]))t.add(n[1]);for(let n of e)if(n[0]==="set"){if(!t.has(n[1]))this.setAttribute(n[1],n[2])}else t.delete(n[1]),this.removeAttribute(n[1])}_installedAttrAccessors;_attrTypedOverride;_installComputedAttribute(e,t){let n=Object.getPrototypeOf(this),i;while(n!=null&&n!==E.prototype&&i===void 0)if(i=Object.getOwnPropertyDescriptor(n,e),i===void 0)n=Object.getPrototypeOf(n);if(i?.get==null)throw Error(`${this.tagName}: initAttributes.${e} is Component.computed(), `+"which declares that this class implements the attribute itself — "+`but no \`get ${e}()\` was found on the class. Define get/set for it, or give the attribute an ordinary default value instead. (If "${e}" is a native DOM property — title, `+"id, hidden, lang, slot, tabIndex … — it cannot be a computed "+"attribute: tosijs will not shadow the platform's accessor, because doing so corrupts it for every element on the page.)");if(this._computedAttrShapes??=new Map,this._computedAttrShapes.set(e,typeof t==="boolean"?"boolean":"string"),i.set==null||n==null)return;if(Xi.has(i.set))return;let{get:s,set:o}=i,r=function(l){let a;try{a=s.call(this)}catch{a=void 0}o.call(this,l);let c;try{c=s.call(this)}catch{c=void 0}if(c!==a)this.queueRender()};Xi.add(r),Object.defineProperty(n,e,{configurable:!0,enumerable:i.enumerable,get:i.get,set:r})}_computedAttrShapes;_setupAttributeAccessors(e){if(!this._attrValues)this._attrValues=new Map;if(!this._installedAttrAccessors)this._installedAttrAccessors=new Set;for(let t of Object.keys(e)){let n=W(t),i=e[t];if(t==="value"){console.warn(`${this.tagName}: 'value' cannot be an attribute. Use the Component value property instead.`);continue}if(Yi(i)){this._installComputedAttribute(t,i.shape);continue}if(typeof i==="object"&&i!==null){console.warn(`${this.tagName}: initAttributes.${t} is an object. Use a regular property instead.`);continue}if(i===!0)throw Error(`${this.tagName}: static initAttributes.${t} defaults a boolean attribute to true, but HTML boolean attributes are false-by-default (presence = true, absence = false) and `+`cannot reflect a true default — it would silently become false. Use { ${t}: false }, or model it as a string/number attribute or a plain (non-attribute) property.`);let s=this,o=!1;while(s){let r=Object.getOwnPropertyDescriptor(s,t);if(r){if(!r.configurable||r.get||r.set){o=!0;break}break}s=Object.getPrototypeOf(s)}if(o)continue;this._installAttrAccessor(t,n,i)}}_installAttrAccessor(e,t,n){Object.defineProperty(this,e,{enumerable:!1,configurable:!0,get:()=>{let i=()=>{let s=this._attrTypedOverride?.get(e);return s!==void 0&&s.reflected===this.getAttribute(t)?{value:s.value}:void 0};if(typeof n==="boolean"){if(this.hasAttribute(t))return i()?.value??!0;if(this._attrValues.has(e))return this._attrValues.get(e);return!1}else if(this.hasAttribute(t)){if(typeof n==="number")return i()?.value??parseFloat(this.getAttribute(t));let s=this._attrTypedOverride?.get(e);if(s!==void 0&&s.reflected===this.getAttribute(t))return s.value;return this.getAttribute(t)}else if(this._attrValues.has(e))return this._attrValues.get(e);else return n},set:(i)=>{if(i!=null&&typeof i!==typeof n&&typeof i!=="object")this._attrTypedOverride??=new Map,this._attrTypedOverride.set(e,{reflected:typeof n==="boolean"&&i?"":String(i),value:i});else this._attrTypedOverride?.delete(e);if(i!=null&&typeof i!==typeof n&&typeof n!=="object"){let s=`${this.tagName.toLowerCase()}.${e}`;if(!ns.has(s))ns.add(s),console.error(`<${this.tagName.toLowerCase()}>: ${e} is declared ${typeof n} (default ${JSON.stringify(n)}), but was written ${typeof i} ${JSON.stringify(i)}. `+"The value is applied as given — nothing is coerced — but this "+"is usually a call site left behind by a type change. (tosijs#24)")}if(typeof n==="boolean"){if(i!==w(this)[e]){if(i)this.setAttribute(t,"");else this.removeAttribute(t);this.queueRender(),this._attrValues.set(e,!!i)}}else if(typeof n==="number"){if(i!==parseFloat(w(this)[e]))this.setAttribute(t,i),this.queueRender(),this._attrValues.set(e,i)}else if(typeof i==="object"||`${i}`!==`${w(this)[e]}`){if(i===null||i===void 0||typeof i==="object")this.removeAttribute(t);else this.setAttribute(t,i);this.queueRender(),this._attrValues.set(e,i)}}}),this._installedAttrAccessors.add(e)}_recoverShadowedAttrAccessors(){let e=this._installedAttrAccessors,t=this.constructor._resolveInitAttributes();if(e==null||t==null)return;let n=[];for(let i of e){let s=Object.getOwnPropertyDescriptor(this,i);if(s==null||s.get!=null||s.set!=null)continue;let o=s.value;delete this[i],this._installAttrAccessor(i,W(i),t[i]),this[i]=o,n.push(i)}if(n.length>0&&!Qi.has(this.tagName)){Qi.add(this.tagName);let i=n.map((s)=>`'${s}'`).join(", ");console.warn(`<${this.tagName.toLowerCase()}> declares instance field(s) ${i} that shadow static initAttributes accessors (class fields use [[Define]] semantics). The field value was adopted and the `+"reactive accessor restored — delete the field declaration; "+"static initAttributes already defines the property.")}}connectedCallback(){if(this._recoverShadowedAttrAccessors(),this._drainPendingAttrOps(),El(this.constructor.tagName),this.hydrate(),this.role!=null)this.setAttribute("role",this.role);{let t=this.constructor,n=qe(t),i=n?.description;if(typeof i==="string"&&i!==""&&!this.hasAttribute("aria-description")&&!this.hasAttribute("aria-describedby"))this.setAttribute("aria-description",i);let s=n?.role;if(typeof s==="string"&&s!==""&&!this.getAttribute("role"))this.setAttribute("role",s)}if(this.constructor.formAssociated&&!this.hasAttribute("tabindex"))this.setAttribute("tabindex","0");let e=w(this).handleResize??w(this).onResize;if(e!==void 0){if(Tn.observe(this),w(this)._onResize==null)w(this)._onResize=e.bind(this);this.addEventListener("resize",w(this)._onResize)}if(w(this).value!=null&&this.getAttribute("value")!=null)w(this)._value=this.getAttribute("value");if(this.internals&&w(this).value!==void 0)this.internals.setFormValue(w(this).value),this.validateValue();this.queueRender()}disconnectedCallback(){Tn.unobserve(this)}formResetCallback(){if(w(this).value!==void 0)w(this).value=w(this).defaultValue??""}formDisabledCallback(e){if(e)this.setAttribute("disabled","");else this.removeAttribute("disabled")}formStateRestoreCallback(e){if(w(this).value!==void 0&&typeof e==="string")w(this).value=e}_changeQueued=!1;_renderQueued=!1;queueRender(e=!1){if(!this._hydrated)return;if(!this._changeQueued)this._changeQueued=e;if(!this._renderQueued)this._renderQueued=!0,requestAnimationFrame(()=>{if(this._changeQueued){if(hs(this,"change",{bubbles:!0,composed:!0}),this.internals&&w(this).value!==void 0)this.internals.setFormValue(w(this).value)}this._changeQueued=!1,this._renderQueued=!1,this.render()})}_hydrated=!1;_whenHydrated;_resolveHydrated;get hydrated(){return this._hydrated}get whenHydrated(){if(this._hydrated)return Promise.resolve();if(this._whenHydrated==null)this._whenHydrated=new Promise((e)=>{this._resolveHydrated=e});return this._whenHydrated}hydrate(){if(!this._hydrated){this.initValue();let e=typeof this.content!=="function",t=typeof this.content==="function"?this.content(C):this.content;if(t!=null&&!Array.isArray(t)&&!(t instanceof Node)&&typeof t!=="string")t=[t];if(Array.isArray(t)){let o={},r=[];for(let l of t)Hn(l,this.tagName,(a)=>r.push(a),(a)=>ks(o,a));t=r;for(let l of Object.keys(o))jn(this,l,o[l])}let n=this.constructor,i=n.shadowStyleSpec??n.styleSpec;if(n.styleSpec&&!n.shadowStyleSpec)ae("static-styleSpec","static styleSpec is deprecated. Use static shadowStyleSpec instead.");let{styleNode:s}=n;if(i)s=n.styleNode=C.style(mt(i)),delete n.styleNode;if(this.styleNode)console.warn(this,"styleNode is deprecated, use static shadowStyleSpec instead"),s=this.styleNode;if(s){let o=this.attachShadow({mode:"open"});if(o.appendChild(s.cloneNode(!0)),$i(o,t,e),!Zi.has(this.tagName)&&o.querySelector(wn)!=null)Zi.add(this.tagName),console.warn(`<${this.tagName.toLowerCase()}> has data-binding sugar in its shadow-DOM content, where bindings do not operate. A shadow-DOM component is bound like an <input>: bind its VALUE from outside (bindings.value) and implement render() to reflect value into `+"the shadow DOM — setting value queues render() and emits change "+"automatically. on() event handlers are fine. Warned once per component class.")}else if(t!==null){let o=Array.from(this.childNodes);if(!e)this._partsCache=Sl(t);$i(this,t,e),this.isSlotted=this.querySelector("slot,tosi-slot,xin-slot")!==null;let r=Array.from(this.querySelectorAll("slot"));if(r.length>0)r.forEach(Pt.replaceSlot);if(o.length>0){let l={"":this};Array.from(this.querySelectorAll("tosi-slot,xin-slot")).forEach((a)=>{l[a.name]=a}),o.forEach((a)=>{let c=l[""],d=a instanceof Element?l[a.slot]:c;(d!==void 0?d:c).append(a)})}}this._hydrated=!0,this._parts=void 0,this._resolveHydrated?.()}}render(){if(this._valueChanged&&this.internals&&w(this).value!==void 0)this.internals.setFormValue(w(this).value),this.validateValue();this._valueChanged=!1}validateValue(){if(!this.internals||w(this).value===void 0)return;let e=typeof w(this).value==="string"?w(this).value:String(w(this).value);ml(this,e)}}class Pt extends E{static preferredTagName="tosi-slot";static initAttributes={name:""};content=null;static replaceSlot(e){let t=document.createElement("tosi-slot");if(e.name!=="")t.setAttribute("name",e.name);while(e.firstChild!=null)t.appendChild(e.firstChild);e.replaceWith(t)}}var Ka=Pt.elementCreator();class Bs extends Pt{static preferredTagName="xin-slot";connectedCallback(){super.connectedCallback(),ae("xin-slot","<xin-slot> is deprecated and will be REMOVED IN 2.0 — rename it to "+"<tosi-slot> (same attributes, same composition). It is registered only so your content keeps landing in the right place until you do.")}}Bs.elementCreator();var Tl="1.10.1";function Vt(e){return Object.assign(re,e),re}function $s(e){return ae("boxedProxy","boxedProxy is deprecated, please use tosi() instead"),Vt(e)}var Ga=new FinalizationRegistry((e)=>{e()});function Ll(e,t=!1){if(t)return ae("xinProxy-boxed","xinProxy(..., true) is deprecated; use tosi(...) instead"),$s(e);return Object.keys(e).forEach((n)=>{Be[n]=e[n]}),Be}var Bl={};async function Ns(e,t){let n=await t(e,{Color:g,Component:E,withAttributes:Al,elements:C,svgElements:Pn,mathML:el,varDefault:m,vars:L,xin:Be,boxed:re,xinProxy:Ll,boxedProxy:$s,tosi:Vt,makeComponent:Ns,bind:ye,on:In,version:Tl}),{type:i}=n;if(i.preferredTagName=e,n.contract!=null&&qe(i)===void 0)i.contract=n.contract;let s=n.lightStyleSpec??n.styleSpec;if(s)i.lightStyleSpec=s;let o={type:i,creator:i.elementCreator()};return Bl[e]=o,o}var Fn={":host":{display:"none"}},Ot={},$l=(e)=>import(e),Nl=["javascript","data","vbscript"];function zl(e){let t=e.replace(/[\u0000-\u0020]/g,""),n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);return n?n[1].toLowerCase():""}function Ol(e,t){let n=zl(e);if(Nl.includes(n))return`${n}: is never an honest blueprint module`;let i=Te.blueprintSrcCheck;if(typeof i==="function"&&i(e,t)===!1)return"settings.blueprintSrcCheck returned false";return null}async function Dl(e,t,n){let i=Array.from(e.querySelectorAll(t)).filter((o)=>o.src),s=await Promise.allSettled(i.map((o)=>o.packaged()));for(let o=0;o<s.length;o++){let r=s[o];if(r.status==="rejected")console.error(`<${n}> failed to load blueprint from "${i[o].src}":`,r.reason)}}class zs extends E{static preferredTagName="tosi-blueprint";static lightStyleSpec=Fn;static initAttributes={tag:"anon-elt",src:"",property:"default"};loaded;blueprintLoaded=(e)=>{};async packaged(){let{tag:e,src:t,property:n}=this,i=`${e}.${n}:${t}`;if(!this.loaded){let s=Ol(t,this);if(s!==null){let o=`<tosi-blueprint> refused "${t}" — ${s}. These tags EXECUTE the module they name: strip them from user-supplied HTML, or set settings.blueprintSrcCheck to allow this source.`;throw console.error(o),Error(o)}if(Ot[i]===void 0)Ot[i]=$l(t).then((o)=>{let r=o[n];return Ns(e,r)});else if(Te.debug)console.log(`using cached ${e} with signature ${i}`);try{this.loaded=await Ot[i]}catch(o){throw delete Ot[i],o}this.blueprintLoaded(this.loaded)}return this.loaded}}var Xa=zs.elementCreator();class Os extends E{static preferredTagName="tosi-loader";static lightStyleSpec=Fn;allLoaded=()=>{};async load(){await Dl(this,"tosi-blueprint","tosi-loader"),this.allLoaded()}connectedCallback(){super.connectedCallback(),this.load()}}var Ya=Os.elementCreator();class qn extends E{static lightStyleSpec=Fn;content=null;connectedCallback(){super.connectedCallback();let e=this.tagName.toLowerCase(),t=e.replace("xin-","tosi-");ae(e,`<${e}> was removed in tosijs 1.8.0 and does NOTHING — this element `+`will not hydrate. Rename it to <${t}> (same attributes, same behaviour). Deprecated since 1.7; the tag is registered only so this message can exist, and goes away in 2.0.`)}}class Ds extends qn{static preferredTagName="xin-blueprint"}Ds.elementCreator();class Is extends qn{static preferredTagName="xin-loader"}Is.elementCreator();var Il=["input","textarea","select"],Hl=["cc-","current-password","new-password","one-time-code"],jl=["password","hidden"],Ja=["[data-tosi-secret]",...jl.map((e)=>`input[type="${e}"]`),...Il.flatMap((e)=>Hl.map((t)=>`${e}[autocomplete^="${t}"]`))].join(",");var xe={blueprint:'<svg class="color" viewBox="0 0 24 24"><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M10.5,14.5 C10.5,14.5,7.5,15.5,7.5,17.5 C7.5,19.5,10.5,19.5,10.5,19.5"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M18.5,14.5 C18.5,14.5,21.5,15.5,21.5,17.5 C21.5,19.5,18.5,19.5,18.5,19.5"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M7,5.09 C7,3.94,7.9,3,9,3 C9,3,20,3,20,3 C21.1,3,22,3.94,22,5.09 C22,5.09,22,12.41,22,12.41 C22,13.56,21.1,14.5,20,14.5 C20,14.5,9,14.5,9,14.5 C7.9,14.5,7,13.56,7,12.41 C7,12.41,7,5.09,7,5.09 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M14.5,5.5 C14.5,5.5,14.5,11.5,14.5,11.5"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M16.5,7.5 C16.5,7.5,16.5,8.5,16.5,8.5"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12.5,7.5 C12.5,7.5,12.5,8.5,12.5,8.5"/><g/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M18.5,21.5 C18.5,21.5,17.5,20.5,17.5,20.5 C17.5,20.5,16.5,21.5,16.5,21.5"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12.5,21.5 C12.5,21.5,11.5,20.5,11.5,20.5 C11.5,20.5,10.5,21.5,10.5,21.5"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M10.5,14.5 C10.5,14.5,18.5,14.5,18.5,14.5 C18.5,14.5,18.5,19.5,18.5,19.5 C18.5,19.5,10.5,19.5,10.5,19.5 C10.5,19.5,10.5,14.5,10.5,14.5 z"/><g><g><path style="fill:#5e78ca;fill-rule:nonzero;stroke:#f2f2f2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M14,16.5 C14,16.5,16,16.5,16,16.5 C16,16.5,14.53,19.5,14.53,19.5"/><path style="fill:#5e78ca;fill-rule:evenodd;stroke:none;" d="M3.59,8.5 C3.59,8.5,12.59,8.5,12.59,8.5 C12.59,8.5,14.53,19.5,14.53,19.5 C14.53,19.5,5.53,19.5,5.53,19.5 C5.53,19.5,3.59,8.5,3.59,8.5 z"/><path style="fill:#5e78ca;fill-rule:nonzero;stroke:#f2f2f2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12.59,8.5 C12.59,8.5,11.12,11.5,11.12,11.5 C11.12,11.5,2.12,11.5,2.12,11.5 C2.12,11.5,3.59,8.5,3.59,8.5"/><path style="fill:#5e78ca;fill-rule:nonzero;stroke:#f2f2f2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12.59,8.5 C12.59,8.5,14.53,19.5,14.53,19.5"/><path style="fill:#5e78ca;fill-rule:nonzero;stroke:#f2f2f2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M4.12,11.5 C4.12,11.5,5.53,19.5,5.53,19.5"/></g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M9.24,12.5 C10.75,12.5,12.2,13.73,12.46,15.24 C12.46,15.24,12.46,15.24,12.46,15.24 C12.68,16.49,11.85,17.5,10.6,17.5 C10.6,17.5,10.55,17.5,10.55,17.5 C10.17,17.5,9.92,17.81,9.98,18.19 C9.98,18.19,9.98,18.19,9.98,18.19 C10.21,19.47,9.36,20.5,8.08,20.5 C8.08,20.5,6.39,20.5,6.39,20.5 C5.1,20.5,3.87,19.45,3.64,18.16 C3.64,18.16,3.12,15.21,3.12,15.21 C2.86,13.71,3.86,12.5,5.35,12.5 C5.35,12.5,9.24,12.5,9.24,12.5 z"/></g></g></svg> ',earth:'<svg class="color" viewBox="0 0 48 48"><g><g><g><path style="fill:#a3d9ff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M7,13.46 C5.1,16.52,4,20.13,4,24 C4,31.81,8.47,38.57,15,41.87 C15,41.87,15,31,15,31 C15,31,9,29,9,29 C9,29,9,19,9,19 C9,19,7,15,7,15 C7,15,7,13.46,7,13.46 z"/><path style="fill:#a3d9ff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M18.4,4.79 C20.18,4.28,22.06,4,24,4 C27.57,4,30.92,4.93,33.82,6.57 C33.82,6.57,29,13,29,13 C29,13,31,19,31,19 C31,19,37,21,37,21 C37,21,39,29,39,29 C39,29,37.35,38.89,37.35,38.89 C33.81,42.07,29.13,44,24,44 C21.03,44,18.22,43.35,15.69,42.2 C15.69,42.2,27,29,27,29 C27,29,27,25,27,25 C27,25,21,23,21,23 C21,23,15,19,15,19 C15,19,11,19,11,19 C11,19,11,13,11,13 C11,13,13,11,13,11 C13,11,15,15,15,15 C15,15,17,15,17,15 C17,15,17,9,17,9 C17,9,18.4,4.79,18.4,4.79 z"/><path style="fill:#274e42;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M18.4,4.79 C18.4,4.79,17,9,17,9 C17,9,17,15,17,15 C17,15,15,15,15,15 C15,15,13,11,13,11 C13,11,11,13,11,13 C11,13,11,19,11,19 C11,19,15,19,15,19 C15,19,21,23,21,23 C21,23,27,25,27,25 C27,25,27,29,27,29 C27,29,15.69,42.2,15.69,42.2 C15.46,42.09,15.23,41.98,15,41.87 C15,41.87,15,31,15,31 C15,31,9,29,9,29 C9,29,9,19,9,19 C9,19,7,15,7,15 C7,15,7,13.46,7,13.46 C9.57,9.32,13.62,6.19,18.4,4.79 z"/><path style="fill:#274e42;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M33.82,6.57 C33.82,6.57,29,13,29,13 C29,13,31,19,31,19 C31,19,37,21,37,21 C37,21,39,29,39,29 C39,29,37.35,38.89,37.35,38.89 C41.43,35.23,44,29.91,44,24 C44,16.52,39.9,10,33.82,6.57 z"/></g></g></g></svg> ',cmy:'<svg class="color filled" viewBox="0 0 24 24"><g><g><path style="fill:#00ff00;fill-rule:evenodd;" d="M12,10.88 C10.9,10.01,9.51,9.5,8,9.5 C7.22,9.5,6.47,9.64,5.78,9.89 C6.37,11.85,7.87,13.42,9.78,14.11 C10.17,12.81,10.96,11.69,12,10.88 z"/><path style="fill:#0000ff;fill-rule:evenodd;" d="M12,10.88 C13.1,10.01,14.49,9.5,16,9.5 C16.78,9.5,17.53,9.64,18.22,9.89 C17.63,11.85,16.13,13.42,14.22,14.11 C13.83,12.81,13.04,11.69,12,10.88 C12,10.88,12,10.88,12,10.88 z"/><path style="fill:#000000;fill-rule:evenodd;" d="M9.78,14.11 C10.17,12.81,10.96,11.69,12,10.88 C13.04,11.69,13.83,12.81,14.22,14.11 C13.53,14.36,12.78,14.5,12,14.5 C11.22,14.5,10.47,14.36,9.78,14.11 C9.78,14.11,9.78,14.11,9.78,14.11 z"/><path style="fill:#ff0000;fill-rule:evenodd;" d="M9.78,14.11 C9.6,14.71,9.5,15.34,9.5,16 C9.5,18.08,10.48,19.93,12,21.12 C13.52,19.93,14.5,18.08,14.5,16 C14.5,15.34,14.4,14.71,14.22,14.11 C13.53,14.36,12.78,14.5,12,14.5 C11.22,14.5,10.47,14.36,9.78,14.11 C9.78,14.11,9.78,14.11,9.78,14.11 z"/><path style="fill:#02fefe;fill-rule:evenodd;" d="M5.78,9.89 C5.6,9.29,5.5,8.66,5.5,8 C5.5,4.41,8.41,1.5,12,1.5 C15.59,1.5,18.5,4.41,18.5,8 C18.5,8.66,18.4,9.29,18.22,9.89 C17.53,9.64,16.78,9.5,16,9.5 C14.49,9.5,13.1,10.01,12,10.88 C10.9,10.01,9.51,9.5,8,9.5 C7.22,9.5,6.47,9.64,5.78,9.89 C5.78,9.89,5.78,9.89,5.78,9.89 z"/><path style="fill:#fffe00;fill-rule:evenodd;" d="M5.78,9.89 C3.28,10.8,1.5,13.19,1.5,16 C1.5,19.59,4.41,22.5,8,22.5 C9.51,22.5,10.9,21.99,12,21.12 C10.48,19.93,9.5,18.08,9.5,16 C9.5,15.34,9.6,14.71,9.78,14.11 C7.87,13.42,6.37,11.85,5.78,9.89 C5.78,9.89,5.78,9.89,5.78,9.89 z"/><path style="fill:#ff00ff;fill-rule:evenodd;" d="M18.22,9.89 C20.72,10.8,22.5,13.19,22.5,16 C22.5,19.59,19.59,22.5,16,22.5 C14.49,22.5,13.1,21.99,12,21.12 C13.52,19.93,14.5,18.08,14.5,16 C14.5,15.34,14.4,14.71,14.22,14.11 C16.13,13.42,17.63,11.85,18.22,9.89 z"/></g></g></svg> ',rgb:'<svg class="color filled" viewBox="0 0 24 24"><g><g><path style="fill:#ff00ff;fill-rule:evenodd;" d="M12,10.88 C10.9,10.01,9.51,9.5,8,9.5 C7.22,9.5,6.47,9.64,5.78,9.89 C6.37,11.85,7.87,13.42,9.78,14.11 C10.17,12.81,10.96,11.69,12,10.88 z"/><path style="fill:#ffff00;fill-rule:evenodd;" d="M12,10.88 C13.1,10.01,14.49,9.5,16,9.5 C16.78,9.5,17.53,9.64,18.22,9.89 C17.63,11.85,16.13,13.42,14.22,14.11 C13.83,12.81,13.04,11.69,12,10.88 C12,10.88,12,10.88,12,10.88 z"/><path style="fill:#ffffff;fill-rule:evenodd;" d="M9.78,14.11 C10.17,12.81,10.96,11.69,12,10.88 C13.04,11.69,13.83,12.81,14.22,14.11 C13.53,14.36,12.78,14.5,12,14.5 C11.22,14.5,10.47,14.36,9.78,14.11 C9.78,14.11,9.78,14.11,9.78,14.11 z"/><path style="fill:#00ffff;fill-rule:evenodd;" d="M9.78,14.11 C9.6,14.71,9.5,15.34,9.5,16 C9.5,18.08,10.48,19.93,12,21.12 C13.52,19.93,14.5,18.08,14.5,16 C14.5,15.34,14.4,14.71,14.22,14.11 C13.53,14.36,12.78,14.5,12,14.5 C11.22,14.5,10.47,14.36,9.78,14.11 C9.78,14.11,9.78,14.11,9.78,14.11 z"/><path style="fill:#ff0000;fill-rule:evenodd;" d="M5.78,9.89 C5.6,9.29,5.5,8.66,5.5,8 C5.5,4.41,8.41,1.5,12,1.5 C15.59,1.5,18.5,4.41,18.5,8 C18.5,8.66,18.4,9.29,18.22,9.89 C17.53,9.64,16.78,9.5,16,9.5 C14.49,9.5,13.1,10.01,12,10.88 C10.9,10.01,9.51,9.5,8,9.5 C7.22,9.5,6.47,9.64,5.78,9.89 C5.78,9.89,5.78,9.89,5.78,9.89 z"/><path style="fill:#0000ff;fill-rule:evenodd;" d="M5.78,9.89 C3.28,10.8,1.5,13.19,1.5,16 C1.5,19.59,4.41,22.5,8,22.5 C9.51,22.5,10.9,21.99,12,21.12 C10.48,19.93,9.5,18.08,9.5,16 C9.5,15.34,9.6,14.71,9.78,14.11 C7.87,13.42,6.37,11.85,5.78,9.89 C5.78,9.89,5.78,9.89,5.78,9.89 z"/><path style="fill:#00ff00;fill-rule:evenodd;" d="M18.22,9.89 C20.72,10.8,22.5,13.19,22.5,16 C22.5,19.59,19.59,22.5,16,22.5 C14.49,22.5,13.1,21.99,12,21.12 C13.52,19.93,14.5,18.08,14.5,16 C14.5,15.34,14.4,14.71,14.22,14.11 C16.13,13.42,17.63,11.85,18.22,9.89 z"/></g></g></svg> ',xrColor:'<svg class="color filled" viewBox="0 0 40 24"><g><g><g><path style="fill:#000000;fill-rule:evenodd;" d="M20,2 C19.99,2,19.98,2,19.98,2 C8.39,2,2,3.61,2,12 C2,18.41,5.32,22,10.54,22 C15.77,22,17.37,17.85,19.98,17.85 C19.98,17.85,19.99,17.85,20,17.85 C20.01,17.85,20.02,17.85,20.02,17.85 C22.63,17.85,24.23,22,29.46,22 C34.68,22,38,18.41,38,12 C38,3.61,31.61,2,20.02,2 C20.02,2,20.01,2,20,2 C20,2,20,2,20,2 z"/></g><path style="fill:#fbed21;fill-rule:evenodd;" d="M12.2,19.84 C15.79,19.39,17.07,16.46,19.07,16.46 C19.07,16.46,19.08,16.46,19.09,16.46 C19.09,16.46,19.1,16.46,19.11,16.46 C19.44,16.46,19.75,16.54,20.06,16.68 C20.37,16.54,20.68,16.46,21.01,16.46 C21.02,16.46,21.02,16.46,21.03,16.46 C21.04,16.46,21.04,16.46,21.05,16.46 C23.05,16.46,24.33,19.39,27.92,19.84 C31.66,19.4,33.98,16.5,33.98,11.62 C33.98,4.91,29.04,3.44,20.06,3.35 C11.07,3.44,6.14,4.91,6.14,11.62 C6.14,16.5,8.46,19.4,12.2,19.84 z"/><path style="fill:#8cc63f;fill-rule:evenodd;" d="M12.2,19.84 C12.52,19.87,12.86,19.89,13.21,19.89 C16.86,19.89,18.37,17.43,20.06,16.68 C19.75,16.54,19.44,16.46,19.11,16.46 C19.1,16.46,19.09,16.46,19.09,16.46 C19.08,16.46,19.07,16.46,19.07,16.46 C17.07,16.46,15.79,19.39,12.2,19.84 z"/><path style="fill:#8cc63f;fill-rule:evenodd;" d="M20.06,3.35 C20.37,3.35,20.69,3.35,21.01,3.35 C21.02,3.35,21.02,3.35,21.03,3.35 C21.03,3.35,21.03,3.35,21.03,3.35 C21.04,3.35,21.04,3.35,21.05,3.35 C30.64,3.35,35.92,4.68,35.92,11.62 C35.92,16.92,33.18,19.89,28.86,19.89 C28.53,19.89,28.22,19.87,27.92,19.84 C31.66,19.4,33.98,16.5,33.98,11.62 C33.98,4.91,29.04,3.44,20.06,3.35 C20.06,3.35,20.06,3.35,20.06,3.35 z"/><path style="fill:#ff1c23;fill-rule:evenodd;" d="M20.06,16.68 C21.74,17.43,23.25,19.89,26.91,19.89 C27.26,19.89,27.59,19.87,27.92,19.84 C24.33,19.39,23.05,16.46,21.05,16.46 C21.04,16.46,21.04,16.46,21.03,16.46 C21.02,16.46,21.02,16.46,21.01,16.46 C20.68,16.46,20.37,16.54,20.06,16.68 z"/><path style="fill:#ff1c23;fill-rule:evenodd;" d="M12.2,19.84 C11.9,19.87,11.59,19.89,11.26,19.89 C6.94,19.89,4.19,16.92,4.19,11.62 C4.19,4.68,9.48,3.35,19.07,3.35 C19.07,3.35,19.08,3.35,19.09,3.35 C19.09,3.35,19.09,3.35,19.09,3.35 C19.09,3.35,19.1,3.35,19.11,3.35 C19.43,3.35,19.75,3.35,20.06,3.35 C11.07,3.44,6.14,4.91,6.14,11.62 C6.14,16.5,8.46,19.4,12.2,19.84 z"/></g><g><path style="fill:#8cc63e;fill-rule:nonzero;" d="M22.55,8.63 C22.55,9.05,22.55,9.46,22.55,9.88 C22.54,10.25,22.85,10.56,23.2,10.55 C23.54,10.56,23.85,10.25,23.85,9.88 C23.85,9.46,23.85,9.05,23.85,8.63 C23.85,8.26,23.54,7.95,23.2,7.96 C22.85,7.95,22.54,8.26,22.55,8.63 z"/><path style="fill:#8cc63e;fill-rule:nonzero;" d="M17.32,8.63 C17.32,9.05,17.32,9.46,17.32,9.88 C17.31,10.25,17.62,10.56,17.97,10.55 C18.31,10.56,18.62,10.25,18.62,9.88 C18.62,9.46,18.62,9.05,18.62,8.63 C18.62,8.26,18.31,7.95,17.97,7.96 C17.62,7.95,17.31,8.26,17.32,8.63 z"/><path style="fill:#8cc63e;fill-rule:nonzero;" d="M19.99,4.39 C19.99,8.09,19.99,11.8,19.99,15.5 C19.99,15.87,20.3,16.18,20.64,16.17 C20.99,16.18,21.3,15.87,21.29,15.5 C21.29,11.8,21.29,8.09,21.29,4.39 C21.3,4.02,20.99,3.71,20.64,3.72 C20.3,3.71,19.99,4.02,19.99,4.39 z"/><path style="fill:#fe1a22;fill-rule:nonzero;" d="M21.43,8.63 C21.43,9.05,21.43,9.46,21.43,9.88 C21.42,10.25,21.73,10.56,22.08,10.55 C22.42,10.56,22.73,10.25,22.73,9.88 C22.73,9.46,22.73,9.05,22.73,8.63 C22.73,8.26,22.42,7.95,22.08,7.96 C21.73,7.95,21.42,8.26,21.43,8.63 z"/><path style="fill:#fe1a22;fill-rule:nonzero;" d="M16.2,8.63 C16.2,9.05,16.2,9.46,16.2,9.88 C16.19,10.25,16.5,10.56,16.85,10.55 C17.19,10.56,17.5,10.25,17.5,9.88 C17.5,9.46,17.5,9.05,17.5,8.63 C17.5,8.26,17.19,7.95,16.85,7.96 C16.5,7.95,16.19,8.26,16.2,8.63 z"/><path style="fill:#fe1a22;fill-rule:nonzero;" d="M18.87,4.39 C18.87,8.09,18.87,11.8,18.87,15.5 C18.87,15.87,19.18,16.18,19.52,16.17 C19.86,16.18,20.18,15.87,20.17,15.5 C20.17,11.8,20.17,8.09,20.17,4.39 C20.18,4.02,19.86,3.71,19.52,3.72 C19.18,3.71,18.87,4.02,18.87,4.39 z"/><path style="fill:#000000;fill-rule:nonzero;" d="M21.97,8.63 C21.97,9.05,21.97,9.46,21.97,9.88 C21.97,10.25,22.28,10.56,22.62,10.55 C22.97,10.56,23.28,10.25,23.27,9.88 C23.27,9.46,23.27,9.05,23.27,8.63 C23.28,8.26,22.97,7.95,22.62,7.96 C22.28,7.95,21.97,8.26,21.97,8.63 z"/><path style="fill:#000000;fill-rule:nonzero;" d="M16.74,8.63 C16.74,9.05,16.74,9.46,16.74,9.88 C16.74,10.25,17.05,10.56,17.39,10.55 C17.74,10.56,18.05,10.25,18.04,9.88 C18.04,9.46,18.04,9.05,18.04,8.63 C18.05,8.26,17.74,7.95,17.39,7.96 C17.05,7.95,16.74,8.26,16.74,8.63 z"/><path style="fill:#000000;fill-rule:nonzero;" d="M19.41,4.39 C19.41,8.09,19.41,11.8,19.41,15.5 C19.41,15.87,19.72,16.18,20.07,16.17 C20.41,16.18,20.72,15.87,20.72,15.5 C20.72,11.8,20.72,8.09,20.72,4.39 C20.72,4.02,20.41,3.71,20.07,3.72 C19.72,3.71,19.41,4.02,19.41,4.39 z"/></g></g></svg> ',tosiFavicon:'<svg class="color" viewBox="0 0 48 48"><g><g><path style="fill:#ed247b;fill-rule:evenodd;stroke:none;" d="M1,9 C1,4.58,4.58,1,9,1 C9,1,39,1,39,1 C43.42,1,47,4.58,47,9 C47,9,47,39,47,39 C47,43.42,43.42,47,39,47 C39,47,9,47,9,47 C4.58,47,1,43.42,1,39 C1,39,1,9,1,9 z"/><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M16,29 C16,29,10,31,10,35 C10,39,16,39,16,39"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M32,29 C32,29,38,31,38,35 C38,39,32,39,32,39"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M9,10.18 C9,7.87,10.79,6,13,6 C13,6,35,6,35,6 C37.21,6,39,7.87,39,10.18 C39,10.18,39,24.82,39,24.82 C39,27.13,37.21,29,35,29 C35,29,13,29,13,29 C10.79,29,9,27.13,9,24.82 C9,24.82,9,10.18,9,10.18 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M24,11 C24,11,24,23,24,23"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M28,15 C28,15,28,17,28,17"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20,15 C20,15,20,17,20,17"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M32,43 C32,43,30,41,30,41 C30,41,28,43,28,43"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20,43 C20,43,18,41,18,41 C18,41,16,43,16,43"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M16,29 C16,29,32,29,32,29 C32,29,32,39,32,39 C32,39,16,39,16,39 C16,39,16,29,16,29 z"/></g></g></g></svg> ',tosiPlatform:'<svg class="color" viewBox="0 0 48 48"><g><g><g><path style="fill:#3ea9f5;fill-rule:evenodd;stroke:none;" d="M23.97,47 C23.97,47,39,47,39,47 C43.42,47,47,43.42,47,39 C47,39,47,9,47,9 C47,4.58,43.42,1,39,1 C39,1,9,1,9,1 C4.58,1,1,4.58,1,9 C1,9,1,39,1,39 C1,41.64,2.28,43.98,4.25,45.44 C4.09,44.82,4,44.17,4,43.5 C4,39.36,7.36,36,11.5,36 C15.14,36,18.18,38.6,18.86,42.05 C19.07,42.02,19.28,42,19.5,42 C21.99,42,24,44.01,24,46.5 C24,46.67,23.99,46.84,23.97,47 z"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:none;" d="M4.25,45.44 C4.09,44.82,4,44.17,4,43.5 C4,39.36,7.36,36,11.5,36 C15.14,36,18.18,38.6,18.86,42.05 C19.07,42.02,19.28,42,19.5,42 C21.99,42,24,44.01,24,46.5 C24,46.67,23.99,46.84,23.97,47 C23.97,47,9,47,9,47 C7.22,47,5.58,46.42,4.25,45.44 z"/></g><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M35,35 C35,35,32.17,35,32.17,35 C32.17,35,32.17,37.83,32.17,37.83"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M31,39 C31,39,28.17,39,28.17,39 C28.17,39,28.17,41.83,28.17,41.83"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M7.48,16 C4.45,16,2,18.45,2,21.48 C2,21.48,2,21.48,2,21.48 C2,23.98,4.02,26,6.52,26 C6.52,26,6.62,26,6.62,26 C7.38,26,8,26.62,8,27.38 C8,27.38,8,27.38,8,27.38 C8,29.93,10.07,32,12.62,32 C12.62,32,16,32,16,32 C18.58,32,20.68,29.91,20.68,27.32 C20.68,27.32,20.68,21.42,20.68,21.42 C20.68,18.43,18.25,16,15.26,16 C15.26,16,7.48,16,7.48,16 z"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M17,29 C17,29,33,29,33,29 C33,29,33,29,33,29 C33,34.52,28.52,39,23,39 C23,39,23,39,23,39 C19.69,39,17,36.31,17,33 C17,33,17,29,17,29 z"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M40.52,16 C43.55,16,46,18.45,46,21.48 C46,21.48,46,21.48,46,21.48 C46,23.98,43.98,26,41.48,26 C41.48,26,41.38,26,41.38,26 C40.62,26,40,26.62,40,27.38 C40,27.38,40,27.38,40,27.38 C40,29.93,37.93,32,35.38,32 C35.38,32,32,32,32,32 C29.42,32,27.32,29.91,27.32,27.32 C27.32,27.32,27.32,21.42,27.32,21.42 C27.32,18.43,29.75,16,32.74,16 C32.74,16,40.52,16,40.52,16 z"/><g><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M6,10.18 C6,7.87,7.79,6,10,6 C10,6,32,6,32,6 C34.21,6,36,7.87,36,10.18 C36,10.18,36,24.82,36,24.82 C36,27.13,34.21,29,32,29 C32,29,10,29,10,29 C7.79,29,6,27.13,6,24.82 C6,24.82,6,10.18,6,10.18 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M21,11 C21,11,21,23,21,23"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M25,15 C25,15,25,17,25,17"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M17,15 C17,15,17,17,17,17"/></g></g></g></svg> ',tosiUi:'<svg class="color" viewBox="0 0 48 48"><g><g><g><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M3,33 C3,31.9,3.9,31,5,31 C5,31,43,31,43,31 C44.1,31,45,31.9,45,33 C45,33,45,43,45,43 C45,44.1,44.1,45,43,45 C43,45,5,45,5,45 C3.9,45,3,44.1,3,43 C3,43,3,33,3,33 z"/><g><path style="fill:#ffffff;fill-rule:evenodd;stroke:#ed247b;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M7,35 C7,35,7,36.34,7,38 C7,39.66,8.34,41,10,41 C11.66,41,13,39.66,13,38 C13,36.34,13,35,13,35"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#ed247b;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M17,35 C17,35,17,41,17,41"/></g><g><path style="fill:#ed247b;fill-rule:evenodd;stroke:none;" d="M38,33 C40.76,33,43,35.24,43,38 C43,40.76,40.76,43,38,43 C35.24,43,33,40.76,33,38 C33,35.24,35.24,33,38,33 z"/><path style="fill:#ed247b;fill-rule:nonzero;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M40,36 C40,36,36,40,36,40"/><path style="fill:#ed247b;fill-rule:nonzero;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M36,36 C36,36,40,40,40,40"/></g></g><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M15.97,21.01 C15.97,21.01,9.97,23.01,9.97,27.01 C9.97,31.01,15.97,31.01,15.97,31.01"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M31.97,21.01 C31.97,21.01,37.97,23.01,37.97,27.01 C37.97,31.01,31.97,31.01,31.97,31.01"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M31,33 C31,33,29.49,31,29.49,31 C29.49,31,27.97,33,27.97,33"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M19.97,33 C19.97,33,17.97,31,17.97,31 C17.97,31,15.97,33,15.97,33"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M15.97,21 C15.97,21,31.97,21,31.97,21 C31.97,21,31.97,31,31.97,31 C31.97,31,15.97,31,15.97,31 C15.97,31,15.97,21,15.97,21 z"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M9,7.18 C9,4.87,10.79,3,13,3 C13,3,35.02,3,35.02,3 C37.23,3,39.03,4.87,39.03,7.18 C39.03,7.18,39.03,21.82,39.03,21.82 C39.03,24.13,37.23,26,35.02,26 C35.02,26,13,26,13,26 C10.79,26,9,24.13,9,21.82 C9,21.82,9,7.18,9,7.18 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M24,11 C24,11,24,23,24,23"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M28,15 C28,15,28,17,28,17"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20,15 C20,15,20,17,20,17"/></g></g></g></svg> ',tosiXr:'<svg class="color" viewBox="0 0 24 24"><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M8,14.25 C8,14.25,5,15.25,5,17.25 C5,19.25,8,19.25,8,19.25"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M16,14.25 C16,14.25,19,15.25,19,17.25 C19,19.25,16,19.25,16,19.25"/><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M4.5,4.85 C4.5,3.69,5.4,2.75,6.5,2.75 C6.5,2.75,17.5,2.75,17.5,2.75 C18.61,2.75,19.5,3.69,19.5,4.85 C19.5,4.85,19.5,12.16,19.5,12.16 C19.5,13.32,18.61,14.25,17.5,14.25 C17.5,14.25,6.5,14.25,6.5,14.25 C5.4,14.25,4.5,13.32,4.5,12.16 C4.5,12.16,4.5,4.85,4.5,4.85 z"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M12,5.25 C12,5.25,12,11.25,12,11.25"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M14,7.25 C14,7.25,14,8.25,14,8.25"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M10,7.25 C10,7.25,10,8.25,10,8.25"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M16,21.25 C16,21.25,15,20.25,15,20.25 C15,20.25,14,21.25,14,21.25"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M10,21.25 C10,21.25,9,20.25,9,20.25 C9,20.25,8,21.25,8,21.25"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1;" d="M8,14.25 C8,14.25,16,14.25,16,14.25 C16,14.25,16,19.25,16,19.25 C16,19.25,8,19.25,8,19.25 C8,19.25,8,14.25,8,14.25 z"/><path style="fill:#ff7bac;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-width:1;" d="M12,4 C12,4,11.99,4,11.99,4 C6.19,4,3,4.73,3,8.5 C3,11.39,4.66,13,7.27,13 C9.88,13,10.68,11.13,11.99,11.13 C11.99,11.13,12,11.13,12,11.13 C12,11.13,12.01,11.13,12.01,11.13 C13.32,11.13,14.12,13,16.73,13 C19.34,13,21,11.39,21,8.5 C21,4.73,17.81,4,12.01,4 C12.01,4,12,4,12,4 C12,4,12,4,12,4 z"/></g></svg> ',tosi:'<svg class="color" viewBox="0 0 48 48"><g><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M38.35,31.7 C39.78,34.37,38.78,37.69,36.11,39.13 C36.11,39.13,36.11,39.13,36.11,39.13 C33.92,40.31,31.18,39.48,29.99,37.29 C29.99,37.29,29.95,37.2,29.95,37.2 C29.58,36.53,28.75,36.27,28.08,36.64 C28.08,36.64,28.08,36.64,28.08,36.64 C25.83,37.84,23.03,37,21.82,34.76 C21.82,34.76,20.22,31.78,20.22,31.78 C18.99,29.5,19.85,26.67,22.12,25.44 C22.12,25.44,27.32,22.65,27.32,22.65 C29.96,21.23,33.24,22.22,34.66,24.85 C34.66,24.85,38.35,31.7,38.35,31.7 z"/><path style="fill:#9e9e9e;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M10.65,31.7 C9.22,34.37,10.22,37.69,12.89,39.13 C12.89,39.13,12.89,39.13,12.89,39.13 C15.08,40.31,17.82,39.48,19.01,37.29 C19.01,37.29,19.05,37.2,19.05,37.2 C19.42,36.53,20.25,36.27,20.92,36.64 C20.92,36.64,20.92,36.64,20.92,36.64 C23.17,37.84,25.97,37,27.18,34.76 C27.18,34.76,28.78,31.78,28.78,31.78 C30.01,29.5,29.15,26.67,26.88,25.44 C26.88,25.44,21.68,22.65,21.68,22.65 C19.04,21.23,15.76,22.22,14.34,24.85 C14.34,24.85,10.65,31.7,10.65,31.7 z"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M32.5,43 C32.5,43,30.5,41,30.5,41 C30.5,41,28.5,43,28.5,43"/><path style="fill:none;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20.5,43 C20.5,43,18.5,41,18.5,41 C18.5,41,16.5,43,16.5,43"/><path style="fill:#e4e4e4;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M16.5,29 C16.5,29,32.5,29,32.5,29 C32.5,29,32.5,36,32.5,36 C32.5,37.66,31.16,39,29.5,39 C29.5,39,19.5,39,19.5,39 C17.84,39,16.5,37.66,16.5,36 C16.5,36,16.5,29,16.5,29 z"/><g><path style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M9.5,10.18 C9.5,7.87,11.29,6,13.5,6 C13.5,6,35.5,6,35.5,6 C37.71,6,39.5,7.87,39.5,10.18 C39.5,10.18,39.5,24.82,39.5,24.82 C39.5,27.13,37.71,29,35.5,29 C35.5,29,13.5,29,13.5,29 C11.29,29,9.5,27.13,9.5,24.82 C9.5,24.82,9.5,10.18,9.5,10.18 z"/><g><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M24.5,11 C24.5,11,24.5,23,24.5,23"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M28.5,15 C28.5,15,28.5,17,28.5,17"/><path style="fill:#ffffff;fill-rule:nonzero;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2;" d="M20.5,15 C20.5,15,20.5,17,20.5,17"/></g></g></g></svg> ',discord:'<svg class="filled" version="1" viewBox="0 0 1013 768"><path d="M858 64c-60-28-131-51-204-64l-5-1c-8 14-17 32-25 51l-1 4c-35-6-75-9-116-9s-81 3-120 9l4-1c-9-22-18-40-28-57l1 3c-79 14-149 36-214 67l5-2c-132 196-168 387-150 575v0c73 55 158 99 250 127l6 2c19-26 38-55 53-85l2-3c-33-13-62-27-89-43l2 1c7-5 14-11 21-16 75 36 163 57 256 57s181-21 260-59l-4 2c7 6 14 11 21 16-25 15-53 29-83 40l-4 1c17 34 36 63 56 90l-1-2c98-30 183-74 259-130l-2 2c21-218-36-407-151-575zM338 524c-50 0-91-45-91-101s40-102 91-102 92 46 91 102-40 101-91 101zM675 524c-50 0-91-45-91-101s40-102 91-102 92 46 91 102-40 101-91 101z"></path></svg> ',facebook:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg>',game:'<svg class="filled" version="1" viewBox="0 0 704 512"><path d="M528 97v-1h-336c-88 0-160 72-160 160s72 160 160 160c52 0 99-25 128-64h64c29 39 76 64 128 64 88 0 160-72 160-160 0-83-63-151-144-159zM288 288h-64v64h-64v-64h-64v-64h64v-64h64v64h64v64zM480 288c-18 0-32-14-32-32s14-32 32-32 32 14 32 32-14 32-32 32zM576 288c-18 0-32-14-32-32 0-18 14-32 32-32s32 14 32 32c0 18-14 32-32 32z"></path></svg> ',google:'<svg class="filled" version="1" viewBox="0 0 512 512"><path d="M256 0c-141 0-256 115-256 256s115 256 256 256 256-115 256-256-115-256-256-256zM260 448c-106 0-192-86-192-192s86-192 192-192c52 0 95 19 129 50l-52 50c-14-14-39-30-77-30-66 0-119 54-119 121s54 121 119 121c76 0 105-55 109-83h-109v-66h181c2 10 3 19 3 32 0 110-73 188-184 188z"></path></svg> ',npm:'<svg class="filled" version="1" viewBox="0 0 512 512"><path d="M0 0v512h512v-512h-512zM416 416h-64v-256h-96v256h-160v-320h320v320z"></path></svg> ',youtube:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"></path><polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"></polygon></svg>',blog:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,10.02 C21,10.02,21,15,21,15 C21,15.53,20.79,16.04,20.41,16.41 C20.04,16.79,19.53,17,19,17 C19,17,7,17,7,17 C5.67,18.33,4.33,19.67,3,21 C3,21,3,5,3,5 C3,4.47,3.21,3.96,3.59,3.59 C3.96,3.21,4.47,3,5,3 C8.53,3,10.49,3,14.02,3"/><path style="" d="M19,2 C19.54,1.46,20.32,1.25,21.05,1.45 C21.78,1.65,22.35,2.22,22.55,2.95 C22.75,3.68,22.54,4.46,22,5 C22,5,15.5,11.5,15.5,11.5 C14.17,11.83,12.83,12.17,11.5,12.5 C11.83,11.17,12.17,9.83,12.5,8.5 C15.67,5.33,15.83,5.17,19,2 z"/><path style="" d="M14.6,3"/><path style="" d="M21,8.77"/><path style="" d="M7,7 C7,7,10,7,10,7"/><path style="" d="M7,10 C7,10,9,10,9,10"/></g></svg> ',bug:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M8,6 C8,3.79,9.79,2,12,2 C14.21,2,16,3.79,16,6 C16,6,8,6,8,6 z"/><path style="" d="M20,7 C20,7,18,9,18,9"/><path style="" d="M20,19 C20,19,18,17,18,17"/><path style="" d="M21,13 C21,13,18,13,18,13"/><path style="" d="M16.44,9 C17.3,9,18,9.7,18,10.56 C18,10.56,18,15,18,15 C18,18.31,15.31,21,12,21 C8.69,21,6,18.31,6,15 C6,15,6,10.56,6,10.56 C6,9.7,6.7,9,7.56,9 C7.56,9,16.44,9,16.44,9 z"/><path style="" d="M4,7 C4,7,6,9,6,9"/><path style="" d="M4,19 C4,19,6,17,6,17"/><path style="" d="M3,13 C3,13,6,13,6,13"/><path style="" d="M12,12 C12,12,12,17,12,17"/></g></svg> ',activity:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg>',airplay:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg>',alertCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>',alertOctagon:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>',alertTriangle:'<svg class="stroked" viewBox="0 0 24 24"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',alignCenter:'<svg class="stroked" viewBox="0 0 24 24"><line x1="18" y1="10" x2="6" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="18" y1="18" x2="6" y2="18"></line></svg>',alignJustify:'<svg class="stroked" viewBox="0 0 24 24"><line x1="21" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="3" y2="18"></line></svg>',alignLeft:'<svg class="stroked" viewBox="0 0 24 24"><line x1="17" y1="10" x2="3" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="17" y1="18" x2="3" y2="18"></line></svg>',alignRight:'<svg class="stroked" viewBox="0 0 24 24"><line x1="21" y1="10" x2="7" y2="10"></line><line x1="21" y1="6" x2="3" y2="6"></line><line x1="21" y1="14" x2="3" y2="14"></line><line x1="21" y1="18" x2="7" y2="18"></line></svg>',anchor:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="5" r="3"></circle><line x1="12" y1="22" x2="12" y2="8"></line><path d="M5 12H2a10 10 0 0 0 20 0h-3"></path></svg>',aperture:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="14.31" y1="8" x2="20.05" y2="17.94"></line><line x1="9.69" y1="8" x2="21.17" y2="8"></line><line x1="7.38" y1="12" x2="13.12" y2="2.06"></line><line x1="9.69" y1="16" x2="3.95" y2="6.06"></line><line x1="14.31" y1="16" x2="2.83" y2="16"></line><line x1="16.62" y1="12" x2="10.88" y2="21.94"></line></svg>',archive:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line></svg>',arrowUpRight:'<svg class="stroked" viewBox="0 0 24 24"><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"></polyline></svg>',atSign:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"></circle><path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"></path></svg>',award:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="8" r="7"></circle><polyline points="8.21 13.89 7 23 12 20 17 23 15.79 13.88"></polyline></svg>',barChart2:'<svg class="stroked" viewBox="0 0 24 24"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line></svg>',barChart:'<svg class="stroked" viewBox="0 0 24 24"><line x1="12" y1="20" x2="12" y2="10"></line><line x1="18" y1="20" x2="18" y2="4"></line><line x1="6" y1="20" x2="6" y2="16"></line></svg>',batteryCharging:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 18H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3.19M15 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-3.19"></path><line x1="23" y1="13" x2="23" y2="11"></line><polyline points="11 6 7 12 13 12 9 18"></polyline></svg>',battery:'<svg class="stroked" viewBox="0 0 24 24"><rect x="1" y="6" width="18" height="12" rx="2" ry="2"></rect><line x1="23" y1="13" x2="23" y2="11"></line></svg>',bellOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M13.73 21a2 2 0 0 1-3.46 0"></path><path d="M18.63 13A17.89 17.89 0 0 1 18 8"></path><path d="M6.26 6.26A5.86 5.86 0 0 0 6 8c0 7-3 9-3 9h14"></path><path d="M18 8a6 6 0 0 0-9.33-5"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',bell:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"></path><path d="M13.73 21a2 2 0 0 1-3.46 0"></path></svg>',bluetooth:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="6.5 6.5 17.5 17.5 12 23 12 1 17.5 6.5 6.5 17.5"></polyline></svg>',bold:'<svg class="stroked" viewBox="0 0 24 24"><path d="M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"></path><path d="M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"></path></svg>',bookOpen:'<svg class="stroked" viewBox="0 0 24 24"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg>',book:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path></svg>',bookmark:'<svg class="stroked" viewBox="0 0 24 24"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path></svg>',box:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>',briefcase:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"></rect><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"></path></svg>',calendar:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>',cameraOff:'<svg class="stroked" viewBox="0 0 24 24"><line x1="1" y1="1" x2="23" y2="23"></line><path d="M21 21H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3m3-3h6l2 3h4a2 2 0 0 1 2 2v9.34m-7.72-2.06a4 4 0 1 1-5.56-5.56"></path></svg>',camera:'<svg class="stroked" viewBox="0 0 24 24"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path><circle cx="12" cy="13" r="4"></circle></svg>',cast:'<svg class="stroked" viewBox="0 0 24 24"><path d="M2 16.1A5 5 0 0 1 5.9 20M2 12.05A9 9 0 0 1 9.95 20M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"></path><line x1="2" y1="20" x2="2.01" y2="20"></line></svg>',checkCircle:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>',checkSquare:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="9 11 12 14 22 4"></polyline><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg>',check:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"></polyline></svg>',chrome:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="21.17" y1="8" x2="12" y2="8"></line><line x1="3.95" y1="6.06" x2="8.54" y2="14"></line><line x1="10.88" y1="21.94" x2="15.46" y2="14"></line></svg>',circle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle></svg>',clipboard:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path><rect x="8" y="2" width="8" height="4" rx="1" ry="1"></rect></svg>',clock:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>',cloudDrizzle:'<svg class="stroked" viewBox="0 0 24 24"><line x1="8" y1="19" x2="8" y2="21"></line><line x1="8" y1="13" x2="8" y2="15"></line><line x1="16" y1="19" x2="16" y2="21"></line><line x1="16" y1="13" x2="16" y2="15"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="12" y1="15" x2="12" y2="17"></line><path d="M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25"></path></svg>',cloudLightning:'<svg class="stroked" viewBox="0 0 24 24"><path d="M19 16.9A5 5 0 0 0 18 7h-1.26a8 8 0 1 0-11.62 9"></path><polyline points="13 11 9 17 15 17 11 23"></polyline></svg>',cloudOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',cloudRain:'<svg class="stroked" viewBox="0 0 24 24"><line x1="16" y1="13" x2="16" y2="21"></line><line x1="8" y1="13" x2="8" y2="21"></line><line x1="12" y1="15" x2="12" y2="23"></line><path d="M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25"></path></svg>',cloudSnow:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20 17.58A5 5 0 0 0 18 8h-1.26A8 8 0 1 0 4 16.25"></path><line x1="8" y1="16" x2="8.01" y2="16"></line><line x1="8" y1="20" x2="8.01" y2="20"></line><line x1="12" y1="18" x2="12.01" y2="18"></line><line x1="12" y1="22" x2="12.01" y2="22"></line><line x1="16" y1="16" x2="16.01" y2="16"></line><line x1="16" y1="20" x2="16.01" y2="20"></line></svg>',cloud:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"></path></svg>',code:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>',codepen:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2"></polygon><line x1="12" y1="22" x2="12" y2="15.5"></line><polyline points="22 8.5 12 15.5 2 8.5"></polyline><polyline points="2 15.5 12 8.5 22 15.5"></polyline><line x1="12" y1="2" x2="12" y2="8.5"></line></svg>',codesandbox:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="7.5 4.21 12 6.81 16.5 4.21"></polyline><polyline points="7.5 19.79 7.5 14.6 3 12"></polyline><polyline points="21 12 16.5 14.6 16.5 19.79"></polyline><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>',coffee:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 8h1a4 4 0 0 1 0 8h-1"></path><path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z"></path><line x1="6" y1="1" x2="6" y2="4"></line><line x1="10" y1="1" x2="10" y2="4"></line><line x1="14" y1="1" x2="14" y2="4"></line></svg>',columns:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 3h7a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-7m0-18H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7m0-18v18"></path></svg>',command:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"></path></svg>',compass:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"></polygon></svg>',copy:'<svg class="stroked" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>',cpu:'<svg class="stroked" viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect><rect x="9" y="9" width="6" height="6"></rect><line x1="9" y1="1" x2="9" y2="4"></line><line x1="15" y1="1" x2="15" y2="4"></line><line x1="9" y1="20" x2="9" y2="23"></line><line x1="15" y1="20" x2="15" y2="23"></line><line x1="20" y1="9" x2="23" y2="9"></line><line x1="20" y1="14" x2="23" y2="14"></line><line x1="1" y1="9" x2="4" y2="9"></line><line x1="1" y1="14" x2="4" y2="14"></line></svg>',creditCard:'<svg class="stroked" viewBox="0 0 24 24"><rect x="1" y="4" width="22" height="16" rx="2" ry="2"></rect><line x1="1" y1="10" x2="23" y2="10"></line></svg>',crop:'<svg class="stroked" viewBox="0 0 24 24"><path d="M6.13 1L6 16a2 2 0 0 0 2 2h15"></path><path d="M1 6.13L16 6a2 2 0 0 1 2 2v15"></path></svg>',crosshair:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="22" y1="12" x2="18" y2="12"></line><line x1="6" y1="12" x2="2" y2="12"></line><line x1="12" y1="6" x2="12" y2="2"></line><line x1="12" y1="22" x2="12" y2="18"></line></svg>',database:'<svg class="stroked" viewBox="0 0 24 24"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"></path><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"></path></svg>',delete:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"></path><line x1="18" y1="9" x2="12" y2="15"></line><line x1="12" y1="9" x2="18" y2="15"></line></svg>',disc:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="3"></circle></svg>',divideCircle:'<svg class="stroked" viewBox="0 0 24 24"><line x1="8" y1="12" x2="16" y2="12"></line><line x1="12" y1="16" x2="12" y2="16"></line><line x1="12" y1="8" x2="12" y2="8"></line><circle cx="12" cy="12" r="10"></circle></svg>',divideSquare:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="8" y1="12" x2="16" y2="12"></line><line x1="12" y1="16" x2="12" y2="16"></line><line x1="12" y1="8" x2="12" y2="8"></line></svg>',divide:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="6" r="2"></circle><line x1="5" y1="12" x2="19" y2="12"></line><circle cx="12" cy="18" r="2"></circle></svg>',dollarSign:'<svg class="stroked" viewBox="0 0 24 24"><line x1="12" y1="1" x2="12" y2="23"></line><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg>',downloadCloud:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="8 17 12 21 16 17"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"></path></svg>',download:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>',dribbble:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M8.56 2.75c4.37 6.03 6.02 9.42 8.03 17.72m2.54-15.38c-3.72 4.35-8.94 5.66-16.88 5.85m19.5 1.9c-3.5-.93-6.63-.82-8.94 0-2.58.92-5.01 2.86-7.44 6.32"></path></svg>',droplet:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"></path></svg>',edit2:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>',edit3:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 20h9"></path><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>',edit:'<svg class="stroked" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>',externalLink:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>',eyeOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',eye:'<svg class="stroked" viewBox="0 0 24 24"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>',fastForward:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="13 19 22 12 13 5 13 19"></polygon><polygon points="2 19 11 12 2 5 2 19"></polygon></svg>',feather:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z"></path><line x1="16" y1="8" x2="2" y2="22"></line><line x1="17.5" y1="15" x2="9" y2="15"></line></svg>',figma:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 5.5A3.5 3.5 0 0 1 8.5 2H12v7H8.5A3.5 3.5 0 0 1 5 5.5z"></path><path d="M12 2h3.5a3.5 3.5 0 1 1 0 7H12V2z"></path><path d="M12 12.5a3.5 3.5 0 1 1 7 0 3.5 3.5 0 1 1-7 0z"></path><path d="M5 19.5A3.5 3.5 0 0 1 8.5 16H12v3.5a3.5 3.5 0 1 1-7 0z"></path><path d="M5 12.5A3.5 3.5 0 0 1 8.5 9H12v7H8.5A3.5 3.5 0 0 1 5 12.5z"></path></svg>',fileMinus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="9" y1="15" x2="15" y2="15"></line></svg>',filePlus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="12" y1="18" x2="12" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></svg>',fileText:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg>',file:'<svg class="stroked" viewBox="0 0 24 24"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg>',film:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="2.18" ry="2.18"></rect><line x1="7" y1="2" x2="7" y2="22"></line><line x1="17" y1="2" x2="17" y2="22"></line><line x1="2" y1="12" x2="22" y2="12"></line><line x1="2" y1="7" x2="7" y2="7"></line><line x1="2" y1="17" x2="7" y2="17"></line><line x1="17" y1="17" x2="22" y2="17"></line><line x1="17" y1="7" x2="22" y2="7"></line></svg>',filter:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"></polygon></svg>',flag:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path><line x1="4" y1="22" x2="4" y2="15"></line></svg>',folderMinus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path><line x1="9" y1="14" x2="15" y2="14"></line></svg>',folderPlus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path><line x1="12" y1="11" x2="12" y2="17"></line><line x1="9" y1="14" x2="15" y2="14"></line></svg>',folder:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg>',framer:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 16V9h14V2H5l14 14h-7m-7 0l7 7v-7m-7 0h7"></path></svg>',frown:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M16 16s-1.5-2-4-2-4 2-4 2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line></svg>',gift:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="20 12 20 22 4 22 4 12"></polyline><rect x="2" y="7" width="20" height="5"></rect><line x1="12" y1="22" x2="12" y2="7"></line><path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"></path><path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"></path></svg>',gitBranch:'<svg class="stroked" viewBox="0 0 24 24"><line x1="6" y1="3" x2="6" y2="15"></line><circle cx="18" cy="6" r="3"></circle><circle cx="6" cy="18" r="3"></circle><path d="M18 9a9 9 0 0 1-9 9"></path></svg>',gitCommit:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg>',gitMerge:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="18" cy="18" r="3"></circle><circle cx="6" cy="6" r="3"></circle><path d="M6 21V9a9 9 0 0 0 9 9"></path></svg>',gitPullRequest:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="18" cy="18" r="3"></circle><circle cx="6" cy="6" r="3"></circle><path d="M13 6h3a2 2 0 0 1 2 2v7"></path><line x1="6" y1="9" x2="6" y2="21"></line></svg>',github:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>',gitlab:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"></path></svg>',globe:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>',grid:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>',hardDrive:'<svg class="stroked" viewBox="0 0 24 24"><line x1="22" y1="12" x2="2" y2="12"></line><path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"></path><line x1="6" y1="16" x2="6.01" y2="16"></line><line x1="10" y1="16" x2="10.01" y2="16"></line></svg>',hash:'<svg class="stroked" viewBox="0 0 24 24"><line x1="4" y1="9" x2="20" y2="9"></line><line x1="4" y1="15" x2="20" y2="15"></line><line x1="10" y1="3" x2="8" y2="21"></line><line x1="16" y1="3" x2="14" y2="21"></line></svg>',headphones:'<svg class="stroked" viewBox="0 0 24 24"><path d="M3 18v-6a9 9 0 0 1 18 0v6"></path><path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"></path></svg>',heart:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>',helpCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>',hexagon:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path></svg>',home:'<svg class="stroked" viewBox="0 0 24 24"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>',image:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>',inbox:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="22 12 16 12 14 15 10 15 8 12 2 12"></polyline><path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"></path></svg>',info:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12" y2="7.75"></line></svg>',instagram:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line></svg>',italic:'<svg class="stroked" viewBox="0 0 24 24"><line x1="19" y1="4" x2="10" y2="4"></line><line x1="14" y1="20" x2="5" y2="20"></line><line x1="15" y1="4" x2="9" y2="20"></line></svg>',key:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.78 7.78 5.5 5.5 0 0 1 7.78-7.78zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"></path></svg>',layers:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="12 2 2 7 12 12 22 7 12 2"></polygon><polyline points="2 17 12 22 22 17"></polyline><polyline points="2 12 12 17 22 12"></polyline></svg>',layout:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="3" y1="9" x2="21" y2="9"></line><line x1="9" y1="21" x2="9" y2="9"></line></svg>',lifeBuoy:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="4"></circle><line x1="4.93" y1="4.93" x2="9.17" y2="9.17"></line><line x1="14.83" y1="14.83" x2="19.07" y2="19.07"></line><line x1="14.83" y1="9.17" x2="19.07" y2="4.93"></line><line x1="14.83" y1="9.17" x2="18.36" y2="5.64"></line><line x1="4.93" y1="19.07" x2="9.17" y2="14.83"></line></svg>',link2:'<svg class="stroked" viewBox="0 0 24 24"><path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path><line x1="8" y1="12" x2="16" y2="12"></line></svg>',link:'<svg class="stroked" viewBox="0 0 24 24"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>',linkedin:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"></path><rect x="2" y="9" width="4" height="12"></rect><circle cx="4" cy="4" r="2"></circle></svg>',list:'<svg class="stroked" viewBox="0 0 24 24"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',loader:'<svg class="stroked" viewBox="0 0 24 24"><line x1="12" y1="2" x2="12" y2="6"></line><line x1="12" y1="18" x2="12" y2="22"></line><line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line><line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line><line x1="2" y1="12" x2="6" y2="12"></line><line x1="18" y1="12" x2="22" y2="12"></line><line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line><line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line></svg>',lock:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg> ',logIn:'<svg class="stroked" viewBox="0 0 24 24"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"></path><polyline points="10 17 15 12 10 7"></polyline><line x1="15" y1="12" x2="3" y2="12"></line></svg>',logOut:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>',mail:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>',mapPin:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>',map:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"></polygon><line x1="8" y1="2" x2="8" y2="18"></line><line x1="16" y1="6" x2="16" y2="22"></line></svg>',maximize2:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>',maximize:'<svg class="stroked" viewBox="0 0 24 24"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg>',meh:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="8" y1="15" x2="16" y2="15"></line><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line></svg>',menu:'<svg class="stroked" viewBox="0 0 24 24"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>',messageCircle:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path></svg>',messageSquare:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg>',micOff:'<svg class="stroked" viewBox="0 0 24 24"><line x1="1" y1="1" x2="23" y2="23"></line><path d="M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"></path><path d="M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line></svg>',mic:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line></svg>',minimize2:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="4 14 10 14 10 20"></polyline><polyline points="20 10 14 10 14 4"></polyline><line x1="14" y1="10" x2="21" y2="3"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg>',minimize:'<svg class="stroked" viewBox="0 0 24 24"><path d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"></path></svg>',minusCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="8" y1="12" x2="16" y2="12"></line></svg>',minusSquare:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="8" y1="12" x2="16" y2="12"></line></svg>',minus:'<svg class="stroked" viewBox="0 0 24 24"><line x1="5" y1="12" x2="19" y2="12"></line></svg>',monitor:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect><line x1="8" y1="21" x2="16" y2="21"></line><line x1="12" y1="17" x2="12" y2="21"></line></svg>',moon:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>',moreHorizontal:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg>',moreVertical:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="5" r="1"></circle><circle cx="12" cy="19" r="1"></circle></svg>',mousePointer:'<svg class="stroked" viewBox="0 0 24 24"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"></path><path d="M13 13l6 6"></path></svg>',move:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="5 9 2 12 5 15"></polyline><polyline points="9 5 12 2 15 5"></polyline><polyline points="15 19 12 22 9 19"></polyline><polyline points="19 9 22 12 19 15"></polyline><line x1="2" y1="12" x2="22" y2="12"></line><line x1="12" y1="2" x2="12" y2="22"></line></svg>',music:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9 18V5l12-2v13"></path><circle cx="6" cy="18" r="3"></circle><circle cx="18" cy="16" r="3"></circle></svg>',navigation2:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="12 2 19 21 12 17 5 21 12 2"></polygon></svg>',navigation:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="3 11 22 2 13 21 11 13 3 11"></polygon></svg>',octagon:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon></svg>',package:'<svg class="stroked" viewBox="0 0 24 24"><line x1="16.5" y1="9.4" x2="7.5" y2="4.21"></line><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg>',paperclip:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"></path></svg>',pauseCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="10" y1="15" x2="10" y2="9"></line><line x1="14" y1="15" x2="14" y2="9"></line></svg>',pause:'<svg class="stroked" viewBox="0 0 24 24"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>',penTool:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 19l7-7 3 3-7 7-3-3z"></path><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"></path><path d="M2 2l7.59 7.59"></path><circle cx="11" cy="11" r="2"></circle></svg>',percent:'<svg class="stroked" viewBox="0 0 24 24"><line x1="19" y1="5" x2="5" y2="19"></line><circle cx="6.5" cy="6.5" r="2.5"></circle><circle cx="17.5" cy="17.5" r="2.5"></circle></svg>',phoneCall:'<svg class="stroked" viewBox="0 0 24 24"><path d="M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phoneForwarded:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="19 1 23 5 19 9"></polyline><line x1="15" y1="5" x2="23" y2="5"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phoneIncoming:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="16 2 16 8 22 8"></polyline><line x1="23" y1="1" x2="16" y2="8"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phoneMissed:'<svg class="stroked" viewBox="0 0 24 24"><line x1="23" y1="1" x2="17" y2="7"></line><line x1="17" y1="1" x2="23" y2="7"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phoneOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"></path><line x1="23" y1="1" x2="1" y2="23"></line></svg>',phoneOutgoing:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 7 23 1 17 1"></polyline><line x1="16" y1="8" x2="23" y2="1"></line><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',phone:'<svg class="stroked" viewBox="0 0 24 24"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',pieChart:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21.21 15.89A10 10 0 1 1 8 2.83"></path><path d="M22 12A10 10 0 0 0 12 2v10z"></path></svg>',playCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><polygon points="10 8 16 12 10 16 10 8"></polygon></svg>',play:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',plusCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg>',plusSquare:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg>',plus:'<svg class="stroked" viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>',pocket:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 3h16a2 2 0 0 1 2 2v6a10 10 0 0 1-10 10A10 10 0 0 1 2 11V5a2 2 0 0 1 2-2z"></path><polyline points="8 10 12 14 16 10"></polyline></svg>',power:'<svg class="stroked" viewBox="0 0 24 24"><path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path><line x1="12" y1="2" x2="12" y2="12"></line></svg>',printer:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="6 9 6 2 18 2 18 9"></polyline><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path><rect x="6" y="14" width="12" height="8"></rect></svg>',radio:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="2"></circle><path d="M16.24 7.76a6 6 0 0 1 0 8.49m-8.48-.01a6 6 0 0 1 0-8.49m11.31-2.82a10 10 0 0 1 0 14.14m-14.14 0a10 10 0 0 1 0-14.14"></path></svg>',repeat:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="17 1 21 5 17 9"></polyline><path d="M3 11V9a4 4 0 0 1 4-4h14"></path><polyline points="7 23 3 19 7 15"></polyline><path d="M21 13v2a4 4 0 0 1-4 4H3"></path></svg>',rewind:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 19 2 12 11 5 11 19"></polygon><polygon points="22 19 13 12 22 5 22 19"></polygon></svg>',cornerDownRight:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="15 10 20 15 15 20"></polyline><path d="M4 4v7a4 4 0 0 0 4 4h12"></path></svg>',cornerRightDown:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="10 15 15 20 20 15"></polyline><path d="M4 4h7a4 4 0 0 1 4 4v12"></path></svg>',cornerRightUp:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="10 9 15 4 20 9"></polyline><path d="M4 20h7a4 4 0 0 0 4-4V4"></path></svg>',cornerUpRight:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="15 14 20 9 15 4"></polyline><path d="M4 20v-7a4 4 0 0 1 4-4h12"></path></svg>',refreshCw:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg>',rotateCw:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>',skipForward:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="5 4 15 12 5 20 5 4"></polygon><line x1="19" y1="5" x2="19" y2="19"></line></svg>',toggleRight:'<svg class="stroked" viewBox="0 0 24 24"><rect x="1" y="5" width="22" height="14" rx="7" ry="7"></rect><circle cx="16" cy="12" r="3"></circle></svg>',rss:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 11a9 9 0 0 1 9 9"></path><path d="M4 4a16 16 0 0 1 16 16"></path><circle cx="5" cy="19" r="1"></circle></svg>',save:'<svg class="stroked" viewBox="0 0 24 24"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"></path><polyline points="17 21 17 13 7 13 7 21"></polyline><polyline points="7 3 7 8 15 8"></polyline></svg>',scissors:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="6" cy="6" r="3"></circle><circle cx="6" cy="18" r="3"></circle><line x1="20" y1="4" x2="8.12" y2="15.88"></line><line x1="14.47" y1="14.48" x2="20" y2="20"></line><line x1="8.12" y1="8.12" x2="12" y2="12"></line></svg>',search:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',send:'<svg class="stroked" viewBox="0 0 24 24"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>',server:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6.01" y2="6"></line><line x1="6" y1="18" x2="6.01" y2="18"></line></svg>',settings:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M4.78,6.75 C6.02,7.26,7.26,6.02,6.75,4.78 C6.75,4.78,6.24,3.57,6.24,3.57 C5.93,2.8,6.29,1.92,7.06,1.6 C7.06,1.6,8.14,1.15,8.14,1.15 C8.91,0.83,9.79,1.2,10.11,1.96 C10.11,1.96,10.61,3.18,10.61,3.18 C11.12,4.42,12.88,4.42,13.39,3.18 C13.39,3.18,13.89,1.97,13.89,1.97 C14.21,1.2,15.09,0.83,15.86,1.15 C15.86,1.15,16.94,1.6,16.94,1.6 C17.71,1.92,18.08,2.8,17.76,3.57 C17.76,3.57,17.15,5.03,17.15,5.03 C16.64,6.27,17.88,7.51,19.12,7 C19.12,7,20.51,6.42,20.51,6.42 C21.28,6.1,22.16,6.47,22.47,7.23 C22.47,7.23,22.92,8.32,22.92,8.32 C23.24,9.09,22.88,9.96,22.11,10.28 C22.11,10.28,21.07,10.71,21.07,10.71 C19.83,11.23,19.83,12.98,21.07,13.49 C21.07,13.49,22.04,13.89,22.04,13.89 C22.8,14.21,23.17,15.09,22.85,15.86 C22.85,15.86,22.4,16.94,22.4,16.94 C22.08,17.71,21.2,18.07,20.43,17.76 C20.43,17.76,19.22,17.25,19.22,17.25 C17.98,16.74,16.74,17.98,17.25,19.22 C17.25,19.22,17.76,20.43,17.76,20.43 C18.07,21.2,17.71,22.08,16.94,22.4 C16.94,22.4,15.86,22.85,15.86,22.85 C15.09,23.17,14.21,22.8,13.89,22.04 C13.89,22.04,13.39,20.82,13.39,20.82 C12.88,19.58,11.12,19.58,10.61,20.82 C10.61,20.82,10.11,22.04,10.11,22.04 C9.79,22.8,8.91,23.17,8.14,22.85 C8.14,22.85,7.06,22.4,7.06,22.4 C6.29,22.08,5.93,21.2,6.24,20.44 C6.24,20.44,6.64,19.47,6.64,19.47 C7.16,18.23,5.92,16.99,4.68,17.5 C4.68,17.5,3.64,17.93,3.64,17.93 C2.87,18.25,1.99,17.89,1.67,17.12 C1.67,17.12,1.22,16.04,1.22,16.04 C0.91,15.27,1.27,14.39,2.04,14.07 C2.04,14.07,3.43,13.49,3.43,13.49 C4.67,12.98,4.67,11.23,3.43,10.71 C3.43,10.71,1.96,10.11,1.96,10.11 C1.2,9.79,0.83,8.91,1.15,8.14 C1.15,8.14,1.6,7.06,1.6,7.06 C1.92,6.29,2.8,5.93,3.57,6.24 C3.57,6.24,4.78,6.75,4.78,6.75 z M14.31,11.04 C14.84,12.32,14.23,13.78,12.96,14.31 C11.68,14.84,10.22,14.23,9.69,12.96 C9.16,11.68,9.77,10.22,11.04,9.69 C12.32,9.16,13.78,9.77,14.31,11.04 z"/></g></svg> ',share2:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg>',share:'<svg class="stroked" viewBox="0 0 24 24"><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"></path><polyline points="16 6 12 2 8 6"></polyline><line x1="12" y1="2" x2="12" y2="15"></line></svg>',shieldOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M19.69 14a6.9 6.9 0 0 0 .31-2V5l-8-3-3.16 1.18"></path><path d="M4.73 4.73L4 5v7c0 6 8 10 8 10a20.29 20.29 0 0 0 5.62-4.38"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',shield:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg>',shoppingBag:'<svg class="stroked" viewBox="0 0 24 24"><path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"></path><line x1="3" y1="6" x2="21" y2="6"></line><path d="M16 10a4 4 0 0 1-8 0"></path></svg>',shoppingCart:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>',shuffle:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="16 3 21 3 21 8"></polyline><line x1="4" y1="20" x2="21" y2="3"></line><polyline points="21 16 21 21 16 21"></polyline><line x1="15" y1="15" x2="21" y2="21"></line><line x1="4" y1="4" x2="9" y2="9"></line></svg>',sidebar:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="3" x2="9" y2="21"></line></svg>',slack:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14.5 10c-.83 0-1.5-.67-1.5-1.5v-5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5z"></path><path d="M20.5 10H19V8.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"></path><path d="M9.5 14c.83 0 1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5S8 21.33 8 20.5v-5c0-.83.67-1.5 1.5-1.5z"></path><path d="M3.5 14H5v1.5c0 .83-.67 1.5-1.5 1.5S2 16.33 2 15.5 2.67 14 3.5 14z"></path><path d="M14 14.5c0-.83.67-1.5 1.5-1.5h5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-5c-.83 0-1.5-.67-1.5-1.5z"></path><path d="M15.5 19H14v1.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z"></path><path d="M10 9.5C10 8.67 9.33 8 8.5 8h-5C2.67 8 2 8.67 2 9.5S2.67 11 3.5 11h5c.83 0 1.5-.67 1.5-1.5z"></path><path d="M8.5 5H10V3.5C10 2.67 9.33 2 8.5 2S7 2.67 7 3.5 7.67 5 8.5 5z"></path></svg>',slash:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"></line></svg>',sliders:'<svg class="stroked" viewBox="0 0 24 24"><line x1="4" y1="21" x2="4" y2="14"></line><line x1="4" y1="10" x2="4" y2="3"></line><line x1="12" y1="21" x2="12" y2="12"></line><line x1="12" y1="8" x2="12" y2="3"></line><line x1="20" y1="21" x2="20" y2="16"></line><line x1="20" y1="12" x2="20" y2="3"></line><line x1="1" y1="14" x2="7" y2="14"></line><line x1="9" y1="8" x2="15" y2="8"></line><line x1="17" y1="16" x2="23" y2="16"></line></svg>',smartphone:'<svg class="stroked" viewBox="0 0 24 24"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"></rect><line x1="12" y1="18" x2="12.01" y2="18"></line></svg>',smile:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><path d="M8 14s1.5 2 4 2 4-2 4-2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line></svg>',speaker:'<svg class="stroked" viewBox="0 0 24 24"><rect x="4" y="2" width="16" height="20" rx="2" ry="2"></rect><circle cx="12" cy="14" r="4"></circle><line x1="12" y1="6" x2="12.01" y2="6"></line></svg>',square:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect></svg>',star:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>',stopCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><rect x="9" y="9" width="6" height="6"></rect></svg>',sun:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>',sunrise:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17 18a5 5 0 0 0-10 0"></path><line x1="12" y1="2" x2="12" y2="9"></line><line x1="4.22" y1="10.22" x2="5.64" y2="11.64"></line><line x1="1" y1="18" x2="3" y2="18"></line><line x1="21" y1="18" x2="23" y2="18"></line><line x1="18.36" y1="11.64" x2="19.78" y2="10.22"></line><line x1="23" y1="22" x2="1" y2="22"></line><polyline points="8 6 12 2 16 6"></polyline></svg>',sunset:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17 18a5 5 0 0 0-10 0"></path><line x1="12" y1="9" x2="12" y2="2"></line><line x1="4.22" y1="10.22" x2="5.64" y2="11.64"></line><line x1="1" y1="18" x2="3" y2="18"></line><line x1="21" y1="18" x2="23" y2="18"></line><line x1="18.36" y1="11.64" x2="19.78" y2="10.22"></line><line x1="23" y1="22" x2="1" y2="22"></line><polyline points="16 5 12 9 8 5"></polyline></svg>',table:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"></path></svg>',tablet:'<svg class="stroked" viewBox="0 0 24 24"><rect x="4" y="2" width="16" height="20" rx="2" ry="2"></rect><line x1="12" y1="18" x2="12.01" y2="18"></line></svg>',tag:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7.01" y2="7"></line></svg>',target:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="6"></circle><circle cx="12" cy="12" r="2"></circle></svg>',terminal:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg>',thermometer:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 14.76V3.5a2.5 2.5 0 0 0-5 0v11.26a4.5 4.5 0 1 0 5 0z"></path></svg>',tool:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg>',trash2:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>',trash:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg>',trello:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><rect x="7" y="7" width="3" height="9"></rect><rect x="14" y="7" width="3" height="5"></rect></svg>',trendingDown:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 18 13.5 8.5 8.5 13.5 1 6"></polyline><polyline points="17 18 23 18 23 12"></polyline></svg>',trendingUp:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline></svg>',triangle:'<svg class="stroked" viewBox="0 0 24 24"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path></svg>',truck:'<svg class="stroked" viewBox="0 0 24 24"><rect x="1" y="3" width="15" height="13"></rect><polygon points="16 8 20 8 23 11 23 16 16 16 16 8"></polygon><circle cx="5.5" cy="18.5" r="2.5"></circle><circle cx="18.5" cy="18.5" r="2.5"></circle></svg>',tv:'<svg class="stroked" viewBox="0 0 24 24"><rect x="2" y="7" width="20" height="15" rx="2" ry="2"></rect><polyline points="17 2 12 7 7 2"></polyline></svg>',twitch:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 2H3v16h5v4l4-4h5l4-4V2zm-10 9V7m5 4V7"></path></svg>',twitter:'<svg class="stroked" viewBox="0 0 24 24"><path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path></svg>',type:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="4 7 4 4 20 4 20 7"></polyline><line x1="9" y1="20" x2="15" y2="20"></line><line x1="12" y1="4" x2="12" y2="20"></line></svg>',umbrella:'<svg class="stroked" viewBox="0 0 24 24"><path d="M23 12a11.05 11.05 0 0 0-22 0zm-5 7a3 3 0 0 1-6 0v-7"></path></svg>',underline:'<svg class="stroked" viewBox="0 0 24 24"><path d="M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3"></path><line x1="4" y1="21" x2="20" y2="21"></line></svg>',unlock:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 9.9-1"></path></svg>',thumbsUp:'<svg class="stroked" viewBox="0 0 24 24"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>',arrowRightCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><polyline points="12 16 16 12 12 8"></polyline><line x1="8" y1="12" x2="16" y2="12"></line></svg>',arrowRight:'<svg class="stroked" viewBox="0 0 24 24"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>',chevronRight:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="9 18 15 12 9 6"></polyline></svg>',chevronsRight:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="13 17 18 12 13 7"></polyline><polyline points="6 17 11 12 6 7"></polyline></svg>',uploadCloud:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="16 16 12 12 8 16"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16"></polyline></svg>',upload:'<svg class="stroked" viewBox="0 0 24 24"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg>',userCheck:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><polyline points="17 11 19 13 23 9"></polyline></svg>',userMinus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="23" y1="11" x2="17" y2="11"></line></svg>',userPlus:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="20" y1="8" x2="20" y2="14"></line><line x1="23" y1="11" x2="17" y2="11"></line></svg>',userX:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="8.5" cy="7" r="4"></circle><line x1="18" y1="8" x2="23" y2="13"></line><line x1="23" y1="8" x2="18" y2="13"></line></svg>',user:'<svg class="stroked" viewBox="0 0 24 24"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>',users:'<svg class="stroked" viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path><circle cx="9" cy="7" r="4"></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path></svg>',videoOff:'<svg class="stroked" viewBox="0 0 24 24"><path d="M16 16v1a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2h2m5.66 0H14a2 2 0 0 1 2 2v3.34l1 1L23 7v10"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>',video:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect></svg>',voicemail:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="5.5" cy="11.5" r="4.5"></circle><circle cx="18.5" cy="11.5" r="4.5"></circle><line x1="5.5" y1="16" x2="18.5" y2="16"></line></svg>',volume1:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><path d="M15.54 8.46a5 5 0 0 1 0 7.07"></path></svg>',volume2:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"></path></svg>',volumeX:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><line x1="23" y1="9" x2="17" y2="15"></line><line x1="17" y1="9" x2="23" y2="15"></line></svg>',volume:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon></svg>',watch:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="7"></circle><polyline points="12 9 12 12 13.5 13.5"></polyline><path d="M16.51 17.35l-.35 3.83a2 2 0 0 1-2 1.82H9.83a2 2 0 0 1-2-1.82l-.35-3.83m.01-10.7l.35-3.83A2 2 0 0 1 9.83 1h4.35a2 2 0 0 1 2 1.82l.35 3.83"></path></svg>',wifiOff:'<svg class="stroked" viewBox="0 0 24 24"><line x1="1" y1="1" x2="23" y2="23"></line><path d="M16.72 11.06A10.94 10.94 0 0 1 19 12.55"></path><path d="M5 12.55a10.94 10.94 0 0 1 5.17-2.39"></path><path d="M10.71 5.05A16 16 0 0 1 22.58 9"></path><path d="M1.42 9a15.91 15.91 0 0 1 4.7-2.88"></path><path d="M8.53 16.11a6 6 0 0 1 6.95 0"></path><line x1="12" y1="20" x2="12.01" y2="20"></line></svg>',wifi:'<svg class="stroked" viewBox="0 0 24 24"><path d="M5 12.55a11 11 0 0 1 14.08 0"></path><path d="M1.42 9a16 16 0 0 1 21.16 0"></path><path d="M8.53 16.11a6 6 0 0 1 6.95 0"></path><line x1="12" y1="20" x2="12.01" y2="20"></line></svg>',wind:'<svg class="stroked" viewBox="0 0 24 24"><path d="M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2"></path></svg>',xCircle:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',xOctagon:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"></polygon><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>',xSquare:'<svg class="stroked" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="9" x2="15" y2="15"></line><line x1="15" y1="9" x2="9" y2="15"></line></svg>',x:'<svg class="stroked" viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',zapOff:'<svg class="stroked" viewBox="0 0 24 24"><polyline points="12.41 6.75 13 2 10.57 4.92"></polyline><polyline points="18.57 12.91 21 10 15.66 10"></polyline><polyline points="8 8 3 14 12 14 11 22 16 16"></polyline><line x1="1" y1="1" x2="23" y2="23"></line></svg>',zap:'<svg class="stroked" viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg>',zoomIn:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="11" y1="8" x2="11" y2="14"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>',zoomOut:'<svg class="stroked" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg>',fontBold:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M13.5,11 C15.71,11,17.5,12.68,17.5,14.75 C17.5,16.82,15.71,18.5,13.5,18.5 C13.5,18.5,8.5,18.5,8.5,18.5 C8.5,18.5,8.5,3.5,8.5,3.5 C8.5,3.5,13.5,3.5,13.5,3.5 C15.71,3.5,17.5,5.18,17.5,7.25 C17.5,9.32,15.71,11,13.5,11 C13.5,11,13.5,11,13.5,11 z"/><path style="" d="M13.5,11 C13.5,11,8.5,11,8.5,11"/><path style="" d="M12.5,11 C14.71,11,16.5,12.68,16.5,14.75 C16.5,16.82,14.71,18.5,12.5,18.5 C12.5,18.5,7.5,18.5,7.5,18.5 C7.5,18.5,7.5,3.5,7.5,3.5 C7.5,3.5,12.5,3.5,12.5,3.5 C14.71,3.5,16.5,5.18,16.5,7.25 C16.5,9.32,14.71,11,12.5,11 C12.5,11,12.5,11,12.5,11 z"/><path style="" d="M12.5,11 C12.5,11,7.5,11,7.5,11"/></g></svg> ',fontItalic:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M17,4.5 C17,4.5,13,4.5,13,4.5"/><path style="" d="M11,19.5 C11,19.5,7,19.5,7,19.5"/><path style="" d="M15,4.5 C15,4.5,9,19.5,9,19.5"/></g></svg> ',fontUnderline:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M7.5,3.5 C7.5,3.5,7.5,10.74,7.5,13.5 C7.5,16.26,9.74,18.5,12.5,18.5 C15.26,18.5,17.5,16.26,17.5,13.5 C17.5,10.74,17.5,3.5,17.5,3.5"/><path style="" d="M7.5,21.5 C7.5,21.5,17.5,21.5,17.5,21.5"/></g></svg> ',indent:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,10 C21,10,8,10,8,10"/><path style="" d="M21,6 C21,6,8,6,8,6"/><path style="" d="M21,14 C21,14,8,14,8,14"/><path style="" d="M21,18 C21,18,8,18,8,18"/><path style="" d="M2.5,9 C2.5,9,5.5,12,5.5,12 C5.5,12,2.5,15,2.5,15"/></g></svg> ',listBullet:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,6 C21,6,10,6,10,6"/><path style="" d="M21,12 C21,12,10,12,10,12"/><path style="" d="M21,18 C21,18,10,18,10,18"/><path style="" d="M5.5,5 C6.05,5,6.5,5.45,6.5,6 C6.5,6.55,6.05,7,5.5,7 C4.95,7,4.5,6.55,4.5,6 C4.5,5.45,4.95,5,5.5,5 z"/><path style="" d="M5.5,11 C6.05,11,6.5,11.45,6.5,12 C6.5,12.55,6.05,13,5.5,13 C4.95,13,4.5,12.55,4.5,12 C4.5,11.45,4.95,11,5.5,11 z"/><path style="" d="M5.5,17 C6.05,17,6.5,17.45,6.5,18 C6.5,18.55,6.05,19,5.5,19 C4.95,19,4.5,18.55,4.5,18 C4.5,17.45,4.95,17,5.5,17 z"/></g></svg> ',listNumber:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,6 C21,6,10,6,10,6"/><path style="" d="M21,12 C21,12,10,12,10,12"/><path style="" d="M21,18 C21,18,10,18,10,18"/><path style="" d="M4.5,5 C4.5,5,5.5,4,5.5,4 C5.5,4,5.5,8,5.5,8"/><path style="" d="M4.5,10 C4.5,10,5.5,10,5.5,10 C6.05,10,6.5,10.45,6.5,11 C6.5,11,6.5,11,6.5,11 C6.5,11.55,6.05,12,5.5,12 C5.5,12,5.5,12,5.5,12 C4.95,12,4.5,12.45,4.5,13 C4.5,13,4.5,14,4.5,14 C4.5,14,6.5,14,6.5,14"/><path style="" d="M4.5,16 C4.5,16,5.5,16,5.5,16 C6.05,16,6.5,16.45,6.5,17 C6.5,17,6.5,17,6.5,17 C6.5,17.55,6.05,18,5.5,18 C5.5,18,4.5,18,4.5,18 C4.5,18,5.5,18,5.5,18 C6.05,18,6.5,18.45,6.5,19 C6.5,19,6.5,19,6.5,19 C6.5,19.55,6.05,20,5.5,20 C5.5,20,4.5,20,4.5,20"/></g></svg> ',outdent:'<svg class="stroked" viewBox="0 0 24 24"><g><path style="" d="M21,10 C21,10,8,10,8,10"/><path style="" d="M21,6 C21,6,8,6,8,6"/><path style="" d="M21,14 C21,14,8,14,8,14"/><path style="" d="M21,18 C21,18,8,18,8,18"/><path style="" d="M5.5,9 C5.5,9,2.5,12,2.5,12 C2.5,12,5.5,15,5.5,15"/></g></svg> ',pin:'<svg class="stroked" viewBox="0 0 24 24"><g><g><path style="" d="M16.23,4.73 C16.23,4.73,19.42,7.9,19.42,7.9 C19.42,7.9,14.46,15.69,14.46,15.69 C14.46,15.69,8.45,9.68,8.45,9.68 C8.45,9.68,16.23,4.73,16.23,4.73 z"/><path style="" d="M20.84,9.32 C20.84,9.32,14.47,2.95,14.47,2.95"/><path style="" d="M16.6,17.8 C16.6,17.8,6.7,7.9,6.7,7.9"/><path style="" d="M10.23,11.44 C10.23,11.44,5.99,18.51,5.99,18.51 C5.99,18.51,13.06,14.27,13.06,14.27"/></g></g></svg> ',resize:'<svg class="stroked" version="1.1" viewBox="0, 0, 24, 24"><g><path d="M9,3 L3,3 L3,9"/><path d="M15,21 L21,21 L21,15"/><path d="M3,3 L10,10"/><path d="M21,21 L14,14"/></g></svg> ',shift:'<svg class="stroked" viewBox="0 0 24 24"><path d="M12 4 4 12h4v8h8v-8h4z"></path></svg> ',sortAscending:'<svg class="stroked" viewBox="0 0 24 24"><g><path d="M16.5,10.5 C16.5,10.5,7.5,10.5,7.5,10.5"/><path d="M14.5,6.5 C14.5,6.5,9.5,6.5,9.5,6.5"/><path d="M18.5,14.5 C18.5,14.5,5.5,14.5,5.5,14.5"/><path d="M20.5,18.5 C20.5,18.5,3.5,18.5,3.5,18.5"/></g></svg> ',sortDescending:'<svg class="stroked" viewBox="0 0 24 24"><g><path d="M16.5,14.5 C16.5,14.5,7.5,14.5,7.5,14.5"/><path d="M14.5,18.5 C14.5,18.5,9.5,18.5,9.5,18.5"/><path d="M18.5,10.5 C18.5,10.5,5.5,10.5,5.5,10.5"/><path d="M20.5,6.5 C20.5,6.5,3.5,6.5,3.5,6.5"/></g></svg> ',tab:'<svg class="stroked" viewBox="0 0 24 24"><line x1="3" y1="12" x2="16" y2="12"></line><polyline points="10 6 16 12 10 18"></polyline><line x1="20" y1="5" x2="20" y2="19"></line></svg> ',cornerDownLeft:"cornerDownRight0f",cornerLeftDown:"cornerRightDown0f",cornerLeftUp:"cornerRightUp0f",cornerUpLeft:"cornerUpRight0f",refreshCcw:"refreshCw0f",rotateCcw:"rotateCw0f",skipBack:"skipForward0f",toggleLeft:"toggleRight0f",thumbsDown:"thumbsUp1f",arrowDownCircle:"arrowRightCircle90r",arrowLeftCircle:"arrowRightCircle180r",arrowUpCircle:"arrowRightCircle270r",arrowDown:"arrowRight90r",arrowLeft:"arrowRight180r",arrowUp:"arrowRight270r",chevronDown:"chevronRight90r",chevronLeft:"chevronRight180r",chevronUp:"chevronRight270r",chevronsDown:"chevronsRight90r",chevronsLeft:"chevronsRight180r",chevronsUp:"chevronsRight270r",arrowDownRight:"arrowUpRight90r",arrowDownLeft:"arrowUpRight180r",arrowUpLeft:"arrowUpRight270r",fatArrowUp:"shift",fatArrowRight:"shift90r",fatArrowDown:"shift180r",fatArrowLeft:"shift270r"};var Rs=(e)=>{Object.assign(xe,e)};var Rl=(e)=>/\d$/.test(e)?e+"_":e,_s=[{prefix:/^spin(_?\d+)/,apply(e,t,n){let i=t[1].replace("_","-"),s=360/Math.abs(parseFloat(i)),o=i.startsWith("-")?"reverse":"normal",r=$e(e,[]),l=r;if(l.animate){let a=l.style.transform||"";l.animate([{transform:`${a} rotate(0deg)`},{transform:`${a} rotate(360deg)`}],{duration:s*1000,iterations:1/0,direction:o})}return Ps(e,n,r)}},{prefix:"un",apply:(e)=>`slash25o$${e}75s75o`},{prefix:"check",apply:(e)=>`check75o_00aa00S$${e}75s50o`},{prefix:"cancel",apply:(e)=>`x75o_cc0000S$${e}75s50o`},{prefix:"search",apply:(e)=>`search80s30x30y$${e}50o`}],_l=0;function Hs(e,t){let n=C.div();n.innerHTML=e;let i=n.querySelector("svg"),s=i.querySelectorAll("[id]");if(s.length>0){let l=new Map;for(let d of s){let u=d.id,h=`tosi_svg_id_${++_l}`;l.set(u,h),d.id=h}let a=i.innerHTML,c=a;for(let[d,u]of l){let h=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");c=c.replace(new RegExp(`url\\(#${h}\\)`,"g"),`url(#${u})`).replace(new RegExp(`href="#${h}"`,"g"),`href="#${u}"`)}if(c!==a)i.innerHTML=c}let o=new Set(i.classList);o.add("tosi-icon");let r=Pn.svg({class:Array.from(o).join(" "),viewBox:i.getAttribute("viewBox")},...t,...i.children);if(r.style.strokeWidth=m.tosiIconStrokeWidth("2px"),o.has("filled"))r.style.stroke="none",r.style.fill="currentColor";else if(o.has("stroked"))r.style.stroke=m.tosiIconStroke("currentColor"),r.style.fill=m.tosiIconFill("none");else r.style.stroke=m.tosiIconStroke("currentColor"),r.style.fill=m.tosiIconFill("currentColor");return r.style.height=m.tosiIconSize("16px"),r}function Ps(e,t,...n){let i=C.span({class:"tosi-icon-composite",dataIcon:e,style:{display:"inline-flex",position:"relative",pointerEvents:"none"}},...n);for(let s of t)if(s&&typeof s==="object"&&!("nodeType"in s)){let o=s;if(o.style&&typeof o.style==="object")Object.assign(i.style,o.style);if(o.class)i.classList.add(...String(o.class).split(" "))}return i}function Pl(e){let t=xe;if(t[e])return!0;let n=Wn(e);return n!=null&&!!t[n.baseName]}function js(e,t){for(let n of _s){let i,s;if(n.prefix instanceof RegExp){let r=new RegExp(n.prefix.source+"(.+)$"),l=e.match(r);if(!l)continue;i=l[l.length-1],i=i[0].toLowerCase()+i.slice(1),s=l}else{if(!e.startsWith(n.prefix)||e.length<=n.prefix.length)continue;i=e[n.prefix.length].toLowerCase()+e.slice(n.prefix.length+1),s=n.prefix}if(!Pl(i))continue;let o=n.apply(Rl(i),s,t);if(typeof o==="string")return $e(o,t);if(o)return o}return null}var Vl=10,Fl=/(?:(?<=[a-zA-Z_])(?:_?\d+[osxyr]|[01]f|\d+W)|_[a-zA-Z0-9]+[FS])+$/;function Wn(e){let t=e.match(Fl);if(!t)return null;let n=e.slice(0,t.index);if(!n)return null;if(n.endsWith("_"))n=n.slice(0,-1);if(!n)return null;if(!xe[n]){if(!_s.some((a)=>{if(a.prefix instanceof RegExp)return a.prefix.test(n);return n.startsWith(a.prefix)&&n.length>a.prefix.length}))return null}let s={},o=t[0].match(/_?\d+[osxyr]|[01]f|_[a-zA-Z0-9]+[FS]|\d+W/g);if(!o)return null;let r=[];for(let l of o){let a=l[l.length-1];if(a==="F"||a==="S"){let c=l.slice(1,-1),u=/^[0-9a-fA-F]{3,8}$/.test(c)?"#"+c:L[c];if(a==="F")s.fill=u;else s.stroke=u}else if(a==="W")s.strokeWidth=l.slice(0,-1);else{let c=parseInt(l.replace("_","-"));switch(a){case"o":s.opacity=String(c/100);break;case"s":r.push(`scale(${c/100})`);break;case"x":r.push(`translateX(${c}%)`);break;case"y":r.push(`translateY(${c}%)`);break;case"r":r.push(`rotate(${c}deg)`);break;case"f":r.push(c===0?"scaleX(-1)":"scaleY(-1)");break}}}if(r.length>0)s.transform=r.join(" "),s.transformOrigin="50% 50%";return{baseName:n,style:s}}function $e(e,t){if(e.endsWith("_"))e=e.slice(0,-1);let n=xe,i=e;for(let r=0;r<Vl;r++){let l=n[i];if(!l)break;if(l.startsWith("<"))return Hs(l,t);i=l}if(i!==e){let r=js(i,t);if(r)return r;let l=Wn(i);if(l){let a=$e(l.baseName,t);return Object.assign(a.style,l.style),a}}if(e.includes("$")){let r=e.split("$"),l=$e(r[r.length-1],[]),a=r.slice(0,-1).reverse().map((c)=>{let d=$e(c,[]);return Object.assign(d.style,{position:"absolute",inset:"0",width:"100%",height:"100%"}),d});return Ps(e,t,l,...a)}let s=js(e,t);if(s)return s;let o=Wn(e);if(o){let r=$e(o.baseName,t);return Object.assign(r.style,o.style),r}if(e)console.warn(`icon ${e} does not exist`);return Hs(xe.square,t)}var x=new Proxy(xe,{get(e,t){return(...n)=>$e(t,n)}});class Vs extends E{static preferredTagName="tosi-icon";static lightStyleSpec={":host":{"--tosi-icon-size":"var(--xin-icon-size, 16px)","--tosi-icon-stroke-width":"var(--xin-icon-stroke-width, var(--icon-stroke-width, 2px))","--tosi-icon-stroke-linejoin":"var(--icon-stroke-linejoin, round)","--tosi-icon-stroke-linecap":"var(--icon-stroke-linecap, round)","--tosi-icon-fill":"var(--xin-icon-fill, var(--icon-fill, none))",display:"inline-flex",verticalAlign:"text-bottom",stroke:"currentColor",strokeWidth:m.tosiIconStrokeWidth("2px"),strokeLinejoin:m.tosiIconStrokeLinejoin("round"),strokeLinecap:m.tosiIconStrokeLinecap("round"),fill:m.tosiIconFill("none"),height:L.tosiIconSize},":host svg, :host .tosi-icon-composite":{height:m.tosiIconSize("16px")}};static initAttributes={icon:"",size:0,fill:"",stroke:"",strokeWidth:1};render(){super.render(),this.textContent="";let e={};if(this.size)e.height=this.size+"px",this.style.setProperty("--tosi-icon-size",`${this.size}px`),this.style.setProperty("--xin-icon-size",`${this.size}px`);if(this.stroke)e.stroke=this.stroke,e.strokeWidth=this.strokeWidth;if(this.fill)e.fill=this.fill;this.append(x[this.icon]({style:e}))}}var rc=Vs.elementCreator();var he="tosi-ins",K="tosi-del",ql=0,Ne=()=>`chg-${Date.now().toString(36)}-${(ql++).toString(36)}`;class Gn extends HTMLElement{}class Xn extends HTMLElement{}function Ge(){if(typeof customElements>"u")return;if(!customElements.get("tosi-ins"))customElements.define("tosi-ins",Gn);if(!customElements.get("tosi-del"))customElements.define("tosi-del",Xn)}function Z(e){return e.replace(/[<>]/g,"")}function Wl(e,t,n){let i=document.createElement(e==="insert"?"tosi-ins":"tosi-del");if(i.setAttribute("data-change",Ne()),i.setAttribute("data-author",Z(n.id)),n.name)i.setAttribute("data-author-name",Z(n.name));return i.setAttribute("data-time",new Date().toISOString()),i.textContent=t,i}function Yn(e){return Array.from(e.querySelectorAll("tosi-ins[data-change], tosi-del[data-change]")).map((t)=>({id:t.getAttribute("data-change")||"",kind:t.tagName.toLowerCase()==="tosi-ins"?"insert":"delete",author:t.getAttribute("data-author")||"",authorName:t.getAttribute("data-author-name")||"",time:t.getAttribute("data-time")||"",text:t.textContent||"",element:t}))}function Fs(e){let t=e.parentNode;if(!t)return;while(e.firstChild)t.insertBefore(e.firstChild,e);e.remove()}function Jn(e){if(e.tagName.toLowerCase()==="tosi-del")e.remove();else Fs(e)}function Zn(e){if(e.tagName.toLowerCase()==="tosi-ins")e.remove();else Fs(e)}function Un(e){return e.match(/\s*\S+|\s+$/g)||[]}var Kn=4000;function qs(e,t){let n=Un(e),i=Un(t);if(n.length>Kn||i.length>Kn){let u=[];if(e)u.push({op:"delete",text:e});if(t)u.push({op:"insert",text:t});return u}let s=n.length,o=i.length,r=Array.from({length:s+1},()=>Array(o+1).fill(0));for(let u=s-1;u>=0;u--)for(let h=o-1;h>=0;h--)r[u][h]=n[u]===i[h]?r[u+1][h+1]+1:Math.max(r[u+1][h],r[u][h+1]);let l=[],a=(u,h)=>{let f=l[l.length-1];if(f&&f.op===u)f.text+=h;else l.push({op:u,text:h})},c=0,d=0;while(c<s&&d<o)if(n[c]===i[d])a("same",n[c]),c++,d++;else if(r[c+1][d]>=r[c][d+1])a("delete",n[c]),c++;else a("insert",i[d]),d++;while(c<s)a("delete",n[c++]);while(d<o)a("insert",i[d++]);return l}function Qn(e,t,n){let i=qs(e.data,t);if(!i.some((r)=>r.op!=="same"))return 0;Ge();let s=document.createDocumentFragment(),o=0;for(let r of i)if(r.op==="same")s.appendChild(document.createTextNode(r.text));else s.appendChild(Wl(r.op,r.text,n)),o++;return e.parentNode?.replaceChild(s,e),o}var Ft="tosi-misspelling";class ti extends HTMLElement{connectedCallback(){this.setAttribute("data-spelling","error")}}function qt(){if(typeof customElements>"u")return;if(customElements.get("tosi-misspelling"))return;customElements.define("tosi-misspelling",ti)}var ei='.not-selectable, .do-not-spanify, code, kbd, samp, pre, [spellcheck="false"]';function Wt(e,t=""){if(e.nodeType!==3)return!1;let n=e.parentElement;if(!n)return!1;return!n.closest(t?`${ei}, ${t}`:ei)}function Ul(e){return Wt(e,"tosi-del")}function ni(e){let t=[],n=Intl.Segmenter,i=n?new n(void 0,{granularity:"word"}):null,s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),o;while(o=s.nextNode()){if(!Ul(o))continue;let r=o;if(i)for(let l of i.segment(r.data)){if(!l.isWordLike)continue;t.push({word:l.segment,node:r,start:l.index,end:l.index+l.segment.length})}else{let l=/[^\s.,;:!?()[\]{}"“”‘’—–]+/g,a;while(a=l.exec(r.data))t.push({word:a[0],node:r,start:a.index,end:a.index+a[0].length})}}return t}function yt(e){for(let t of Array.from(e.querySelectorAll("tosi-misspelling"))){let n=t.parentNode;if(!n)continue;while(t.firstChild)n.insertBefore(t.firstChild,t);t.remove()}e.normalize()}function Kl(e){let t=[];for(let n=e.length-1;n>=0;n--){let{node:i,start:s,end:o}=e[n];if(s>=i.data.length)continue;let r=document.createRange();r.setStart(i,s),r.setEnd(i,Math.min(o,i.data.length));let l=document.createElement("tosi-misspelling");try{r.surroundContents(l),t.push(l)}catch{}}return t.reverse()}async function ii(e,t,n=new Set,i=(s)=>s()){qt();let s=i(()=>{yt(e);let r=ni(e);return[...new Set(r.map((l)=>l.word))].filter((l)=>!n.has(l))});if(s.length===0)return[];let o=await t(s);if(!o||o.size===0)return[];return i(()=>Gl(e,o,n))}function Gl(e,t,n){yt(e);let s=ni(e).filter((r)=>t.has(r.word)&&!n.has(r.word));if(s.length===0)return[];let o=new Map;for(let r of s){let l=o.get(r.node);if(l)l.push(r);else o.set(r.node,[r])}for(let r of o.values())Kl(r.sort((l,a)=>l.start-a.start));return Array.from(e.querySelectorAll("tosi-misspelling")).map((r)=>({word:r.textContent||"",element:r}))}var we=C.div({style:{content:" ",position:"fixed",top:0,left:0,right:0,bottom:0}}),Ut={passive:!0},Ws=(e,t,n="move")=>{if(!e.type.startsWith("touch")){e.preventDefault();let{clientX:s,clientY:o}=e;we.style.cursor=n,Xe(we),document.body.append(we);let r=(l)=>{let a=l.clientX-s,c=l.clientY-o;if(t(a,c,l)===!0)we.removeEventListener("mousemove",r),we.removeEventListener("mouseup",r),we.remove()};we.addEventListener("mousemove",r,Ut),we.addEventListener("mouseup",r,Ut)}else if(e instanceof TouchEvent){let s=e.changedTouches[0],{identifier:o,clientX:r,clientY:l}=s,a=e.target,c=0,d=0,u=(h)=>{let f=[...h.touches].find((p)=>p.identifier===o);if(f!==void 0)c=f.clientX-r,d=f.clientY-l;if(h.type==="touchmove")h.stopPropagation(),h.preventDefault();if(t(c,d,h)===!0||f===void 0)a.removeEventListener("touchmove",u),a.removeEventListener("touchend",u),a.removeEventListener("touchcancel",u)};a.addEventListener("touchmove",u),a.addEventListener("touchend",u,Ut),a.addEventListener("touchcancel",u,Ut)}},Xl=(e="body *")=>[...document.querySelectorAll(e)].map((t)=>parseFloat(getComputedStyle(t).zIndex)).reduce((t,n)=>isNaN(t)||Number(t)<n?n:Number(t),0),Xe=(e,t="body *")=>{e.style.zIndex=String(Xl(t)+1)};var{slot:Yl}=C;class fe extends E{static preferredTagName="tosi-float";static floats=new Set;static initAttributes={drag:!1,remainOnResize:"remove",remainOnScroll:"remain"};content=Yl();static shadowStyleSpec={":host":{position:"fixed"}};reposition=(e)=>{if(e instanceof MouseEvent&&e.button!==0)return;if(e.target?.closest(".no-drag"))return;if(this.drag){Xe(this);let n=this.offsetLeft,i=this.offsetTop;Ws(e,(s,o,r)=>{if(this.style.left=`${n+s}px`,this.style.top=`${i+o}px`,this.style.right="auto",this.style.bottom="auto",r.type==="mouseup")return!0})}};connectedCallback(){super.connectedCallback(),Jl(),fe.floats.add(this);let e={passive:!0};this.addEventListener("touchstart",this.reposition,e),this.addEventListener("mousedown",this.reposition),Xe(this)}disconnectedCallback(){super.disconnectedCallback(),fe.floats.delete(this)}}var si=fe.elementCreator();var Us=!1;function Jl(){if(Us)return;Us=!0,window.addEventListener("resize",()=>{Array.from(fe.floats).forEach((e)=>{if(e.remainOnResize==="hide")e.hidden=!0;else if(e.remainOnResize==="remove")e.remove()})},{passive:!0}),document.addEventListener("scroll",(e)=>{if(e.target instanceof HTMLElement&&e.target.closest(fe.tagName))return;Array.from(fe.floats).forEach((t)=>{if(t.remainOnScroll==="hide")t.hidden=!0;else if(t.remainOnScroll==="remove")t.remove()})},{passive:!0,capture:!0})}var Ks=(e)=>{let{content:t,target:n,position:i,remainOnScroll:s,remainOnResize:o,draggable:r}=e,l=Array.isArray(t)?si(...t):si(t);if(Zl(l,n,i,s,o,r),e.class)l.setAttribute("class",e.class);return document.body.append(l),l},Zl=(e,t,n,i,s,o=!1)=>{{let{position:p}=getComputedStyle(e);if(p!=="fixed")e.style.position="fixed";if(e instanceof fe){if(s)e.remainOnResize=s;if(i)e.remainOnScroll=i;e.drag=o}Xe(e)}let{left:r,top:l,width:a,height:c}=t.getBoundingClientRect(),d=r+a*0.5,u=l+c*0.5,{innerWidth:h,innerHeight:f}=window;if(n==="side")n=(d<h*0.5?"e":"w")+(u<f*0.5?"s":"n");else if(n==="auto"||n===void 0)n=(u<f*0.5?"s":"n")+(d<h*0.5?"e":"w");if(e.style.top=e.style.left=e.style.right=e.style.bottom=e.style.transform="",n.length===2){let[p,b]=n;switch(p){case"n":e.style.bottom=(f-l).toFixed(2)+"px";break;case"e":e.style.left=(r+a).toFixed(2)+"px";break;case"s":e.style.top=(l+c).toFixed(2)+"px";break;case"w":e.style.right=(h-r).toFixed(2)+"px";break}switch(b){case"n":e.style.bottom=(f-l-c).toFixed(2)+"px";break;case"e":e.style.left=r.toFixed(2)+"px";break;case"s":e.style.top=l.toFixed(2)+"px";break;case"w":e.style.right=(h-r-a).toFixed(2)+"px";break}e.style.transform=""}else if(n==="n")e.style.bottom=(f-l).toFixed(2)+"px",e.style.left=d.toFixed(2)+"px",e.style.transform="translateX(-50%)";else if(n==="s")e.style.top=(l+c).toFixed(2)+"px",e.style.left=d.toFixed(2)+"px",e.style.transform="translateX(-50%)";else if(n==="e")e.style.left=(r+a).toFixed(2)+"px",e.style.top=u.toFixed(2)+"px",e.style.transform="translateY(-50%)";else if(n==="w")e.style.right=(h-r).toFixed(2)+"px",e.style.top=u.toFixed(2)+"px",e.style.transform="translateY(-50%)";e.style.setProperty("--max-height",`calc(100vh - ${e.style.top||e.style.bottom})`),e.style.setProperty("--max-width",`calc(100vw - ${e.style.left||e.style.right})`)};function Gs(e,t=!0){return(n,i)=>{let s=e(n),o=e(i);for(let r in s)if(s[r]!==o[r])return(Array.isArray(t)?t[r]!==!1:t)?s[r]>o[r]?1:-1:s[r]>o[r]?-1:1;return 0}}var{button:Ql,span:Xs,input:ea}=C,Ys=(e,t)=>!!e.find((n)=>{if(n===null||t==null)return!1;else if(Array.isArray(n))return Ys(n,t);else if(n.value===t||n===t)return!0});class Ye extends E{static preferredTagName="tosi-select";static formAssociated=!0;static lightStyleSpec={":host":{"--tosi-select-gap":"var(--tosi-spacing-sm, 8px)","--tosi-select-touch-size":"var(--tosi-touch-size, 44px)","--tosi-select-padding":"0 var(--tosi-spacing-sm, 8px)","--tosi-select-value-padding":"0 var(--tosi-spacing-sm, 8px)","--tosi-select-icon-width":"24px","--tosi-select-field-width":"140px","--gap":"var(--tosi-select-gap)","--touch-size":"var(--tosi-select-touch-size)","--padding":"var(--tosi-select-padding)","--value-padding":"var(--tosi-select-value-padding)","--icon-width":"var(--tosi-select-icon-width)","--fieldWidth":"var(--tosi-select-field-width)",display:"inline-flex",position:"relative"},":host button":{display:"flex",alignItems:"center",justifyItems:"center",gap:L.tosiSelectGap,textAlign:"left",height:L.tosiSelectTouchSize,padding:L.tosiSelectPadding,position:"relative",width:"100%"},":host:not([show-icon]) button > :first-child":{display:"none"},":host[hide-caption] button > :nth-child(2)":{display:"none"},':host [part="value"]':{width:L.tosiSelectFieldWidth,padding:L.tosiSelectValuePadding,height:L.tosiSelectTouchSize,lineHeight:L.tosiSelectTouchSize,boxShadow:"none",whiteSpace:"nowrap",outline:"none",background:"transparent",flex:"1"},':host [part="value"]:not(:focus)':{overflow:"hidden",textOverflow:"ellipsis",background:"transparent"}};static initAttributes={editable:!1,placeholder:"",showIcon:!1,hideCaption:!1,localized:!1,disabled:!1,required:!1,name:"",menuClass:""};_options=[];get options(){return this._options}set options(e){if(typeof e==="string")this._options=Ye.parseOptionsString(e);else this._options=e;this.queueRender()}static parseOptionsString(e){return e.split(",").map((t)=>{let n=t.trim();if(n==="")return null;let[i,s]=n.split("=").map((l)=>l.trim());if(!s)return{value:i,caption:i};let[o,r]=s.split(":").map((l)=>l.trim());return{value:i,caption:o||i,icon:r||void 0}})}value="";filter="";isExpanded=!1;formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=""}setValue=(e,t=!1)=>{if(this.value!==e)this.value=e,this.queueRender(!0);if(t)this.dispatchEvent(new Event("action"))};getValue=()=>this.value;get selectOptions(){return this.options}buildOptionMenuItem=(e)=>{if(e===null)return null;let{setValue:t,getValue:n}=this,i,s,o,r,l;if(typeof e==="string")s=o=e;else({icon:i,caption:s,value:o,tooltip:r,properties:l}=e);if(this.localized)s=H(s);let{options:a}=e;if(a)return{icon:i,caption:s,tooltip:r,properties:l,checked:()=>Ys(a,n()),menuItems:a.map(this.buildOptionMenuItem)};return{icon:i,caption:s,tooltip:r,properties:l,checked:()=>n()===o,action:typeof o==="function"?async()=>{let c=await o();if(c!==void 0)t(c,!0)}:()=>{if(typeof o==="string")t(o,!0)}}};poppedOptions=[];get optionsMenu(){let e=this.selectOptions.map(this.buildOptionMenuItem);if(this.filter==="")return e;let t=(n)=>{if(n===null||typeof n==="function")return!0;else if(n.menuItems){let i=pe(n.menuItems);return n.menuItems=i.filter(t),i.length>0}else return n.caption.toLocaleLowerCase().includes(this.filter)};return e.filter(t)}handleChange=(e)=>{let{value:t}=this.parts,n=t.value||"";if(this.value!==String(n))this.value=n,this.dispatchEvent(new Event("change"));this.filter="",e.stopPropagation(),e.preventDefault()};handleKey=(e)=>{if(e.key==="Enter")e.preventDefault()};filterMenu=jt(()=>{this.filter=this.parts.value.value.toLocaleLowerCase(),j(0),this.popOptions()});popOptions=(e)=>{if(e&&e.type==="click")this.filter="";this.poppedOptions=this.optionsMenu,this.isExpanded=!0,this.updateAriaExpanded(),Ce({target:this,menuItems:this.poppedOptions,showChecked:!0,role:"listbox",menuClass:this.menuClass,onClose:()=>{this.isExpanded=!1,this.updateAriaExpanded()}})};updateAriaExpanded(){let{value:e}=this.parts;e.setAttribute("aria-expanded",String(this.isExpanded))}content=()=>[Ql({type:"button",part:"button",onClick:this.popOptions},Xs(),ea({part:"value",value:this.value,tabindex:0,role:"combobox",ariaHaspopup:"listbox",ariaExpanded:"false",ariaAutocomplete:this.editable?"list":"none",onKeydown:this.handleKey,onInput:this.filterMenu,onChange:this.handleChange}),x.chevronDown())];get allOptions(){let e=[];function t(n){for(let i of n)if(typeof i==="string")e.push({caption:i,value:i});else if(i?.value)e.push(i);else if(i?.options)t(i.options)}return t(this.selectOptions),e}findOption(){return this.allOptions.find((t)=>t.value===this.value)||{caption:this.value,value:this.value}}localeChanged=()=>{this.queueRender()};connectedCallback(){super.connectedCallback();let e=this.getAttribute("options");if(e&&this._options.length===0)this._options=Ye.parseOptionsString(e);if(this.localized)oi.allInstances.add(this)}disconnectedCallback(){if(super.disconnectedCallback(),this.localized)oi.allInstances.delete(this)}render(){super.render();let{value:e,button:t}=this.parts;t.disabled=this.disabled;let n=e.previousElementSibling,i=this.findOption(),s=Xs();if(e.value=this.localized?H(i.caption):i.caption,i.icon)if(i.icon instanceof HTMLElement)s=i.icon.cloneNode(!0);else s=x[i.icon]();n.replaceWith(s),e.setAttribute("placeholder",this.localized?H(this.placeholder):this.placeholder),e.style.pointerEvents=this.editable?"":"none",e.readOnly=!this.editable}}var ri=Ye.elementCreator(),Mc=_t((...e)=>ri(...e),"xinSelect is deprecated, use tosiSelect instead (tag is now <tosi-select>)");var{span:ta}=C,{i18n:Je}=Vt({i18n:{locale:window.navigator.language,locales:[window.navigator.language],languages:[window.navigator.language],emoji:[""],stringMap:{},localeOptions:[{icon:ta(),caption:window.navigator.language,value:window.navigator.language}]}});Rt.localeOptions={toDOM(e,t){if(e instanceof Ye)e.options=t}};var na=()=>{let e=Array.from(Ze.allInstances);for(let t of e)t.localeChanged();eo()};Je.locale.observe(na);var vt="data-tosi-localized";function Kt(e){let t=e.getAttribute(vt);if(!t)return;let n;try{n=JSON.parse(t)}catch(i){console.warn(`[data-tosi-localized] invalid JSON: ${t}`,i);return}if(!n||typeof n!=="object")return;for(let[i,s]of Object.entries(n)){if(typeof s!=="string")continue;e.setAttribute(i,H(s))}}function*Qs(e){for(let t of Array.from(e.querySelectorAll(`[${vt}]`)))yield t;for(let t of Array.from(e.querySelectorAll("*"))){let n=t.shadowRoot;if(n)yield*Qs(n)}}function eo(){if(typeof document>"u")return;for(let e of Qs(document))Kt(e)}var Js=null;if(typeof document<"u"&&typeof MutationObserver<"u"){let e=()=>{if(!document.body){queueMicrotask(e);return}Js=new MutationObserver((t)=>{for(let n of t){if(n.type==="attributes"&&n.target instanceof Element){Kt(n.target);continue}for(let i of Array.from(n.addedNodes)){if(!(i instanceof Element))continue;if(i.hasAttribute(vt))Kt(i);for(let s of Array.from(i.querySelectorAll(`[${vt}]`)))Kt(s)}}}),Js.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[vt]}),eo()};e()}var Lc=Gs((e)=>[e.caption.toLocaleLowerCase()]);var ia=/(?<=[^\s\\])#[A-Za-z0-9_-]+$/;function to(e){let t=ia.exec(e);return t?t.index:-1}function Zs(e){let t=to(e);return(t===-1?e:e.slice(0,t)).replace(/\\#/g,"#")}function sa(e,t){return e.replace(/\{([A-Za-z0-9_]+)\}/g,(n,i)=>Object.prototype.hasOwnProperty.call(t,i)?String(t[i]):n)}function H(e,t){if(t)return sa(H(e),t);if(e.endsWith("…"))return H(e.substring(0,e.length-1))+"…";let n=Je.locales.value.indexOf(Je.locale.value);if(n>-1){let i=B(Je.stringMap),s=e.toLocaleLowerCase(),o=i[s],r=o&&o[n],l=to(s);if((!r||r==='"')&&l>-1){let a=i[s.substring(0,l)];r=a&&a[n]}if(r){if(l>-1){let a=s.slice(l);if(r.toLocaleLowerCase().endsWith(a))r=r.slice(0,-a.length)}r=r.replace(/\\#/g,"#"),e=e.toLocaleLowerCase()===e?r.toLocaleLowerCase():r}else e=Zs(e)}else e=Zs(e);return e}class no extends E{static preferredTagName="tosi-locale-picker";static initAttributes={hideCaption:!1};content=()=>ri({part:"select",showIcon:!0,title:H("Language"),bindValue:Je.locale,bindLocaleOptions:Je.localeOptions});render(){super.render(),this.parts.select.toggleAttribute("hide-caption",this.hideCaption)}}var io=no.elementCreator();class Ze extends E{static preferredTagName="tosi-localized";static lightStyleSpec={":host":{pointerEvents:"none"}};static allInstances=new Set;static initAttributes={refString:""};contents=()=>C.tosiSlot();connectedCallback(){super.connectedCallback(),Ze.allInstances.add(this)}disconnectedCallback(){super.disconnectedCallback(),Ze.allInstances.delete(this)}localeChanged(){if(!this.refString)this.refString=this.textContent||"";this.textContent=this.refString?H(this.refString):""}render(){super.render(),this.localeChanged()}}var oi=Ze,so=Ze.elementCreator();var oa=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||"");var ra=[[/\^|ctrl-?/i,"ctrlKey"],[/⌘|meta-?/i,"metaKey"],[/⌥|⎇|alt-?|option-?/i,"altKey"],[/⇧|shift-?/i,"shiftKey"]],oo=(e)=>{let t=e.trim(),n={ctrlKey:!1,metaKey:!1,altKey:!1,shiftKey:!1,key:""};for(let[i,s]of ra)if(i.test(t))n[s]=!0,t=t.replace(i,"");return t=t.replace(/^-+/,""),n.key=t.toLowerCase(),n},ro=(e,t)=>{let n=oo(t);return e.key.toLowerCase()===n.key&&e.metaKey===n.metaKey&&e.ctrlKey===n.ctrlKey&&e.altKey===n.altKey&&e.shiftKey===n.shiftKey};var li=(e)=>{let t=oo(e);if(oa){let i=[];if(t.ctrlKey)i.push("⌃");if(t.altKey)i.push("⌥");if(t.shiftKey)i.push("⇧");if(t.metaKey)i.push("⌘");return i.push(t.key.toUpperCase()),i.join("")}let n=[];if(t.ctrlKey)n.push("Ctrl");if(t.altKey)n.push("Alt");if(t.shiftKey)n.push("Shift");if(t.metaKey)n.push("Meta");return n.push(t.key.toUpperCase()),n.join("+")};var ai=(e,t)=>{if(!e)return!1;for(let n of e)if(n==="special/any")return!0;else if(n.indexOf("*")>-1){let[i,s]=n.split("/"),[o,r]=t.split("/");if((i==="*"||i===o)&&(s==="*"||s===r))return!0}else if(n===t)return!0};var lo=(e,t=";")=>(e||"").split(t).map((n)=>n.trim()).filter((n)=>n!=="");var pe=(e)=>typeof e==="function"?e():e,{div:ao,button:xt,span:N,a:la,tosiSlot:aa}=C,ca=(e)=>{let t=[];for(let n of e)if(n===null){if(t.length>0&&t[t.length-1]!==null)t.push(n)}else t.push(n);while(t.length>0&&t[t.length-1]===null)t.pop();return t},Gt=(e,t,n=!1)=>{let i=[];for(let s of e){if(s===null){i.push(s);continue}if(typeof s==="function"){i.push(s);continue}let{acceptsDrop:o}=s;if(!o){if(!n)i.push({...s,enabled:()=>!1});continue}if(!t.some((a)=>ai(o,a))){if(!n)i.push({...s,enabled:()=>!1});continue}let l=s;if(l.menuItems){let a=Gt(pe(l.menuItems),t,!0);if(a.length>0||l.dropAction){let c=n?a:Gt(pe(l.menuItems),t,!1);i.push({...l,menuItems:c})}else if(!n)i.push({...l,enabled:()=>!1})}else i.push(s)}return ca(i)};var da={overflow:"hidden auto",maxHeight:`calc(${L.maxHeight} - ${m.menuInset("8px")})`,borderRadius:L.spacing50,background:m.menuBg("#fafafa"),boxShadow:m.menuShadow(`${L.spacing13} ${L.spacing50} ${L.spacing} #0004`)},ua={boxShadow:"none",border:"none !important",display:"grid",alignItems:"center",justifyContent:"flex-start",textDecoration:"none",gridTemplateColumns:"0px 1fr max-content",width:"100%",gap:0,background:"transparent",padding:m.menuItemPadding("0 8px"),height:m.menuItemHeight("48px"),lineHeight:m.menuItemHeight("48px"),textAlign:"left"},ha={color:m.menuItemColor("#222")},fa={boxShadow:"none !important",background:m.menuItemHoverBg("#eee")},co={boxShadow:"none !important",background:m.menuItemActiveBg("#aaa"),color:m.menuItemActiveColor("#000")},pa={background:`${m.menuDropOverBg("#2196F3")} !important`,color:`${m.menuDropOverColor("#fff")} !important`},ga={color:`${m.menuDropOverColor("#fff")} !important`},ma={stroke:`${m.menuDropOverColor("#fff")} !important`},uo={boxShadow:`inset 0 0 0 2px color-mix(in srgb, ${m.menuDropOverBg("#2196F3")} 50%, transparent) !important`},ya={".xin-menu, .tosi-menu":da,".xin-menu > div, .tosi-menu > div":{width:m.menuWidth("auto")},".xin-menu-trigger, .tosi-menu-trigger":{paddingLeft:0,paddingRight:0,minWidth:m.touchSize("48px")},".xin-menu-separator, .tosi-menu-separator":{display:"inline-block",content:" ",height:"1px",width:"100%",background:m.menuSeparatorColor("#2224"),margin:m.menuSeparatorMargin("8px 0")},".xin-menu-element, .tosi-menu-element":{minHeight:m.menuItemHeight("48px")},".xin-menu-item, .tosi-menu-item":ua,".xin-menu-item, .xin-menu-item > span, .tosi-menu-item, .tosi-menu-item > span":ha,".xin-menu-with-icons .xin-menu-item, .tosi-menu-with-icons .tosi-menu-item":{gridTemplateColumns:"24px 1fr max-content",gap:m.menuItemGap("8px")},".xin-menu-shortcut, .tosi-menu-shortcut":{whiteSpace:"nowrap",paddingLeft:"1em",textAlign:"right",opacity:"0.65"},".xin-menu-item > :first-child, .tosi-menu-item > :first-child":{justifySelf:"center",alignSelf:"center"},".xin-menu-item svg, .tosi-menu-item svg":{stroke:m.menuItemIconColor("#222")},".xin-menu-item.xin-menu-item-checked, .tosi-menu-item.tosi-menu-item-checked":{background:m.menuItemHoverBg("#eee")},".xin-menu-item > span:nth-child(2), .tosi-menu-item > span:nth-child(2)":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:"left"},".xin-menu-item:hover, .tosi-menu-item:hover":fa,".xin-menu-item.drag-target:hover, .tosi-menu-item.drag-target:hover":uo,".xin-menu-item:active, .tosi-menu-item:active":co,".xin-menu-item:active svg, .tosi-menu-item:active svg":{stroke:m.menuItemIconActiveColor("#000")},".xin-menu-item-highlight, .tosi-menu-item-highlight":co,".xin-menu-item-highlight svg, .tosi-menu-item-highlight svg":{stroke:m.menuItemIconActiveColor("#000")},".xin-drop-over, .tosi-drop-over":pa,".xin-drop-over > span, .tosi-drop-over > span":ga,".xin-drop-over svg, .tosi-drop-over svg":ma,".drag-target":uo},ho=!1;function ci(){if(ho)return;ho=!0,Ss("xin-menu-helper",ya),document.addEventListener("mousedown",(e)=>{if(D.length===0)return;let t=e.composedPath();if(!D.find((n)=>t.includes(n.target)||t.includes(n.menu)))j(0)}),document.body.addEventListener("keydown",(e)=>{if(e.key==="Escape")j(0)})}var va=(e,t)=>{let n=e.checked&&e.checked()&&"check"||!1,i=e?.icon||n||N(" ");if(typeof i==="string")i=x[i]();let s=t.role==="listbox"?"option":"menuitem",o,r=e.properties||{};if(typeof e?.action==="string")o=la(r,{role:s,href:e.action},i,t.localized?N(H(e.caption)):N(e.caption),N({class:"tosi-menu-shortcut"},e.shortcut?li(e.shortcut):" "));else o=xt(r,{role:s,onClick:e.action},i,t.localized?N(H(e.caption)):N(e.caption),N({class:"tosi-menu-shortcut"},e.shortcut?li(e.shortcut):" "));if(o.classList.add("xin-menu-item","tosi-menu-item"),o.classList.toggle("xin-menu-item-checked",n!==!1),o.classList.toggle("tosi-menu-item-checked",n!==!1),e.tooltip)o.dataset.tooltip=e.tooltip;if(t.role==="listbox")o.toggleAttribute("aria-selected",n!==!1);if(e?.enabled&&!e.enabled())o.setAttribute("disabled",""),o.setAttribute("aria-disabled","true");return o},ba=(e,t)=>{let n=e?.icon||N(" ");if(typeof n==="string")n=x[n]();let i=e.properties||{},s=xt(i,{onDragenter(o){et(),s.classList.add("xin-drop-over","tosi-drop-over"),o.preventDefault()},onDragover(o){if(o.preventDefault(),o.dataTransfer)o.dataTransfer.dropEffect="copy"},onDragleave(o){let r=o.relatedTarget;if(r&&s.contains(r))return;s.classList.remove("xin-drop-over","tosi-drop-over")},onDrop(o){if(o.preventDefault(),o.stopPropagation(),s.classList.remove("xin-drop-over","tosi-drop-over"),e.dropAction&&o.dataTransfer)e.dropAction(o.dataTransfer);j(0)}},n,t.localized?N(H(e.caption)):N(e.caption),N(" "));if(s.classList.add("xin-menu-item","tosi-menu-item"),e.tooltip)s.dataset.tooltip=e.tooltip;if(e.dropAction&&e.acceptsDrop)s.dataset.drop=e.acceptsDrop.join(";");if(e?.enabled&&!e.enabled())s.setAttribute("disabled",""),s.setAttribute("aria-disabled","true");return s},fo=(e,t)=>{let n=e.checked&&e.checked()&&"check"||!1,i=e?.icon||n||N(" ");if(typeof i==="string")i=x[i]();let s=null,o=!1,r=e.properties||{},l=xt(r,{disabled:!(!e.enabled||e.enabled()),onClick(a){if(t._dropMode)return;Ce(Object.assign({},t,{menuItems:pe(e.menuItems),target:l,submenuDepth:(t.submenuDepth||0)+1,position:"side"})),a.stopPropagation(),a.preventDefault()},onDragenter(a){if(!t._dropMode)return;et(),a.preventDefault(),a.stopPropagation();let c=a.relatedTarget;if(c&&l.contains(c))return;if(l.classList.add("xin-drop-over","tosi-drop-over"),o){if(j((t.submenuDepth||0)+1),o=!1,s)clearTimeout(s);s=null;return}if(s)clearTimeout(s);s=setTimeout(()=>{o=!0;let d=pe(e.menuItems),u=t._dataTypes?Gt(d,t._dataTypes,t.hideDisabled):d;if(u.length>0)Ce(Object.assign({},t,{menuItems:u,target:l,submenuDepth:(t.submenuDepth||0)+1,position:"side",_dropMode:!0,_dataTypes:t._dataTypes}))},t.disclosureDelay??200)},onDragover(a){if(!t._dropMode)return;if(a.preventDefault(),a.stopPropagation(),a.dataTransfer)a.dataTransfer.dropEffect=e.dropAction?"copy":"link"},onDragleave(a){if(!t._dropMode)return;let c=a.relatedTarget;if(c&&l.contains(c))return;if(o&&c&&D.some((d)=>d.menu.contains(c)||d.target.contains(c)))return;if(l.classList.remove("xin-drop-over","tosi-drop-over"),s)clearTimeout(s),s=null},onDrop(a){if(!t._dropMode||!e.dropAction)return;if(a.preventDefault(),a.stopPropagation(),l.classList.remove("xin-drop-over","tosi-drop-over"),a.dataTransfer)e.dropAction(a.dataTransfer);j(0)}},i,t.localized?N(H(e.caption)):N(e.caption),x.chevronRight({style:{justifySelf:"flex-end"}}));if(l.classList.add("xin-menu-item","tosi-menu-item"),e.tooltip)l.dataset.tooltip=e.tooltip;if(t._dropMode&&e.dropAction&&e.acceptsDrop)l.dataset.drop=e.acceptsDrop.join(";");return l},xa=(e,t)=>{if(e===null)return N({class:"xin-menu-separator tosi-menu-separator"});else if(typeof e==="function"){let n=e();return n.classList.add("xin-menu-element","tosi-menu-element"),n}else if(t._dropMode){let n=e;if(n.menuItems&&pe(n.menuItems).length>0)return fo(n,t);else if(e.dropAction)return ba(e,t);else{let s=e?.icon||N(" ");if(typeof s==="string")s=x[s]();return xt({class:"xin-menu-item tosi-menu-item",disabled:!0},s,t.localized?N(H(e.caption)):N(e.caption),N(" "))}}else{let n=e?.action?va(e,t):fo(e,t);if(t.showChecked&&e.checked&&e.checked())requestAnimationFrame(()=>{n.scrollIntoView({block:"center"})});return n}},wa=(e)=>{let{target:t,width:n,menuItems:i,role:s="menu"}=e,o=i.find((a)=>a!=null&&typeof a!=="function"&&(a.icon||a.checked)),r=e.submenuDepth||0,l=ao({class:[o?"xin-menu tosi-menu xin-menu-with-icons tosi-menu-with-icons":"xin-menu tosi-menu",e.menuClass??""].filter(Boolean).join(" "),role:s,onClick(){if(!e._dropMode)j(0)},onDragover(a){if(!e._dropMode)return;a.preventDefault()},onDragenter(){if(!e._dropMode)return;et()},onDragleave(a){if(!e._dropMode)return;let c=a.relatedTarget;if(c&&l.contains(c))return;if(c&&D.some((d)=>d.menu.contains(c)||d.target.contains(c)))return;po(r)}},ao({style:{minWidth:t.offsetWidth+"px",width:typeof n==="number"?`${n}px`:n},onMousedown(a){a.preventDefault(),a.stopPropagation()}},...i.map((a)=>xa(a,e))));return l},Qe,D=[],bt=null,et=()=>{if(bt)clearTimeout(bt),bt=null},po=(e)=>{et(),bt=setTimeout(()=>{bt=null,j(e)},500)},j=(e=0)=>{if(et(),e===0)document.querySelectorAll("tosi-menu.xin-drop-over, tosi-menu.tosi-drop-over").forEach((n)=>n.classList.remove("xin-drop-over","tosi-drop-over"));let t=D.splice(e);for(let n of t)if(n.menu.remove(),n.onClose)n.onClose();return Qe=t[0],e>0?D[e-1]:void 0},Ce=(e)=>{ci(),e=Object.assign({submenuDepth:0},e);let{target:t,position:n,submenuDepth:i}=e;if(Qe&&!document.body.contains(Qe?.menu))Qe=void 0;if(D.length&&!document.body.contains(D[0].menu))D.splice(0);if(e._dropMode){if(D.length>i&&D[i]?.target===t)return;j(i)}else{if(i===0&&Qe?.target===t)return;let r=j(i);if(Qe?.target===t)return;if(r&&r.target===t){j();return}}if(!e.menuItems?.length)return;let s=wa(e),o=Ks({content:s,target:t,position:n});o.remainOnScroll=e._dropMode?"remain":"remove",D.push({target:t,menu:o,onClose:e.onClose})},Ca=(e)=>{ci();let{dataTypes:t,...n}=e,i=Gt(e.menuItems,t,e.hideDisabled);if(!i.length)return;Ce({...n,menuItems:i,_dropMode:!0,_dataTypes:t})};function go(e,t,n=[]){for(let i of e){if(!i)continue;if(typeof i==="function")continue;let{shortcut:s}=i,{menuItems:o}=i;if(s){if(ro(t,s)){let r=i;if(r.enabled&&!r.enabled())return;if(n.some((l)=>l.enabled&&!l.enabled()))return;return{action:r,path:n}}}else if(o){let r=go(pe(o),t,[...n,i]);if(r)return r}}return}class mo extends E{static preferredTagName="tosi-menu";static lightStyleSpec={":host":{display:"inline-flex",minWidth:L.touchSize,minHeight:L.touchSize},":host button":{margin:0,padding:0,alignSelf:"stretch",flex:"1",textAlign:"center"},":host button > tosi-slot":{display:"flex",alignItems:"center",gap:m.tosiMenuTriggerGap("10px")}};static initAttributes={menuWidth:"auto",localized:!1,icon:"",acceptsDrop:"",disclosureDelay:0,hideDisabled:!1,menuClass:""};menuItems=[];dropAction=null;_dragMatches=!1;_matchesDrag(e){if(!this.acceptsDrop)return!1;let t=lo(this.acceptsDrop);return[...e.dataTransfer?.types||[]].some((i)=>t.some((s)=>ai([s],i)))}showMenu=(e)=>{if(e.type==="click"||e.code==="Space")Ce({target:this.parts.trigger,width:this.menuWidth,localized:this.localized,menuItems:this.menuItems,menuClass:this.menuClass}),e.stopPropagation(),e.preventDefault()};handleDragEnter=(e)=>{if(this._dragMatches=this._matchesDrag(e),!this._dragMatches)return;et(),this.classList.add("xin-drop-over","tosi-drop-over");let t=[...e.dataTransfer?.types||[]];if(this.menuItems.length)Ca({target:this.parts.trigger,menuItems:this.menuItems,dataTypes:t,width:this.menuWidth,localized:this.localized,disclosureDelay:this.disclosureDelay||void 0,hideDisabled:this.hideDisabled,menuClass:this.menuClass});e.preventDefault()};handleDragOver=(e)=>{if(!this._dragMatches)return;if(e.preventDefault(),e.dataTransfer)e.dataTransfer.dropEffect=this.dropAction?"copy":"link"};handleDragLeave=(e)=>{if(!this._dragMatches)return;let t=e.relatedTarget;if(t&&this.contains(t))return;if(t&&D.some((n)=>n.menu.contains(t)||n.target.contains(t))){this.classList.remove("xin-drop-over","tosi-drop-over");return}this.classList.remove("xin-drop-over","tosi-drop-over"),po(0)};handleDrop=(e)=>{if(!this._dragMatches||!this.dropAction)return;if(e.preventDefault(),e.stopPropagation(),this.classList.remove("xin-drop-over","tosi-drop-over"),e.dataTransfer)this.dropAction(e.dataTransfer);j(0)};content=()=>xt({tabindex:0,part:"trigger",onClick:this.showMenu},aa());handleShortcut=async(e)=>{let t=go(this.menuItems,e);if(!t)return;e.preventDefault(),e.stopImmediatePropagation();let{action:n,path:i}=t;if(this.isConnected&&document.body.contains(this))await this.animateShortcut(i,n);if(n.action instanceof Function)n.action()};findMenuItemByCaption(e,t){for(let n of e.querySelectorAll(".xin-menu-item")){let i=n.children[1];if(i&&i.textContent===t)return n}return null}async animateShortcut(e,t){j(0),Ce({target:this.parts.trigger,width:this.menuWidth,localized:this.localized,menuItems:this.menuItems}),await new Promise((i)=>setTimeout(i,80));for(let i=0;i<e.length;i++){let s=i+1,o=D[i]?.menu;if(!o)break;let r=this.findMenuItemByCaption(o,e[i].caption);if(!r)break;Ce({target:r,width:this.menuWidth,localized:this.localized,menuItems:pe(e[i].menuItems),submenuDepth:s,position:"side"}),await new Promise((l)=>setTimeout(l,80))}let n=D[D.length-1]?.menu;if(n){let i=this.findMenuItemByCaption(n,t.caption);if(i)i.classList.add("xin-menu-item-highlight","tosi-menu-item-highlight")}await new Promise((i)=>setTimeout(i,300)),j(0)}constructor(){super();this.addEventListener("keydown",this.showMenu),this.addEventListener("dragenter",this.handleDragEnter),this.addEventListener("dragover",this.handleDragOver),this.addEventListener("dragleave",this.handleDragLeave),this.addEventListener("drop",this.handleDrop)}connectedCallback(){if(super.connectedCallback(),ci(),document.addEventListener("keydown",this.handleShortcut,!0),this.acceptsDrop)this.dataset.drop=this.acceptsDrop}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleShortcut)}}var ke=mo.elementCreator();var{button:ka,span:yo}=C;Rs({highlighter:'<svg class="stroked" viewBox="0 0 24 24"><path d="m9 11-6 6v3h9l3-3"></path><path d="m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"></path></svg>'});var vo="tosijs-styled-editor-menu";function Oe(){return()=>{let e=yo({style:{display:"none"}});return queueMicrotask(()=>{e.closest(".tosi-menu")?.classList.add(vo)}),e}}function I(e,t,n,i){let s={title:e,value:t,dataTosiLocalized:JSON.stringify({title:e})};if(i)s.dataShortcut=i;return ka(s,n)}function ze(e="8px"){return yo({style:{display:"inline-block",width:e}})}function De(e){return so({refString:e})}function di(){return io({slot:"menubar",hideCaption:!0})}function y(e,t,n){return{caption:t,action(){e.doCommand(n)}}}function bo(e){return ke({slot:"menubar",localized:!0,menuItems:[Oe(),y(e,"Title","setBlockType h1"),y(e,"Heading","setBlockType h2"),y(e,"Subheading","setBlockType h3"),y(e,"Minor Heading","setBlockType h4"),null,y(e,"Body","setBlockType p"),y(e,"Code Block","setBlockType pre"),y(e,"Blockquote","setBlockType blockquote"),null,y(e,"Bulleted List","setList ul"),y(e,"Numbered List","setList ol"),y(e,"No List","setList none")]},x.type()," ",De("Style"))}function xo(e){return ke({slot:"menubar",localized:!0,menuItems:[Oe(),y(e,"Left","setBlocks text-align left"),y(e,"Center","setBlocks text-align center"),y(e,"Right","setBlocks text-align right"),y(e,"Justify","setBlocks text-align justify")]},x.alignLeft()," ",De("Align"))}function wo(e){return ke({slot:"menubar",localized:!0,menuItems:[Oe(),y(e,"Times New Roman","setText font-family Times+New+Roman"),y(e,"Georgia","setText font-family Georgia"),y(e,"Helvetica","setText font-family Helvetica"),y(e,"Arial","setText font-family Arial"),null,y(e,"Serif","setText font-family serif"),y(e,"Sans-serif","setText font-family sans-serif"),y(e,"Monospace","setText font-family monospace")]},x.type()," ",De("Font"))}function Co(e){return ke({slot:"menubar",localized:!0,menuItems:[Oe(),y(e,"10","setText font-size 10px"),y(e,"12","setText font-size 12px"),y(e,"14","setText font-size 14px"),y(e,"18","setText font-size 18px"),y(e,"24","setText font-size 24px"),y(e,"36","setText font-size 36px")]}," ",De("Size"))}function ko(e){return ke({slot:"menubar",localized:!0,menuItems:[Oe(),y(e,"Single","setBlocks line-height unset"),y(e,"1.5","setBlocks line-height 1.875"),y(e,"Double","setBlocks line-height 2.5")]}," ",De("Spacing"))}function ui(){return[I("Bold","setText font-weight bold",x.fontBold(),"ctrl+b"),I("Italic","setText font-style italic",x.fontItalic(),"ctrl+i"),I("Underline","setText text-decoration underline",x.underline(),"ctrl+u"),I("Highlight","setText background-color rgba(255,255,64,0.5)",x.highlighter())]}function Mo(){return[I("Align Left","setBlocks text-align left",x.alignLeft()),I("Center","setBlocks text-align center",x.alignCenter()),I("Align Right","setBlocks text-align right",x.alignRight()),I("Justify","setBlocks text-align justify",x.alignJustify()),ze(),I("Bulleted List","setList ul",x.listBullet()),I("Numbered List","setList ol",x.listNumber()),ze(),I("Indent","setBlocks margin-left 40px",x.indent()),I("Outdent","setBlocks margin-left 0px",x.outdent())]}function hi(){return[I("Undo","updateUndo undo",x.rotateCcw(),"ctrl+z"),I("Redo","updateUndo redo",x.rotateCw(),"ctrl+y")]}function Eo(){return I("Toggle Debug","setDebug",x.bug())}function fi(){return[...ui(),ze(),...hi()]}function pi(){return[...ui(),ze(),...Mo(),ze(),...hi(),ze(),Eo()]}function So(e){return ke({slot:"menubar",localized:!0,menuItems:[Oe(),{caption:"Link…",action(){let t=prompt("Link URL");if(!t)return;let n=prompt("Target (blank for a new tab)","_blank");e.doCommandWith("setLink",t,n||"_blank")}},{caption:"Remove Link",action:()=>e.doCommand("removeLink")},null,{caption:"Image…",action(){let t=prompt("Image URL");if(!t)return;let n=prompt("Alt text (describe the image)")||"";e.doCommandWith("insertImage",t,n)}},null,{caption:"Footnote",action:()=>e.doCommand("insertFootnote")},{caption:"Renumber Footnotes",action:()=>e.doCommand("renumberFootnotes")}]},x.link()," ",De("Insert"))}function Ao(e){return ke({slot:"menubar",localized:!0,menuItems:[Oe(),{caption:"Insert Table",menuItems:[y(e,"2 Columns","insertTable 2"),y(e,"3 Columns","insertTable 3"),y(e,"4 Columns","insertTable 4"),y(e,"5 Columns","insertTable 5")]},null,y(e,"Insert Row After","insertTableRow after"),y(e,"Insert Row Before","insertTableRow before"),y(e,"Insert Column After","insertTableCol after"),y(e,"Insert Column Before","insertTableCol before"),null,y(e,"Delete Row","deleteTableRow"),y(e,"Delete Column","deleteTableCol"),null,y(e,"Toggle Header Row","toggleHeaderRow")]},x.grid()," ",De("Table"))}function gi(e){return[bo(e),So(e),xo(e),wo(e),Co(e),ko(e),Ao(e)]}var{slot:To,div:mi}=C,Ma=/[\u0591-\u07FF\u08A0-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,Ea=/[A-Za-z\u00C0-\u024F\u0370-\u04FF]/;function Sa(e){if(Ma.test(e))return"rtl";if(Ea.test(e))return"ltr";return null}function Q(e){if(e instanceof Element)return!e.classList.contains("sel-start")&&!e.classList.contains("sel-end");return e.nodeType!==3||e.textContent!==""}class yi extends E{static formAssociated=!0;static preferredTagName="tosijs-styled-editor";static initAttributes={widgets:"none",localized:!1,name:"",required:!1};static shadowStyleSpec={":host":{display:"flex",flexDirection:"column",position:"relative","--editor-ink":"#27488c","--editor-surface":"Canvas","--editor-text":"CanvasText","--editor-menubar-bg":"color-mix(in oklab, var(--editor-ink) 14%, var(--editor-surface))","--editor-toolbar-bg":"color-mix(in oklab, var(--editor-ink) 6%, var(--editor-surface))","--editor-edge":"color-mix(in oklab, var(--editor-ink) 25%, transparent)","--editor-chrome-text":"color-mix(in oklab, var(--editor-ink) 30%, var(--editor-text))",background:"var(--editor-surface)",color:"var(--editor-text)",colorScheme:"light dark"},":host ::slotted(*)":{flex:"0 0 auto"},':host [part="menubar"]':{flexShrink:"0",padding:"0 2px",display:"flex",gap:"0",flex:"0 0 auto",flexWrap:"wrap",alignItems:"center",background:"var(--editor-menubar-bg)",borderBottom:"1px solid var(--editor-edge)"},':host(:not([has-menubar])) [part="menubar"]':{display:"none"},':host [part="toolbar"]':{flexShrink:"0",padding:"1px 3px",display:"flex",gap:"1px",flex:"0 0 auto",flexWrap:"wrap",alignItems:"center",background:"var(--editor-toolbar-bg)",borderBottom:"1px solid var(--editor-edge)"},':host(:not([has-toolbar])) [part="toolbar"]':{display:"none"},':host [part="doc"]':{flex:"1 1 auto",minHeight:"0",background:"var(--editor-surface)",padding:"8px",cursor:"text",overflowY:"auto",position:"relative",touchAction:"manipulation",transition:"padding-top 0.15s ease-out, padding-bottom 0.15s ease-out"},':host [part="doc"] > *':{position:"relative",padding:"4px 8px",margin:"0"},':host [part="doc"] > blockquote':{padding:"4px 40px"},':host [part="doc"] img':{maxWidth:"100%",height:"auto",verticalAlign:"bottom"},':host [part="doc"] a':{color:"color-mix(in oklab, var(--editor-ink) 65%, var(--editor-text))",textDecoration:"underline"},':host [part="doc"] .footnote-ref':{fontSize:"0.75em",lineHeight:"0",verticalAlign:"super"},':host [part="doc"] .footnote-ref a':{textDecoration:"none",padding:"0 1px"},':host [part="doc"] ol.footnotes':{marginTop:"16px",paddingTop:"8px",borderTop:"1px solid var(--editor-edge)",fontSize:"0.85em"},':host [part="doc"] code:not([dir]), :host [part="doc"] kbd:not([dir]), :host [part="doc"] samp:not([dir])':{direction:"ltr",unicodeBidi:"isolate"},":host .sel-start, :host .sel-end":{display:"contents"},':host [part="caret"]':{position:"absolute",display:"none",width:"2px",padding:"0",margin:"0",border:"0",outline:"none",fontSize:"16px",lineHeight:"1",background:"var(--editor-text)",color:"transparent",caretColor:"transparent",pointerEvents:"none",zIndex:"3"},':host [part="caret"].-collapsed':{animation:"blink 1s steps(2, start) infinite"},":host .selection-edge":{position:"absolute",display:"none",width:"2px",pointerEvents:"none",zIndex:"3"},":host .selection-edge.-start":{background:"color-mix(in oklab, green 70%, var(--editor-text))"},":host .selection-edge.-end":{background:"color-mix(in oklab, red 70%, var(--editor-text))"},":host tosi-ins":{textDecoration:"underline",textDecorationColor:"color-mix(in oklab, green 60%, var(--editor-text))",background:"color-mix(in oklab, green 12%, transparent)"},":host tosi-del":{textDecoration:"line-through",textDecorationColor:"color-mix(in oklab, red 60%, var(--editor-text))",background:"color-mix(in oklab, red 12%, transparent)",opacity:"0.75"},":host tosi-misspelling":{textDecoration:"underline wavy",textDecorationColor:"color-mix(in oklab, red 70%, var(--editor-text))",textDecorationSkipInk:"none",textUnderlineOffset:"2px"},":host .selected":{background:"color-mix(in oklab, var(--editor-ink) 42%, color-mix(in oklab, white 38%, var(--editor-surface)))"},":host .selected-block":{background:"color-mix(in oklab, var(--editor-ink) 12%, color-mix(in oklab, white 21%, var(--editor-surface)))"},":host .first-block":{position:"relative"},":host .last-block":{position:"relative"},".debug .spanified":{boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.15)"},":host .spanified-word":{display:"inline"},":host .annotation::after":{position:"relative",top:"-4px",content:'"\\2020"'},":host .annotation > span":{display:"block",padding:"4px 8px",fontWeight:"normal",fontStyle:"normal",fontSize:"12px",background:"#ffc",position:"absolute",right:"0",maxWidth:"200px"},':host [part="doc"] *':{userSelect:"none",webkitUserSelect:"none"},":host ul, :host ol":{paddingLeft:"30px"},".debug .sel-start":{background:"green",opacity:"0.5",width:"2px",minHeight:"1em",display:"inline-block"},".debug .sel-end":{background:"red",opacity:"0.5",width:"2px",minHeight:"1em",display:"inline-block"},".debug .selected-block":{outline:"1px dashed blue"},":host .editor-table":{display:"grid",listStyle:"none",padding:"0",margin:"8px 0",border:"1px solid #ccc",borderRadius:"2px"},":host .editor-table > li":{padding:"4px 8px",borderRight:"1px solid #ddd",borderBottom:"1px solid #ddd",minHeight:"1.5em",outline:"none"},":host .editor-table > li.table-header":{fontWeight:"bold",background:"#f0f0f0"},":host .touch-affordances":{display:"none",position:"absolute",pointerEvents:"none",zIndex:"1000",top:"0",left:"0",width:"0",height:"0",transition:"opacity 0.1s ease-out"},":host .touch-affordance":{position:"absolute",width:"44px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto",touchAction:"none",background:"transparent",transition:"left 0.1s ease-out, top 0.1s ease-out"},":host .touch-affordances.dragging .touch-affordance":{transition:"none"},":host .touch-icon":{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",background:"#0078ff",color:"white",fontSize:"13px",fontWeight:"bold",border:"2px solid white",boxShadow:"0 1px 6px rgba(0,0,0,0.4)"},":host .touch-icon svg":{width:"16px",height:"16px",stroke:"white",fill:"none"},":host .touch-handle-start .touch-icon":{borderRadius:"4px 4px 0 4px"},":host .touch-handle-end .touch-icon":{borderRadius:"0 4px 4px 4px"},":host .touch-context-menu .touch-icon":{borderRadius:"4px"},":host .touch-menu":{position:"absolute",display:"flex",gap:"0",background:"rgba(0,0,0,0.85)",borderRadius:"8px",padding:"0",zIndex:"1001",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",overflow:"hidden"},":host .touch-menu-item":{background:"transparent",color:"white",border:"none",padding:"12px 16px",fontSize:"15px",borderRadius:"0",whiteSpace:"nowrap",margin:"0"}};static lightStyleSpec={".tosijs-styled-editor-menu":{"--menu-item-height":"30px","--menu-item-padding":"0 16px","--menu-separator-margin":"4px 0","--menu-inset":"4px"},'tosijs-styled-editor button[slot="toolbar"]':{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"26px",height:"26px",padding:"0",border:"0",borderRadius:"4px",background:"transparent",boxShadow:"none",color:"var(--editor-chrome-text) !important",cursor:"pointer"},'tosijs-styled-editor button[slot="toolbar"]:hover:not([disabled])':{background:"color-mix(in oklab, currentColor 16%, transparent)"},'tosijs-styled-editor button[slot="toolbar"]:active:not([disabled])':{background:"color-mix(in oklab, currentColor 28%, transparent)"},'tosijs-styled-editor button[slot="toolbar"][disabled]':{opacity:"0.35",cursor:"default",background:"transparent"},'tosijs-styled-editor button[slot="toolbar"] svg':{width:"18px",height:"18px"},'tosijs-styled-editor [slot="menubar"] button':{background:"transparent",border:"0",boxShadow:"none",borderRadius:"4px",padding:"4px 10px",color:"var(--editor-chrome-text) !important",cursor:"pointer"},'tosijs-styled-editor [slot="menubar"] button:hover':{background:"color-mix(in oklab, currentColor 16%, transparent)"},'tosijs-styled-editor [slot="menubar"] button svg':{width:"16px",height:"16px"}};selectable;active=!0;pastemode="merge";undo=[];undoDepth=0;reasonForLastUndo;lastKey=0;lastCursorX=0;isInitialized=!1;touchAffordances=null;touchHandleStart=null;touchContextMenu=null;touchHandleEnd=null;touchMenuEl=null;isTouchInteraction=!1;touchDrags=new Map;resizeTable=null;resizeCol=-1;resizeStartX=0;resizeStartWidths=[];_value="";get docHTML(){this.touchAffordances?.remove();let e=Array.from(this.parts.doc.querySelectorAll(Ft)).map((n)=>({el:n,parent:n.parentNode,next:n.nextSibling,children:Array.from(n.childNodes)}));for(let{el:n,parent:i}of e){while(n.firstChild)i.insertBefore(n.firstChild,n);n.remove()}let t=this.parts.doc.innerHTML;for(let{el:n,parent:i,next:s,children:o}of e.reverse()){i.insertBefore(n,s&&s.parentNode===i?s:null);for(let r of o)n.appendChild(r)}if(this.touchAffordances)this.parts.doc.appendChild(this.touchAffordances);return t}set docHTML(e){if(this.touchAffordances?.remove(),this.parts.doc.innerHTML=e,this.touchAffordances)this.parts.doc.appendChild(this.touchAffordances);this.syncSpellingValidity()}get value(){return this.isInitialized?this.docHTML:this._value}set value(e){let t=this._value;if(this._value=e,this.isInitialized&&this.docHTML!==e)this.docHTML=e;if(t!==e&&this.internals)this.internals.setFormValue(e)}commands={...dt};changeAuthor={id:"user",name:"You"};async reviseWith(e,t=this.changeAuthor){Ge(),this.selectable.removeBounds(),this.normalize();let n=[],i=document.createTreeWalker(this.parts.doc,NodeFilter.SHOW_TEXT),s;while(s=i.nextNode()){let r=s;if(!r.data.trim())continue;if(!Wt(r,`${he}, ${K}`))continue;n.push(r)}let o=0;try{for(let r of n){if(!r.isConnected)continue;let l=await e(r.data);if(typeof l!=="string")continue;o+=Qn(r,l,t)}}finally{if(o>0)this.normalize(),this.updateUndo("new","revise")}return o}trackChanges=!1;sessionId=`s-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;currentInsertion(){let t=this.insertionPoint()?.closest(he);if(!t)return null;if(t.getAttribute("data-author")!==this.changeAuthor.id)return null;if(t.getAttribute("data-session")!==this.sessionId)return null;return t}enterInsertion(){if(!this.trackChanges)return;if(this.currentInsertion())return;let e=this.insertionPoint();if(!e||e.closest(K))return;let t=this.openInsertion();if(t)t.appendChild(e)}openInsertion(){let e=this.insertionPoint();if(!e||e.closest(K))return null;Ge();let t=document.createElement(he);if(t.setAttribute("data-change",Ne()),t.setAttribute("data-author",Z(this.changeAuthor.id)),this.changeAuthor.name)t.setAttribute("data-author-name",Z(this.changeAuthor.name));t.setAttribute("data-session",this.sessionId),t.setAttribute("data-time",new Date().toISOString());let n=e.closest(he);if(!n?.parentNode)return e.before(t),t;let i=document.createElement(he);for(let o of Array.from(n.attributes))i.setAttribute(o.name,o.value);let s=document.createRange();if(s.setStartAfter(e),s.setEnd(n,n.childNodes.length),i.appendChild(s.extractContents()),n.after(t),i.firstChild&&!it(i))t.after(i);return t}trackDeletion(e,t){if(!this.trackChanges)return!1;Ge();let n=t??Ne();for(let i of e){let s=i.nodeType===3?i.parentElement:i;if(s?.closest(K))continue;let o=s?.closest(he);if(o&&o.getAttribute("data-author")===this.changeAuthor.id&&o.getAttribute("data-session")===this.sessionId){i.parentNode?.removeChild(i);continue}let r=i.nodeType===1&&i.parentNode===this.parts.doc?i:null;if(r&&!r.firstChild)continue;if(r?.firstElementChild?.matches?.(K)&&r.children.length===1)continue;let l=document.createElement(K);if(l.setAttribute("data-change",n),l.setAttribute("data-author",Z(this.changeAuthor.id)),this.changeAuthor.name)l.setAttribute("data-author-name",Z(this.changeAuthor.name));if(l.setAttribute("data-session",this.sessionId),l.setAttribute("data-time",new Date().toISOString()),r){l.setAttribute("data-block-delete","");while(r.firstChild)l.appendChild(r.firstChild);r.appendChild(l)}else i.parentNode?.insertBefore(l,i),l.appendChild(i)}return!0}deletionTarget(e,t,n){let i=n==="back"?q:F,s=i(e,t,Q);if(!this.trackChanges)return s;let o=(r)=>!!(r.nodeType===3?r.parentElement:r)?.closest(K);while(s&&o(s))s=i(s,t,Q);return s}removeNode(e,t){if(!this.trackDeletion([e],t))e.parentNode?.removeChild(e)}deleteEdgeCharacter(e,t){if(!this.trackChanges){e.data=t==="end"?e.data.slice(0,-1):e.data.slice(1);return}if(e.parentElement?.closest(K))return;let n=t==="end"?e.splitText(e.data.length-1):e;if(t==="start")n.splitText(1);this.trackDeletion([n])}get refusesStructuralDelete(){return this.trackChanges}asUntracked(e){let t=this.trackChanges;this.trackChanges=!1;try{return e()}finally{this.trackChanges=t}}refuseStructural(e){let t=new CustomEvent("structural-edit-refused",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,author:this.changeAuthor}});return this.dispatchEvent(t)}get changes(){return Yn(this.parts.doc)}acceptChanges(e){if(e==="")return;let t=this.changes.filter((i)=>!e||i.id===e),n=t.filter((i)=>i.kind==="delete"&&i.element.hasAttribute("data-block-delete")).map((i)=>i.element.parentElement).filter((i)=>!!i&&i.parentNode===this.parts.doc);for(let i of t)Jn(i.element);for(let i of n)if(i.isConnected&&!i.querySelector(".caret, .sel-end, .sel-start")&&it(i))i.remove();if(t.length)this.normalize(),this.updateUndo("new","accept-changes")}rejectChanges(e){if(e==="")return;let t=this.changes.filter((n)=>!e||n.id===e);for(let n of t)Zn(n.element);if(t.length)this.normalize(),this.updateUndo("new","reject-changes")}spellChecker=null;documentWords=new Set;userDictionary=new Set;handleWordAccepted=null;get acceptedWords(){return new Set([...this.documentWords,...this.userDictionary])}async checkSpelling(){if(!this.spellChecker)return[];qt();let e=await ii(this.parts.doc,this.spellChecker,this.acceptedWords,(t)=>this.selectable.withoutBounds(t));return this.applySpellingValidity(e),e}get spellingErrors(){return Array.from(this.parts.doc.querySelectorAll(Ft)).map((e)=>({word:e.textContent||"",element:e}))}acceptWord(e,t="document"){if(t==="dictionary")this.userDictionary.add(e);else this.documentWords.add(e);this.handleWordAccepted?.(e,t),this.dropMarksFor(e)}dropMarksFor(e){for(let t of this.spellingErrors){if(t.word!==e)continue;let n=t.element.parentNode;if(!n)continue;while(t.element.firstChild)n.insertBefore(t.element.firstChild,t.element);t.element.remove()}this.parts.doc.normalize(),this.applySpellingValidity(this.spellingErrors)}clearSpelling(){yt(this.parts.doc),this.applySpellingValidity([])}syncSpellingValidity(){if(!this.spellChecker&&!this.internals)return;this.applySpellingValidity(this.spellingErrors)}applySpellingValidity(e){if(!this.internals)return;if(e.length===0){this.internals.setValidity({});return}let t=e[0];this.internals.setValidity({customError:!0},e.length===1?`"${t.word}" may be misspelled`:`${e.length} words may be misspelled, starting with "${t.word}"`,t.element)}sanitize=Ct;content=[To({name:"menubar",part:"menubar"}),To({name:"toolbar",part:"toolbar"}),mi({part:"doc",tabindex:"0"}),C.input({part:"caret",class:"caret-paint"}),mi({part:"edgeStart",class:"selection-edge -start"}),mi({part:"edgeEnd",class:"selection-edge -end"})];formResetCallback(){this.value=""}connectedCallback(){super.connectedCallback();let{doc:e}=this.parts;if(e.innerHTML==="")if(this._value.trim()!=="")e.innerHTML=this._value;else{let o=Array.from(this.childNodes).filter((r)=>!(r instanceof Element&&r.hasAttribute("slot")));if(o.length>0){let r=document.createDocumentFragment();for(let l of o)r.appendChild(l);e.appendChild(r)}}this.isInitialized=!0,this.selectable=new st(e);let t=e.querySelector("p,h1,h2,h3,h4,h5,h6,div,blockquote,pre")||e.firstElementChild;if(t)t.appendChild(this.selectable.createBounds());this.selectable.normalize(),e.addEventListener("keydown",this.handleKeydown,!0),e.addEventListener("keypress",this.handleKeypress),e.addEventListener("copy",this.handleCopy),e.addEventListener("cut",this.handleCut),e.addEventListener("paste",this.handlePaste),e.addEventListener("pointerdown",this.handleResizePointerDown),e.addEventListener("pointermove",this.handleResizePointerMove),e.addEventListener("pointerup",this.handleResizePointerUp),this.touchAffordances=document.createElement("div"),this.touchAffordances.className="touch-affordances not-selectable do-not-spanify",this.touchHandleStart=document.createElement("div"),this.touchHandleStart.className="touch-affordance touch-handle-start not-selectable do-not-spanify";let n=document.createElement("span");n.className="touch-icon",n.appendChild(x.chevronLeft()),this.touchHandleStart.appendChild(n),this.touchContextMenu=document.createElement("div"),this.touchContextMenu.className="touch-affordance touch-context-menu not-selectable do-not-spanify";let i=document.createElement("span");i.className="touch-icon",i.innerHTML="⋮",this.touchContextMenu.appendChild(i),this.touchHandleEnd=document.createElement("div"),this.touchHandleEnd.className="touch-affordance touch-handle-end not-selectable do-not-spanify";let s=document.createElement("span");s.className="touch-icon",s.appendChild(x.chevronRight()),this.touchHandleEnd.appendChild(s),this.touchAffordances.append(this.touchHandleStart,this.touchContextMenu,this.touchHandleEnd),e.appendChild(this.touchAffordances);for(let o of[this.touchHandleStart,this.touchHandleEnd])o.addEventListener("pointerdown",this.handleAffordanceDragStart),o.addEventListener("pointermove",this.handleAffordanceDragMove),o.addEventListener("pointerup",this.handleAffordanceDragEnd);this.touchContextMenu.addEventListener("pointerdown",this.handleTouchContextMenu),e.addEventListener("selectionchanged",()=>{if(this.isTouchInteraction=this.selectable.touchMode,!this.touchMenuEl)this.updateUndo("new","selectionchanged");this.updateTouchAffordances()}),e.addEventListener("click",this.handleDocClick),e.addEventListener("dragstart",this.handleDragStart),e.addEventListener("dragover",this.handleDragOver),e.addEventListener("drop",this.handleDrop),e.addEventListener("dragend",this.handleDragEnd),e.setAttribute("data-drop","text/html;text/plain;Files;image/*"),this.addEventListener("click",this.handleToolbarClick),this.addEventListener("change",this.handleToolbarChange),this.selectable.focusTarget=this.parts.caret,this.selectable.onBoundsChanged=()=>this.syncCaret(),this.syncCaret(),this.parts.doc.addEventListener("scroll",this.handleGeometryChange,{capture:!0,passive:!0}),window.addEventListener("resize",this.handleGeometryChange,{passive:!0}),this.geometryObserver=new ResizeObserver(this.handleGeometryChange),this.geometryObserver.observe(this.parts.doc,{box:"content-box"}),this.geometryObserver.observe(this,{box:"border-box"}),this.applyWidgets(),this.trackBar(this.parts.menubar,"has-menubar"),this.trackBar(this.parts.toolbar,"has-toolbar"),this.updateUndo("init"),this.focus()}trackBar(e,t){let n=()=>this.toggleAttribute(t,e.assignedNodes({flatten:!0}).length>0);e.addEventListener("slotchange",n),n()}applyWidgets(){let e=this.widgets;if(e!=="default"&&e!=="minimal")return;if(this.querySelector('[slot="toolbar"], [slot="menubar"]'))return;if(e==="default"){for(let t of gi(this))this.appendChild(t);if(this.localized)this.appendChild(di())}for(let t of e==="minimal"?fi():pi())t.setAttribute("slot","toolbar"),this.appendChild(t)}disconnectedCallback(){super.disconnectedCallback(),this.selectable?.destroy(),this.parts?.doc?.removeEventListener("scroll",this.handleGeometryChange,{capture:!0}),window.removeEventListener("resize",this.handleGeometryChange),this.geometryObserver?.disconnect()}geometryObserver=null;handleGeometryChange=()=>{if(this.syncCaret(),this.touchAffordances?.style.display==="block")this.positionAffordances()};markerRect(e){let t=Et(e,this.parts.doc);if(t)return{left:t.left,top:t.top,right:t.left,bottom:t.top+t.height,width:0,height:t.height};return e.getBoundingClientRect()}syncCaret(){let e=this.parts.caret,t=this.parts.edgeStart,n=this.parts.edgeEnd,i=this.parts.doc,s=i.querySelector(".sel-start"),o=i.querySelector(".sel-end"),r=o||s,l=i.querySelector(".selected")===null,a=this.getBoundingClientRect(),c=i.getBoundingClientRect(),d=getComputedStyle(this),u=a.top+parseFloat(d.borderTopWidth||"0"),h=a.left+parseFloat(d.borderLeftWidth||"0"),f=(p,b)=>{if(!b){p.style.display="none";return}let v=Et(b,i);if(!v){p.style.display="none";return}if(v.top+v.height<c.top||v.top>c.bottom){p.style.display="none";return}p.style.display="block",p.style.left=`${v.left-h}px`,p.style.top=`${v.top-u}px`,p.style.height=`${v.height}px`};f(e,r),e.classList.toggle("-collapsed",l),f(t,l?null:s),f(n,l?null:o)}getContext(){return{root:this.parts.doc,selectable:this.selectable,commands:this.commands,find:(e)=>this.parts.doc.querySelector(e),findAll:(e)=>Array.from(this.parts.doc.querySelectorAll(e)),selectedLeafNodes:()=>this.selectedLeafNodes(),selectedBlocks:()=>this.selectedBlocks(),insertionPoint:()=>this.insertionPoint(),block:(e)=>this.block(e),normalize:()=>this.normalize(),focus:()=>this.focus(),updateUndo:(e,t)=>this.updateUndo(e,t),removeNode:(e)=>this.removeNode(e),refuseStructural:(e)=>this.refuseStructural(e),tracksChanges:()=>this.trackChanges}}doCommand(e){dn(this.getContext(),e)}doCommandWith(e,...t){cn(this.getContext(),e,...t)}focus(){this.selectable?.focus()}normalize(){this.selectable?.normalize()}selectedLeafNodes(){return je(this.parts.doc).filter((e)=>e.parentElement?.closest(".selected")!==null)}selectedBlocks(){return Array.from(this.parts.doc.querySelectorAll(".selected-block"))}insertionPoint(){return this.parts.doc.querySelector(".sel-end")}block(e){let t=e;while(t&&t.parentNode!==this.parts.doc)t=t.parentNode;return t instanceof Element?t:null}caretCell(){let e=this.insertionPoint();return e?J(e):null}listItemOf(e){let t=e;while(t&&t!==this.parts.doc){if(t instanceof Element&&t.tagName==="LI"&&t.parentElement&&(t.parentElement.tagName==="UL"||t.parentElement.tagName==="OL")&&!t.parentElement.classList.contains("editor-table"))return t;t=t.parentNode}return null}moveCaretToCell(e){this.selectable.unmark(),this.selectable.removeBounds();let t=this.selectable.createBounds(),{lastChild:n,firstChild:i}=t;e.insertBefore(i,e.firstChild),e.appendChild(n),this.selectable.normalize(),this.selectable.markBounds(),this.selectable.selectionChanged()}tableMoveUp(e){let t=P(e);if(!t)return;let n=O(t),i=ie(e,n),o=V(t,i,n)[0];for(let l=0;l<n;l++)o.before(se());let r=Tt(e);if(r)this.moveCaretToCell(r);this.updateUndo("new")}tableMoveDown(e){let t=P(e);if(!t)return;let n=O(t),i=ie(e,n),s=V(t,i,n),o=s[s.length-1];for(let l=0;l<n;l++)o.after(se());let r=At(e);if(r)this.moveCaretToCell(r);this.updateUndo("new")}exitTable(e,t){let n=P(e);if(!n)return;let i=this.block(n);if(!i)return;let s=t==="before"?i.previousElementSibling:i.nextElementSibling;if(s){if(this.selectable.unmark(),this.selectable.removeBounds(),t==="before")s.appendChild(this.selectable.createBounds());else s.insertBefore(this.selectable.createBounds(),s.firstChild);this.selectable.normalize(),this.selectable.markBounds(),this.selectable.selectionChanged()}else{let o=document.createElement("p");if(o.textContent=" ",t==="before")i.before(o);else i.after(o);this.selectable.unmark(),this.selectable.removeBounds(),o.appendChild(this.selectable.createBounds()),this.selectable.normalize(),this.selectable.markBounds(),this.selectable.selectionChanged(),this.updateUndo("new")}}splitListItem(e){let t=this.insertionPoint();if(!t)return;let n=e.parentElement;if(!n)return;if(!e.textContent?.replace(/\u00A0/g,"").trim()){let a=document.createElement("p");if(a.textContent=" ",this.selectable.removeBounds(),a.appendChild(this.selectable.createBounds()),n.children.length<=1)n.after(a),n.remove();else if(!e.previousElementSibling)n.before(a),e.remove();else if(!e.nextElementSibling)n.after(a),e.remove();else{let c=document.createElement(n.tagName),d=e.nextElementSibling;while(d){let u=d.nextElementSibling;c.appendChild(d),d=u}n.after(a),a.after(c),e.remove()}this.selectable.normalize(),this.selectable.markBounds(),this.updateUndo("new");return}let s=document.createElement("li"),o=t.nextSibling;while(o){let a=o.nextSibling;s.appendChild(o),o=a}let r=e.querySelector(".sel-start"),l=e.querySelector(".sel-end");if(l)s.insertBefore(l,s.firstChild);if(r)s.insertBefore(r,s.firstChild);if(!s.textContent?.trim()){let a=document.createTextNode(" ");if(r)r.before(a);else s.appendChild(a)}if(!e.textContent?.trim())e.appendChild(document.createTextNode(" "));e.after(s),this.selectable.markBounds(),this.updateUndo("new")}isListItemEmpty(e){return!e.textContent?.replace(/\u00A0/g,"").trim()}removeListItem(e){let t=e.parentElement;if(!t)return;if(this.refusesStructuralDelete&&this.refuseStructural("remove-list-item"))return;let n=e.previousElementSibling;if(n&&n.tagName==="LI"){while(e.firstChild)n.appendChild(e.firstChild);e.remove()}else{let i=document.createElement("p");while(e.firstChild)i.appendChild(e.firstChild);if(t.before(i),e.remove(),t.children.length===0)t.remove()}this.normalize(),this.selectable.markBounds(),this.updateUndo("new")}listBackspace(e){if(!this.deleteSelection()){let t=this.insertionPoint();if(!t)return;if(this.isListItemEmpty(e)){this.removeListItem(e);return}let n=this.deletionTarget(t,e,"back");if(n){if(n.nodeType===3&&(n.textContent||"").length>1)this.deleteEdgeCharacter(n,"end");else{let i=Y(n);if(e.contains(i))this.removeNode(i)}this.normalize(),this.updateUndo()}else this.removeListItem(e)}}listForwardDelete(e){if(!this.deleteSelection()){let t=this.insertionPoint();if(!t)return;let n=this.deletionTarget(t,e,"forward");if(n){if(n.nodeType===3&&(n.textContent||"").length>1)this.deleteEdgeCharacter(n,"start");else{let i=Y(n);if(e.contains(i))this.removeNode(i)}this.normalize(),this.updateUndo()}else{let i=e.nextElementSibling;if(i&&i.tagName==="LI"&&(!this.refusesStructuralDelete||!this.refuseStructural("merge-list-items"))){while(i.firstChild)e.appendChild(i.firstChild);i.remove(),this.normalize(),this.selectable.markBounds(),this.updateUndo("new")}}}}groupByLine(e){let t=new Map;for(let i of e){let s=i.getBoundingClientRect(),o=Math.round(s.top),r=t.get(o);if(!r)r=[],t.set(o,r);r.push(i)}return Array.from(t.keys()).sort((i,s)=>i-s).map((i)=>t.get(i))}closestCharOnLine(e,t){let n=e[0],i=1/0;for(let s of e){let o=s.getBoundingClientRect(),r=o.left+o.width/2,l=Math.abs(r-t);if(l<i)i=l,n=s}return n}positionAtSpanChar(e,t,n,i){let s=e.getBoundingClientRect(),o=this.selectable.find(".sel-start"),r=this.selectable.find(".sel-end");if(!o||!r)return;if(t<s.left+s.width/2)e.before(r);else e.after(r);if(!n)r.parentNode?.insertBefore(o,r);k(i,!1),this.selectable.markBounds(),this.focus()}moveVertical(e,t){let n=this.insertionPoint();if(!n)return;let i=this.block(n);if(!i)return;if(!(this.lastKey===38||this.lastKey===40)){let d=this.markerRect(n);this.lastCursorX=d.left}let o=this.lastCursorX,r=this.listItemOf(n),l=r||i;k(l,!0);let a=Array.from(l.querySelectorAll(".spanified"));if(a.length>0){let d=this.groupByLine(a),u=this.markerRect(n),h=Math.round(u.top),f=0,p=1/0;for(let v=0;v<d.length;v++){let G=Math.round(d[v][0].getBoundingClientRect().top),ee=Math.abs(G-h);if(ee<p)p=ee,f=v}let b=e==="up"?f-1:f+1;if(b>=0&&b<d.length){let v=this.closestCharOnLine(d[b],o);this.positionAtSpanChar(v,o,t,l);return}}if(k(l,!1),r){let d=e==="up"?r.previousElementSibling:r.nextElementSibling;if(d&&d.tagName==="LI"){k(d,!0);let h=Array.from(d.querySelectorAll(".spanified"));if(h.length===0){k(d,!1),this.moveCaretToEmptyContainer(d,e,t);return}let f=this.groupByLine(h),p=e==="up"?f[f.length-1]:f[0],b=this.closestCharOnLine(p,o);this.positionAtSpanChar(b,o,t,d);return}let u=e==="up"?i.previousElementSibling:i.nextElementSibling;if(!u)return;this.moveVerticalToBlock(u,e,o,t);return}let c=e==="up"?i.previousElementSibling:i.nextElementSibling;if(!c)return;this.moveVerticalToBlock(c,e,o,t)}moveCaretToEmptyContainer(e,t,n){let i=this.selectable.find(".sel-start"),s=this.selectable.find(".sel-end");if(!i||!s)return;if(t==="up")e.appendChild(s);else e.insertBefore(s,e.firstChild);if(!n)s.parentNode?.insertBefore(i,s);this.selectable.markBounds(),this.focus()}moveVerticalToBlock(e,t,n,i){let o=(e.tagName==="UL"||e.tagName==="OL")&&!e.classList.contains("editor-table")?(t==="up"?e.querySelector(":scope > li:last-child"):e.querySelector(":scope > li:first-child"))||e:e;k(o,!0);let r=Array.from(o.querySelectorAll(".spanified"));if(r.length===0){k(o,!1),this.moveCaretToEmptyContainer(o,t,i);return}let l=this.groupByLine(r),a=t==="up"?l[l.length-1]:l[0],c=this.closestCharOnLine(a,n);this.positionAtSpanChar(c,n,i,o)}contentKey(e){if(!this.insertionPoint())return;this.enterInsertion(),this.isolateForTyping(e);let t=this.insertionPoint();if(t)t.before(document.createTextNode(e)),this.normalize(),this.updateUndo()}isolateForTyping(e){let t=this.insertionPoint(),n=Sa(e);if(!t||!n)return null;let i=this.block(t);if(!i)return null;let s=i.getAttribute("dir")??(getComputedStyle(i).direction||"ltr");if(n===s)return null;let o=t.parentElement;if(o?.dataset.bidiRun===n)return o;let r=document.createElement("span");return r.dataset.bidiRun=n,r.setAttribute("dir",n),t.parentNode?.insertBefore(r,t),r.appendChild(t),r}backspace(){if(!this.deleteSelection()){let e=this.insertionPoint();if(!e)return;let t=this.deletionTarget(e,this.parts.doc,"back");if(!t)return;let n=this.block(e),i=this.block(t),s=!!(i&&n&&i!==n);if(this.refusesStructuralDelete&&s&&this.refuseStructural("merge-blocks-backward"))return;let o=this.refusesStructuralDelete&&s;((l)=>o?this.asUntracked(l):l())(()=>{if(t.nodeType===3&&(t.textContent||"").length>1)this.deleteEdgeCharacter(t,"end");else this.removeNode(Y(t));if(this.normalize(),i&&n&&this.parts.doc.contains(i)&&i!==n){while(n.firstChild)i.appendChild(n.firstChild);n.remove()}}),this.updateUndo()}}forwardDelete(){if(!this.deleteSelection()){let e=this.insertionPoint();if(!e)return;let t=this.deletionTarget(e,this.parts.doc,"forward");if(!t)return;let n=this.block(e),i=this.block(t),s=!!(i&&n&&i!==n);if(this.refusesStructuralDelete&&s&&this.refuseStructural("merge-blocks-forward"))return;let o=this.refusesStructuralDelete&&s;((l)=>o?this.asUntracked(l):l())(()=>{if(t.nodeType===3&&(t.textContent||"").length>1)this.deleteEdgeCharacter(t,"start");else this.removeNode(Y(t));if(this.normalize(),i&&n&&this.parts.doc.contains(i)&&i!==n){while(i.firstChild)n.appendChild(i.firstChild);i.remove()}}),this.updateUndo()}}deleteSelection(){let e=this.selectedBlocks(),t=e.length>1,n=this.refusesStructuralDelete&&t;return n&&!this.refuseStructural("merge-blocks-selection")?this.asUntracked(()=>this.runDeleteSelection(e,!0)):this.runDeleteSelection(e,!n)}runDeleteSelection(e,t){let n=!1,i=this.trackChanges?Ne():void 0;for(let a of e)if(!a.classList.contains("first-block")&&!a.classList.contains("last-block"))this.removeNode(a,i),n=!0;let s=this.insertionPoint(),o=this.selectedLeafNodes().filter((a)=>a!==s);if(o.length){let a=Y(o[0]);if(s&&a.parentNode)a.parentNode.insertBefore(s,a);for(let c of o)this.removeNode(Y(c),i);n=!0}let r=this.parts.doc.querySelector(".sel-start");if(r&&!r.classList.contains("caret"))r.remove();this.selectable.unmark();let l=this.parts.doc.querySelector(".caret");for(let a of e)if(this.parts.doc.contains(a)&&(!l||!a.contains(l))&&it(a))this.removeNode(a,i);if(e.length>1){let a=e[0],c=e[e.length-1];if(t&&this.parts.doc.contains(a)&&this.parts.doc.contains(c)&&!a.classList.contains("editor-table")&&!c.classList.contains("editor-table")){let d=c.firstChild;for(let u of Array.from(a.childNodes))c.insertBefore(u,d);a.remove()}this.selectable.markBounds(),this.focus()}else if(n)this.updateUndo(),this.selectable.selectionChanged();return n}splitAtCaret(){let e=this.insertionPoint();if(!e)return!1;let t=this.block(e);if(!t)return!1;let n=document.createElement(t.tagName),i=e.nextSibling;while(i){let r=i.nextSibling;n.appendChild(i),i=r}let s=t.querySelector(".sel-start"),o=t.querySelector(".sel-end");if(o)n.insertBefore(o,n.firstChild);if(s)n.insertBefore(s,n.firstChild);if(!n.textContent?.trim()){let r=document.createTextNode(" ");if(s)s.before(r);else n.appendChild(r)}if(!t.textContent?.trim())t.appendChild(document.createTextNode(" "));return t.after(n),this.selectable.markBounds(),this.updateUndo("new"),!0}arrowLeft(e){let t=this.selectable.find(".sel-start");if(!t)return;if(e.altKey)this.moveWordLeft(e.shiftKey);else{let n=q(t,this.parts.doc,Q);if(n)this.moveBoundsBefore(n,e.shiftKey)}}arrowRight(e){let t=this.selectable.find(".sel-end");if(!t)return;if(e.altKey)this.moveWordRight(e.shiftKey);else{let n=F(t,this.parts.doc,Q);if(n)this.moveBoundsAfter(n,e.shiftKey)}}moveWordLeft(e){let t=this.selectable.find(".sel-start");if(!t)return;let n=this.block(t);if(!n)return;k(n,!0);let i=q(t,n,Q);if(!i){k(n,!1);return}while(i&&i.nodeType===3&&/^\s$/.test(i.textContent||""))i=q(i,n,Q);let s=i;while(i&&i.nodeType===3&&/^\S$/.test(i.textContent||"")){s=i;let o=q(i,n,Q);if(o&&o.nodeType===3&&/^\S$/.test(o.textContent||""))i=o;else break}if(s){let o=this.selectable.find(".sel-start"),r=this.selectable.find(".sel-end");if(o&&r){if(s.parentNode?.insertBefore(o,s),!e)o.after(r)}}k(n,!1),this.selectable.markBounds(),this.focus()}moveWordRight(e){let t=this.selectable.find(".sel-end");if(!t)return;let n=this.block(t);if(!n)return;k(n,!0);let i=F(t,n,Q);if(!i){k(n,!1);return}while(i&&i.nodeType===3&&/^\s$/.test(i.textContent||""))i=F(i,n,Q);let s=i;while(i&&i.nodeType===3&&/^\S$/.test(i.textContent||"")){s=i;let o=F(i,n,Q);if(o&&o.nodeType===3&&/^\S$/.test(o.textContent||""))i=o;else break}if(s){let o=this.selectable.find(".sel-start"),r=this.selectable.find(".sel-end");if(o&&r){if(s.parentNode?.insertBefore(r,s.nextSibling),!e)r.parentNode?.insertBefore(o,r)}}k(n,!1),this.selectable.markBounds(),this.focus()}moveBoundsBefore(e,t){let n=this.selectable.find(".sel-start"),i=this.selectable.find(".sel-end");if(!n||!i)return;if(e.nodeType===3&&(e.textContent||"").length>1){let s=e.splitText((e.textContent||"").length-1);s.parentNode?.insertBefore(n,s)}else e.parentNode?.insertBefore(n,e);if(!t)n.after(i);this.selectable.markBounds(),this.focus()}moveBoundsAfter(e,t){let n=this.selectable.find(".sel-start"),i=this.selectable.find(".sel-end");if(!n||!i)return;if(e.nodeType===3&&(e.textContent||"").length>1)e.splitText(1);if(e.parentNode?.insertBefore(i,e.nextSibling),!t)i.parentNode?.insertBefore(n,i);this.selectable.markBounds(),this.focus()}signatureOf(e){let t=document.createElement("div");t.innerHTML=e;for(let n of Array.from(t.querySelectorAll(".sel-start, .sel-end")))n.remove();for(let n of Array.from(t.querySelectorAll("[class], [draggable], [data-drag]"))){if(n.classList.remove("selected","selected-block","first-block","last-block"),n.classList.length===0)n.removeAttribute("class");n.removeAttribute("draggable"),n.removeAttribute("data-drag")}for(let n of Array.from(t.querySelectorAll("span")))if(n.attributes.length===0)n.replaceWith(...Array.from(n.childNodes));return t.normalize(),t.innerHTML}updateUndo(e,t){if(this.undo.length===0)e="init";if(t&&this.reasonForLastUndo===t)e=void 0;this.reasonForLastUndo=t,this.syncSpellingValidity();let n=this.docHTML;switch(e){case"init":this.undo=[n],this.undoDepth=0;break;case"new":if(this.undoDepth)this.undo=this.undo.slice(this.undoDepth),this.undoDepth=0;if(this.undo.length&&this.signatureOf(this.undo[0])===this.signatureOf(n)){this.undo[0]=n;break}this.undo.unshift(n);break;case"undo":if(this.undoDepth<this.undo.length-1)this.undoDepth++,this.docHTML=this.undo[this.undoDepth],this.focus();break;case"redo":if(this.undoDepth>0)this.undoDepth--,this.docHTML=this.undo[this.undoDepth],this.focus();break;default:if(this.undoDepth||this.undo.length===1){if(this.undo.length&&this.signatureOf(this.undo[0])===this.signatureOf(n)){this.undo[0]=n;break}this.undo=this.undo.slice(this.undoDepth),this.undoDepth=0,this.undo.unshift(n)}else this.undo[0]=n}if(this.selectable?.onBoundsChanged?.(),this.updateUndoButtons(),this.internals)this.internals.setFormValue(n)}updateUndoButtons(){let e=this.parts.toolbar,t=e.querySelector('[value="updateUndo undo"]'),n=e.querySelector('[value="updateUndo redo"]');if(t)t.disabled=this.undoDepth>=this.undo.length-1;if(n)n.disabled=this.undoDepth===0}handleDocClick=(e)=>{if(!this.active)return;let t=e.target?.closest?.("a");if(!t||!this.parts.doc.contains(t))return;if(e.metaKey||e.ctrlKey){let n=t.getAttribute("href")||"";if(Ie(n))window.open(n,"_blank","noopener")}e.preventDefault()};handleShortcut(e){let t=e.key.toLowerCase(),n=`${e.ctrlKey||e.metaKey?"ctrl+":""}${t}`,i=typeof CSS<"u"&&CSS.escape?CSS.escape(n):n.replace(/["\\]/g,"\\$&"),s=this.parts.toolbar.querySelector(`[data-shortcut="${i}"]`);if(s){let o=s.getAttribute("value");if(o)this.doCommand(o),e.preventDefault(),e.stopPropagation()}}handleKeydown=(e)=>{if(!this.active)return;if(e.target.closest(".not-editable"))return;let n=this.caretCell(),i=this.insertionPoint(),s=i?this.listItemOf(i):null;switch(e.key){case"Tab":if(e.preventDefault(),n)if(e.shiftKey){let o=sn(n);if(o)this.moveCaretToCell(o)}else{let o=Lt(n);if(o)this.moveCaretToCell(o);else{let r=P(n);if(r){let l=O(r);for(let c=0;c<l;c++)r.appendChild(se());let a=Lt(n);if(a)this.moveCaretToCell(a);this.updateUndo("new")}}}break;case"Backspace":if(e.preventDefault(),this.deleteSelection())this.updateUndo("new");else if(n){if(i){let o=this.deletionTarget(i,n,"back");if(o){if(o.nodeType===3&&(o.textContent||"").length>1)this.deleteEdgeCharacter(o,"end");else{let r=Y(o);if(n.contains(r))this.removeNode(r)}this.normalize(),this.updateUndo()}}}else if(s)this.listBackspace(s);else this.backspace();break;case"Delete":if(e.preventDefault(),this.deleteSelection())this.updateUndo("new");else if(n){if(i){let o=this.deletionTarget(i,n,"forward");if(o){if(o.nodeType===3&&(o.textContent||"").length>1)this.deleteEdgeCharacter(o,"start");else{let r=Y(o);if(n.contains(r))this.removeNode(r)}this.normalize(),this.updateUndo()}}}else if(s)this.listForwardDelete(s);else this.forwardDelete();break;case"Enter":if(e.preventDefault(),n){if(e.shiftKey)this.tableMoveDown(n);else if(i)i.before(document.createElement("br")),this.normalize(),this.updateUndo()}else if(s)this.deleteSelection(),this.splitListItem(s);else this.deleteSelection(),this.splitAtCaret();break;case"ArrowLeft":e.preventDefault(),this.arrowLeft(e);break;case"ArrowRight":e.preventDefault(),this.arrowRight(e);break;case"ArrowUp":if(e.preventDefault(),n)if(e.shiftKey)this.tableMoveUp(n);else{let o=Tt(n);if(o)this.moveCaretToCell(o);else this.exitTable(n,"before")}else this.moveVertical("up",e.shiftKey);break;case"ArrowDown":if(e.preventDefault(),n)if(e.shiftKey)this.tableMoveDown(n);else{let o=At(n);if(o)this.moveCaretToCell(o);else this.exitTable(n,"after")}else this.moveVertical("down",e.shiftKey);break}this.lastKey=e.keyCode};handleKeypress=(e)=>{if(!this.active)return;if(e.target.closest(".not-editable"))return;if(e.ctrlKey||e.metaKey)this.handleShortcut(e);else if(this.deleteSelection(),e.key.length===1)this.contentKey(e.key);e.preventDefault(),e.stopPropagation()};handleCopy=(e)=>{let t=Array.from(this.parts.doc.querySelectorAll(".selected"));if(t.length===0)return;let n="",i="";for(let s of t)n+=s.outerHTML,i+=s.textContent;e.clipboardData?.setData("text/html",n),e.clipboardData?.setData("text/plain",i),e.preventDefault()};handleCut=(e)=>{this.handleCopy(e),this.deleteSelection()};insertTransfer(e,t){let n=this.insertionPoint();if(!n)return!1;let i=this.trackChanges?this.openInsertion():null,s=(o)=>{if(i)i.appendChild(o);else n.before(o)};if(this.pastemode==="remove"||!e){if(!t)return i?.remove(),!1;s(document.createTextNode(t))}else{let o=document.createElement("div");o.innerHTML=e,this.sanitize(o),this.restampPastedChanges(o);while(o.firstChild)s(o.firstChild)}if(i&&!i.firstChild)i.remove();return!0}restampPastedChanges(e){let t=e.querySelectorAll(`${he}, ${K}`);if(!t.length)return;let n=Ne();for(let i of Array.from(t)){if(i.setAttribute("data-change",n),i.setAttribute("data-author",Z(this.changeAuthor.id)),this.changeAuthor.name)i.setAttribute("data-author-name",Z(this.changeAuthor.name));else i.removeAttribute("data-author-name");i.setAttribute("data-session",this.sessionId),i.setAttribute("data-time",new Date().toISOString()),i.removeAttribute("data-block-delete")}}handlePaste=(e)=>{if(!this.active)return;let t=e.clipboardData?.getData("text/html"),n=e.clipboardData?.getData("text/plain");this.deleteSelection(),this.insertTransfer(t,n),this.normalize(),this.updateUndo("new"),e.preventDefault()};draggingSelection=!1;handleDragStart=(e)=>{if(!this.active||!e.dataTransfer)return;let t=this.selectable.findAll(".selected");if(t.length===0)return;let n=document.createElement("div");for(let i of t)n.appendChild(i.cloneNode(!0));e.dataTransfer.setData("text/html",n.innerHTML),e.dataTransfer.setData("text/plain",n.textContent||""),e.dataTransfer.effectAllowed="copyMove",this.draggingSelection=!0};handleDragOver=(e)=>{if(!this.active)return;if(e.preventDefault(),e.dataTransfer)e.dataTransfer.dropEffect=e.altKey?"copy":"move";if(e.target instanceof Element)this.selectable.placeCaretAt(e.clientX,e.clientY)};handleDrop=(e)=>{if(!this.active||!e.dataTransfer)return;e.preventDefault();let t=this.draggingSelection;this.draggingSelection=!1;let n=this.insertionPoint();if(t&&n?.closest(".selected")){this.clearDraggable();return}let s=Array.from(e.dataTransfer.files||[]).filter((l)=>l.type.startsWith("image/"));if(s.length){this.insertDroppedImages(s),this.clearDraggable();return}let o=e.dataTransfer.getData("text/html"),r=e.dataTransfer.getData("text/plain");if(t&&!e.altKey)this.deleteSelection();else this.selectable.unmark();this.clearDraggable(),this.insertTransfer(o,r),this.normalize(),this.updateUndo("new"),this.focus()};handleDragEnd=()=>{this.draggingSelection=!1,this.clearDraggable()};clearDraggable(){for(let e of Array.from(this.parts.doc.querySelectorAll("[draggable]")))e.removeAttribute("draggable"),e.removeAttribute("data-drag")}async insertDroppedImages(e){for(let t of e){let n=await new Promise((i)=>{let s=new FileReader;s.onload=()=>i(String(s.result||"")),s.readAsDataURL(t)});if(n)this.doCommandWith("insertImage",n,t.name)}}cellEdgeAt(e){let n=e.target.closest(".editor-table > li");if(!n)return null;let i=n.parentElement;if(!i||!i.classList.contains("editor-table"))return null;let s=n.getBoundingClientRect(),o=O(i),r=Pe(n,o),l=4;if(Math.abs(e.clientX-s.right)<l&&r<o-1)return[i,r];if(Math.abs(e.clientX-s.left)<l&&r>0)return[i,r-1];return null}updateTouchAffordances(){if(!this.touchAffordances)return;if(!this.isTouchInteraction&&!this.touchMenuEl){this.touchAffordances.style.display="none",this.parts.doc.style.paddingTop="",this.parts.doc.style.paddingBottom="",this.syncCaret();return}let e=this.parts.doc.querySelector(".sel-start"),t=this.parts.doc.querySelector(".sel-end");if(!e||!t){this.touchAffordances.style.display="none",this.parts.doc.style.paddingTop="",this.parts.doc.style.paddingBottom="",this.syncCaret();return}let n=this.parts.doc.getBoundingClientRect(),i=this.markerRect(e),s=this.markerRect(t);if(this.touchDrags.size===0){let o=parseFloat(this.parts.doc.style.paddingTop)||0,r=parseFloat(this.parts.doc.style.paddingBottom)||0,l=Math.min(i.top,s.top)-48-o,a=Math.max(i.bottom,s.bottom)+48+r,c=l<n.top?"52px":"",d=a>n.bottom?"52px":"",u=this.parts.doc.style.paddingTop,h=this.parts.doc.style.paddingBottom;if(c!==u||d!==h)this.parts.doc.style.paddingTop=c,this.parts.doc.style.paddingBottom=d}this.positionAffordances(),this.touchAffordances.style.display="block",this.touchAffordances.style.opacity="1"}positionAffordances(){let e=this.parts.doc.querySelector(".sel-start"),t=this.parts.doc.querySelector(".sel-end");if(!e||!t)return;let n=this.parts.doc.getBoundingClientRect(),i=this.markerRect(e),s=this.markerRect(t),o=i.left-n.left+this.parts.doc.scrollLeft,r=i.top-n.top+this.parts.doc.scrollTop,l=s.right-n.left+this.parts.doc.scrollLeft,a=s.bottom-n.top+this.parts.doc.scrollTop;if(e.nextElementSibling===t)this.touchHandleStart.style.left=`${o-44}px`,this.touchHandleStart.style.top=`${r-44}px`,this.touchContextMenu.style.left=`${o}px`,this.touchContextMenu.style.top=`${r-44}px`,this.touchHandleEnd.style.left=`${l}px`,this.touchHandleEnd.style.top=`${a}px`;else{this.touchHandleStart.style.left=`${o-44}px`,this.touchHandleStart.style.top=`${r-44}px`,this.touchHandleEnd.style.left=`${l}px`,this.touchHandleEnd.style.top=`${a}px`;let d=(o+l)/2-22,u=Math.min(r,a)-44;this.touchContextMenu.style.left=`${d}px`,this.touchContextMenu.style.top=`${u}px`}}handleAffordanceDragStart=(e)=>{let t=e.currentTarget,n=t===this.touchHandleStart?"start":"end";t.setPointerCapture(e.pointerId);let i=t.getBoundingClientRect(),s=n==="start"?".sel-start":".sel-end",o=this.parts.doc.querySelector(s),r=o?parseFloat(getComputedStyle(o).lineHeight):NaN,l=isNaN(r)?10:r/2,a,c;if(n==="start")a=i.right-e.clientX,c=i.bottom+l-e.clientY;else a=i.left-e.clientX,c=i.top-l-e.clientY;this.touchDrags.set(e.pointerId,{target:n,offsetX:a,offsetY:c}),this.hideTouchMenu(),this.touchAffordances.classList.add("dragging"),e.preventDefault(),e.stopPropagation()};handleAffordanceDragMove=(e)=>{let t=this.touchDrags.get(e.pointerId);if(!t)return;let n=e.clientX+t.offsetX,i=e.clientY+t.offsetY,s=e.currentTarget;s.style.pointerEvents="none",this.touchAffordances.style.pointerEvents="none";let o=this.shadowRoot.elementFromPoint(n,i);if(s.style.pointerEvents="auto",this.touchAffordances.style.pointerEvents="",!o||o.closest(".not-selectable")||o.classList.contains("not-selectable"))return;let r=ne(this.parts.doc,n,i);if(!r)return;let l=t.target==="start"?".sel-start":".sel-end",a=this.parts.doc.querySelector(l);if(a){let c=document.createRange();c.setStart(r.node,r.after?r.offset+1:r.offset),c.collapse(!0),c.insertNode(a),this.parts.doc.normalize(),this.selectable.markBounds();let d=this.parts.doc.getBoundingClientRect(),u=e.currentTarget,h=e.clientX-d.left+this.parts.doc.scrollLeft,f=e.clientY-d.top+this.parts.doc.scrollTop;u.style.left=`${h-22}px`,u.style.top=`${f-22}px`}e.preventDefault(),e.stopPropagation()};handleAffordanceDragEnd=(e)=>{if(!this.touchDrags.has(e.pointerId))return;if(e.currentTarget.releasePointerCapture(e.pointerId),this.touchDrags.delete(e.pointerId),this.touchDrags.size===0)this.selectable.despanify(),this.selectable.selectionChanged(),requestAnimationFrame(()=>{this.touchAffordances.classList.remove("dragging")});e.preventDefault(),e.stopPropagation()};handleTouchContextMenu=(e)=>{if(e.preventDefault(),e.stopPropagation(),this.touchMenuEl){this.hideTouchMenu();return}this.showTouchMenu(e)};showTouchMenu(e){this.hideTouchMenu();let t=document.createElement("div");t.className="touch-menu not-selectable do-not-spanify";let n=()=>this.selectable.findAll(".selected").map((d)=>d.textContent).join(""),i=[{label:"Cut",action:()=>{let d=n();if(!d)return;navigator.clipboard.writeText(d),this.deleteSelection(),this.updateUndo("new")}},{label:"Copy",action:()=>{navigator.clipboard.writeText(n())}},{label:"Paste",action:()=>{navigator.clipboard.readText().then((d)=>{if(d){this.deleteSelection();let u=this.insertionPoint();if(u)u.before(document.createTextNode(d)),this.normalize(),this.updateUndo("new")}})}},{label:"Delete",action:()=>{this.deleteSelection(),this.updateUndo("new")}},{label:"Bold",action:()=>this.doCommand("setText font-weight bold")},{label:"Italic",action:()=>this.doCommand("setText font-style italic")},{label:"Plain",action:()=>this.doCommand("setText font-weight normal; setText font-style normal; setText text-decoration none")}];for(let{label:d,action:u}of i){let h=document.createElement("button");h.className="touch-menu-item not-selectable",h.textContent=d,h.addEventListener("pointerdown",(f)=>{f.stopPropagation(),f.preventDefault(),u(),this.hideTouchMenu()}),t.appendChild(h)}let s=document.createElement("button");s.className="touch-menu-item touch-menu-close not-selectable",s.textContent="×",s.addEventListener("pointerdown",(d)=>{d.stopPropagation(),d.preventDefault(),this.hideTouchMenu()}),t.appendChild(s);let o=this.touchContextMenu.getBoundingClientRect(),r=this.parts.doc.getBoundingClientRect(),l=(i.length+1)*70,a=o.left-r.left+this.parts.doc.scrollLeft+22-l/2;if(a<0)a=4;if(a+l>r.width)a=r.width-l-4;t.style.left=`${a}px`;let c=o.top-r.top+this.parts.doc.scrollTop-44;if(c<0)c=o.bottom-r.top+this.parts.doc.scrollTop+4;t.style.top=`${c}px`,this.touchMenuEl=t,this.touchAffordances.appendChild(t),this.touchMenuDismiss=(d)=>{if(d===e)return;if(this.touchMenuEl&&!this.touchMenuEl.contains(d.target))this.hideTouchMenu()},this.parts.doc.addEventListener("pointerdown",this.touchMenuDismiss)}touchMenuDismiss=null;hideTouchMenu(){if(this.touchMenuDismiss)this.parts.doc.removeEventListener("pointerdown",this.touchMenuDismiss),this.touchMenuDismiss=null;if(this.touchMenuEl)this.touchMenuEl.remove(),this.touchMenuEl=null}handleResizePointerDown=(e)=>{let t=this.cellEdgeAt(e);if(!t)return;let[n,i]=t;this.resizeTable=n,this.resizeCol=i,this.resizeStartX=e.clientX;let s=V(n,0,O(n));this.resizeStartWidths=s.map((o)=>o.getBoundingClientRect().width),e.preventDefault(),e.stopPropagation(),this.parts.doc.setPointerCapture(e.pointerId)};handleResizePointerMove=(e)=>{if(!this.resizeTable){let i=this.cellEdgeAt(e);this.parts.doc.style.cursor=i?"col-resize":"";return}let t=e.clientX-this.resizeStartX,n=[...this.resizeStartWidths];n[this.resizeCol]=Math.max(30,n[this.resizeCol]+t),n[this.resizeCol+1]=Math.max(30,n[this.resizeCol+1]-t),_e(this.resizeTable,n.map((i)=>`${i}px`))};handleResizePointerUp=(e)=>{if(this.resizeTable)this.updateUndo("new"),this.resizeTable=null,this.resizeCol=-1,this.parts.doc.style.cursor="",this.parts.doc.releasePointerCapture(e.pointerId)};isToolbarEvent(e){return e.closest('[slot="toolbar"]')!==null||e.closest('[slot="menubar"]')!==null}handleToolbarClick=(e)=>{let t=e.target;if(!this.isToolbarEvent(t))return;let n=t.closest("button");if(!n)return;let i=n.getAttribute("value");if(i)this.doCommand(i)};handleToolbarChange=(e)=>{let t=e.target;if(!this.isToolbarEvent(t))return;let n=t.closest("select")||t.closest("tosi-select");if(!n)return;let i=n.value;if(!i)return;let s=i.trim().split(/[\s;]/)[0];if(!s||!(s in this.commands))return;this.doCommand(i)}}ot();var Aa=yi.elementCreator();var Lo="0.5.2";})();
|