@excalidraw/common 0.18.0-414182f → 0.18.0-4e0441e

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.
Files changed (68) hide show
  1. package/dist/dev/index.js +78 -32
  2. package/dist/dev/index.js.map +2 -2
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/constants.d.ts +11 -1
  5. package/dist/types/common/src/utils.d.ts +3 -1
  6. package/dist/types/element/src/renderElement.d.ts +4 -1
  7. package/dist/types/element/src/transformHandles.d.ts +1 -1
  8. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +21 -6
  9. package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -4
  10. package/dist/types/excalidraw/actions/actionCanvas.d.ts +92 -40
  11. package/dist/types/excalidraw/actions/actionClipboard.d.ts +42 -12
  12. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -2
  13. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +21 -6
  14. package/dist/types/excalidraw/actions/actionElementLink.d.ts +7 -2
  15. package/dist/types/excalidraw/actions/actionElementLock.d.ts +14 -4
  16. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +7 -2
  17. package/dist/types/excalidraw/actions/actionExport.d.ts +63 -18
  18. package/dist/types/excalidraw/actions/actionFinalize.d.ts +14 -4
  19. package/dist/types/excalidraw/actions/actionFrame.d.ts +28 -8
  20. package/dist/types/excalidraw/actions/actionGroup.d.ts +14 -4
  21. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +8 -3
  22. package/dist/types/excalidraw/actions/actionLink.d.ts +6 -1
  23. package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -368
  24. package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -4
  25. package/dist/types/excalidraw/actions/actionProperties.d.ts +122 -38
  26. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +7 -2
  27. package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -2
  28. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +7 -2
  29. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +7 -2
  30. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +7 -2
  31. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +7 -2
  32. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +7 -2
  33. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +7 -2
  34. package/dist/types/excalidraw/actions/index.d.ts +2 -2
  35. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  36. package/dist/types/excalidraw/appState.d.ts +5 -1
  37. package/dist/types/excalidraw/clipboard.d.ts +2 -0
  38. package/dist/types/excalidraw/components/Actions.d.ts +17 -3
  39. package/dist/types/excalidraw/components/App.d.ts +1 -2
  40. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -0
  41. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
  42. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
  43. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
  44. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  45. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  46. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  47. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  48. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  49. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  50. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  51. package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
  52. package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
  53. package/dist/types/excalidraw/components/Popover.d.ts +2 -1
  54. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  55. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  56. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  57. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  58. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  59. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  60. package/dist/types/excalidraw/components/icons.d.ts +5 -0
  61. package/dist/types/excalidraw/data/blob.d.ts +2 -2
  62. package/dist/types/excalidraw/data/types.d.ts +4 -1
  63. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  64. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  65. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  66. package/dist/types/excalidraw/types.d.ts +10 -3
  67. package/dist/types/math/src/segment.d.ts +1 -0
  68. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- var he=Object.create;var Y=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty;var Oe=(e,t)=>()=>(e&&(t=e(e=0)),t);var V=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Re=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ge(t))!Se.call(e,s)&&s!==n&&Y(e,s,{get:()=>t[s],enumerable:!(r=ye(t,s))||r.enumerable});return e};var X=(e,t,n)=>(n=e!=null?he(Le(e)):{},Re(t||!e||!e.__esModule?Y(n,"default",{value:e,enumerable:!0}):n,e));var f,c=Oe(()=>{f={PROD:!0}});var le=V((G,ae)=>{c();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof G=="object"?ae.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(G,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(o,a){this._listeners[o]=this._listeners[o]||[],this._listeners[o].indexOf(a)<0&&this._listeners[o].push(a)},e.prototype.removeEventListener=function(o,a){if(this._listeners[o]){var p=this._listeners[o].indexOf(a);p>=0&&this._listeners[o].splice(p,1)}},e.prototype.dispatchEvent=function(o){if(this._listeners[o.type]&&this._listeners[o.type].length)for(var a=this._listeners[o.type].slice(),p=0,E=a.length;p<E;++p)a[p].call(this,o)};var t=function(o){return typeof o.constructor=="function"&&o.constructor.name==="GeneratorFunction"},n=function(o){return{next:function(){var a=o();return a?{value:a}:{done:!0}}}},r=function(o){var a=!1;return{next:function(){return a?{done:!0}:(a=!0,{value:o})}}},s=function(o,a){var p=typeof o;if(p==="object"){if(typeof o.next=="function")return o;if(typeof o.then=="function")return r(o)}return p==="function"?t(o)?o():n(o):r(a.resolve(o))},l=function(o,a,p){this.target=o,this.type=a,this.data=p},i=function(o,a,p){if(e.call(this),typeof a!="number"||Math.floor(a)!==a||a<1)throw new Error("Invalid concurrency");this._concurrency=a,this._options=p||{},this._options.promise=this._options.promise||Promise,this._iterator=s(o,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return i.prototype=new e,i.prototype.constructor=i,i.prototype.concurrency=function(o){return typeof o<"u"&&(this._concurrency=o,this.active()&&this._proceed()),this._concurrency},i.prototype.size=function(){return this._size},i.prototype.active=function(){return!!this._promise},i.prototype.promise=function(){return this._promise},i.prototype.start=function(){var o=this,a=this._options.promise;return this._promise=new a(function(p,E){o._callbacks={reject:E,resolve:p},o._proceed()}),this._promise},i.prototype._fireEvent=function(o,a){this.dispatchEvent(new l(this,o,a))},i.prototype._settle=function(o){o?this._callbacks.reject(o):this._callbacks.resolve(),this._promise=null,this._callbacks=null},i.prototype._onPooledPromiseFulfilled=function(o,a){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:o,result:a}),this._proceed())},i.prototype._onPooledPromiseRejected=function(o,a){this._size--,this.active()&&(this._fireEvent("rejected",{promise:o,error:a}),this._settle(a||new Error("Unknown error")))},i.prototype._trackPromise=function(o){var a=this;o.then(function(p){a._onPooledPromiseFulfilled(o,p)},function(p){a._onPooledPromiseRejected(o,p)}).catch(function(p){a._settle(new Error("Promise processing failed: "+p))})},i.prototype._proceed=function(){if(!this._done){for(var o={done:!1};this._size<this._concurrency&&!(o=this._iterator.next()).done;)this._size++,this._trackPromise(o.value);this._done=o===null||!!o.done}this._done&&this._size===0&&this._settle()},i.PromisePoolEvent=l,i.PromisePool=i,i})});var be=V(U=>{"use strict";c();Object.defineProperty(U,"__esModule",{value:!0});U.sanitizeUrl=void 0;var rt=/^([^\w]*)(javascript|data|vbscript)/im,ot=/&#(\w+)(^\w|;)?/g,st=/&(newline|tab);/gi,it=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,at=/^.+(:|&colon;)/gim,lt=[".","/"];function ct(e){return lt.indexOf(e[0])>-1}function ut(e){return e.replace(ot,function(t,n){return String.fromCharCode(n)})}function pt(e){var t=ut(e||"").replace(st,"").replace(it,"").trim();if(!t)return"about:blank";if(ct(t))return t;var n=t.match(at);if(!n)return t;var r=n[0];return rt.test(r)?"about:blank":t}U.sanitizeUrl=pt});c();c();var $=class{constructor(t){this.scoreFunction=t}content=[];sinkDown(t){let n=this.content[t];for(;t>0;){let r=(t+1>>1)-1,s=this.content[r];if(this.scoreFunction(n)<this.scoreFunction(s))this.content[r]=n,this.content[t]=s,t=r;else break}}bubbleUp(t){let n=this.content.length,r=this.content[t],s=this.scoreFunction(r);for(;;){let l=t+1<<1,i=l-1,o=null,a=0;if(i<n){let p=this.content[i];a=this.scoreFunction(p),a<s&&(o=i)}if(l<n){let p=this.content[l];this.scoreFunction(p)<(o===null?s:a)&&(o=l)}if(o!==null)this.content[t]=this.content[o],this.content[o]=r,t=o;else break}}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),r=this.content.pop();n<this.content.length&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}};c();var z={white:"#ffffff",black:"#000000",gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};var _t=240,Fe=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),At=5,ht=5,yt=4,C=4,F=1,m=[0,2,4,6,8],gt=[0,1,2,3,4],x=(e,t)=>t.map(n=>z[e][n]),u={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:x("gray",m),red:x("red",m),pink:x("pink",m),grape:x("grape",m),violet:x("violet",m),blue:x("blue",m),cyan:x("cyan",m),teal:x("teal",m),green:x("green",m),yellow:x("yellow",m),orange:x("orange",m),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},j=Fe(u,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Lt=[u.black,u.red[C],u.green[C],u.blue[C],u.yellow[C]],St=[u.transparent,u.red[F],u.green[F],u.blue[F],u.yellow[F]],Ot=[u.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Rt={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...j},vt={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...j},Ct=e=>[u.cyan[e],u.blue[e],u.violet[e],u.grape[e],u.pink[e],u.green[e],u.teal[e],u.yellow[e],u.orange[e],u.red[e]],Ft=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;c();var w=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Pt=/^Win/.test(navigator.platform),Dt=/\b(android)\b/i.test(navigator.userAgent),Ut=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,we=navigator.userAgent.indexOf("Chrome")!==-1,Nt=!we&&navigator.userAgent.indexOf("Safari")!==-1,Ie=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,kt=()=>navigator.brave?.isBrave?.name==="isBrave",Ht=Ie||/android|webos|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent)||/android|ios|ipod|blackberry|windows phone/i.test(navigator.platform),Kt=typeof window<"u"&&"ResizeObserver"in window,Bt="Excalidraw",Gt=36,Wt=10,Yt=20,Vt=8,Xt=5,$t=1,zt=30,jt=Math.PI/12,Zt="red",qt={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},Qt={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},Jt={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Me=(d=>(d.COPY="copy",d.PASTE="paste",d.CUT="cut",d.KEYDOWN="keydown",d.KEYUP="keyup",d.MOUSE_MOVE="mousemove",d.RESIZE="resize",d.UNLOAD="unload",d.FOCUS="focus",d.BLUR="blur",d.DRAG_OVER="dragover",d.DROP="drop",d.GESTURE_END="gestureend",d.BEFORE_UNLOAD="beforeunload",d.GESTURE_START="gesturestart",d.GESTURE_CHANGE="gesturechange",d.POINTER_MOVE="pointermove",d.POINTER_DOWN="pointerdown",d.POINTER_UP="pointerup",d.STATE_CHANGE="statechange",d.WHEEL="wheel",d.TOUCH_START="touchstart",d.TOUCH_END="touchend",d.HASHCHANGE="hashchange",d.VISIBILITY_CHANGE="visibilitychange",d.SCROLL="scroll",d.EXCALIDRAW_LINK="excalidraw-link",d.MENU_ITEM_SELECT="menu.itemSelect",d.MESSAGE="message",d.FULLSCREENCHANGE="fullscreenchange",d))(Me||{}),en={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},I={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},tn={SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup"},q="Xiaolai",L="Segoe UI Emoji",T={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},Q="sans-serif",J="monospace",Pe={[Q]:998,[J]:999},B={[q]:100,...Pe,[L]:1e3};function De(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return J;default:return Q}}var ee=e=>{let t=De(e);switch(e){case T.Excalifont:return[q,t,L];default:return[t,L]}},nn={LIGHT:"light",DARK:"dark"},rn={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},on=1,sn=20,an=T.Excalifont,ln="left",cn="top",te="{version}",Ue=2,Ne=2*Ue,ke=1e-5,un=2*Ne-ke,pn="#ffffff",dn="#1e1e1e",fn="#a2f1a6",Tn=["selectAll"],En=20,mn=5,ne={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},He={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json"},Z={...He,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...ne},xn=[Z.text,Z.html,...Object.values(ne)],bn={png:"png",svg:"svg",clipboard:"clipboard"},_n={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},An=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,hn=500,yn=300,gn=500,Ln=1e4,Sn=3e4,On=100,Rn=.1,vn=.1,Cn=30,Fn=300,wn=6e4,In=3e3,Mn="invert(93%) hue-rotate(180deg)",Pn={addLibrary:"addLibrary"},Dn={addLibrary:"addLibrary"},Un={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},Nn=730,kn=1e3,Hn=500,Kn=1229,Bn=2,Gn=[1,2,3],Wn=10,Yn=1440,Vn=4*1024*1024,Xn="http://www.w3.org/2000/svg",$n=`<?xml version="1.0" standalone="no"?>
1
+ var ge=Object.create;var Y=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var ve=(e,t)=>()=>(e&&(t=e(e=0)),t);var V=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ce=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Le(t))!Re.call(e,r)&&r!==n&&Y(e,r,{get:()=>t[r],enumerable:!(o=Se(t,r))||o.enumerable});return e};var X=(e,t,n)=>(n=e!=null?ge(Oe(e)):{},Ce(t||!e||!e.__esModule?Y(n,"default",{value:e,enumerable:!0}):n,e));var f,c=ve(()=>{f={PROD:!0}});var ue=V((G,ce)=>{c();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof G=="object"?ce.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(G,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(s,a){this._listeners[s]=this._listeners[s]||[],this._listeners[s].indexOf(a)<0&&this._listeners[s].push(a)},e.prototype.removeEventListener=function(s,a){if(this._listeners[s]){var p=this._listeners[s].indexOf(a);p>=0&&this._listeners[s].splice(p,1)}},e.prototype.dispatchEvent=function(s){if(this._listeners[s.type]&&this._listeners[s.type].length)for(var a=this._listeners[s.type].slice(),p=0,m=a.length;p<m;++p)a[p].call(this,s)};var t=function(s){return typeof s.constructor=="function"&&s.constructor.name==="GeneratorFunction"},n=function(s){return{next:function(){var a=s();return a?{value:a}:{done:!0}}}},o=function(s){var a=!1;return{next:function(){return a?{done:!0}:(a=!0,{value:s})}}},r=function(s,a){var p=typeof s;if(p==="object"){if(typeof s.next=="function")return s;if(typeof s.then=="function")return o(s)}return p==="function"?t(s)?s():n(s):o(a.resolve(s))},l=function(s,a,p){this.target=s,this.type=a,this.data=p},i=function(s,a,p){if(e.call(this),typeof a!="number"||Math.floor(a)!==a||a<1)throw new Error("Invalid concurrency");this._concurrency=a,this._options=p||{},this._options.promise=this._options.promise||Promise,this._iterator=r(s,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return i.prototype=new e,i.prototype.constructor=i,i.prototype.concurrency=function(s){return typeof s<"u"&&(this._concurrency=s,this.active()&&this._proceed()),this._concurrency},i.prototype.size=function(){return this._size},i.prototype.active=function(){return!!this._promise},i.prototype.promise=function(){return this._promise},i.prototype.start=function(){var s=this,a=this._options.promise;return this._promise=new a(function(p,m){s._callbacks={reject:m,resolve:p},s._proceed()}),this._promise},i.prototype._fireEvent=function(s,a){this.dispatchEvent(new l(this,s,a))},i.prototype._settle=function(s){s?this._callbacks.reject(s):this._callbacks.resolve(),this._promise=null,this._callbacks=null},i.prototype._onPooledPromiseFulfilled=function(s,a){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:s,result:a}),this._proceed())},i.prototype._onPooledPromiseRejected=function(s,a){this._size--,this.active()&&(this._fireEvent("rejected",{promise:s,error:a}),this._settle(a||new Error("Unknown error")))},i.prototype._trackPromise=function(s){var a=this;s.then(function(p){a._onPooledPromiseFulfilled(s,p)},function(p){a._onPooledPromiseRejected(s,p)}).catch(function(p){a._settle(new Error("Promise processing failed: "+p))})},i.prototype._proceed=function(){if(!this._done){for(var s={done:!1};this._size<this._concurrency&&!(s=this._iterator.next()).done;)this._size++,this._trackPromise(s.value);this._done=s===null||!!s.done}this._done&&this._size===0&&this._settle()},i.PromisePoolEvent=l,i.PromisePool=i,i})});var he=V(D=>{"use strict";c();Object.defineProperty(D,"__esModule",{value:!0});D.sanitizeUrl=void 0;var st=/^([^\w]*)(javascript|data|vbscript)/im,it=/&#(\w+)(^\w|;)?/g,at=/&(newline|tab);/gi,lt=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,ct=/^.+(:|&colon;)/gim,ut=[".","/"];function pt(e){return ut.indexOf(e[0])>-1}function dt(e){return e.replace(it,function(t,n){return String.fromCharCode(n)})}function ft(e){var t=dt(e||"").replace(at,"").replace(lt,"").trim();if(!t)return"about:blank";if(pt(t))return t;var n=t.match(ct);if(!n)return t;var o=n[0];return st.test(o)?"about:blank":t}D.sanitizeUrl=ft});c();c();var $=class{constructor(t){this.scoreFunction=t}content=[];sinkDown(t){let n=this.content[t],o=this.scoreFunction(n);for(;t>0;){let r=(t+1>>1)-1,l=this.content[r];if(o<this.scoreFunction(l))this.content[t]=l,t=r;else break}this.content[t]=n}bubbleUp(t){let n=this.content.length,o=this.content[t],r=this.scoreFunction(o);for(;;){let l=(t+1<<1)-1,i=l+1,s=t,a=r;if(l<n){let p=this.scoreFunction(this.content[l]);p<a&&(s=l,a=p)}if(i<n&&this.scoreFunction(this.content[i])<a&&(s=i),s===t)break;this.content[t]=this.content[s],t=s}this.content[t]=o}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),o=this.content.pop();n<this.content.length&&(this.content[n]=o,this.scoreFunction(o)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}};c();var z={white:"#ffffff",black:"#000000",gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};var At=240,we=(e,t)=>t.reduce((n,o)=>(o in e&&(n[o]=e[o]),n),{}),yt=5,gt=5,St=4,C=4,F=1,E=[0,2,4,6,8],Lt=[0,1,2,3,4],x=(e,t)=>t.map(n=>z[e][n]),u={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:x("gray",E),red:x("red",E),pink:x("pink",E),grape:x("grape",E),violet:x("violet",E),blue:x("blue",E),cyan:x("cyan",E),teal:x("teal",E),green:x("green",E),yellow:x("yellow",E),orange:x("orange",E),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},j=we(u,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Ot=[u.black,u.red[C],u.green[C],u.blue[C],u.yellow[C]],Rt=[u.transparent,u.red[F],u.green[F],u.blue[F],u.yellow[F]],vt=[u.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Ct={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...j},Ft={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...j},Mt=e=>[u.cyan[e],u.blue[e],u.violet[e],u.grape[e],u.pink[e],u.green[e],u.teal[e],u.yellow[e],u.orange[e],u.red[e]],wt=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;c();var q=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ut=/^Win/.test(navigator.platform),Q=/\b(android)\b/i.test(navigator.userAgent),Nt=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Ie=navigator.userAgent.indexOf("Chrome")!==-1,kt=!Ie&&navigator.userAgent.indexOf("Safari")!==-1,K=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Ht=()=>navigator.brave?.isBrave?.name==="isBrave",Kt=K||/android|webos|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent)||/android|ios|ipod|blackberry|windows phone/i.test(navigator.platform),Bt=typeof window<"u"&&"ResizeObserver"in window,Gt="Excalidraw",Wt=36,Yt=10,Vt=20,Xt=8,$t=5,zt=1,jt=30,Zt=Math.PI/12,qt="red",Qt={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},Jt={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},en={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Pe=(d=>(d.COPY="copy",d.PASTE="paste",d.CUT="cut",d.KEYDOWN="keydown",d.KEYUP="keyup",d.MOUSE_MOVE="mousemove",d.RESIZE="resize",d.UNLOAD="unload",d.FOCUS="focus",d.BLUR="blur",d.DRAG_OVER="dragover",d.DROP="drop",d.GESTURE_END="gestureend",d.BEFORE_UNLOAD="beforeunload",d.GESTURE_START="gesturestart",d.GESTURE_CHANGE="gesturechange",d.POINTER_MOVE="pointermove",d.POINTER_DOWN="pointerdown",d.POINTER_UP="pointerup",d.STATE_CHANGE="statechange",d.WHEEL="wheel",d.TOUCH_START="touchstart",d.TOUCH_END="touchend",d.HASHCHANGE="hashchange",d.VISIBILITY_CHANGE="visibilitychange",d.SCROLL="scroll",d.EXCALIDRAW_LINK="excalidraw-link",d.MENU_ITEM_SELECT="menu.itemSelect",d.MESSAGE="message",d.FULLSCREENCHANGE="fullscreenchange",d))(Pe||{}),tn={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},M={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},nn={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope"},J="Xiaolai",S="Segoe UI Emoji",T={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},ee="sans-serif",te="monospace",De={[ee]:998,[te]:999},B={[J]:100,...De,[S]:1e3};function Ue(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return te;default:return ee}}var ne=e=>{let t=Ue(e);switch(e){case T.Excalifont:return[J,t,S];default:return[t,S]}},on={LIGHT:"light",DARK:"dark"},rn={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},sn=1,an=20,ln=T.Excalifont,cn="left",un="top",oe="{version}",Ne=2,ke=2*Ne,He=1e-5,pn=2*ke-He,dn="#ffffff",fn="#1e1e1e",Tn="#a2f1a6",mn=["selectAll"],En=20,xn=5,re={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},Ke={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",excalidrawlibIds:"application/vnd.excalidrawlib.ids+json"},Z={...Ke,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...re},bn=[Z.text,Z.html,...Object.values(re)],_n={png:"png",svg:"svg",clipboard:"clipboard"},hn={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},An=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,yn=500,gn=300,Sn=500,Ln=1e4,On=3e4,Rn=100,vn=.1,Cn=.1,Fn=30,Mn=300,wn=6e4,In=3e3,Pn="invert(93%) hue-rotate(180deg)",Dn={addLibrary:"addLibrary"},Un={addLibrary:"addLibrary"},Nn={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},Be=599,kn=1e3,Hn=500,Kn=Be+1,Bn=1400,Gn=1440,Wn=1229,Yn=2,Vn=[1,2,3],Xn=10,$n=1440,zn=4*1024*1024,jn="http://www.w3.org/2000/svg",Zn=`<?xml version="1.0" standalone="no"?>
2
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- `,zn=128,jn={excalidraw:2,excalidrawLibrary:2},Zn=5,qn=.7,Qn=11,Jn={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},er={LEFT:"left",CENTER:"center",RIGHT:"right"},tr=20,nr=.25,rr=32,or={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Ke={architect:0,artist:1,cartoonist:2},sr={thin:1,bold:2,extraBold:4},ir={strokeColor:u.black,backgroundColor:u.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:Ke.artist,opacity:100,locked:!1},Be="library",ar="search",lr={name:"default",defaultTab:Be},cr=new Set(["iframe","embeddable","image"]),ur={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser"},pr={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},dr="Untitled",fr={generalStats:1,elementProperties:2},Tr=1,Er={sharp:"sharp",round:"round",elbow:"elbow"},mr=.3,xr="element",br=Symbol.for("__test__originalId__"),Ge=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Ge||{}),_r=20,Ar=35;c();var M={[T.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25}},[T.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.25}},[T["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15}},[T["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25}},[T.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},deprecated:!0},[T.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},deprecated:!0,local:!0},[T.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},deprecated:!0},[T["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},private:!0},[T.Assistant]:{metrics:{unitsPerEm:2048,ascender:1021,descender:-287,lineHeight:1.25},private:!0},[B.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[B["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Lr={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},Sr="local:",Or=(e,t,n)=>{let{unitsPerEm:r,ascender:s,descender:l}=M[e]?.metrics||M[T.Excalifont].metrics,i=t/r,o=(n-i*s+i*l)/2;return i*s+o},Rr=e=>{let{lineHeight:t}=M[e]?.metrics||M[T.Excalifont].metrics;return t};c();var re=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(se(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=oe();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};c();var ie={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",NINE:"Digit9",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},y={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:w?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",W:"w",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},We=new Map([[y.Z,ie.Z],[y.Y,ie.Y]]),Ye=e=>/^[a-z]$/.test(e.toLowerCase()),Pr=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=We.get(t);return!!(n&&!Ye(e.key)&&e.code===n)},Dr=e=>e===y.ARROW_LEFT||e===y.ARROW_RIGHT||e===y.ARROW_DOWN||e===y.ARROW_UP,Ur=e=>e.altKey,Nr=e=>e.shiftKey,kr=e=>e.shiftKey;c();import{pointFromPair as Ve}from"@excalidraw/math";var Gr=e=>{let t=e.map(r=>r[0]),n=e.map(r=>r[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},Wr=(e,t,n,r)=>{let s=n.map(b=>b[e]),l=Math.max(...s),i=Math.min(...s),o=l-i,a=o===0?1:t/o,p=1/0,E=n.map(b=>{let _=b[e]*a,A=[...b];return A[e]=_,_<p&&(p=_),A});if(!r||E.length===2)return E;let O=i-p;return E.map(b=>Ve(b.map((_,A)=>A===e?_+O:_)))},Yr=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];c();var ue=X(le(),1),ce=class{pool;entries={};constructor(t,n){this.pool=new ue.default(t,n)}all(){let t=n=>{if(n.data.result){let[r,s]=n.data.result;this.entries[r]=s}};return this.pool.addEventListener("fulfilled",t),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",t)}),Object.values(this.entries)))}};c();c();c();var pe=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");c();var S=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};c();import{average as P}from"@excalidraw/math";var W=null,ao=e=>{W=e},lo=()=>{if(W)return W;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),s=`${e.getHours()}`.padStart(2,"0"),l=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${s}${l}`},co=e=>e.charAt(0).toUpperCase()+e.slice(1),uo=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),Xe=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,po=e=>Xe(e)||e instanceof Element&&!!e.closest("label, button"),fo=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"),$e=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${ee(n).map(r=>`, ${r}`).join("")}`;return L},To=({fontSize:e,fontFamily:t})=>`${e}px ${$e({fontFamily:t})}`,Eo=(e,t)=>{let n=0,r=null,s=(...l)=>{r=l,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...l)},t)};return s.flush=()=>{if(clearTimeout(n),r){let l=r;r=null,e(...l)}},s.cancel=()=>{r=null,clearTimeout(n)},s},mo=(e,t)=>{let n=null,r=null,s=null,l=o=>{n=window.requestAnimationFrame(()=>{n=null,e(...o),r=null,s&&(r=s,s=null,l(r))})},i=(...o)=>{if(D()){e(...o);return}r=o,n===null?l(r):t?.trailing&&(s=o)};return i.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),r&&(e(...s||r),r=s=null)},i.cancel=()=>{r=s=null,n!==null&&(cancelAnimationFrame(n),n=null)},i},Te=e=>1-Math.pow(1-e,4),de=(e,t,n)=>(t-e)*Te(n)+e,xo=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:s,onStart:l,onEnd:i,onCancel:o})=>{let a=!1,p=0,E;function O(N){if(a)return;E===void 0&&(E=N,l?.());let b=Math.min(N-E,r),_=Te(b/r),A={};if(Object.keys(e).forEach(g=>{let h=g,k=(t[h]-e[h])*_+e[h];A[h]=k}),n(A),b<r){let g=b/r,h={};Object.keys(e).forEach(k=>{let R=k,H=e[R],K=t[R],v;v=s?s(H,K,g,R):de(H,K,g),v==null&&(v=de(H,K,g)),h[R]=v}),n(h),p=window.requestAnimationFrame(O)}else n(t),i?.()}return p=window.requestAnimationFrame(O),()=>{o?.(),a=!0,window.cancelAnimationFrame(p)}},bo=(e,t)=>{if(!e.length||t<1)return[];let n=0,r=0,s=Array(Math.ceil(e.length/t));for(;n<e.length;)s[r++]=e.slice(n,n+=t);return s},_o=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Ao=()=>{let e=window.getSelection();e&&e.removeAllRanges()},ho=(e,t)=>Math.abs(e-t),yo=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},go=()=>document.fullscreenElement?.nodeName==="HTML",Lo=()=>document.documentElement.requestFullscreen(),So=()=>document.exitFullscreen(),Oo=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter"),w?e.replace(/\bCtrlOrCmd\b/gi,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/gi,"Ctrl")),Ro=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:s,scrollX:l,scrollY:i})=>{let o=(e-r)/n.value-l,a=(t-s)/n.value-i;return{x:o,y:a}},vo=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:s,scrollX:l,scrollY:i})=>{let o=(e+l)*n.value+r,a=(t+i)*n.value+s;return{x:o,y:a}},Co=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),ze="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",je="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Ze=new RegExp(`^[^${ze}]*[${je}]`),Fo=e=>Ze.test(e),wo=e=>{let[t,n]=e;return{x:t,y:n}},Io=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},Mo=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1},Po=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1},Do=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},qe=e=>{let t=e.length===5&&e.substr(4,1)==="0",n=e.length===9&&e.substr(7,2)==="00";return t||n||e===u.transparent},Uo=e=>e.fillStyle!=="solid"||qe(e.backgroundColor),oe=()=>{let e,t,n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},No=(e,t)=>{let n=[{value:1,symbol:"b"},{value:1e3,symbol:"k"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"}],r=/\.0+$|(\.[0-9]*[1-9])0+$/,s;for(s=n.length-1;s>0&&!(e>=n[s].value);s--);return(e/n[s].value).toFixed(t).replace(r,"$1")+n[s].symbol},ko=()=>document.querySelector('meta[name="version"]')?.content||te,Ho=()=>{let t=document.createElement("canvas").getContext("2d");if(!t)return!1;let n=12;return t.fillStyle="#f00",t.textBaseline="top",t.font="32px Arial",t.fillText("\u{1F600}",0,0),t.getImageData(n,n,1,1).data[0]!==0},Ko=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},Bo=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},Go=e=>{e.preventDefault(),e.returnValue=""},Wo=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),Yo=()=>D()?1:Date.now(),Vo=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),Xo=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),$o=(e,t)=>e.reduce((n,r,s)=>(n[t?t(r):s]=r,n),{}),zo=e=>e.reduce((t,n,r)=>{let s={...n,prev:null,next:null};if(r!==0){let l=t[r-1];if(s.prev=l,l.next=s,r===e.length-1){let i=t[0];s.next=i,i.prev=s}}return t.push(s),t},[]),Qe=e=>Array.isArray(e)?e:e.values(),jo=e=>Array.isArray(e)?e:Array.from(Qe(e)),D=()=>f.MODE===I.TEST,Zo=()=>f.MODE===I.DEVELOPMENT,qo=()=>f.MODE===I.PRODUCTION,Qo=()=>typeof process<"u"&&!0,Jo=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),es=(e,t)=>{let n=!1;for(let r in t){let s=t[r];if(typeof s<"u"){if(e[r]===s&&(typeof s!="object"||s===null))continue;n=!0}}return n?{...e,...t}:e},ts=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},Je=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},ns=()=>Je()==="iframe",rs=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,os=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},fe=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,et=(e,t,n,r=!1)=>{let s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return r&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let i of n)if(!(e[i]===t[i]||fe(e[i],t[i])))return r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),!1;return!0}return s.every(i=>{let o=n?.[i],a=o?o(e[i],t[i]):e[i]===t[i]||fe(e[i],t[i]);return!a&&r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),a})},ss=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(s){if(e?.(s),!n||!s?.defaultPrevented)return t?.(s)},is=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function as(e,t){if(!e)throw new Error(t)}var ls=e=>{let t,n,r=function(s){let l=Object.entries(s);if(t){let o=!0;for(let[a,p]of l)if(t.get(a)!==p){o=!1;break}if(o)return n}let i=e(s);return t=new Map(l),n=i,i};return r.clear=()=>{t=void 0,n=void 0},r},cs=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),us=e=>JSON.parse(JSON.stringify(e)),ps=(e,t)=>et(e,t)?e:t;function ds(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function fs(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],s=e[1],l=e[2],i=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${s[0].toFixed(2)},${s[1].toFixed(2)} ${P(s[0],l[0]).toFixed(2)},${P(s[1],l[1]).toFixed(2)} T`;for(let o=2,a=n-1;o<a;o++)r=e[o],s=e[o+1],i+=`${P(r[0],s[0]).toFixed(2)},${P(r[1],s[1]).toFixed(2)} `;return t&&(i+="Z"),i}var Ts=e=>e.replace(/\r?\n|\r/g,`
4
- `),Es=e=>e,se=async(e,...t)=>new Promise(n=>{n(e(...t))}),ms=(...e)=>Math.max(...e.map(t=>t?1:0))>0,xs=e=>{try{return JSON.parse(e)}catch{return null}},Ee=e=>e.replace(/"/g,"&quot;"),bs=e=>Array.isArray(e)?e:[e],tt=e=>Array.isArray(e),nt=e=>tt(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,_s=(e,t)=>{if(nt(e)===0)return null;let n=t||(s=>s),r=null;for(let s of e){let l=n(s);if((r===null||r===l)&&l!=null)r=l;else return null}return r};var me=new S(Date.now()),xe=0,Ss=()=>Math.floor(me.next()*2**31),Os=e=>{me=new S(e),xe=0},Rs=()=>D()?`id${xe++}`:pe();c();var _e=X(be(),1);var dt=e=>(e=e.trim(),e&&(0,_e.sanitizeUrl)(Ee(e))),Ms=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),Ps=e=>{if(e=dt(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};c();var Ae=class{subscribers=[];on(...t){let n=t.flat().filter(r=>typeof r=="function");return this.subscribers.push(...n),()=>this.off(n)}once(...t){let n=t.flat().filter(s=>typeof s=="function");n.push(()=>r());let r=this.on(...n);return r}off(...t){let n=t.flat();this.subscribers=this.subscribers.filter(r=>!n.includes(r))}trigger(...t){for(let n of this.subscribers)n(...t);return this}clear(){this.subscribers=[]}};export{In as ACTIVE_THRESHOLD,xn as ALLOWED_PASTE_MIME_TYPES,Bt as APP_NAME,Qn as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,qn as ARROW_LABEL_WIDTH_FRACTION,Er as ARROW_TYPE,Zn as BOUND_TEXT_PADDING,$ as BinaryHeap,Tn as CANVAS_ONLY_ACTIONS,gt as CANVAS_PALETTE_SHADE_INDEXES,ar as CANVAS_SEARCH_TAB,q as CJK_HAND_DRAWN_FALLBACK_FONT,tn as CLASSES,ie as CODES,ht as COLORS_PER_ROW,dn as COLOR_CHARCOAL_BLACK,_t as COLOR_OUTLINE_CONTRAST_THRESHOLD,u as COLOR_PALETTE,fn as COLOR_VOICE_CALL,pn as COLOR_WHITE,qt as CURSOR_TYPE,rr as DEFAULT_ADAPTIVE_RADIUS,Ot as DEFAULT_CANVAS_BACKGROUND_PICKS,yt as DEFAULT_CHART_COLOR_INDEX,un as DEFAULT_COLLISION_THRESHOLD,F as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,vt as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,St as DEFAULT_ELEMENT_BACKGROUND_PICKS,ir as DEFAULT_ELEMENT_PROPS,C as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Rt as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Lt as DEFAULT_ELEMENT_STROKE_PICKS,Wn as DEFAULT_EXPORT_PADDING,dr as DEFAULT_FILENAME,an as DEFAULT_FONT_FAMILY,sn as DEFAULT_FONT_SIZE,En as DEFAULT_GRID_SIZE,mn as DEFAULT_GRID_STEP,Zt as DEFAULT_LASER_COLOR,Yn as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,nr as DEFAULT_PROPORTIONAL_RADIUS,mr as DEFAULT_REDUCED_GLOBAL_ALPHA,lr as DEFAULT_SIDEBAR,ln as DEFAULT_TEXT_ALIGN,Ue as DEFAULT_TRANSFORM_HANDLE_SPACING,Un as DEFAULT_UI_OPTIONS,te as DEFAULT_VERSION,cn as DEFAULT_VERTICAL_ALIGN,Ar as DOUBLE_TAP_POSITION_THRESHOLD,Wt as DRAGGING_THRESHOLD,pr as EDITOR_LS_KEYS,m as ELEMENTS_PALETTE_SHADE_INDEXES,xr as ELEMENT_LINK_KEY,tr as ELEMENT_READY_TO_ERASE_OPACITY,Xt as ELEMENT_SHIFT_TRANSLATE_AMOUNT,$t as ELEMENT_TRANSLATE_AMOUNT,zn as ENCRYPTION_KEY_BITS,I as ENV,ke as EPSILON,Me as EVENT,_n as EXPORT_DATA_TYPES,bn as EXPORT_IMAGE_TYPES,Gn as EXPORT_SCALES,Ae as Emitter,T as FONT_FAMILY,B as FONT_FAMILY_FALLBACKS,Pe as FONT_FAMILY_GENERIC_FALLBACKS,M as FONT_METADATA,rn as FRAME_STYLE,Lr as GOOGLE_FONTS_RANGES,Fn as HYPERLINK_TOOLTIP_DELAY,wn as IDLE_THRESHOLD,ne as IMAGE_MIME_TYPES,hn as IMAGE_RENDER_TIMEOUT,y as KEYS,We as KeyCodeMap,cr as LIBRARY_DISABLED_TYPES,Be as LIBRARY_SIDEBAR_TAB,Vt as LINE_CONFIRM_THRESHOLD,_r as LINE_POLYGON_POINT_MERGE_DISTANCE,Sr as LOCAL_FONT_PROTOCOL,Vn as MAX_ALLOWED_FILE_BYTES,At as MAX_CUSTOM_COLORS_USED_IN_CANVAS,Bn as MAX_DECIMALS_FOR_SVG_EXPORT,Cn as MAX_ZOOM,Z as MIME_TYPES,Yt as MINIMUM_ARROW_SIZE,on as MIN_FONT_SIZE,Tr as MIN_WIDTH_OR_HEIGHT,vn as MIN_ZOOM,J as MONOSPACE_GENERIC_FONT,Hn as MQ_MAX_HEIGHT_LANDSCAPE,kn as MQ_MAX_WIDTH_LANDSCAPE,Nn as MQ_MAX_WIDTH_PORTRAIT,Kn as MQ_RIGHT_SIDEBAR_MIN_WIDTH,br as ORIG_ID,Qt as POINTER_BUTTON,Jt as POINTER_EVENTS,ce as PromisePool,re as Queue,Ke as ROUGHNESS,or as ROUNDNESS,Q as SANS_SERIF_GENERIC_FONT,On as SCROLL_TIMEOUT,jt as SHIFT_LOCKING_ANGLE,Ne as SIDE_RESIZING_THRESHOLD,fr as STATS_PANELS,He as STRING_MIME_TYPES,sr as STROKE_WIDTH,$n as SVG_DOCUMENT_PREAMBLE,Xn as SVG_NS,yn as TAP_TWICE_TIMEOUT,er as TEXT_ALIGN,Gt as TEXT_AUTOWRAP_THRESHOLD,zt as TEXT_TO_CENTER_SNAP_THRESHOLD,nn as THEME,Mn as THEME_FILTER,Ln as TITLE_TIMEOUT,ur as TOOL_TYPE,gn as TOUCH_CTX_MENU_TIMEOUT,Dn as URL_HASH_KEYS,Pn as URL_QUERY_KEYS,Ge as UserIdleState,jn as VERSIONS,Sn as VERSION_TIMEOUT,Jn as VERTICAL_ALIGN,L as WINDOWS_EMOJI_FALLBACK_FONT,en as YOUTUBE_STATES,Rn as ZOOM_STEP,ds as addEventListener,Lo as allowFullScreen,zo as arrayToList,Vo as arrayToMap,Xo as arrayToMapWithIndex,$o as arrayToObject,is as assertNever,Wo as bytesToHexString,co as capitalizeString,bs as castArray,bo as chunk,us as cloneJSON,ss as composeEventHandlers,Eo as debounce,ho as distance,Te as easeOut,xo as easeToValuesRAF,Ee as escapeDoubleQuotes,So as exitFullScreen,Mo as findIndex,Po as findLastIndex,Bo as focusNearestParent,Ct as getAllColorsSpecificShade,lo as getDateTime,An as getExportSource,ee as getFontFamilyFallbacks,$e as getFontFamilyString,To as getFontString,Je as getFrame,De as getGenericFontFamilyFallback,Co as getGlobalCSSVariable,Yr as getGridPoint,Rr as getLineHeight,Ko as getNearestScrollableContainer,Oo as getShortcutKey,Gr as getSizeFromPoints,x as getSpecificColorShades,fs as getSvgPathFromStroke,Yo as getUpdatedTimestamp,ko as getVersion,Or as getVerticalOffset,as as invariant,Dt as isAndroid,ms as isAnyTrue,Dr as isArrowKey,Uo as isBindingFallthroughEnabled,kt as isBrave,we as isChrome,w as isDarwin,Zo as isDevEnv,Ut as isFirefox,go as isFullScreen,Ie as isIOS,Xe as isInputLike,po as isInteractive,Ye as isLatinChar,Ms as isLocalLink,cs as isMemberOf,Ht as isMobile,ts as isPrimitive,qo as isProdEnv,rs as isPromiseLike,Fo as isRTL,tt as isReadonlyArray,ns as isRunningInIframe,Nt as isSafari,Qo as isServerEnv,et as isShallowEqual,D as isTestEnv,uo as isToolIcon,qe as isTransparent,Pt as isWindows,fo as isWritableElement,Do as mapFind,Pr as matchKey,ls as memoize,Io as muteFSAbortError,No as nFormatter,Ts as normalizeEOL,dt as normalizeLink,Go as preventUnload,se as promiseTry,os as queryFocusableElements,Rs as randomId,Ss as randomInteger,_s as reduceToCommonValue,Ao as removeSelection,Wr as rescalePoints,Os as reseed,oe as resolvablePromise,Ft as rgbToHex,xs as safelyParseJSON,vo as sceneCoordsToViewportCoords,_o as selectNode,ao as setDateTimeForTests,Nr as shouldMaintainAspectRatio,Ur as shouldResizeFromCenter,kr as shouldRotateWithDiscreteAngle,nt as sizeOf,Ho as supportsEmoji,Kt as supportsResizeObserver,mo as throttleRAF,jo as toArray,Es as toBrandedType,Qe as toIterable,Ps as toValidURL,wo as tupleToCoors,yo as updateActiveTool,es as updateObject,ps as updateStable,Ro as viewportCoordsToSceneCoords,Jo as wrapEvent};
3
+ `,qn=128,Qn={excalidraw:2,excalidrawLibrary:2},Jn=5,eo=.7,to=11,no={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},oo={LEFT:"left",CENTER:"center",RIGHT:"right"},ro=20,so=.25,io=32,ao={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Ge={architect:0,artist:1,cartoonist:2},lo={thin:1,bold:2,extraBold:4},co={strokeColor:u.black,backgroundColor:u.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:Ge.artist,opacity:100,locked:!1},We="library",uo="search",po={name:"default",defaultTab:We},fo=new Set(["iframe","embeddable","image"]),To={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser"},mo={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},Eo="Untitled",xo={generalStats:1,elementProperties:2},bo=1,_o={sharp:"sharp",round:"round",elbow:"elbow"},ho=.3,Ao="element",yo=Symbol.for("__test__originalId__"),Ye=(o=>(o.ACTIVE="active",o.AWAY="away",o.IDLE="idle",o))(Ye||{}),go=20,So=35,Lo={background:"var(--mobile-action-button-bg)"};c();var w={[T.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25}},[T.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.25}},[T["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15}},[T["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25}},[T.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},deprecated:!0},[T.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},deprecated:!0,local:!0},[T.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},deprecated:!0},[T["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},private:!0},[T.Assistant]:{metrics:{unitsPerEm:2048,ascender:1021,descender:-287,lineHeight:1.25},private:!0},[B.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[B["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Co={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},Fo="local:",Mo=(e,t,n)=>{let{unitsPerEm:o,ascender:r,descender:l}=w[e]?.metrics||w[T.Excalifont].metrics,i=t/o,s=(n-i*r+i*l)/2;return i*r+s},wo=e=>{let{lineHeight:t}=w[e]?.metrics||w[T.Excalifont].metrics;return t};c();var se=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(ae(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let o=ie();return this.jobs.push({jobFactory:t,promise:o,args:n}),this.tick(),o}};c();var le={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",NINE:"Digit9",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},y={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:q?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",W:"w",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},Ve=new Map([[y.Z,le.Z],[y.Y,le.Y]]),Xe=e=>/^[a-z]$/.test(e.toLowerCase()),Ho=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Ve.get(t);return!!(n&&!Xe(e.key)&&e.code===n)},Ko=e=>e===y.ARROW_LEFT||e===y.ARROW_RIGHT||e===y.ARROW_DOWN||e===y.ARROW_UP,Bo=e=>e.altKey,Go=e=>e.shiftKey,Wo=e=>e.shiftKey;c();import{pointFromPair as $e}from"@excalidraw/math";var $o=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},zo=(e,t,n,o)=>{let r=n.map(b=>b[e]),l=Math.max(...r),i=Math.min(...r),s=l-i,a=s===0?1:t/s,p=1/0,m=n.map(b=>{let _=b[e]*a,h=[...b];return h[e]=_,_<p&&(p=_),h});if(!o||m.length===2)return m;let O=i-p;return m.map(b=>$e(b.map((_,h)=>h===e?_+O:_)))},jo=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];c();var de=X(ue(),1),pe=class{pool;entries={};constructor(t,n){this.pool=new de.default(t,n)}all(){let t=n=>{if(n.data.result){let[o,r]=n.data.result;this.entries[o]=r}};return this.pool.addEventListener("fulfilled",t),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",t)}),Object.values(this.entries)))}};c();c();c();var fe=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");c();var L=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};c();import{average as I}from"@excalidraw/math";var W=null,dr=e=>{W=e},fr=()=>{if(W)return W;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),o=`${e.getDate()}`.padStart(2,"0"),r=`${e.getHours()}`.padStart(2,"0"),l=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${o}-${r}${l}`},Tr=e=>e.charAt(0).toUpperCase()+e.slice(1),mr=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),ze=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Er=e=>ze(e)||e instanceof Element&&!!e.closest("label, button"),xr=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"||e.type==="search"),je=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${ne(n).map(o=>`, ${o}`).join("")}`;return S},br=({fontSize:e,fontFamily:t})=>`${e}px ${je({fontFamily:t})}`,_r=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},hr=(e,t)=>{let n=0,o=null,r=(...l)=>{o=l,clearTimeout(n),n=window.setTimeout(()=>{o=null,e(...l)},t)};return r.flush=()=>{if(clearTimeout(n),o){let l=o;o=null,e(...l)}},r.cancel=()=>{o=null,clearTimeout(n)},r},Ar=(e,t)=>{let n=null,o=null,r=null,l=s=>{n=window.requestAnimationFrame(()=>{n=null,e(...s),o=null,r&&(o=r,r=null,l(o))})},i=(...s)=>{if(P()){e(...s);return}o=s,n===null?l(o):t?.trailing&&(r=s)};return i.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),o&&(e(...r||o),o=r=null)},i.cancel=()=>{o=r=null,n!==null&&(cancelAnimationFrame(n),n=null)},i},Ee=e=>1-Math.pow(1-e,4),Te=(e,t,n)=>(t-e)*Ee(n)+e,yr=({fromValues:e,toValues:t,onStep:n,duration:o=250,interpolateValue:r,onStart:l,onEnd:i,onCancel:s})=>{let a=!1,p=0,m;function O(U){if(a)return;m===void 0&&(m=U,l?.());let b=Math.min(U-m,o),_=Ee(b/o),h={};if(Object.keys(e).forEach(g=>{let A=g,N=(t[A]-e[A])*_+e[A];h[A]=N}),n(h),b<o){let g=b/o,A={};Object.keys(e).forEach(N=>{let R=N,k=e[R],H=t[R],v;v=r?r(k,H,g,R):Te(k,H,g),v==null&&(v=Te(k,H,g)),A[R]=v}),n(A),p=window.requestAnimationFrame(O)}else n(t),i?.()}return p=window.requestAnimationFrame(O),()=>{s?.(),a=!0,window.cancelAnimationFrame(p)}},gr=(e,t)=>{if(!e.length||t<1)return[];let n=0,o=0,r=Array(Math.ceil(e.length/t));for(;n<e.length;)r[o++]=e.slice(n,n+=t);return r},Sr=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Lr=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Or=(e,t)=>Math.abs(e-t),Rr=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},vr=()=>document.fullscreenElement?.nodeName==="HTML",Cr=()=>document.documentElement.requestFullscreen(),Fr=()=>document.exitFullscreen(),Mr=({clientX:e,clientY:t},{zoom:n,offsetLeft:o,offsetTop:r,scrollX:l,scrollY:i})=>{let s=(e-o)/n.value-l,a=(t-r)/n.value-i;return{x:s,y:a}},wr=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:o,offsetTop:r,scrollX:l,scrollY:i})=>{let s=(e+l)*n.value+o,a=(t+i)*n.value+r;return{x:s,y:a}},Ir=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),Ze="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",qe="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Qe=new RegExp(`^[^${Ze}]*[${qe}]`),Pr=e=>Qe.test(e),Dr=e=>{let[t,n]=e;return{x:t,y:n}},Ur=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},Nr=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let o=n-1;for(;++o<e.length;)if(t(e[o],o,e))return o;return-1},kr=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let o=n+1;for(;--o>-1;)if(t(e[o],o,e))return o;return-1},Hr=(e,t)=>{for(let n=0;n<e.length;n++){let o=t(e[n],n);if(o!=null)return o}},Je=e=>{let t=e.length===5&&e.substr(4,1)==="0",n=e.length===9&&e.substr(7,2)==="00";return t||n||e===u.transparent},Kr=e=>e.fillStyle!=="solid"||Je(e.backgroundColor),ie=()=>{let e,t,n=new Promise((o,r)=>{e=o,t=r});return n.resolve=e,n.reject=t,n},Br=(e,t)=>{let n=[{value:1,symbol:"b"},{value:1e3,symbol:"k"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"}],o=/\.0+$|(\.[0-9]*[1-9])0+$/,r;for(r=n.length-1;r>0&&!(e>=n[r].value);r--);return(e/n[r].value).toFixed(t).replace(o,"$1")+n[r].symbol},Gr=()=>document.querySelector('meta[name="version"]')?.content||oe,Wr=()=>{let t=document.createElement("canvas").getContext("2d");if(!t)return!1;let n=12;return t.fillStyle="#f00",t.textBaseline="top",t.font="32px Arial",t.fillText("\u{1F600}",0,0),t.getImageData(n,n,1,1).data[0]!==0},Yr=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},Vr=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},Xr=e=>{e.preventDefault(),e.returnValue=""},$r=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),zr=()=>P()?1:Date.now(),jr=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),Zr=e=>e.reduce((t,n,o)=>(t.set(n.id,[n,o]),t),new Map),qr=(e,t)=>e.reduce((n,o,r)=>(n[t?t(o):r]=o,n),{}),Qr=e=>e.reduce((t,n,o)=>{let r={...n,prev:null,next:null};if(o!==0){let l=t[o-1];if(r.prev=l,l.next=r,o===e.length-1){let i=t[0];r.next=i,i.prev=r}}return t.push(r),t},[]),et=e=>Array.isArray(e)?e:e.values(),Jr=e=>Array.isArray(e)?e:Array.from(et(e)),P=()=>f.MODE===M.TEST,es=()=>f.MODE===M.DEVELOPMENT,ts=()=>f.MODE===M.PRODUCTION,ns=()=>typeof process<"u"&&!0,os=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),rs=(e,t)=>{let n=!1;for(let o in t){let r=t[o];if(typeof r<"u"){if(e[o]===r&&(typeof r!="object"||r===null))continue;n=!0}}return n?{...e,...t}:e},ss=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},tt=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},is=()=>tt()==="iframe",as=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,ls=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},me=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,nt=(e,t,n,o=!1)=>{let r=Object.keys(e),l=Object.keys(t);if(r.length!==l.length)return o&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let i of n)if(!(e[i]===t[i]||me(e[i],t[i])))return o&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),!1;return!0}return r.every(i=>{let s=n?.[i],a=s?s(e[i],t[i]):e[i]===t[i]||me(e[i],t[i]);return!a&&o&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),a})},cs=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(r){if(e?.(r),!n||!r?.defaultPrevented)return t?.(r)},us=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function ps(e,t){if(!e)throw new Error(t)}var ds=e=>{let t,n,o=function(r){let l=Object.entries(r);if(t){let s=!0;for(let[a,p]of l)if(t.get(a)!==p){s=!1;break}if(s)return n}let i=e(r);return t=new Map(l),n=i,i};return o.clear=()=>{t=void 0,n=void 0},o},fs=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Ts=e=>JSON.parse(JSON.stringify(e)),ms=(e,t)=>nt(e,t)?e:t;function Es(e,t,n,o){return e?(e?.addEventListener?.(t,n,o),()=>{e?.removeEventListener?.(t,n,o)}):()=>{}}function xs(e,t=!0){let n=e.length;if(n<4)return"";let o=e[0],r=e[1],l=e[2],i=`M${o[0].toFixed(2)},${o[1].toFixed(2)} Q${r[0].toFixed(2)},${r[1].toFixed(2)} ${I(r[0],l[0]).toFixed(2)},${I(r[1],l[1]).toFixed(2)} T`;for(let s=2,a=n-1;s<a;s++)o=e[s],r=e[s+1],i+=`${I(o[0],r[0]).toFixed(2)},${I(o[1],r[1]).toFixed(2)} `;return t&&(i+="Z"),i}var bs=e=>e.replace(/\r?\n|\r/g,`
4
+ `),_s=e=>e,ae=async(e,...t)=>new Promise(n=>{n(e(...t))}),hs=(...e)=>Math.max(...e.map(t=>t?1:0))>0,As=e=>{try{return JSON.parse(e)}catch{return null}},xe=e=>e.replace(/"/g,"&quot;"),ys=e=>Array.isArray(e)?e:[e],ot=e=>Array.isArray(e),rt=e=>ot(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,gs=(e,t)=>{if(rt(e)===0)return null;let n=t||(r=>r),o=null;for(let r of e){let l=n(r);if((o===null||o===l)&&l!=null)o=l;else return null}return o},Ss=()=>{let e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.userAgentData;if(n){let r=(n.platform||"").toLowerCase(),l=r==="windows"||r==="macos"||r==="linux"||r==="chrome os";if(n.mobile===!0)return!0;if(n.mobile===!1&&r==="android")return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches;if(l)return!1}if(K)return!0;if(Q){let r=/Mobile/i.test(e);if(r||!r)return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches}return/Win|Linux|CrOS|Mac/.test(t)||/Windows NT|X11|CrOS|Macintosh/.test(e),!1};var be=new L(Date.now()),_e=0,Fs=()=>Math.floor(be.next()*2**31),Ms=e=>{be=new L(e),_e=0},ws=()=>P()?`id${_e++}`:fe();c();var Ae=X(he(),1);var Tt=e=>(e=e.trim(),e&&(0,Ae.sanitizeUrl)(xe(e))),ks=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),Hs=e=>{if(e=Tt(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};c();var ye=class{subscribers=[];on(...t){let n=t.flat().filter(o=>typeof o=="function");return this.subscribers.push(...n),()=>this.off(n)}once(...t){let n=t.flat().filter(r=>typeof r=="function");n.push(()=>o());let o=this.on(...n);return o}off(...t){let n=t.flat();this.subscribers=this.subscribers.filter(o=>!n.includes(o))}trigger(...t){for(let n of this.subscribers)n(...t);return this}clear(){this.subscribers=[]}};export{In as ACTIVE_THRESHOLD,bn as ALLOWED_PASTE_MIME_TYPES,Gt as APP_NAME,to as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,eo as ARROW_LABEL_WIDTH_FRACTION,_o as ARROW_TYPE,Jn as BOUND_TEXT_PADDING,$ as BinaryHeap,mn as CANVAS_ONLY_ACTIONS,Lt as CANVAS_PALETTE_SHADE_INDEXES,uo as CANVAS_SEARCH_TAB,J as CJK_HAND_DRAWN_FALLBACK_FONT,nn as CLASSES,le as CODES,gt as COLORS_PER_ROW,fn as COLOR_CHARCOAL_BLACK,At as COLOR_OUTLINE_CONTRAST_THRESHOLD,u as COLOR_PALETTE,Tn as COLOR_VOICE_CALL,dn as COLOR_WHITE,Qt as CURSOR_TYPE,io as DEFAULT_ADAPTIVE_RADIUS,vt as DEFAULT_CANVAS_BACKGROUND_PICKS,St as DEFAULT_CHART_COLOR_INDEX,pn as DEFAULT_COLLISION_THRESHOLD,F as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Ft as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Rt as DEFAULT_ELEMENT_BACKGROUND_PICKS,co as DEFAULT_ELEMENT_PROPS,C as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Ct as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Ot as DEFAULT_ELEMENT_STROKE_PICKS,Xn as DEFAULT_EXPORT_PADDING,Eo as DEFAULT_FILENAME,ln as DEFAULT_FONT_FAMILY,an as DEFAULT_FONT_SIZE,En as DEFAULT_GRID_SIZE,xn as DEFAULT_GRID_STEP,qt as DEFAULT_LASER_COLOR,$n as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,so as DEFAULT_PROPORTIONAL_RADIUS,ho as DEFAULT_REDUCED_GLOBAL_ALPHA,po as DEFAULT_SIDEBAR,cn as DEFAULT_TEXT_ALIGN,Ne as DEFAULT_TRANSFORM_HANDLE_SPACING,Nn as DEFAULT_UI_OPTIONS,oe as DEFAULT_VERSION,un as DEFAULT_VERTICAL_ALIGN,So as DOUBLE_TAP_POSITION_THRESHOLD,Yt as DRAGGING_THRESHOLD,mo as EDITOR_LS_KEYS,E as ELEMENTS_PALETTE_SHADE_INDEXES,Ao as ELEMENT_LINK_KEY,ro as ELEMENT_READY_TO_ERASE_OPACITY,$t as ELEMENT_SHIFT_TRANSLATE_AMOUNT,zt as ELEMENT_TRANSLATE_AMOUNT,qn as ENCRYPTION_KEY_BITS,M as ENV,He as EPSILON,Pe as EVENT,hn as EXPORT_DATA_TYPES,_n as EXPORT_IMAGE_TYPES,Vn as EXPORT_SCALES,ye as Emitter,T as FONT_FAMILY,B as FONT_FAMILY_FALLBACKS,De as FONT_FAMILY_GENERIC_FALLBACKS,w as FONT_METADATA,rn as FRAME_STYLE,Co as GOOGLE_FONTS_RANGES,Mn as HYPERLINK_TOOLTIP_DELAY,wn as IDLE_THRESHOLD,re as IMAGE_MIME_TYPES,yn as IMAGE_RENDER_TIMEOUT,y as KEYS,Ve as KeyCodeMap,fo as LIBRARY_DISABLED_TYPES,We as LIBRARY_SIDEBAR_TAB,Xt as LINE_CONFIRM_THRESHOLD,go as LINE_POLYGON_POINT_MERGE_DISTANCE,Fo as LOCAL_FONT_PROTOCOL,zn as MAX_ALLOWED_FILE_BYTES,yt as MAX_CUSTOM_COLORS_USED_IN_CANVAS,Yn as MAX_DECIMALS_FOR_SVG_EXPORT,Fn as MAX_ZOOM,Z as MIME_TYPES,Vt as MINIMUM_ARROW_SIZE,sn as MIN_FONT_SIZE,bo as MIN_WIDTH_OR_HEIGHT,Cn as MIN_ZOOM,Lo as MOBILE_ACTION_BUTTON_BG,te as MONOSPACE_GENERIC_FONT,Hn as MQ_MAX_HEIGHT_LANDSCAPE,Be as MQ_MAX_MOBILE,Bn as MQ_MAX_TABLET,kn as MQ_MAX_WIDTH_LANDSCAPE,Kn as MQ_MIN_TABLET,Gn as MQ_MIN_WIDTH_DESKTOP,Wn as MQ_RIGHT_SIDEBAR_MIN_WIDTH,yo as ORIG_ID,Jt as POINTER_BUTTON,en as POINTER_EVENTS,pe as PromisePool,se as Queue,Ge as ROUGHNESS,ao as ROUNDNESS,ee as SANS_SERIF_GENERIC_FONT,Rn as SCROLL_TIMEOUT,Zt as SHIFT_LOCKING_ANGLE,ke as SIDE_RESIZING_THRESHOLD,xo as STATS_PANELS,Ke as STRING_MIME_TYPES,lo as STROKE_WIDTH,Zn as SVG_DOCUMENT_PREAMBLE,jn as SVG_NS,gn as TAP_TWICE_TIMEOUT,oo as TEXT_ALIGN,Wt as TEXT_AUTOWRAP_THRESHOLD,jt as TEXT_TO_CENTER_SNAP_THRESHOLD,on as THEME,Pn as THEME_FILTER,Ln as TITLE_TIMEOUT,To as TOOL_TYPE,Sn as TOUCH_CTX_MENU_TIMEOUT,Un as URL_HASH_KEYS,Dn as URL_QUERY_KEYS,Ye as UserIdleState,Qn as VERSIONS,On as VERSION_TIMEOUT,no as VERTICAL_ALIGN,S as WINDOWS_EMOJI_FALLBACK_FONT,tn as YOUTUBE_STATES,vn as ZOOM_STEP,Es as addEventListener,Cr as allowFullScreen,Qr as arrayToList,jr as arrayToMap,Zr as arrayToMapWithIndex,qr as arrayToObject,us as assertNever,$r as bytesToHexString,Tr as capitalizeString,ys as castArray,gr as chunk,Ts as cloneJSON,cs as composeEventHandlers,hr as debounce,Or as distance,Ee as easeOut,yr as easeToValuesRAF,xe as escapeDoubleQuotes,Fr as exitFullScreen,Nr as findIndex,kr as findLastIndex,Vr as focusNearestParent,Mt as getAllColorsSpecificShade,fr as getDateTime,An as getExportSource,ne as getFontFamilyFallbacks,je as getFontFamilyString,br as getFontString,tt as getFrame,Ue as getGenericFontFamilyFallback,Ir as getGlobalCSSVariable,jo as getGridPoint,wo as getLineHeight,Yr as getNearestScrollableContainer,$o as getSizeFromPoints,x as getSpecificColorShades,xs as getSvgPathFromStroke,zr as getUpdatedTimestamp,Gr as getVersion,Mo as getVerticalOffset,ps as invariant,Q as isAndroid,hs as isAnyTrue,Ko as isArrowKey,Kr as isBindingFallthroughEnabled,Ht as isBrave,Ie as isChrome,q as isDarwin,es as isDevEnv,Nt as isFirefox,vr as isFullScreen,K as isIOS,ze as isInputLike,Er as isInteractive,Xe as isLatinChar,ks as isLocalLink,fs as isMemberOf,Kt as isMobile,Ss as isMobileOrTablet,ss as isPrimitive,ts as isProdEnv,as as isPromiseLike,Pr as isRTL,ot as isReadonlyArray,is as isRunningInIframe,kt as isSafari,ns as isServerEnv,nt as isShallowEqual,P as isTestEnv,mr as isToolIcon,Je as isTransparent,Ut as isWindows,xr as isWritableElement,Hr as mapFind,Ho as matchKey,ds as memoize,Ur as muteFSAbortError,Br as nFormatter,_r as nextAnimationFrame,bs as normalizeEOL,Tt as normalizeLink,Xr as preventUnload,ae as promiseTry,ls as queryFocusableElements,ws as randomId,Fs as randomInteger,gs as reduceToCommonValue,Lr as removeSelection,zo as rescalePoints,Ms as reseed,ie as resolvablePromise,wt as rgbToHex,As as safelyParseJSON,wr as sceneCoordsToViewportCoords,Sr as selectNode,dr as setDateTimeForTests,Go as shouldMaintainAspectRatio,Bo as shouldResizeFromCenter,Wo as shouldRotateWithDiscreteAngle,rt as sizeOf,Wr as supportsEmoji,Bt as supportsResizeObserver,Ar as throttleRAF,Jr as toArray,_s as toBrandedType,et as toIterable,Hs as toValidURL,Dr as tupleToCoors,Rr as updateActiveTool,rs as updateObject,ms as updateStable,Mr as viewportCoordsToSceneCoords,os as wrapEvent};
@@ -87,10 +87,12 @@ export declare const ENV: {
87
87
  PRODUCTION: string;
88
88
  };
89
89
  export declare const CLASSES: {
90
+ SIDEBAR: string;
90
91
  SHAPE_ACTIONS_MENU: string;
91
92
  ZOOM_ACTIONS: string;
92
93
  SEARCH_MENU_INPUT_WRAPPER: string;
93
94
  CONVERT_ELEMENT_TYPE_POPUP: string;
95
+ SHAPE_ACTIONS_THEME_SCOPE: string;
94
96
  };
95
97
  export declare const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
96
98
  export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
@@ -182,6 +184,7 @@ export declare const STRING_MIME_TYPES: {
182
184
  readonly json: "application/json";
183
185
  readonly excalidraw: "application/vnd.excalidraw+json";
184
186
  readonly excalidrawlib: "application/vnd.excalidrawlib+json";
187
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
185
188
  };
186
189
  export declare const MIME_TYPES: {
187
190
  readonly svg: "image/svg+xml";
@@ -201,6 +204,7 @@ export declare const MIME_TYPES: {
201
204
  readonly json: "application/json";
202
205
  readonly excalidraw: "application/vnd.excalidraw+json";
203
206
  readonly excalidrawlib: "application/vnd.excalidrawlib+json";
207
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
204
208
  };
205
209
  export declare const ALLOWED_PASTE_MIME_TYPES: readonly ["text/plain", "text/html", ...("image/svg+xml" | "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/bmp" | "image/x-icon" | "image/avif" | "image/jfif")[]];
206
210
  export declare const EXPORT_IMAGE_TYPES: {
@@ -235,9 +239,12 @@ export declare const URL_HASH_KEYS: {
235
239
  readonly addLibrary: "addLibrary";
236
240
  };
237
241
  export declare const DEFAULT_UI_OPTIONS: AppProps["UIOptions"];
238
- export declare const MQ_MAX_WIDTH_PORTRAIT = 730;
242
+ export declare const MQ_MAX_MOBILE = 599;
239
243
  export declare const MQ_MAX_WIDTH_LANDSCAPE = 1000;
240
244
  export declare const MQ_MAX_HEIGHT_LANDSCAPE = 500;
245
+ export declare const MQ_MIN_TABLET: number;
246
+ export declare const MQ_MAX_TABLET = 1400;
247
+ export declare const MQ_MIN_WIDTH_DESKTOP = 1440;
241
248
  export declare const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
242
249
  export declare const MAX_DECIMALS_FOR_SVG_EXPORT = 2;
243
250
  export declare const EXPORT_SCALES: number[];
@@ -351,3 +358,6 @@ export declare enum UserIdleState {
351
358
  */
352
359
  export declare const LINE_POLYGON_POINT_MERGE_DISTANCE = 20;
353
360
  export declare const DOUBLE_TAP_POSITION_THRESHOLD = 35;
361
+ export declare const MOBILE_ACTION_BUTTON_BG: {
362
+ readonly background: "var(--mobile-action-button-bg)";
363
+ };
@@ -17,6 +17,8 @@ export declare const getFontString: ({ fontSize, fontFamily, }: {
17
17
  fontSize: number;
18
18
  fontFamily: FontFamilyValues;
19
19
  }) => FontString;
20
+ /** executes callback in the frame that's after the current one */
21
+ export declare const nextAnimationFrame: (cb: () => any) => Promise<void>;
20
22
  export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeout: number) => {
21
23
  (...args: T): void;
22
24
  flush(): void;
@@ -94,7 +96,6 @@ export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">,
94
96
  export declare const isFullScreen: () => boolean;
95
97
  export declare const allowFullScreen: () => Promise<void>;
96
98
  export declare const exitFullScreen: () => Promise<void>;
97
- export declare const getShortcutKey: (shortcut: string) => string;
98
99
  export declare const viewportCoordsToSceneCoords: ({ clientX, clientY }: {
99
100
  clientX: number;
100
101
  clientY: number;
@@ -264,4 +265,5 @@ export declare const castArray: <T>(value: T | T[]) => T[];
264
265
  export declare const isReadonlyArray: (value?: any) => value is readonly any[];
265
266
  export declare const sizeOf: (value: readonly unknown[] | Readonly<Map<string, unknown>> | Readonly<Record<string, unknown>> | ReadonlySet<unknown>) => number;
266
267
  export declare const reduceToCommonValue: <T, R = T>(collection: ReadonlySet<T> | readonly T[], getValue?: ((item: T) => R) | undefined) => R | null;
268
+ export declare const isMobileOrTablet: () => boolean;
267
269
  export {};
@@ -1,6 +1,7 @@
1
+ import { type GlobalPoint } from "@excalidraw/math";
1
2
  import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
2
3
  import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
3
- import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "./types";
4
+ import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
4
5
  import type { RoughCanvas } from "roughjs/bin/canvas";
5
6
  export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
6
7
  export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
@@ -26,3 +27,5 @@ export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
26
27
  export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
27
28
  export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
28
29
  export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
30
+ export declare function getFreedrawOutlineAsSegments(element: ExcalidrawFreeDrawElement, points: [number, number][], elementsMap: ElementsMap): import("@excalidraw/math").LineSegment<GlobalPoint>[];
31
+ export declare function getFreedrawOutlinePoints(element: ExcalidrawFreeDrawElement): [number, number][];
@@ -52,4 +52,4 @@ export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoo
52
52
  se?: boolean | undefined;
53
53
  rotation?: boolean | undefined;
54
54
  }) => TransformHandles;
55
- export declare const shouldShowBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState) => boolean;
55
+ export declare const hasBoundingBox: (elements: readonly NonDeletedExcalidrawElement[], appState: InteractiveCanvasAppState) => boolean;
@@ -44,6 +44,10 @@ export declare const actionAddToLibrary: {
44
44
  locked: boolean;
45
45
  fromSelection: boolean;
46
46
  } & import("../types").ActiveTool;
47
+ preferredSelectionTool: {
48
+ type: "selection" | "lasso";
49
+ initialized: boolean;
50
+ };
47
51
  penMode: boolean;
48
52
  penDetected: boolean;
49
53
  exportBackground: boolean;
@@ -76,8 +80,8 @@ export declare const actionAddToLibrary: {
76
80
  zoom: Readonly<{
77
81
  value: import("../types").NormalizedZoomValue;
78
82
  }>;
79
- openMenu: "canvas" | "shape" | null;
80
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
83
+ openMenu: "canvas" | null;
84
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
81
85
  openSidebar: {
82
86
  name: string;
83
87
  tab?: string | undefined;
@@ -173,6 +177,7 @@ export declare const actionAddToLibrary: {
173
177
  lockedMultiSelections: {
174
178
  [groupId: string]: true;
175
179
  };
180
+ stylesPanelMode: "compact" | "full" | "mobile";
176
181
  };
177
182
  } | {
178
183
  captureUpdate: "EVENTUALLY";
@@ -211,6 +216,10 @@ export declare const actionAddToLibrary: {
211
216
  locked: boolean;
212
217
  fromSelection: boolean;
213
218
  } & import("../types").ActiveTool;
219
+ preferredSelectionTool: {
220
+ type: "selection" | "lasso";
221
+ initialized: boolean;
222
+ };
214
223
  penMode: boolean;
215
224
  penDetected: boolean;
216
225
  exportBackground: boolean;
@@ -243,8 +252,8 @@ export declare const actionAddToLibrary: {
243
252
  zoom: Readonly<{
244
253
  value: import("../types").NormalizedZoomValue;
245
254
  }>;
246
- openMenu: "canvas" | "shape" | null;
247
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
255
+ openMenu: "canvas" | null;
256
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
248
257
  openSidebar: {
249
258
  name: string;
250
259
  tab?: string | undefined;
@@ -345,6 +354,7 @@ export declare const actionAddToLibrary: {
345
354
  lockedMultiSelections: {
346
355
  [groupId: string]: true;
347
356
  };
357
+ stylesPanelMode: "compact" | "full" | "mobile";
348
358
  };
349
359
  }> | {
350
360
  captureUpdate: "EVENTUALLY";
@@ -383,6 +393,10 @@ export declare const actionAddToLibrary: {
383
393
  locked: boolean;
384
394
  fromSelection: boolean;
385
395
  } & import("../types").ActiveTool;
396
+ preferredSelectionTool: {
397
+ type: "selection" | "lasso";
398
+ initialized: boolean;
399
+ };
386
400
  penMode: boolean;
387
401
  penDetected: boolean;
388
402
  exportBackground: boolean;
@@ -415,8 +429,8 @@ export declare const actionAddToLibrary: {
415
429
  zoom: Readonly<{
416
430
  value: import("../types").NormalizedZoomValue;
417
431
  }>;
418
- openMenu: "canvas" | "shape" | null;
419
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
432
+ openMenu: "canvas" | null;
433
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
420
434
  openSidebar: {
421
435
  name: string;
422
436
  tab?: string | undefined;
@@ -517,6 +531,7 @@ export declare const actionAddToLibrary: {
517
531
  lockedMultiSelections: {
518
532
  [groupId: string]: true;
519
533
  };
534
+ stylesPanelMode: "compact" | "full" | "mobile";
520
535
  };
521
536
  };
522
537
  label: string;
@@ -64,6 +64,10 @@ export declare const actionBindText: {
64
64
  locked: boolean;
65
65
  fromSelection: boolean;
66
66
  } & import("../types").ActiveTool;
67
+ preferredSelectionTool: {
68
+ type: "selection" | "lasso";
69
+ initialized: boolean;
70
+ };
67
71
  penMode: boolean;
68
72
  penDetected: boolean;
69
73
  exportBackground: boolean;
@@ -96,8 +100,8 @@ export declare const actionBindText: {
96
100
  zoom: Readonly<{
97
101
  value: import("../types").NormalizedZoomValue;
98
102
  }>;
99
- openMenu: "canvas" | "shape" | null;
100
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
103
+ openMenu: "canvas" | null;
104
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
101
105
  openSidebar: {
102
106
  name: string;
103
107
  tab?: string | undefined;
@@ -195,6 +199,7 @@ export declare const actionBindText: {
195
199
  lockedMultiSelections: {
196
200
  [groupId: string]: true;
197
201
  };
202
+ stylesPanelMode: "compact" | "full" | "mobile";
198
203
  };
199
204
  captureUpdate: "IMMEDIATELY";
200
205
  };
@@ -248,6 +253,10 @@ export declare const actionWrapTextInContainer: {
248
253
  locked: boolean;
249
254
  fromSelection: boolean;
250
255
  } & import("../types").ActiveTool;
256
+ preferredSelectionTool: {
257
+ type: "selection" | "lasso";
258
+ initialized: boolean;
259
+ };
251
260
  penMode: boolean;
252
261
  penDetected: boolean;
253
262
  exportBackground: boolean;
@@ -280,8 +289,8 @@ export declare const actionWrapTextInContainer: {
280
289
  zoom: Readonly<{
281
290
  value: import("../types").NormalizedZoomValue;
282
291
  }>;
283
- openMenu: "canvas" | "shape" | null;
284
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
292
+ openMenu: "canvas" | null;
293
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
285
294
  openSidebar: {
286
295
  name: string;
287
296
  tab?: string | undefined;
@@ -379,6 +388,7 @@ export declare const actionWrapTextInContainer: {
379
388
  lockedMultiSelections: {
380
389
  [groupId: string]: true;
381
390
  };
391
+ stylesPanelMode: "compact" | "full" | "mobile";
382
392
  };
383
393
  captureUpdate: "IMMEDIATELY";
384
394
  };