open-webui/static/pyscript/codemirror_view-C0PMO2z_.js

3 lines
177 KiB
JavaScript
Raw Normal View History

2024-05-17 03:49:28 +00:00
import{RangeValue as t,RangeSet as e,MapMode as i,Facet as s,ChangeSet as o,EditorSelection as n,EditorState as r,Transaction as l,Prec as h,StateEffect as a,codePointAt as c,codePointSize as d,countColumn as u,StateField as f,findClusterBreak as p,findColumn as g,Annotation as m,Text as w,combineConfig as v,RangeSetBuilder as b,CharCategory as y}from"./codemirror_state-BKbyfKsm.js";const S="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),x="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),M="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class k{constructor(t,e){this.rules=[];let{finish:i}=e||{};function s(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function o(t,e,n,r){let l=[],h=/^@(\w+)\b/.exec(t[0]),a=h&&"keyframes"==h[1];if(h&&null==e)return n.push(t[0]+";");for(let i in e){let r=e[i];if(/&/.test(i))o(i.split(/,\s*/).map((e=>t.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),r,n);else if(r&&"object"==typeof r){if(!h)throw new RangeError("The value of a property ("+i+") should be a primitive value.");o(s(i),r,l,a)}else null!=r&&l.push(i.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+r+";")}(l.length||a)&&n.push((!i||h||r?t:t.map(i)).join(", ")+" {"+l.join(" ")+"}")}for(let e in t)o(s(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=M[S]||1;return M[S]=t+1,"ͼ"+t.toString(36)}static mount(t,e,i){let s=t[x],o=i&&i.nonce;s?o&&s.setNonce(o):s=new A(t,o),s.mount(Array.isArray(e)?e:[e])}}let C=new Map;class A{constructor(t,e){let i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){let e=C.get(i);if(e)return t.adoptedStyleSheets=[e.sheet,...t.adoptedStyleSheets],t[x]=e;this.sheet=new s.CSSStyleSheet,t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets],C.set(i,this)}else{this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);let s=t.head||t;s.insertBefore(this.styleTag,s.firstChild)}this.modules=[],t[x]=this}mount(t){let e=this.sheet,i=0,s=0;for(let o=0;o<t.length;o++){let n=t[o],r=this.modules.indexOf(n);if(r<s&&r>-1&&(this.modules.splice(r,1),s--,r=-1),-1==r){if(this.modules.splice(s++,0,n),e)for(let t=0;t<n.rules.length;t++)e.insertRule(n.rules[t],i++)}else{for(;s<r;)i+=this.modules[s++].rules.length;i+=n.rules.length,s++}}if(!e){let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}for(var D={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},T={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},O="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),E="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),R=0;R<10;R++)D[48+R]=D[96+R]=String(R);for(R=1;R<=24;R++)D[R+111]="F"+R;for(R=65;R<=90;R++)D[R]=String.fromCharCode(R+32),T[R]=String.fromCharCode(R);for(var L in D)T.hasOwnProperty(L)||(T[L]=D[L]);function B(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function H(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function P(t,e){if(!e.anchorNode)return!1;try{return H(t,e.anchorNode)}catch(t){return!1}}function V(t){return 3==t.nodeType?U(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function N(t,e,i,s){re
//# sourceMappingURL=codemirror_view-C0PMO2z_.js.map