@limetech/lime-elements 39.9.0 → 39.9.1

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 (77) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/{component-DC8AD-ZG.js → component-BrNWuGdj.js} +1 -1
  3. package/dist/cjs/{component-BflTavfP.js → component-CFk7Dfoi.js} +3 -3
  4. package/dist/cjs/{component--XvTU1MI.js → component-y8swlNNR.js} +1 -1
  5. package/dist/cjs/lime-elements.cjs.js +1 -1
  6. package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js +4 -4
  7. package/dist/cjs/limel-chip_2.cjs.entry.js +4 -4
  8. package/dist/cjs/limel-code-diff.cjs.entry.js +645 -711
  9. package/dist/cjs/limel-date-picker.cjs.entry.js +4 -4
  10. package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
  11. package/dist/cjs/limel-portal_3.cjs.entry.js +3 -3
  12. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  13. package/dist/cjs/limel-select.cjs.entry.js +2 -2
  14. package/dist/cjs/limel-slider.cjs.entry.js +2 -2
  15. package/dist/cjs/limel-switch.cjs.entry.js +18 -632
  16. package/dist/cjs/limel-tab-bar.cjs.entry.js +4 -4
  17. package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
  18. package/dist/cjs/limel-table.cjs.entry.js +3 -3
  19. package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +3 -3
  20. package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/cjs/{ponyfill-CNdYytGF.js → ponyfill-BgIFyUG5.js} +0 -1
  23. package/dist/collection/components/switch/switch.css +69 -769
  24. package/dist/collection/components/switch/switch.js +18 -50
  25. package/dist/collection/components/tab-bar/tab-bar.js +2 -2
  26. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  27. package/dist/collection/components/table/table.js +3 -3
  28. package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
  29. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
  30. package/dist/collection/components/text-editor/text-editor.js +1 -1
  31. package/dist/collection/components/tooltip/tooltip-content.js +1 -1
  32. package/dist/collection/components/tooltip/tooltip.js +2 -2
  33. package/dist/esm/{component-CfpvJ0ln.js → component-7QB0OUSF.js} +1 -1
  34. package/dist/esm/{component-zxri0Bi3.js → component-D4qgwaTf.js} +1 -1
  35. package/dist/esm/{component-BsWKksqY.js → component-wGVqvUmL.js} +3 -3
  36. package/dist/esm/lime-elements.js +1 -1
  37. package/dist/esm/limel-breadcrumbs_7.entry.js +4 -4
  38. package/dist/esm/limel-chip_2.entry.js +4 -4
  39. package/dist/esm/limel-code-diff.entry.js +645 -711
  40. package/dist/esm/limel-date-picker.entry.js +4 -4
  41. package/dist/esm/limel-dialog.entry.js +2 -2
  42. package/dist/esm/limel-portal_3.entry.js +3 -3
  43. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  44. package/dist/esm/limel-select.entry.js +2 -2
  45. package/dist/esm/limel-slider.entry.js +2 -2
  46. package/dist/esm/limel-switch.entry.js +19 -633
  47. package/dist/esm/limel-tab-bar.entry.js +4 -4
  48. package/dist/esm/limel-tab-panel.entry.js +1 -1
  49. package/dist/esm/limel-table.entry.js +3 -3
  50. package/dist/esm/limel-text-editor-link-menu.entry.js +3 -3
  51. package/dist/esm/limel-text-editor.entry.js +1 -1
  52. package/dist/esm/loader.js +1 -1
  53. package/dist/esm/{ponyfill-D-I_3IxW.js → ponyfill-ChRGk668.js} +1 -1
  54. package/dist/lime-elements/lime-elements.esm.js +1 -1
  55. package/dist/lime-elements/{p-89dfbd4a.entry.js → p-13f4d39d.entry.js} +1 -1
  56. package/dist/lime-elements/{p-68ffd790.entry.js → p-1a3a7374.entry.js} +1 -1
  57. package/dist/lime-elements/{p-90f8d2ef.entry.js → p-288aa326.entry.js} +1 -1
  58. package/dist/lime-elements/{p-6b05db4a.entry.js → p-2af214de.entry.js} +1 -1
  59. package/dist/lime-elements/{p-c6e9af7c.entry.js → p-37b41bad.entry.js} +1 -1
  60. package/dist/lime-elements/{p-ce22f3da.entry.js → p-74cd80a9.entry.js} +4 -4
  61. package/dist/lime-elements/{p-70e2e60c.entry.js → p-767935ac.entry.js} +1 -1
  62. package/dist/lime-elements/{p-b95a42ea.entry.js → p-86eebe44.entry.js} +1 -1
  63. package/dist/lime-elements/{p-D7ojrUFG.js → p-BN1-aIOw.js} +1 -1
  64. package/dist/lime-elements/{p-ClrXWM0F.js → p-C9yTLqR8.js} +1 -1
  65. package/dist/lime-elements/{p-D-I_3IxW.js → p-ChRGk668.js} +3 -3
  66. package/dist/lime-elements/{p-BDAjvVhN.js → p-DZkKQUDM.js} +3 -3
  67. package/dist/lime-elements/{p-dcf3cc71.entry.js → p-b2ea92be.entry.js} +1 -1
  68. package/dist/lime-elements/p-b3622713.entry.js +1 -0
  69. package/dist/lime-elements/{p-8ec4fdee.entry.js → p-cd722648.entry.js} +2 -2
  70. package/dist/lime-elements/{p-ee3afb60.entry.js → p-cdd5b814.entry.js} +9 -9
  71. package/dist/lime-elements/{p-8ec92025.entry.js → p-db51323c.entry.js} +1 -1
  72. package/dist/lime-elements/{p-64f664b0.entry.js → p-e2f1b070.entry.js} +1 -1
  73. package/dist/lime-elements/p-f10ca306.entry.js +1 -0
  74. package/dist/types/components/switch/switch.d.ts +4 -6
  75. package/package.json +3 -3
  76. package/dist/lime-elements/p-644911cc.entry.js +0 -68
  77. package/dist/lime-elements/p-965288d2.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e,h as t,H as o,a as n}from"./p-DBTJNfo7.js";import{t as r}from"./p-DVRaJQvC.js";class i{diff(e,t,o={}){let n;"function"==typeof o?(n=o,o={}):"callback"in o&&(n=o.callback);const r=this.castInput(e,o),i=this.castInput(t,o),s=this.removeEmpty(this.tokenize(r,o)),l=this.removeEmpty(this.tokenize(i,o));return this.diffWithOptionsObj(s,l,o,n)}diffWithOptionsObj(e,t,o,n){var r;const i=e=>(e=this.postProcess(e,o),n?void setTimeout((function(){n(e)}),0):e),s=t.length,l=e.length;let a=1,d=s+l;null!=o.maxEditLength&&(d=Math.min(d,o.maxEditLength));const c=null!==(r=o.timeout)&&void 0!==r?r:1/0,f=Date.now()+c,u=[{oldPos:-1,lastComponent:void 0}];let h=this.extractCommon(u[0],t,e,0,o);if(u[0].oldPos+1>=l&&h+1>=s)return i(this.buildValues(u[0].lastComponent,t,e));let b=-1/0,v=1/0;const p=()=>{for(let n=Math.max(b,-a);n<=Math.min(v,a);n+=2){let r;const a=u[n-1],d=u[n+1];a&&(u[n-1]=void 0);let c=!1;if(d){const e=d.oldPos-n;c=d&&0<=e&&e<s}const f=a&&a.oldPos+1<l;if(c||f){if(r=!f||c&&a.oldPos<d.oldPos?this.addToPath(d,!0,!1,0,o):this.addToPath(a,!1,!0,1,o),h=this.extractCommon(r,t,e,n,o),r.oldPos+1>=l&&h+1>=s)return i(this.buildValues(r.lastComponent,t,e))||!0;u[n]=r,r.oldPos+1>=l&&(v=Math.min(v,n-1)),h+1>=s&&(b=Math.max(b,n+1))}else u[n]=void 0}a++};if(n)!function e(){setTimeout((function(){if(a>d||Date.now()>f)return n(void 0);p()||e()}),0)}();else for(;a<=d&&Date.now()<=f;){const e=p();if(e)return e}}addToPath(e,t,o,n,r){const i=e.lastComponent;return i&&!r.oneChangePerToken&&i.added===t&&i.removed===o?{oldPos:e.oldPos+n,lastComponent:{count:i.count+1,added:t,removed:o,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:t,removed:o,previousComponent:i}}}extractCommon(e,t,o,n,r){const i=t.length,s=o.length;let l=e.oldPos,a=l-n,d=0;for(;a+1<i&&l+1<s&&this.equals(o[l+1],t[a+1],r);)a++,l++,d++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!r.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,a}equals(e,t,o){return o.comparator?o.comparator(e,t):e===t||!!o.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let o=0;o<e.length;o++)e[o]&&t.push(e[o]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,o){const n=[];let r;for(;e;)n.push(e),r=e.previousComponent,delete e.previousComponent,e=r;n.reverse();const i=n.length;let s=0,l=0,a=0;for(;s<i;s++){const e=n[s];if(e.removed)e.value=this.join(o.slice(a,a+e.count)),a+=e.count;else{if(!e.added&&this.useLongestToken){let n=t.slice(l,l+e.count);n=n.map((function(e,t){const n=o[a+t];return n.length>e.length?n:e})),e.value=this.join(n)}else e.value=this.join(t.slice(l,l+e.count));l+=e.count,e.added||(a+=e.count)}}return n}}function s(e,t){let o;for(o=0;o<e.length&&o<t.length;o++)if(e[o]!=t[o])return e.slice(0,o);return e.slice(0,o)}function l(e,t){let o;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(o=0;o<e.length&&o<t.length;o++)if(e[e.length-(o+1)]!=t[t.length-(o+1)])return e.slice(-o);return e.slice(-o)}function a(e,t,o){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return o+e.slice(t.length)}function d(e,t,o){if(!t)return e+o;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+o}function c(e,t){return a(e,t,"")}function f(e,t){return d(e,t,"")}function u(e,t){return t.slice(0,function(e,t){let o=0;e.length>t.length&&(o=e.length-t.length);let n=t.length;e.length<t.length&&(n=e.length);const r=Array(n);let i=0;r[0]=0;for(let e=1;e<n;e++){for(r[e]=t[e]==t[i]?r[i]:i;i>0&&t[e]!=t[i];)i=r[i];t[e]==t[i]&&i++}i=0;for(let n=o;n<e.length;n++){for(;i>0&&e[n]!=t[i];)i=r[i];e[n]==t[i]&&i++}return i}(e,t))}function h(e){let t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)}function b(e){const t=e.match(/^\s*/);return t?t[0]:""}const v="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",p=new RegExp(`[${v}]+|\\s+|[^${v}]`,"ug"),m=new class extends i{equals(e,t,o){return o.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let o;if(t.intlSegmenter){const n=t.intlSegmenter;if("word"!=n.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');o=[];for(const t of Array.from(n.segment(e))){const e=t.segment;o.length&&/\s/.test(o[o.length-1])&&/\s/.test(e)?o[o.length-1]+=e:o.push(e)}}else o=e.match(p)||[];const n=[];let r=null;return o.forEach((e=>{/\s/.test(e)?n.push(null==r?e:n.pop()+e):null!=r&&/\s/.test(r)?n.push(n[n.length-1]==r?n.pop()+e:r+e):n.push(e),r=e})),n}join(e){return e.map(((e,t)=>0==t?e:e.replace(/^\s+/,""))).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let o=null,n=null,r=null;return e.forEach((e=>{e.added?n=e:e.removed?r=e:((n||r)&&g(o,r,n,e),o=e,n=null,r=null)})),(n||r)&&g(o,r,n,null),e}};function g(e,t,o,n){if(t&&o){const r=b(t.value),i=h(t.value),u=b(o.value),v=h(o.value);if(e){const n=s(r,u);e.value=d(e.value,u,n),t.value=c(t.value,n),o.value=c(o.value,n)}if(n){const e=l(i,v);n.value=a(n.value,v,e),t.value=f(t.value,e),o.value=f(o.value,e)}}else if(o){if(e){const e=b(o.value);o.value=o.value.substring(e.length)}if(n){const e=b(n.value);n.value=n.value.substring(e.length)}}else if(e&&n){const o=b(n.value),r=b(t.value),i=h(t.value),u=s(o,r);t.value=c(t.value,u);const v=l(c(o,u),i);t.value=f(t.value,v),n.value=a(n.value,o,v),e.value=d(e.value,o,o.slice(0,o.length-v.length))}else if(n){const e=b(n.value),o=u(h(t.value),e);t.value=f(t.value,o)}else if(e){const o=u(h(e.value),b(t.value));t.value=c(t.value,o)}}const x=new class extends i{constructor(){super(...arguments),this.tokenize=y}equals(e,t,o){return o.ignoreWhitespace?(o.newlineIsToken&&e.includes("\n")||(e=e.trim()),o.newlineIsToken&&t.includes("\n")||(t=t.trim())):o.ignoreNewlineAtEof&&!o.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),super.equals(e,t,o)}};function y(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));const o=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let e=0;e<n.length;e++){const r=n[e];e%2&&!t.newlineIsToken?o[o.length-1]+=r:o.push(r)}return o}function w(e,t,o){const n=[];for(;t<e.length&&"removed"===e[t].type;)n.push(e[t]),t++;const r=[];for(;t<e.length&&"added"===e[t].type;)r.push(e[t]),t++;const i=Math.max(n.length,r.length);for(let e=0;e<i;e++)o.push({left:e<n.length?n[e]:void 0,right:e<r.length?r[e]:void 0});return t}function k(e,t=!1){if("object"==typeof e&&null!==e)return JSON.stringify(_(e),null,4);if("string"==typeof e&&t)try{const t=JSON.parse(e);return JSON.stringify(_(t),null,4)}catch(t){return e}return String(null!=e?e:"")}function _(e){if(Array.isArray(e))return e.map(_);if(null!==e&&"object"==typeof e){const t={},o=Object.keys(e).sort(((e,t)=>e.localeCompare(t)));for(const n of o)t[n]=_(e[n]);return t}return e}function C(e){if(!e)return[];const t=e.split("\n");return t.length>0&&""===t.at(-1)&&t.pop(),t}function S(e,t){const o=m.diff(e,t,undefined);const n=[],r=[];for(const e of o)e.added?r.push({value:e.value,type:"added"}):e.removed?n.push({value:e.value,type:"removed"}):(n.push({value:e.value,type:"equal"}),r.push({value:e.value,type:"equal"}));return[n,r]}const j=[[/"(?:[^"\\]|\\.)*"/,"string"],[/-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/,"number"],[/\b(?:true|false)\b/,"boolean"],[/\bnull\b/,"null"],[/[{}[\]:,]/,"punctuation"]],D=new RegExp(j.map((([e])=>`(${e.source})`)).join("|"),"g");function O(e){for(const[t,[,o]]of j.entries())if(void 0!==e[t+1])return o;return"plain"}const M=class{constructor(t){e(this,t),this.oldValue="",this.newValue="",this.layout="unified",this.contextLines=3,this.lineWrapping=!0,this.reformatJson=!1,this.translationLanguage="en",this.diffResult={hunks:[],additions:0,deletions:0,allLines:[]},this.liveAnnouncement="",this.copyState="idle",this.searchVisible=!1,this.searchTerm="",this.currentMatchIndex=0,this.focusedRowIndex=-1,this.normalizedOldText="",this.searchMatchCounter=0,this.totalSearchMatches=0,this.isRenderingRemovedLine=!1,this.activeSearchRegex=null,this.prevSearchVisible=!1}componentWillLoad(){this.recomputeDiff()}componentDidRender(){var e,t;if(this.searchVisible&&!this.prevSearchVisible&&(null===(e=this.searchInputEl)||void 0===e||e.focus()),this.prevSearchVisible=this.searchVisible,this.searchTerm&&this.totalSearchMatches>0){const e=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".search-match--current");null==e||e.scrollIntoView({block:"center",behavior:"smooth"})}}render(){var e;this.searchMatchCounter=0,this.activeSearchRegex=(e=this.searchTerm)?new RegExp(`(${function(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}(e)})`,"gi"):null;const n=this.renderDiff();this.totalSearchMatches=this.searchMatchCounter;const r=this.computeLineNumberWidth();return t(o,{key:"8122ede0d323b9021dae44cd5f65703d03083617",style:{"--limel-line-number-min-width":r}},this.renderHeader(),this.renderScreenReaderSummary(),this.searchVisible&&this.renderSearchBar(),t("div",{key:"fefe6e4898cbc82b6eb87f7dff7af71a14c7c91e",class:"diff-body",role:"table","aria-label":this.getTranslation("code-diff.table-label"),tabindex:"0",onKeyDown:e=>this.handleKeyDown(e)},n),t("div",{key:"2af1c7b29f2060a58af13d67fb174cb4de085efb",class:"screen-reader-only",role:"status","aria-live":"polite","aria-atomic":"true"},this.liveAnnouncement))}watchInputs(){this.recomputeDiff()}recomputeDiff(){const e=k(this.oldValue,this.reformatJson),t=k(this.newValue,this.reformatJson);this.normalizedOldText=e,this.diffResult=function(e,t,o=3){const n=function(e,t){const o=x.diff(e,t,void 0),n=[];let r=1,i=1;for(const e of o){const t=C(e.value);for(const o of t)n.push(e.added?{type:"added",content:o,newLineNumber:i++}:e.removed?{type:"removed",content:o,oldLineNumber:r++}:{type:"context",content:o,oldLineNumber:r++,newLineNumber:i++})}return function(e){let t=0;for(;t<e.length;){const o=t;for(;t<e.length&&"removed"===e[t].type;)t++;const n=t,r=t;for(;t<e.length&&"added"===e[t].type;)t++;const i=n-o,s=t-r;if(i>0&&s>0){const t=Math.min(i,s);for(let n=0;n<t;n++){const t=e[o+n],i=e[r+n],[s,l]=S(t.content,i.content);t.segments=s,i.segments=l}}t===o&&t++}}(n),n}(e,t);return function(e,t){if(0===e.length)return{hunks:[],additions:0,deletions:0,allLines:e};let o=0,n=0;for(const t of e)"added"===t.type?o++:"removed"===t.type&&n++;if(0===o&&0===n)return{hunks:[],additions:0,deletions:0,allLines:e};const r=[];for(const[t,o]of e.entries())"context"!==o.type&&r.push(t);const i=function(e,t,o){if(0===e.length)return[];const n=[];let r=Math.max(0,e[0]-o),i=Math.min(t,e[0]+o+1);for(let s=1;s<e.length;s++){const l=Math.max(0,e[s]-o),a=Math.min(t,e[s]+o+1);l<=i?i=Math.max(i,a):(n.push({start:r,end:i}),r=l,i=a)}return n.push({start:r,end:i}),n}(r,e.length,t),s=[];let l=0;for(const t of i){const o=e.slice(t.start,t.end),n=t.start-l;s.push({lines:o,collapsedBefore:n>0?n:void 0,startIndex:t.start}),l=t.end}const a=i.at(-1);return{hunks:s,additions:o,deletions:n,collapsedAfter:a.end<e.length?e.length-a.end:void 0,allLines:e}}(n,o)}(e,t,this.contextLines),this.focusedRowIndex=-1}formatSrSummary(){const{additions:e,deletions:t}=this.diffResult;if(0===e&&0===t)return null;const o=[];return e>0&&o.push(this.getTranslation(1===e?"code-diff.diff-addition":"code-diff.diff-additions",{count:e})),t>0&&o.push(this.getTranslation(1===t?"code-diff.diff-deletion":"code-diff.diff-deletions",{count:t})),this.getTranslation("code-diff.diff-summary",{parts:o.join(", ")})}renderScreenReaderSummary(){const e=this.formatSrSummary();return t("div",{class:"screen-reader-only",role:"status","aria-live":"polite"},null!=e?e:this.getTranslation("code-diff.no-differences-found"))}handleKeyDown(e){if("ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;e.preventDefault();const t=this.getDiffRows();0!==t.length&&(this.focusedRowIndex="ArrowDown"===e.key?Math.min(this.focusedRowIndex+1,t.length-1):Math.max(this.focusedRowIndex-1,0),this.updateRowFocus(t))}getDiffRows(){var e;const t=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector(".diff-body");return t?[...t.querySelectorAll(".diff-line:not(.diff-line--collapsed)")]:[]}updateRowFocus(e){for(const t of e)t.removeAttribute("tabindex"),t.classList.remove("diff-line--focused");const t=e[this.focusedRowIndex];t&&(t.setAttribute("tabindex","-1"),t.classList.add("diff-line--focused"),t.focus(),this.announceLine(t))}announceLine(e){var t,o;let n=this.getTranslation("code-diff.line-context");e.classList.contains("diff-line--added")?n=this.getTranslation("code-diff.line-added"):e.classList.contains("diff-line--removed")&&(n=this.getTranslation("code-diff.line-removed"));const r=null!==(o=null===(t=e.querySelector(".line-content, .split-content"))||void 0===t?void 0:t.textContent)&&void 0!==o?o:"",i=r.length>80?r.slice(0,80)+"…":r;this.liveAnnouncement=`${n}: ${i}`}renderHeader(){var e,o;const n=null!==(e=this.oldHeading)&&void 0!==e?e:this.getTranslation("code-diff.old-heading"),r=null!==(o=this.newHeading)&&void 0!==o?o:this.getTranslation("code-diff.new-heading"),{additions:i,deletions:s}=this.diffResult,l=i>0||s>0;return t("div",{class:"diff-header"},t("div",{class:"diff-header__labels"},t("span",{class:"diff-header__old"},n),t("span",{class:"diff-header__new"},r)),t("div",{class:"diff-header__actions"},t("div",{class:"diff-header__stats"},i>0&&t("span",{class:"stat stat--added"},"+",i),s>0&&t("span",{class:"stat stat--removed"},"-",s)),l&&this.renderCopyButton(),s>0&&this.renderSearchToggle()))}renderCopyButton(){const e=this.getTranslation("copied"===this.copyState?"code-diff.copied":"code-diff.copy-old-version");return t("limel-icon-button",{label:e,icon:"copied"===this.copyState?"checkmark":"copy",onClick:()=>this.copyToClipboard(this.normalizedOldText)})}async copyToClipboard(e){try{await navigator.clipboard.writeText(e),this.copyState="copied",this.liveAnnouncement=this.getTranslation("code-diff.copied-to-clipboard"),setTimeout((()=>{this.copyState="idle"}),2e3)}catch(e){}}renderSearchToggle(){return t("limel-icon-button",{class:{"search-toggle--active":this.searchVisible},label:this.getTranslation("code-diff.search"),icon:"search",onClick:()=>this.toggleSearch()})}renderSearchBar(){const e=0===this.totalSearchMatches?this.getTranslation("code-diff.no-matches"):this.getTranslation("code-diff.match-count",{current:this.currentMatchIndex+1,total:this.totalSearchMatches});return t("div",{class:"search-bar"},t("limel-input-field",{class:"search-bar__input",type:"search",placeholder:this.getTranslation("code-diff.search")+"…",value:this.searchTerm,onChange:e=>this.onSearchInput(e),onKeyDown:e=>this.onSearchKeyDown(e),ref:e=>this.searchInputEl=e}),t("span",{class:"search-bar__count"},e),t("limel-action-bar",{actions:this.getSearchActions(),onItemSelected:e=>this.onSearchAction(e)}))}toggleSearch(){this.searchVisible=!this.searchVisible,this.searchVisible||(this.searchTerm="",this.currentMatchIndex=0)}onSearchInput(e){this.searchTerm=e.detail,this.currentMatchIndex=0}onSearchKeyDown(e){"Enter"===e.key?(e.preventDefault(),this.navigateSearch(e.shiftKey?-1:1)):"Escape"===e.key&&this.toggleSearch()}computeLineNumberWidth(){return`calc(${String(this.diffResult.allLines.length).length}ch + 2 * var(--limel-code-diff-line-number-padding))`}getSearchActions(){const e=0===this.totalSearchMatches;return[{text:this.getTranslation("code-diff.previous-match"),icon:"-lime-caret-top",iconOnly:!0,disabled:e,value:"prev"},{text:this.getTranslation("code-diff.next-match"),icon:"-lime-caret-bottom",iconOnly:!0,disabled:e,value:"next"},{text:this.getTranslation("code-diff.close-search"),icon:"cancel",iconOnly:!0,value:"close"}]}onSearchAction(e){const{value:t}=e.detail;"prev"===t?this.navigateSearch(-1):"next"===t?this.navigateSearch(1):"close"===t&&this.toggleSearch()}navigateSearch(e){this.currentMatchIndex=function(e,t,o){return 0===o?0:(e+t+o)%o}(this.currentMatchIndex,e,this.totalSearchMatches)}renderDiff(){const{hunks:e,collapsedAfter:o}=this.diffResult;return 0===e.length?t("div",{class:"diff-empty"},this.getTranslation("code-diff.no-differences")):this.renderHunks(e,o,"split"===this.layout?e=>this.renderSplitHunkRows(e):e=>this.renderHunkLines(e))}renderHunks(e,t,o){const n=[];for(const[t,r]of e.entries())r.collapsedBefore&&n.push(this.renderCollapsedRow(r.collapsedBefore,t)),n.push(...o(r));return t&&n.push(this.renderCollapsedAfterRow(t)),n}renderHunkLines(e){const t=[];let o=0;for(;o<e.lines.length;){const n=e.lines[o];if("context"===n.type){t.push(this.renderLine(n)),o++;continue}const r=[];for(;o<e.lines.length&&"context"!==e.lines[o].type;)r.push(e.lines[o]),o++;t.push(this.renderChangeBlock(r))}return t}renderChangeBlock(e){const o=function(e){return e.filter((e=>"removed"===e.type)).map((e=>e.content)).join("\n")}(e);return t("div",{class:"change-group"},e.map((e=>this.renderLine(e))),o&&this.renderBlockCopyButton(o))}renderLine(e){var o,n;const r={added:"+",removed:"-",context:" "}[e.type];return t("div",{class:{"diff-line":!0,[`diff-line--${e.type}`]:!0},role:"row"},t("span",{class:"line-number line-number--old",role:"cell","aria-label":e.oldLineNumber?this.getTranslation("code-diff.old-line",{number:e.oldLineNumber}):void 0},null!==(o=e.oldLineNumber)&&void 0!==o?o:""),t("span",{class:"line-number line-number--new",role:"cell","aria-label":e.newLineNumber?this.getTranslation("code-diff.new-line",{number:e.newLineNumber}):void 0},null!==(n=e.newLineNumber)&&void 0!==n?n:""),t("span",{class:"line-indicator",role:"cell"},r),t("span",{class:"line-content",role:"cell"},this.renderContent(e)))}renderSplitHunkRows(e){var t,o,n,r;const i=function(e){const t=[];let o=0;for(;o<e.length;){const n=e[o];"context"!==n.type?o=w(e,o,t):(t.push({left:n,right:n}),o++)}return t}(e.lines),s=[];let l=0;for(;l<i.length;){const e=i[l];if("context"===(null===(t=e.left)||void 0===t?void 0:t.type)&&"context"===(null===(o=e.right)||void 0===o?void 0:o.type)){s.push(this.renderSplitRow(e)),l++;continue}const a=[];for(;l<i.length;){const e=i[l];if("context"===(null===(n=e.left)||void 0===n?void 0:n.type)&&"context"===(null===(r=e.right)||void 0===r?void 0:r.type))break;a.push(e),l++}s.push(this.renderSplitChangeBlock(a))}return s}renderSplitChangeBlock(e){const o=function(e){return e.filter((e=>{var t;return"removed"===(null===(t=e.left)||void 0===t?void 0:t.type)})).map((e=>e.left.content)).join("\n")}(e);return t("div",{class:"change-group"},e.map((e=>this.renderSplitRow(e))),o&&this.renderBlockCopyButton(o))}renderSplitRow(e){var o,n,r,i,s,l,a,d,c,f;const u=null!==(n=null===(o=e.left)||void 0===o?void 0:o.type)&&void 0!==n?n:"empty",h=null!==(i=null===(r=e.right)||void 0===r?void 0:r.type)&&void 0!==i?i:"empty",b=(null===(s=e.left)||void 0===s?void 0:s.oldLineNumber)?this.getTranslation("code-diff.old-line",{number:e.left.oldLineNumber}):void 0,v=(null===(l=e.right)||void 0===l?void 0:l.newLineNumber)?this.getTranslation("code-diff.new-line",{number:e.right.newLineNumber}):void 0;return t("div",{class:"diff-line diff-line--split",role:"row"},t("span",{class:"line-number line-number--old",role:"cell","aria-label":b},null!==(d=null===(a=e.left)||void 0===a?void 0:a.oldLineNumber)&&void 0!==d?d:""),t("span",{class:`split-content split-content--left split-content--${u}`,role:"cell"},e.left?this.renderContent(e.left):""),t("span",{class:"line-number line-number--new",role:"cell","aria-label":v},null!==(f=null===(c=e.right)||void 0===c?void 0:c.newLineNumber)&&void 0!==f?f:""),t("span",{class:`split-content split-content--right split-content--${h}`,role:"cell"},e.right?this.renderContent(e.right):""))}renderBlockCopyButton(e){return t("limel-icon-button",{class:"change-group__copy",elevated:!0,label:this.getTranslation("code-diff.copy-change"),icon:"copy",onClick:()=>this.copyToClipboard(e)})}renderContent(e){return this.isRenderingRemovedLine="removed"===e.type&&this.searchTerm.length>0,e.segments&&0!==e.segments.length?e.segments.map((t=>this.renderSegment(t,e.type))):this.renderSyntaxTokens(e.content)}renderSegment(e,o){const n=this.renderSyntaxTokens(e.value);return"equal"===e.type?n:t("mark",{class:"removed"===o?"segment--removed":"segment--added"},n)}renderSyntaxTokens(e){const t=function(e,t){return t&&0!==e.length&&"json"===t?function(e){const t=[];let o=0;D.lastIndex=0;let n=D.exec(e);for(;null!==n;){n.index>o&&t.push({value:e.slice(o,n.index),type:"plain"});const r=O(n),i=n[0];if("string"===r){const o=e.slice(n.index+i.length);/^\s*:/.test(o)?t.push({value:i,type:"key"}):t.push({value:i,type:"string"})}else t.push({value:i,type:r});o=n.index+i.length,n=D.exec(e)}return o<e.length&&t.push({value:e.slice(o),type:"plain"}),t}(e):[{value:e,type:"plain"}]}(e,this.language);return 1===t.length&&"plain"===t[0].type?this.renderSearchableText(e):t.map((e=>this.renderSyntaxToken(e)))}renderSyntaxToken(e){const o=this.renderSearchableText(e.value);return"plain"===e.type?o:t("span",{class:`syntax--${e.type}`},o)}renderSearchableText(e){if(!this.isRenderingRemovedLine||!this.activeSearchRegex)return e;const o=e.split(this.activeSearchRegex);return 1===o.length?e:o.map(((e,o)=>{if(o%2==0)return e;const n=this.searchMatchCounter++;return t("mark",{key:`match-${n}`,class:{"search-match":!0,"search-match--current":n===this.currentMatchIndex}},e)}))}renderCollapsedRow(e,o){return t("div",{class:"diff-line diff-line--collapsed",role:"row"},t("button",{class:"expand-button",type:"button",onClick:()=>this.expandHunk(o),"aria-label":this.getTranslation("code-diff.show-hidden-lines",{count:e})},this.getTranslation("code-diff.hidden-lines",{count:e})))}renderCollapsedAfterRow(e){return t("div",{class:"diff-line diff-line--collapsed",role:"row"},t("button",{class:"expand-button",type:"button",onClick:()=>this.expandAfter(),"aria-label":this.getTranslation("code-diff.show-hidden-lines",{count:e})},this.getTranslation("code-diff.hidden-lines",{count:e})))}expandHunk(e){const t=[...this.diffResult.hunks],o=t[e],n=e>0?t[e-1].startIndex+t[e-1].lines.length:0,r=this.diffResult.allLines.slice(n,o.startIndex);t[e]=Object.assign(Object.assign({},o),{lines:[...r,...o.lines],collapsedBefore:void 0,startIndex:n}),this.diffResult=Object.assign(Object.assign({},this.diffResult),{hunks:t}),this.liveAnnouncement=this.getTranslation("code-diff.expanded-lines")}expandAfter(){const e=[...this.diffResult.hunks],t=e.length-1,o=e[t],n=this.diffResult.allLines.slice(o.startIndex+o.lines.length);e[t]=Object.assign(Object.assign({},o),{lines:[...o.lines,...n]}),this.diffResult=Object.assign(Object.assign({},this.diffResult),{hunks:e,collapsedAfter:void 0}),this.liveAnnouncement=this.getTranslation("code-diff.expanded-lines-end")}getTranslation(e,t){return r.get(e,this.translationLanguage,t)}get host(){return n(this)}static get watchers(){return{oldValue:[{watchInputs:0}],newValue:[{watchInputs:0}],contextLines:[{watchInputs:0}],reformatJson:[{watchInputs:0}],layout:[{watchInputs:0}]}}};M.style='@charset "UTF-8";*,*::before,*::after{box-sizing:border-box;min-width:0;min-height:0}:host(limel-code-diff){--diff-added-bg:rgb(var(--color-green-default), 0.1);--diff-added-bg-hover:rgb(var(--color-green-default), 0.3);--diff-added-highlight-bg:rgb(var(--color-green-default), 0.3);--diff-removed-bg:rgb(var(--color-red-default), 0.1);--diff-removed-bg-hover:rgb(var(--color-red-default), 0.3);--diff-removed-highlight-bg:rgb(var(--color-red-default), 0.3);--diff-context-bg:transparent;--diff-indicator-added-color:rgb(var(--color-green-default));--diff-indicator-removed-color:rgb(var(--color-red-default));--diff-stat-added-color:rgb(var(--color-green-default));--diff-stat-removed-color:rgb(var(--color-red-default));--search-match-bg:rgb(var(--color-amber-default), 0.3);--search-match-current-bg:rgb(var(--color-amber-default), 0.6);--diff-line-hover-bg:rgb(var(--contrast-800), 0.08);--diff-gutter-bg:rgb(var(--contrast-200));--diff-gutter-text-color:rgb(var(--contrast-700));--diff-text-color:rgb(var(--contrast-1100));--diff-border-color:rgb(var(--contrast-400));--diff-collapsed-bg:rgb(var(--contrast-200));--diff-collapsed-text-color:rgb(var(--contrast-800));--diff-header-bg:rgb(var(--contrast-200));--diff-empty-text-color:rgb(var(--contrast-700));--diff-split-divider-color:rgb(var(--contrast-400));--diff-empty-cell-bg:rgb(var(--contrast-100));--syntax-string-color:rgb(var(--color-green-dark));--syntax-number-color:rgb(var(--color-blue-default));--syntax-boolean-color:rgb(var(--color-amber-darker));--syntax-key-color:rgb(var(--color-sky-dark));--syntax-null-color:rgb(var(--contrast-700));--syntax-punctuation-color:rgb(var(--contrast-700));--search-bar-bg:rgb(var(--contrast-100));--search-bar-border:rgb(var(--contrast-400));--limel-code-diff-line-number-padding:0.25rem;font-family:ui-sans-serif, system-ui, sans-serif;display:flex;flex-direction:column;width:100%;height:100%;color:var(--diff-text-color);border:1px solid var(--diff-border-color);border-radius:0.5rem;max-height:var(--code-diff-max-height, none)}.screen-reader-only{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap}.diff-header{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:0.125rem 0.125rem 0.125rem 0.5rem;background:var(--diff-header-bg);border-bottom:1px solid var(--diff-border-color);font-family:ui-sans-serif, system-ui, sans-serif;font-size:0.75rem;border-radius:0.5rem 0.5rem 0 0}.diff-header__labels{display:flex;gap:0.75rem;font-weight:500}.diff-header__old,.diff-header__new{padding:0.125rem 0.25rem;border-radius:0.25rem;box-shadow:var(--shadow-brighten-edges-outside)}.diff-header__old{background-color:var(--diff-removed-bg)}.diff-header__new{background-color:var(--diff-added-bg)}.diff-header__actions{display:flex;align-items:center;gap:0.25rem}.search-toggle--active{--limel-theme-on-surface-color:var(--mdc-theme-primary)}.diff-header__stats{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;display:flex;gap:0.5rem;margin-right:0.5rem}.stat{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:0.8125rem;font-weight:600}.stat--added{color:var(--diff-stat-added-color)}.stat--removed{color:var(--diff-stat-removed-color)}.search-bar{flex-shrink:0;display:flex;align-items:center;gap:0.25rem;padding:0.25rem 0 0.25rem 0.25rem;background:var(--search-bar-bg);border-bottom:1px solid var(--search-bar-border)}.search-bar limel-action-bar{--action-bar-background-color:transparent;min-width:2.5rem;flex-shrink:0}.search-bar limel-input-field{flex-grow:1}.search-bar__count{color:var(--diff-collapsed-text-color);white-space:nowrap;min-width:4rem;text-align:center;font-size:0.75rem}.search-match{background:var(--search-match-bg);color:inherit;border-radius:0.125rem}.search-match--current{background:var(--search-match-current-bg);outline:1px solid rgb(var(--color-amber-dark), 0.5)}.change-group{position:relative}.change-group__copy{--icon-background-color:rgb(var(--contrast-100));scale:0.9;position:absolute;top:0.125rem;right:0.5rem;display:none}.change-group:hover .change-group__copy{display:inline-flex}.diff-body{flex-grow:1;overflow-x:auto;font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:var(--code-diff-font-size, 0.75rem)}.diff-body:focus{outline:none}.diff-body:focus-visible{outline:0.125rem solid rgb(var(--color-blue-default));outline-offset:0.125rem;border-radius:0.25rem}.diff-line{display:flex;align-items:stretch;min-height:1.25rem;line-height:1.25rem}.diff-line:hover .line-content{transition-duration:0.2s;background:var(--diff-line-hover-bg)}.diff-line--added .line-content{background:var(--diff-added-bg)}.diff-line--added .line-indicator{color:var(--diff-indicator-added-color)}.diff-line--added:hover .line-content{background:var(--diff-added-bg-hover)}.diff-line--removed .line-content{background:var(--diff-removed-bg)}.diff-line--removed .line-indicator{color:var(--diff-indicator-removed-color)}.diff-line--removed:hover .line-content{background:var(--diff-removed-bg-hover)}.diff-line--context .line-content{background:var(--diff-context-bg)}.diff-line--collapsed{display:flex;justify-content:center;background:var(--diff-collapsed-bg);border-top:1px solid var(--diff-border-color);border-bottom:1px solid var(--diff-border-color)}.diff-line--focused{outline:0.125rem solid rgb(var(--color-blue-default));outline-offset:-0.125rem;z-index:1}.line-number{display:inline-flex;align-items:center;justify-content:flex-end;min-width:calc(1ch + 2 * var(--limel-code-diff-line-number-padding));width:var(--limel-line-number-min-width);padding:0 var(--limel-code-diff-line-number-padding);background:var(--diff-gutter-bg);color:var(--diff-gutter-text-color);user-select:none;text-align:right;flex-shrink:0}.line-number--old{border-right:1px solid var(--diff-border-color)}.line-indicator{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;flex-shrink:0;user-select:none;font-weight:600;background:var(--diff-gutter-bg)}.line-content{flex:1;padding:0 0.75rem;white-space:pre;overflow-x:visible;min-width:0;transition:background-color 0.6s ease}mark{background:transparent;color:inherit;border-radius:0.125rem}mark.segment--added{background:var(--diff-added-highlight-bg)}mark.segment--removed{background:var(--diff-removed-highlight-bg)}.syntax--string{color:var(--syntax-string-color)}.syntax--number{color:var(--syntax-number-color)}.syntax--boolean{color:var(--syntax-boolean-color)}.syntax--null{color:var(--syntax-null-color);font-style:italic}.syntax--key{color:var(--syntax-key-color)}.syntax--punctuation{color:var(--syntax-punctuation-color)}.expand-button{all:unset;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}.expand-button:hover,.expand-button:focus,.expand-button:focus-visible{will-change:color, background-color, box-shadow, transform}.expand-button:hover,.expand-button:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.expand-button:hover{box-shadow:var(--button-shadow-hovered)}.expand-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.expand-button:hover,.expand-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.expand-button:focus{outline:none}.expand-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.expand-button{padding:0 0.75rem;border-radius:0.25rem;margin:0.125rem;width:calc(100% - 0.25rem);text-align:center}.diff-empty{padding:2rem;text-align:center;color:var(--diff-empty-text-color);font-style:italic}.diff-line--split{display:flex;align-items:stretch;min-height:1.25rem;line-height:1.25rem}.diff-line--split:hover .split-content--removed{background:var(--diff-removed-bg-hover)}.diff-line--split:hover .split-content--added{background:var(--diff-added-bg-hover)}.diff-line--split:hover .split-content--context{background:var(--diff-line-hover-bg)}.split-content{flex:1;padding:0 0.75rem;white-space:pre;overflow-x:visible;min-width:0}.split-content--left{border-right:1px solid var(--diff-split-divider-color)}.split-content--removed{background:var(--diff-removed-bg)}.split-content--added{background:var(--diff-added-bg)}.split-content--context{background:var(--diff-context-bg)}.split-content--empty{background:var(--diff-empty-cell-bg)}.split-content--left{overflow-x:hidden;text-overflow:ellipsis}.change-group:has(.diff-line--split)>.change-group__copy{right:calc(50% - var(--limel-line-number-min-width))}:host(limel-code-diff[line-wrapping]) .diff-body{overflow-x:hidden}:host(limel-code-diff[line-wrapping]) .line-content,:host(limel-code-diff[line-wrapping]) .split-content{white-space:pre-wrap;overflow-wrap:break-word;word-break:break-all}:host(limel-code-diff[line-wrapping]) .diff-line--split .split-content{flex:1 1 0%;max-width:calc(50% - var(--limel-line-number-min-width))}';export{M as limel_code_diff}
@@ -59,15 +59,13 @@ export declare class Switch {
59
59
  private host;
60
60
  private helperTextId;
61
61
  private fieldId;
62
- private mdcSwitch;
63
- connectedCallback(): void;
64
62
  componentWillLoad(): void;
65
- componentDidLoad(): void;
66
- private initialize;
67
63
  disconnectedCallback(): void;
68
- render(): any[];
69
- protected valueWatcher(newValue: boolean): void;
64
+ render(): any;
65
+ private renderReadonly;
66
+ private renderInteractive;
70
67
  private renderHelperLine;
68
+ private get ariaDescribedBy();
71
69
  private hasHelperText;
72
70
  private handleClick;
73
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "39.9.0",
3
+ "version": "39.9.1",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -69,7 +69,7 @@
69
69
  "jsonlint-mod": "^1.7.6",
70
70
  "jsx-dom": "^8.1.6",
71
71
  "kompendium": "^1.1.0",
72
- "lodash-es": "^4.17.21",
72
+ "lodash-es": "^4.17.23",
73
73
  "material-components-web": "^13.0.0",
74
74
  "moment": "^2.30.1",
75
75
  "number-abbreviate": "^2.0.0",
@@ -125,7 +125,7 @@
125
125
  "homepage": "https://github.com/Lundalogik/lime-elements#readme",
126
126
  "packageManager": "npm@>=10.9",
127
127
  "dependencies": {
128
- "diff": "^7.0.0",
128
+ "diff": "^8.0.3",
129
129
  "sortablejs": "^1.15.6"
130
130
  }
131
131
  }
@@ -1,68 +0,0 @@
1
- import{r as c,c as e,h as t,a as i}from"./p-DBTJNfo7.js";import{c as s}from"./p-JbKhhoXs.js";import{m as d,r}from"./p-BgTwPGeH.js";import{a,b as o,_ as l,f as h,g as n,M as m,c as w}from"./p-D-I_3IxW.js";import{M as p,b as f}from"./p-D7ojrUFG.js";
2
- /**
3
- * @license
4
- * Copyright 2021 Google Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in
14
- * all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- * THE SOFTWARE.
23
- */var u,b;!function(c){c.PROCESSING="mdc-switch--processing",c.SELECTED="mdc-switch--selected",c.UNSELECTED="mdc-switch--unselected"}(u||(u={})),function(c){c.RIPPLE=".mdc-switch__ripple"}(b||(b={}));var v=new WeakMap,_=function(c){function e(){return null!==c&&c.apply(this,arguments)||this}return l(e,c),e.prototype.init=function(){c.prototype.init.call(this),this.observe(this.adapter.state,{disabled:this.onDisabledChange,processing:this.onProcessingChange,selected:this.onSelectedChange})},e.prototype.initFromDOM=function(){this.setObserversEnabled(this.adapter.state,!1),this.adapter.state.selected=this.adapter.hasClass(u.SELECTED),this.onSelectedChange(),this.adapter.state.disabled=this.adapter.isDisabled(),this.adapter.state.processing=this.adapter.hasClass(u.PROCESSING),this.setObserversEnabled(this.adapter.state,!0),this.stopProcessingIfDisabled()},e.prototype.onDisabledChange=function(){this.adapter.setDisabled(this.adapter.state.disabled)},e.prototype.onProcessingChange=function(){this.toggleClass(this.adapter.state.processing,u.PROCESSING)},e.prototype.onSelectedChange=function(){this.adapter.setAriaChecked(String(this.adapter.state.selected)),this.toggleClass(this.adapter.state.selected,u.SELECTED),this.toggleClass(!this.adapter.state.selected,u.UNSELECTED)},e.prototype.toggleClass=function(c,e){c?this.adapter.addClass(e):this.adapter.removeClass(e)},e}(function(c){function e(e){var t=c.call(this,e)||this;return t.handleClick=t.handleClick.bind(t),t}return l(e,c),e.prototype.init=function(){this.observe(this.adapter.state,{disabled:this.stopProcessingIfDisabled,processing:this.stopProcessingIfDisabled})},e.prototype.handleClick=function(){this.adapter.state.disabled||(this.adapter.state.selected=!this.adapter.state.selected)},e.prototype.stopProcessingIfDisabled=function(){this.adapter.state.disabled&&(this.adapter.state.processing=!1)},e}(function(c){function e(e){var t=c.call(this,e)||this;return t.unobserves=new Set,t}return l(e,c),e.prototype.destroy=function(){c.prototype.destroy.call(this),this.unobserve()},e.prototype.observe=function(c,e){var t,i,s=this,d=[];try{for(var r=o(Object.keys(e)),a=r.next();!a.done;a=r.next()){var l=a.value,h=e[l].bind(this);d.push(this.observeProperty(c,l,h))}}catch(c){t={error:c}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}var n=function(){var c,e;try{for(var t=o(d),i=t.next();!i.done;i=t.next())(0,i.value)()}catch(e){c={error:e}}finally{try{i&&!i.done&&(e=t.return)&&e.call(t)}finally{if(c)throw c.error}}s.unobserves.delete(n)};return this.unobserves.add(n),n},e.prototype.observeProperty=function(c,e,t){
24
- /**
25
- * @license
26
- * Copyright 2021 Google Inc.
27
- *
28
- * Permission is hereby granted, free of charge, to any person obtaining a copy
29
- * of this software and associated documentation files (the "Software"), to deal
30
- * in the Software without restriction, including without limitation the rights
31
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32
- * copies of the Software, and to permit persons to whom the Software is
33
- * furnished to do so, subject to the following conditions:
34
- *
35
- * The above copyright notice and this permission notice shall be included in
36
- * all copies or substantial portions of the Software.
37
- *
38
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
44
- * THE SOFTWARE.
45
- */
46
- return function(c,e,t){var i=function(c,e){var t=new Map;v.has(c)||v.set(c,{isEnabled:!0,getObservers:function(c){var e=t.get(c)||[];return t.has(c)||t.set(c,e),e},installedProperties:new Set});var i=v.get(c);if(i.installedProperties.has(e))return i;var s=function(c,e){for(var t,i=c;i&&!(t=Object.getOwnPropertyDescriptor(i,e));)i=Object.getPrototypeOf(i);return t}(c,e)||{configurable:!0,enumerable:!0,value:c[e],writable:!0},d=a({},s),r=s.get,l=s.set;if("value"in s){delete d.value,delete d.writable;var h=s.value;r=function(){return h},s.writable&&(l=function(c){h=c})}return r&&(d.get=function(){return r.call(this)}),l&&(d.set=function(c){var t,s,d=r?r.call(this):c;if(l.call(this,c),i.isEnabled&&(!r||c!==d))try{for(var a=o(i.getObservers(e)),h=a.next();!h.done;h=a.next())(0,h.value)(c,d)}catch(c){t={error:c}}finally{try{h&&!h.done&&(s=a.return)&&s.call(a)}finally{if(t)throw t.error}}}),i.installedProperties.add(e),Object.defineProperty(c,e,d),i}(c,e),s=i.getObservers(e);return s.push(t),function(){s.splice(s.indexOf(t),1)}}(c,e,t)},e.prototype.setObserversEnabled=function(c,e){!function(c,e){var t=v.get(c);t&&(t.isEnabled=e)}
47
- /**
48
- * @license
49
- * Copyright 2021 Google Inc.
50
- *
51
- * Permission is hereby granted, free of charge, to any person obtaining a copy
52
- * of this software and associated documentation files (the "Software"), to deal
53
- * in the Software without restriction, including without limitation the rights
54
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55
- * copies of the Software, and to permit persons to whom the Software is
56
- * furnished to do so, subject to the following conditions:
57
- *
58
- * The above copyright notice and this permission notice shall be included in
59
- * all copies or substantial portions of the Software.
60
- *
61
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
67
- * THE SOFTWARE.
68
- */(c,e)},e.prototype.unobserve=function(){var c,e;try{for(var t=o(h([],n(this.unobserves))),i=t.next();!i.done;i=t.next())(0,i.value)()}catch(e){c={error:e}}finally{try{i&&!i.done&&(e=t.return)&&e.call(t)}finally{if(c)throw c.error}}},e}(m))),g=function(c){function e(e,t){var i=c.call(this,e,t)||this;return i.root=e,i}return l(e,c),e.attachTo=function(c){return new e(c)},e.prototype.initialize=function(){this.ripple=new p(this.root,this.createRippleFoundation())},e.prototype.initialSyncWithDOM=function(){var c=this.root.querySelector(b.RIPPLE);if(!c)throw new Error("Switch "+b.RIPPLE+" element is required.");this.rippleElement=c,this.root.addEventListener("click",this.foundation.handleClick),this.foundation.initFromDOM()},e.prototype.destroy=function(){c.prototype.destroy.call(this),this.ripple.destroy(),this.root.removeEventListener("click",this.foundation.handleClick)},e.prototype.getDefaultFoundation=function(){return new _(this.createAdapter())},e.prototype.createAdapter=function(){var c=this;return{addClass:function(e){c.root.classList.add(e)},hasClass:function(e){return c.root.classList.contains(e)},isDisabled:function(){return c.root.disabled},removeClass:function(e){c.root.classList.remove(e)},setAriaChecked:function(e){return c.root.setAttribute("aria-checked",e)},setDisabled:function(e){c.root.disabled=e},state:this}},e.prototype.createRippleFoundation=function(){return new f(this.createRippleAdapter())},e.prototype.createRippleAdapter=function(){var c=this;return a(a({},p.createAdapter(this)),{computeBoundingRect:function(){return c.rippleElement.getBoundingClientRect()},isUnbounded:function(){return!0}})},e}(w);const k=class{constructor(i){c(this,i),this.change=e(this,"change"),this.disabled=!1,this.readonly=!1,this.value=!1,this.readonlyLabels=[],this.helperTextId=s(),this.fieldId=s(),this.renderHelperLine=()=>{if(this.hasHelperText())return t("limel-helper-line",{helperTextId:this.helperTextId,helperText:this.helperText,invalid:this.invalid})},this.hasHelperText=()=>null!=this.helperText,this.handleClick=c=>{c.stopPropagation(),this.change.emit(!this.value)}}connectedCallback(){this.initialize()}componentWillLoad(){d(this.host)}componentDidLoad(){this.initialize()}initialize(){const c=this.host.shadowRoot.querySelector(".mdc-switch");c&&(this.mdcSwitch=new g(c))}disconnectedCallback(){var c;r(this.host),null===(c=this.mdcSwitch)||void 0===c||c.destroy()}render(){if(this.readonly){let c="minus";return this.value&&(c={name:"ok",color:"var(--lime-primary-color, var(--limel-theme-primary-color))"}),[t("limel-dynamic-label",{value:this.value,"aria-controls":this.helperText?this.helperTextId:void 0,defaultLabel:{text:this.label,icon:c},labels:this.readonlyLabels}),this.renderHelperLine()]}return[t("button",{id:this.fieldId,class:{"mdc-switch":!0,"mdc-switch--unselected":!this.value,"mdc-switch--selected":this.value},type:"button",role:"switch","aria-checked":this.value,disabled:this.disabled,onClick:this.handleClick,"aria-controls":this.helperText?this.helperTextId:void 0},t("div",{class:"mdc-switch__track"}),t("div",{class:"mdc-switch__handle-track"},t("div",{class:"mdc-switch__handle"},t("div",{class:"mdc-switch__shadow"},t("div",{class:"mdc-elevation-overlay"})),t("div",{class:"mdc-switch__ripple"}),t("div",{class:"mdc-switch__icons"},t("svg",{class:"mdc-switch__icon mdc-switch__icon--on",viewBox:"0 0 24 24"},t("path",{d:"M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"})),t("svg",{class:"mdc-switch__icon mdc-switch__icon--off",viewBox:"0 0 24 24"},t("path",{d:"M20 13H4v-2h16v2z"})))))),t("label",{class:this.disabled?"disabled":"",htmlFor:this.fieldId},this.label),this.renderHelperLine()]}valueWatcher(c){this.mdcSwitch&&(this.mdcSwitch.selected=c)}get host(){return i(this)}static get watchers(){return{value:[{valueWatcher:0}]}}};k.style='@charset "UTF-8";:host(limel-switch:focus),:host(limel-switch:focus-visible),:host(limel-switch:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-switch){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-switch:focus) limel-helper-line,:host(limel-switch:focus-visible) limel-helper-line,:host(limel-switch:focus-within) limel-helper-line,:host(limel-switch:hover) limel-helper-line{will-change:grid-template-rows}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative}.mdc-switch:disabled{cursor:default;pointer-events:none}.mdc-switch__track{overflow:hidden;position:relative;width:100%}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid transparent;border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0)}.mdc-switch__track::after{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(-100%)}[dir=rtl] .mdc-switch__track::after,.mdc-switch__track[dir=rtl]::after{transform:translateX(100%);}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track[dir=rtl]::before{transform:translateX(-100%);}.mdc-switch--selected .mdc-switch__track::after{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0)}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto}[dir=rtl] .mdc-switch__handle-track,.mdc-switch__handle-track[dir=rtl]{left:auto;right:0;}.mdc-switch__handle-track{transform:translateX(0)}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track,.mdc-switch--selected .mdc-switch__handle-track[dir=rtl]{transform:translateX(-100%);}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto}[dir=rtl] .mdc-switch__handle,.mdc-switch__handle[dir=rtl]{left:auto;right:0;}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid transparent;border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1), border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-elevation-overlay{bottom:0;left:0;right:0;top:0}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1}.mdc-switch:disabled .mdc-switch__ripple{display:none}.mdc-switch__icons{height:100%;position:relative;width:100%;z-index:1}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-switch{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity}.mdc-switch .mdc-switch__ripple::before,.mdc-switch .mdc-switch__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-switch .mdc-switch__ripple::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-switch .mdc-switch__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-switch.mdc-ripple-upgraded .mdc-switch__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-switch.mdc-ripple-upgraded .mdc-switch__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-switch.mdc-ripple-upgraded--unbounded .mdc-switch__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-switch.mdc-ripple-upgraded--foreground-activation .mdc-switch__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-switch.mdc-ripple-upgraded--foreground-deactivation .mdc-switch__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-switch .mdc-switch__ripple::before,.mdc-switch .mdc-switch__ripple::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-switch.mdc-ripple-upgraded .mdc-switch__ripple::before,.mdc-switch.mdc-ripple-upgraded .mdc-switch__ripple::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-switch.mdc-ripple-upgraded .mdc-switch__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-switch.mdc-switch--selected:enabled .mdc-switch__handle::after{background:#6200ee;background:var(--mdc-switch-selected-handle-color, var(--mdc-theme-primary, #6200ee))}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:#310077;background:var(--mdc-switch-selected-hover-handle-color, #310077)}.mdc-switch.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:#310077;background:var(--mdc-switch-selected-focus-handle-color, #310077)}.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:#310077;background:var(--mdc-switch-selected-pressed-handle-color, #310077)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__handle::after{background:#424242;background:var(--mdc-switch-disabled-selected-handle-color, #424242)}.mdc-switch.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:#616161;background:var(--mdc-switch-unselected-handle-color, #616161)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:#212121;background:var(--mdc-switch-unselected-hover-handle-color, #212121)}.mdc-switch.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:#212121;background:var(--mdc-switch-unselected-focus-handle-color, #212121)}.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:#212121;background:var(--mdc-switch-unselected-pressed-handle-color, #212121)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__handle::after{background:#424242;background:var(--mdc-switch-disabled-unselected-handle-color, #424242)}.mdc-switch .mdc-switch__handle::before{background:#fff;background:var(--mdc-switch-handle-surface-color, var(--mdc-theme-surface, #fff))}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-switch-handle-elevation, var(--mdc-elevation-box-shadow-for-gss));--mdc-elevation-box-shadow-for-gss:0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12)}.mdc-switch:disabled .mdc-switch__shadow{box-shadow:0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-switch-disabled-handle-elevation, var(--mdc-elevation-box-shadow-for-gss));--mdc-elevation-box-shadow-for-gss:0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12)}.mdc-switch .mdc-switch__handle{height:20px;height:var(--mdc-switch-handle-height, 20px)}.mdc-switch:disabled .mdc-switch__handle::after{opacity:0.38;opacity:var(--mdc-switch-disabled-handle-opacity, 0.38)}.mdc-switch .mdc-switch__handle{border-radius:10px;border-radius:var(--mdc-switch-handle-shape, 10px)}.mdc-switch .mdc-switch__handle{width:20px;width:var(--mdc-switch-handle-width, 20px)}.mdc-switch .mdc-switch__handle-track{width:calc(100% - 20px);width:calc(100% - var(--mdc-switch-handle-width, 20px))}.mdc-switch.mdc-switch--selected:enabled .mdc-switch__icon{fill:#fff;fill:var(--mdc-switch-selected-icon-color, var(--mdc-theme-on-primary, #fff))}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icon{fill:#fff;fill:var(--mdc-switch-disabled-selected-icon-color, var(--mdc-theme-on-primary, #fff))}.mdc-switch.mdc-switch--unselected:enabled .mdc-switch__icon{fill:#fff;fill:var(--mdc-switch-unselected-icon-color, var(--mdc-theme-on-primary, #fff))}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icon{fill:#fff;fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mdc-theme-on-primary, #fff))}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icons{opacity:0.38;opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icons{opacity:0.38;opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch.mdc-switch--selected .mdc-switch__icon{width:18px;width:var(--mdc-switch-selected-icon-size, 18px);height:18px;height:var(--mdc-switch-selected-icon-size, 18px)}.mdc-switch.mdc-switch--unselected .mdc-switch__icon{width:18px;width:var(--mdc-switch-unselected-icon-size, 18px);height:18px;height:var(--mdc-switch-unselected-icon-size, 18px)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background-color:#6200ee;background-color:var(--mdc-switch-selected-hover-state-layer-color, var(--mdc-theme-primary, #6200ee))}.mdc-switch.mdc-switch--selected:enabled:focus .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background-color:#6200ee;background-color:var(--mdc-switch-selected-focus-state-layer-color, var(--mdc-theme-primary, #6200ee))}.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background-color:#6200ee;background-color:var(--mdc-switch-selected-pressed-state-layer-color, var(--mdc-theme-primary, #6200ee))}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background-color:#424242;background-color:var(--mdc-switch-unselected-hover-state-layer-color, #424242)}.mdc-switch.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background-color:#424242;background-color:var(--mdc-switch-unselected-focus-state-layer-color, #424242)}.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background-color:#424242;background-color:var(--mdc-switch-unselected-pressed-state-layer-color, #424242)}.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus):hover .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:hover:not(:focus).mdc-ripple-surface--hover .mdc-switch__ripple::before{opacity:0.04;opacity:var(--mdc-switch-selected-hover-state-layer-opacity, 0.04)}.mdc-switch.mdc-switch--selected:enabled:focus.mdc-ripple-upgraded--background-focused .mdc-switch__ripple::before,.mdc-switch.mdc-switch--selected:enabled:focus:not(.mdc-ripple-upgraded):focus .mdc-switch__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-switch-selected-focus-state-layer-opacity, 0.12)}.mdc-switch.mdc-switch--selected:enabled:active:not(.mdc-ripple-upgraded) .mdc-switch__ripple::after{transition:opacity 150ms linear}.mdc-switch.mdc-switch--selected:enabled:active:not(.mdc-ripple-upgraded):active .mdc-switch__ripple::after{transition-duration:75ms;opacity:0.1;opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, 0.1)}.mdc-switch.mdc-switch--selected:enabled:active.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, 0.1)}.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus):hover .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:hover:not(:focus).mdc-ripple-surface--hover .mdc-switch__ripple::before{opacity:0.04;opacity:var(--mdc-switch-unselected-hover-state-layer-opacity, 0.04)}.mdc-switch.mdc-switch--unselected:enabled:focus.mdc-ripple-upgraded--background-focused .mdc-switch__ripple::before,.mdc-switch.mdc-switch--unselected:enabled:focus:not(.mdc-ripple-upgraded):focus .mdc-switch__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-switch-unselected-focus-state-layer-opacity, 0.12)}.mdc-switch.mdc-switch--unselected:enabled:active:not(.mdc-ripple-upgraded) .mdc-switch__ripple::after{transition:opacity 150ms linear}.mdc-switch.mdc-switch--unselected:enabled:active:not(.mdc-ripple-upgraded):active .mdc-switch__ripple::after{transition-duration:75ms;opacity:0.1;opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, 0.1)}.mdc-switch.mdc-switch--unselected:enabled:active.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, 0.1)}.mdc-switch .mdc-switch__ripple{height:48px;height:var(--mdc-switch-state-layer-size, 48px);width:48px;width:var(--mdc-switch-state-layer-size, 48px)}.mdc-switch .mdc-switch__track{height:14px;height:var(--mdc-switch-track-height, 14px)}.mdc-switch:disabled .mdc-switch__track{opacity:0.12;opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch:enabled .mdc-switch__track::after{background:#d7bbff;background:var(--mdc-switch-selected-track-color, #d7bbff)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:#d7bbff;background:var(--mdc-switch-selected-hover-track-color, #d7bbff)}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:#d7bbff;background:var(--mdc-switch-selected-focus-track-color, #d7bbff)}.mdc-switch:enabled:active .mdc-switch__track::after{background:#d7bbff;background:var(--mdc-switch-selected-pressed-track-color, #d7bbff)}.mdc-switch:disabled .mdc-switch__track::after{background:#424242;background:var(--mdc-switch-disabled-selected-track-color, #424242)}.mdc-switch:enabled .mdc-switch__track::before{background:#e0e0e0;background:var(--mdc-switch-unselected-track-color, #e0e0e0)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:#e0e0e0;background:var(--mdc-switch-unselected-hover-track-color, #e0e0e0)}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:#e0e0e0;background:var(--mdc-switch-unselected-focus-track-color, #e0e0e0)}.mdc-switch:enabled:active .mdc-switch__track::before{background:#e0e0e0;background:var(--mdc-switch-unselected-pressed-track-color, #e0e0e0)}.mdc-switch:disabled .mdc-switch__track::before{background:#424242;background:var(--mdc-switch-disabled-unselected-track-color, #424242)}.mdc-switch .mdc-switch__track{border-radius:7px;border-radius:var(--mdc-switch-track-shape, 7px)}.mdc-switch{width:36px;width:var(--mdc-switch-track-width, 36px)}@media screen and (forced-colors: active), (-ms-high-contrast: active){.mdc-switch:enabled .mdc-switch__shadow{}.mdc-switch:disabled .mdc-switch__shadow{}.mdc-switch:disabled .mdc-switch__handle::after{opacity:1;opacity:var(--mdc-switch-disabled-handle-opacity, 1)}.mdc-switch.mdc-switch--selected:enabled .mdc-switch__icon{fill:ButtonText;fill:var(--mdc-switch-selected-icon-color, ButtonText)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icon{fill:GrayText;fill:var(--mdc-switch-disabled-selected-icon-color, GrayText)}.mdc-switch.mdc-switch--unselected:enabled .mdc-switch__icon{fill:ButtonText;fill:var(--mdc-switch-unselected-icon-color, ButtonText)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icon{fill:GrayText;fill:var(--mdc-switch-disabled-unselected-icon-color, GrayText)}.mdc-switch.mdc-switch--selected:disabled .mdc-switch__icons{opacity:1;opacity:var(--mdc-switch-disabled-selected-icon-opacity, 1)}.mdc-switch.mdc-switch--unselected:disabled .mdc-switch__icons{opacity:1;opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 1)}.mdc-switch:disabled .mdc-switch__track{opacity:1;opacity:var(--mdc-switch-disabled-track-opacity, 1)}}:host(limel-switch){isolation:isolate;min-height:1.75rem;display:flex;align-items:flex-start;gap:0.5rem;--mdc-switch-selected-icon-color:transparent;--mdc-switch-unselected-icon-color:transparent;--mdc-switch-disabled-selected-icon-opacity:1;--mdc-switch-disabled-unselected-icon-opacity:1;--mdc-switch-selected-icon-size:0.75rem;--mdc-switch-unselected-icon-size:0.75rem;--mdc-switch-track-height:1.25rem;--mdc-switch-track-shape:var(--mdc-switch-track-height);--mdc-switch-unselected-focus-handle-color:var( --lime-elevated-surface-background-color );--mdc-switch-selected-focus-handle-color:var( --lime-elevated-surface-background-color );--mdc-switch-unselected-pressed-handle-color:var( --lime-elevated-surface-background-color );--mdc-switch-selected-pressed-handle-color:var( --lime-elevated-surface-background-color );--mdc-switch-unselected-handle-color:var( --lime-elevated-surface-background-color );--mdc-switch-unselected-hover-handle-color:var( --lime-elevated-surface-background-color );--mdc-switch-selected-handle-color:var( --lime-elevated-surface-background-color );--mdc-switch-selected-hover-handle-color:var( --lime-elevated-surface-background-color );--mdc-switch-unselected-track-color:rgb(var(--contrast-700));--mdc-switch-unselected-focus-track-color:rgb(var(--contrast-800));--mdc-switch-unselected-pressed-track-color:rgb(var(--contrast-800));--mdc-switch-unselected-hover-track-color:rgb(var(--contrast-800));--mdc-switch-selected-focus-track-color:var( --lime-primary-color, var(--limel-theme-primary-color) );--mdc-switch-selected-pressed-track-color:var( --lime-primary-color, var(--limel-theme-primary-color) );--mdc-switch-selected-track-color:var( --lime-primary-color, var(--limel-theme-primary-color) );--mdc-switch-selected-hover-track-color:var( --lime-primary-color, var(--limel-theme-primary-color) );--mdc-switch-handle-elevation:var(--button-shadow-normal);--mdc-switch-disabled-track-opacity:0.4;--mdc-switch-disabled-selected-handle-color:rgb(var(--contrast-1000));--mdc-switch-disabled-unselected-handle-color:rgb(var(--contrast-1000))}.mdc-switch{margin-top:0.25rem}.mdc-switch:hover{--mdc-switch-handle-elevation:var(--button-shadow-hovered)}label{padding-top:0.25rem;font-size:var(--limel-theme-default-font-size)}label:not(.disabled){cursor:pointer}label{font-family:inherit}.mdc-switch.mdc-switch--selected .mdc-switch__handle:after,.mdc-switch.mdc-switch--selected .mdc-switch__handle:before,.mdc-switch.mdc-switch.mdc-switch--unselected .mdc-switch__handle:after,.mdc-switch.mdc-switch.mdc-switch--unselected .mdc-switch__handle:before{transform:scale(0.8)}.mdc-switch .mdc-switch__shadow{transform:scale(0.8)}';export{k as limel_switch}
@@ -1 +0,0 @@
1
- import{r as e,h as t,H as r,a as n}from"./p-DBTJNfo7.js";import{t as o}from"./p-DVRaJQvC.js";function i(){}function a(e,t,r,n,o){for(var i,a=[];t;)a.push(t),i=t.previousComponent,delete t.previousComponent,t=i;a.reverse();for(var s=0,d=a.length,l=0,c=0;s<d;s++){var f=a[s];if(f.removed)f.value=e.join(n.slice(c,c+f.count)),c+=f.count;else{if(!f.added&&o){var u=r.slice(l,l+f.count);u=u.map((function(e,t){var r=n[c+t];return r.length>e.length?r:e})),f.value=e.join(u)}else f.value=e.join(r.slice(l,l+f.count));l+=f.count,f.added||(c+=f.count)}}return a}function s(e,t){var r;for(r=0;r<e.length&&r<t.length;r++)if(e[r]!=t[r])return e.slice(0,r);return e.slice(0,r)}function d(e,t){var r;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(r=0;r<e.length&&r<t.length;r++)if(e[e.length-(r+1)]!=t[t.length-(r+1)])return e.slice(-r);return e.slice(-r)}function l(e,t,r){if(e.slice(0,t.length)!=t)throw Error("string ".concat(JSON.stringify(e)," doesn't start with prefix ").concat(JSON.stringify(t),"; this is a bug"));return r+e.slice(t.length)}function c(e,t,r){if(!t)return e+r;if(e.slice(-t.length)!=t)throw Error("string ".concat(JSON.stringify(e)," doesn't end with suffix ").concat(JSON.stringify(t),"; this is a bug"));return e.slice(0,-t.length)+r}function f(e,t){return l(e,t,"")}function u(e,t){return c(e,t,"")}function h(e,t){return t.slice(0,function(e,t){var r=0;e.length>t.length&&(r=e.length-t.length);var n=t.length;e.length<t.length&&(n=e.length);var o=Array(n),i=0;o[0]=0;for(var a=1;a<n;a++){for(o[a]=t[a]==t[i]?o[i]:i;i>0&&t[a]!=t[i];)i=o[i];t[a]==t[i]&&i++}i=0;for(var s=r;s<e.length;s++){for(;i>0&&e[s]!=t[i];)i=o[i];e[s]==t[i]&&i++}return i}(e,t))}i.prototype={diff:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.callback;"function"==typeof n&&(o=n,n={});var i=this;function s(e){return e=i.postProcess(e,n),o?(setTimeout((function(){o(e)}),0),!0):e}e=this.castInput(e,n),t=this.castInput(t,n),e=this.removeEmpty(this.tokenize(e,n));var d=(t=this.removeEmpty(this.tokenize(t,n))).length,l=e.length,c=1,f=d+l;null!=n.maxEditLength&&(f=Math.min(f,n.maxEditLength));var u=null!==(r=n.timeout)&&void 0!==r?r:1/0,h=Date.now()+u,v=[{oldPos:-1,lastComponent:void 0}],b=this.extractCommon(v[0],t,e,0,n);if(v[0].oldPos+1>=l&&b+1>=d)return s(a(i,v[0].lastComponent,t,e,i.useLongestToken));var m=-1/0,p=1/0;function g(){for(var r=Math.max(m,-c);r<=Math.min(p,c);r+=2){var o=void 0,f=v[r-1],u=v[r+1];f&&(v[r-1]=void 0);var h=!1;if(u){var g=u.oldPos-r;h=u&&0<=g&&g<d}var y=f&&f.oldPos+1<l;if(h||y){if(o=!y||h&&f.oldPos<u.oldPos?i.addToPath(u,!0,!1,0,n):i.addToPath(f,!1,!0,1,n),b=i.extractCommon(o,t,e,r,n),o.oldPos+1>=l&&b+1>=d)return s(a(i,o.lastComponent,t,e,i.useLongestToken));v[r]=o,o.oldPos+1>=l&&(p=Math.min(p,r-1)),b+1>=d&&(m=Math.max(m,r+1))}else v[r]=void 0}c++}if(o)!function e(){setTimeout((function(){if(c>f||Date.now()>h)return o();g()||e()}),0)}();else for(;c<=f&&Date.now()<=h;){var y=g();if(y)return y}},addToPath:function(e,t,r,n,o){var i=e.lastComponent;return i&&!o.oneChangePerToken&&i.added===t&&i.removed===r?{oldPos:e.oldPos+n,lastComponent:{count:i.count+1,added:t,removed:r,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:t,removed:r,previousComponent:i}}},extractCommon:function(e,t,r,n,o){for(var i=t.length,a=r.length,s=e.oldPos,d=s-n,l=0;d+1<i&&s+1<a&&this.equals(r[s+1],t[d+1],o);)d++,s++,l++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!o.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,d},equals:function(e,t,r){return r.comparator?r.comparator(e,t):e===t||r.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],r=0;r<e.length;r++)e[r]&&t.push(e[r]);return t},castInput:function(e){return e},tokenize:function(e){return Array.from(e)},join:function(e){return e.join("")},postProcess:function(e){return e}};var v="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",b=new RegExp("[".concat(v,"]+|\\s+|[^").concat(v,"]"),"ug"),m=new i;function p(e,t,r,n){if(t&&r){var o=t.value.match(/^\s*/)[0],i=t.value.match(/\s*$/)[0],a=r.value.match(/^\s*/)[0],v=r.value.match(/\s*$/)[0];if(e){var b=s(o,a);e.value=c(e.value,a,b),t.value=f(t.value,b),r.value=f(r.value,b)}if(n){var m=d(i,v);n.value=l(n.value,v,m),t.value=u(t.value,m),r.value=u(r.value,m)}}else if(r)e&&(r.value=r.value.replace(/^\s*/,"")),n&&(n.value=n.value.replace(/^\s*/,""));else if(e&&n){var p=n.value.match(/^\s*/)[0],g=t.value.match(/^\s*/)[0],y=t.value.match(/\s*$/)[0],x=s(p,g);t.value=f(t.value,x);var w=d(f(p,x),y);t.value=u(t.value,w),n.value=l(n.value,p,w),e.value=c(e.value,p,p.slice(0,p.length-w.length))}else if(n){var k=n.value.match(/^\s*/)[0],S=h(t.value.match(/\s*$/)[0],k);t.value=u(t.value,S)}else if(e){var _=h(e.value.match(/\s*$/)[0],t.value.match(/^\s*/)[0]);t.value=f(t.value,_)}}m.equals=function(e,t,r){return r.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()},m.tokenize=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.intlSegmenter){if("word"!=r.intlSegmenter.resolvedOptions().granularity)throw new Error('The segmenter passed must have a granularity of "word"');t=Array.from(r.intlSegmenter.segment(e),(function(e){return e.segment}))}else t=e.match(b)||[];var n=[],o=null;return t.forEach((function(e){/\s/.test(e)?n.push(null==o?e:n.pop()+e):/\s/.test(o)?n.push(n[n.length-1]==o?n.pop()+e:o+e):n.push(e),o=e})),n},m.join=function(e){return e.map((function(e,t){return 0==t?e:e.replace(/^\s+/,"")})).join("")},m.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var r=null,n=null,o=null;return e.forEach((function(e){e.added?n=e:e.removed?o=e:((n||o)&&p(r,o,n,e),r=e,n=null,o=null)})),(n||o)&&p(r,o,n,null),e},(new i).tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat(v,"]+|[^\\S\\n\\r]+|[^").concat(v,"]"),"ug");return e.match(t)||[]};var g=new i;function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}g.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));var r=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var o=0;o<n.length;o++){var i=n[o];o%2&&!t.newlineIsToken?r[r.length-1]+=i:r.push(i)}return r},g.equals=function(e,t,r){return r.ignoreWhitespace?(r.newlineIsToken&&e.includes("\n")||(e=e.trim()),r.newlineIsToken&&t.includes("\n")||(t=t.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),i.prototype.equals.call(this,e,t,r)},(new i).tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)},(new i).tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};var x=new i;function w(e,t,r,n,o){var i,a;for(t=t||[],r=r||[],n&&(e=n(o,e)),i=0;i<t.length;i+=1)if(t[i]===e)return r[i];if("[object Array]"===Object.prototype.toString.call(e)){for(t.push(e),a=new Array(e.length),r.push(a),i=0;i<e.length;i+=1)a[i]=w(e[i],t,r,n,o);return t.pop(),r.pop(),a}if(e&&e.toJSON&&(e=e.toJSON()),"object"===y(e)&&null!==e){t.push(e),r.push(a={});var s,d=[];for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&d.push(s);for(d.sort(),i=0;i<d.length;i+=1)a[s=d[i]]=w(e[s],t,r,n,s);t.pop(),r.pop()}else a=e;return a}x.useLongestToken=!0,x.tokenize=g.tokenize,x.castInput=function(e,t){var r=t.undefinedReplacement,n=t.stringifyReplacer,o=void 0===n?function(e,t){return void 0===t?r:t}:n;return"string"==typeof e?e:JSON.stringify(w(e,null,null,o),o," ")},x.equals=function(e,t,r){return i.prototype.equals.call(x,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),r)};var k=new i;function S(e,t,r){const n=[];for(;t<e.length&&"removed"===e[t].type;)n.push(e[t]),t++;const o=[];for(;t<e.length&&"added"===e[t].type;)o.push(e[t]),t++;const i=Math.max(n.length,o.length);for(let e=0;e<i;e++)r.push({left:e<n.length?n[e]:void 0,right:e<o.length?o[e]:void 0});return t}function _(e,t=!1){if("object"==typeof e&&null!==e)return JSON.stringify(C(e),null,4);if("string"==typeof e&&t)try{const t=JSON.parse(e);return JSON.stringify(C(t),null,4)}catch(t){return e}return String(null!=e?e:"")}function C(e){if(Array.isArray(e))return e.map(C);if(null!==e&&"object"==typeof e){const t={},r=Object.keys(e).sort(((e,t)=>e.localeCompare(t)));for(const n of r)t[n]=C(e[n]);return t}return e}function j(e){if(!e)return[];const t=e.split("\n");return t.length>0&&""===t.at(-1)&&t.pop(),t}function O(e,t){const r=m.diff(e,t,undefined);const n=[],o=[];for(const e of r)e.added?o.push({value:e.value,type:"added"}):e.removed?n.push({value:e.value,type:"removed"}):(n.push({value:e.value,type:"equal"}),o.push({value:e.value,type:"equal"}));return[n,o]}k.tokenize=function(e){return e.slice()},k.join=k.removeEmpty=function(e){return e};const D=[[/"(?:[^"\\]|\\.)*"/,"string"],[/-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/,"number"],[/\b(?:true|false)\b/,"boolean"],[/\bnull\b/,"null"],[/[{}[\]:,]/,"punctuation"]],M=new RegExp(D.map((([e])=>`(${e.source})`)).join("|"),"g");function $(e){for(const[t,[,r]]of D.entries())if(void 0!==e[t+1])return r;return"plain"}const A=class{constructor(t){e(this,t),this.oldValue="",this.newValue="",this.layout="unified",this.contextLines=3,this.lineWrapping=!0,this.reformatJson=!1,this.translationLanguage="en",this.diffResult={hunks:[],additions:0,deletions:0,allLines:[]},this.liveAnnouncement="",this.copyState="idle",this.searchVisible=!1,this.searchTerm="",this.currentMatchIndex=0,this.focusedRowIndex=-1,this.normalizedOldText="",this.searchMatchCounter=0,this.totalSearchMatches=0,this.isRenderingRemovedLine=!1,this.activeSearchRegex=null,this.prevSearchVisible=!1}componentWillLoad(){this.recomputeDiff()}componentDidRender(){var e,t;if(this.searchVisible&&!this.prevSearchVisible&&(null===(e=this.searchInputEl)||void 0===e||e.focus()),this.prevSearchVisible=this.searchVisible,this.searchTerm&&this.totalSearchMatches>0){const e=null===(t=this.host.shadowRoot)||void 0===t?void 0:t.querySelector(".search-match--current");null==e||e.scrollIntoView({block:"center",behavior:"smooth"})}}render(){var e;this.searchMatchCounter=0,this.activeSearchRegex=(e=this.searchTerm)?new RegExp(`(${function(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}(e)})`,"gi"):null;const n=this.renderDiff();this.totalSearchMatches=this.searchMatchCounter;const o=this.computeLineNumberWidth();return t(r,{key:"8122ede0d323b9021dae44cd5f65703d03083617",style:{"--limel-line-number-min-width":o}},this.renderHeader(),this.renderScreenReaderSummary(),this.searchVisible&&this.renderSearchBar(),t("div",{key:"fefe6e4898cbc82b6eb87f7dff7af71a14c7c91e",class:"diff-body",role:"table","aria-label":this.getTranslation("code-diff.table-label"),tabindex:"0",onKeyDown:e=>this.handleKeyDown(e)},n),t("div",{key:"2af1c7b29f2060a58af13d67fb174cb4de085efb",class:"screen-reader-only",role:"status","aria-live":"polite","aria-atomic":"true"},this.liveAnnouncement))}watchInputs(){this.recomputeDiff()}recomputeDiff(){const e=_(this.oldValue,this.reformatJson),t=_(this.newValue,this.reformatJson);this.normalizedOldText=e,this.diffResult=function(e,t,r=3){const n=function(e,t){const r=g.diff(e,t,void 0),n=[];let o=1,i=1;for(const e of r){const t=j(e.value);for(const r of t)n.push(e.added?{type:"added",content:r,newLineNumber:i++}:e.removed?{type:"removed",content:r,oldLineNumber:o++}:{type:"context",content:r,oldLineNumber:o++,newLineNumber:i++})}return function(e){let t=0;for(;t<e.length;){const r=t;for(;t<e.length&&"removed"===e[t].type;)t++;const n=t,o=t;for(;t<e.length&&"added"===e[t].type;)t++;const i=n-r,a=t-o;if(i>0&&a>0){const t=Math.min(i,a);for(let n=0;n<t;n++){const t=e[r+n],i=e[o+n],[a,s]=O(t.content,i.content);t.segments=a,i.segments=s}}t===r&&t++}}(n),n}(e,t);return function(e,t){if(0===e.length)return{hunks:[],additions:0,deletions:0,allLines:e};let r=0,n=0;for(const t of e)"added"===t.type?r++:"removed"===t.type&&n++;if(0===r&&0===n)return{hunks:[],additions:0,deletions:0,allLines:e};const o=[];for(const[t,r]of e.entries())"context"!==r.type&&o.push(t);const i=function(e,t,r){if(0===e.length)return[];const n=[];let o=Math.max(0,e[0]-r),i=Math.min(t,e[0]+r+1);for(let a=1;a<e.length;a++){const s=Math.max(0,e[a]-r),d=Math.min(t,e[a]+r+1);s<=i?i=Math.max(i,d):(n.push({start:o,end:i}),o=s,i=d)}return n.push({start:o,end:i}),n}(o,e.length,t),a=[];let s=0;for(const t of i){const r=e.slice(t.start,t.end),n=t.start-s;a.push({lines:r,collapsedBefore:n>0?n:void 0,startIndex:t.start}),s=t.end}const d=i.at(-1);return{hunks:a,additions:r,deletions:n,collapsedAfter:d.end<e.length?e.length-d.end:void 0,allLines:e}}(n,r)}(e,t,this.contextLines),this.focusedRowIndex=-1}formatSrSummary(){const{additions:e,deletions:t}=this.diffResult;if(0===e&&0===t)return null;const r=[];return e>0&&r.push(this.getTranslation(1===e?"code-diff.diff-addition":"code-diff.diff-additions",{count:e})),t>0&&r.push(this.getTranslation(1===t?"code-diff.diff-deletion":"code-diff.diff-deletions",{count:t})),this.getTranslation("code-diff.diff-summary",{parts:r.join(", ")})}renderScreenReaderSummary(){const e=this.formatSrSummary();return t("div",{class:"screen-reader-only",role:"status","aria-live":"polite"},null!=e?e:this.getTranslation("code-diff.no-differences-found"))}handleKeyDown(e){if("ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;e.preventDefault();const t=this.getDiffRows();0!==t.length&&(this.focusedRowIndex="ArrowDown"===e.key?Math.min(this.focusedRowIndex+1,t.length-1):Math.max(this.focusedRowIndex-1,0),this.updateRowFocus(t))}getDiffRows(){var e;const t=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector(".diff-body");return t?[...t.querySelectorAll(".diff-line:not(.diff-line--collapsed)")]:[]}updateRowFocus(e){for(const t of e)t.removeAttribute("tabindex"),t.classList.remove("diff-line--focused");const t=e[this.focusedRowIndex];t&&(t.setAttribute("tabindex","-1"),t.classList.add("diff-line--focused"),t.focus(),this.announceLine(t))}announceLine(e){var t,r;let n=this.getTranslation("code-diff.line-context");e.classList.contains("diff-line--added")?n=this.getTranslation("code-diff.line-added"):e.classList.contains("diff-line--removed")&&(n=this.getTranslation("code-diff.line-removed"));const o=null!==(r=null===(t=e.querySelector(".line-content, .split-content"))||void 0===t?void 0:t.textContent)&&void 0!==r?r:"",i=o.length>80?o.slice(0,80)+"…":o;this.liveAnnouncement=`${n}: ${i}`}renderHeader(){var e,r;const n=null!==(e=this.oldHeading)&&void 0!==e?e:this.getTranslation("code-diff.old-heading"),o=null!==(r=this.newHeading)&&void 0!==r?r:this.getTranslation("code-diff.new-heading"),{additions:i,deletions:a}=this.diffResult,s=i>0||a>0;return t("div",{class:"diff-header"},t("div",{class:"diff-header__labels"},t("span",{class:"diff-header__old"},n),t("span",{class:"diff-header__new"},o)),t("div",{class:"diff-header__actions"},t("div",{class:"diff-header__stats"},i>0&&t("span",{class:"stat stat--added"},"+",i),a>0&&t("span",{class:"stat stat--removed"},"-",a)),s&&this.renderCopyButton(),a>0&&this.renderSearchToggle()))}renderCopyButton(){const e=this.getTranslation("copied"===this.copyState?"code-diff.copied":"code-diff.copy-old-version");return t("limel-icon-button",{label:e,icon:"copied"===this.copyState?"checkmark":"copy",onClick:()=>this.copyToClipboard(this.normalizedOldText)})}async copyToClipboard(e){try{await navigator.clipboard.writeText(e),this.copyState="copied",this.liveAnnouncement=this.getTranslation("code-diff.copied-to-clipboard"),setTimeout((()=>{this.copyState="idle"}),2e3)}catch(e){}}renderSearchToggle(){return t("limel-icon-button",{class:{"search-toggle--active":this.searchVisible},label:this.getTranslation("code-diff.search"),icon:"search",onClick:()=>this.toggleSearch()})}renderSearchBar(){const e=0===this.totalSearchMatches?this.getTranslation("code-diff.no-matches"):this.getTranslation("code-diff.match-count",{current:this.currentMatchIndex+1,total:this.totalSearchMatches});return t("div",{class:"search-bar"},t("limel-input-field",{class:"search-bar__input",type:"search",placeholder:this.getTranslation("code-diff.search")+"…",value:this.searchTerm,onChange:e=>this.onSearchInput(e),onKeyDown:e=>this.onSearchKeyDown(e),ref:e=>this.searchInputEl=e}),t("span",{class:"search-bar__count"},e),t("limel-action-bar",{actions:this.getSearchActions(),onItemSelected:e=>this.onSearchAction(e)}))}toggleSearch(){this.searchVisible=!this.searchVisible,this.searchVisible||(this.searchTerm="",this.currentMatchIndex=0)}onSearchInput(e){this.searchTerm=e.detail,this.currentMatchIndex=0}onSearchKeyDown(e){"Enter"===e.key?(e.preventDefault(),this.navigateSearch(e.shiftKey?-1:1)):"Escape"===e.key&&this.toggleSearch()}computeLineNumberWidth(){return`calc(${String(this.diffResult.allLines.length).length}ch + 2 * var(--limel-code-diff-line-number-padding))`}getSearchActions(){const e=0===this.totalSearchMatches;return[{text:this.getTranslation("code-diff.previous-match"),icon:"-lime-caret-top",iconOnly:!0,disabled:e,value:"prev"},{text:this.getTranslation("code-diff.next-match"),icon:"-lime-caret-bottom",iconOnly:!0,disabled:e,value:"next"},{text:this.getTranslation("code-diff.close-search"),icon:"cancel",iconOnly:!0,value:"close"}]}onSearchAction(e){const{value:t}=e.detail;"prev"===t?this.navigateSearch(-1):"next"===t?this.navigateSearch(1):"close"===t&&this.toggleSearch()}navigateSearch(e){this.currentMatchIndex=function(e,t,r){return 0===r?0:(e+t+r)%r}(this.currentMatchIndex,e,this.totalSearchMatches)}renderDiff(){const{hunks:e,collapsedAfter:r}=this.diffResult;return 0===e.length?t("div",{class:"diff-empty"},this.getTranslation("code-diff.no-differences")):this.renderHunks(e,r,"split"===this.layout?e=>this.renderSplitHunkRows(e):e=>this.renderHunkLines(e))}renderHunks(e,t,r){const n=[];for(const[t,o]of e.entries())o.collapsedBefore&&n.push(this.renderCollapsedRow(o.collapsedBefore,t)),n.push(...r(o));return t&&n.push(this.renderCollapsedAfterRow(t)),n}renderHunkLines(e){const t=[];let r=0;for(;r<e.lines.length;){const n=e.lines[r];if("context"===n.type){t.push(this.renderLine(n)),r++;continue}const o=[];for(;r<e.lines.length&&"context"!==e.lines[r].type;)o.push(e.lines[r]),r++;t.push(this.renderChangeBlock(o))}return t}renderChangeBlock(e){const r=function(e){return e.filter((e=>"removed"===e.type)).map((e=>e.content)).join("\n")}(e);return t("div",{class:"change-group"},e.map((e=>this.renderLine(e))),r&&this.renderBlockCopyButton(r))}renderLine(e){var r,n;const o={added:"+",removed:"-",context:" "}[e.type];return t("div",{class:{"diff-line":!0,[`diff-line--${e.type}`]:!0},role:"row"},t("span",{class:"line-number line-number--old",role:"cell","aria-label":e.oldLineNumber?this.getTranslation("code-diff.old-line",{number:e.oldLineNumber}):void 0},null!==(r=e.oldLineNumber)&&void 0!==r?r:""),t("span",{class:"line-number line-number--new",role:"cell","aria-label":e.newLineNumber?this.getTranslation("code-diff.new-line",{number:e.newLineNumber}):void 0},null!==(n=e.newLineNumber)&&void 0!==n?n:""),t("span",{class:"line-indicator",role:"cell"},o),t("span",{class:"line-content",role:"cell"},this.renderContent(e)))}renderSplitHunkRows(e){var t,r,n,o;const i=function(e){const t=[];let r=0;for(;r<e.length;){const n=e[r];"context"!==n.type?r=S(e,r,t):(t.push({left:n,right:n}),r++)}return t}(e.lines),a=[];let s=0;for(;s<i.length;){const e=i[s];if("context"===(null===(t=e.left)||void 0===t?void 0:t.type)&&"context"===(null===(r=e.right)||void 0===r?void 0:r.type)){a.push(this.renderSplitRow(e)),s++;continue}const d=[];for(;s<i.length;){const e=i[s];if("context"===(null===(n=e.left)||void 0===n?void 0:n.type)&&"context"===(null===(o=e.right)||void 0===o?void 0:o.type))break;d.push(e),s++}a.push(this.renderSplitChangeBlock(d))}return a}renderSplitChangeBlock(e){const r=function(e){return e.filter((e=>{var t;return"removed"===(null===(t=e.left)||void 0===t?void 0:t.type)})).map((e=>e.left.content)).join("\n")}(e);return t("div",{class:"change-group"},e.map((e=>this.renderSplitRow(e))),r&&this.renderBlockCopyButton(r))}renderSplitRow(e){var r,n,o,i,a,s,d,l,c,f;const u=null!==(n=null===(r=e.left)||void 0===r?void 0:r.type)&&void 0!==n?n:"empty",h=null!==(i=null===(o=e.right)||void 0===o?void 0:o.type)&&void 0!==i?i:"empty",v=(null===(a=e.left)||void 0===a?void 0:a.oldLineNumber)?this.getTranslation("code-diff.old-line",{number:e.left.oldLineNumber}):void 0,b=(null===(s=e.right)||void 0===s?void 0:s.newLineNumber)?this.getTranslation("code-diff.new-line",{number:e.right.newLineNumber}):void 0;return t("div",{class:"diff-line diff-line--split",role:"row"},t("span",{class:"line-number line-number--old",role:"cell","aria-label":v},null!==(l=null===(d=e.left)||void 0===d?void 0:d.oldLineNumber)&&void 0!==l?l:""),t("span",{class:`split-content split-content--left split-content--${u}`,role:"cell"},e.left?this.renderContent(e.left):""),t("span",{class:"line-number line-number--new",role:"cell","aria-label":b},null!==(f=null===(c=e.right)||void 0===c?void 0:c.newLineNumber)&&void 0!==f?f:""),t("span",{class:`split-content split-content--right split-content--${h}`,role:"cell"},e.right?this.renderContent(e.right):""))}renderBlockCopyButton(e){return t("limel-icon-button",{class:"change-group__copy",elevated:!0,label:this.getTranslation("code-diff.copy-change"),icon:"copy",onClick:()=>this.copyToClipboard(e)})}renderContent(e){return this.isRenderingRemovedLine="removed"===e.type&&this.searchTerm.length>0,e.segments&&0!==e.segments.length?e.segments.map((t=>this.renderSegment(t,e.type))):this.renderSyntaxTokens(e.content)}renderSegment(e,r){const n=this.renderSyntaxTokens(e.value);return"equal"===e.type?n:t("mark",{class:"removed"===r?"segment--removed":"segment--added"},n)}renderSyntaxTokens(e){const t=function(e,t){return t&&0!==e.length&&"json"===t?function(e){const t=[];let r=0;M.lastIndex=0;let n=M.exec(e);for(;null!==n;){n.index>r&&t.push({value:e.slice(r,n.index),type:"plain"});const o=$(n),i=n[0];if("string"===o){const r=e.slice(n.index+i.length);/^\s*:/.test(r)?t.push({value:i,type:"key"}):t.push({value:i,type:"string"})}else t.push({value:i,type:o});r=n.index+i.length,n=M.exec(e)}return r<e.length&&t.push({value:e.slice(r),type:"plain"}),t}(e):[{value:e,type:"plain"}]}(e,this.language);return 1===t.length&&"plain"===t[0].type?this.renderSearchableText(e):t.map((e=>this.renderSyntaxToken(e)))}renderSyntaxToken(e){const r=this.renderSearchableText(e.value);return"plain"===e.type?r:t("span",{class:`syntax--${e.type}`},r)}renderSearchableText(e){if(!this.isRenderingRemovedLine||!this.activeSearchRegex)return e;const r=e.split(this.activeSearchRegex);return 1===r.length?e:r.map(((e,r)=>{if(r%2==0)return e;const n=this.searchMatchCounter++;return t("mark",{key:`match-${n}`,class:{"search-match":!0,"search-match--current":n===this.currentMatchIndex}},e)}))}renderCollapsedRow(e,r){return t("div",{class:"diff-line diff-line--collapsed",role:"row"},t("button",{class:"expand-button",type:"button",onClick:()=>this.expandHunk(r),"aria-label":this.getTranslation("code-diff.show-hidden-lines",{count:e})},this.getTranslation("code-diff.hidden-lines",{count:e})))}renderCollapsedAfterRow(e){return t("div",{class:"diff-line diff-line--collapsed",role:"row"},t("button",{class:"expand-button",type:"button",onClick:()=>this.expandAfter(),"aria-label":this.getTranslation("code-diff.show-hidden-lines",{count:e})},this.getTranslation("code-diff.hidden-lines",{count:e})))}expandHunk(e){const t=[...this.diffResult.hunks],r=t[e],n=e>0?t[e-1].startIndex+t[e-1].lines.length:0,o=this.diffResult.allLines.slice(n,r.startIndex);t[e]=Object.assign(Object.assign({},r),{lines:[...o,...r.lines],collapsedBefore:void 0,startIndex:n}),this.diffResult=Object.assign(Object.assign({},this.diffResult),{hunks:t}),this.liveAnnouncement=this.getTranslation("code-diff.expanded-lines")}expandAfter(){const e=[...this.diffResult.hunks],t=e.length-1,r=e[t],n=this.diffResult.allLines.slice(r.startIndex+r.lines.length);e[t]=Object.assign(Object.assign({},r),{lines:[...r.lines,...n]}),this.diffResult=Object.assign(Object.assign({},this.diffResult),{hunks:e,collapsedAfter:void 0}),this.liveAnnouncement=this.getTranslation("code-diff.expanded-lines-end")}getTranslation(e,t){return o.get(e,this.translationLanguage,t)}get host(){return n(this)}static get watchers(){return{oldValue:[{watchInputs:0}],newValue:[{watchInputs:0}],contextLines:[{watchInputs:0}],reformatJson:[{watchInputs:0}],layout:[{watchInputs:0}]}}};A.style='@charset "UTF-8";*,*::before,*::after{box-sizing:border-box;min-width:0;min-height:0}:host(limel-code-diff){--diff-added-bg:rgb(var(--color-green-default), 0.1);--diff-added-bg-hover:rgb(var(--color-green-default), 0.3);--diff-added-highlight-bg:rgb(var(--color-green-default), 0.3);--diff-removed-bg:rgb(var(--color-red-default), 0.1);--diff-removed-bg-hover:rgb(var(--color-red-default), 0.3);--diff-removed-highlight-bg:rgb(var(--color-red-default), 0.3);--diff-context-bg:transparent;--diff-indicator-added-color:rgb(var(--color-green-default));--diff-indicator-removed-color:rgb(var(--color-red-default));--diff-stat-added-color:rgb(var(--color-green-default));--diff-stat-removed-color:rgb(var(--color-red-default));--search-match-bg:rgb(var(--color-amber-default), 0.3);--search-match-current-bg:rgb(var(--color-amber-default), 0.6);--diff-line-hover-bg:rgb(var(--contrast-800), 0.08);--diff-gutter-bg:rgb(var(--contrast-200));--diff-gutter-text-color:rgb(var(--contrast-700));--diff-text-color:rgb(var(--contrast-1100));--diff-border-color:rgb(var(--contrast-400));--diff-collapsed-bg:rgb(var(--contrast-200));--diff-collapsed-text-color:rgb(var(--contrast-800));--diff-header-bg:rgb(var(--contrast-200));--diff-empty-text-color:rgb(var(--contrast-700));--diff-split-divider-color:rgb(var(--contrast-400));--diff-empty-cell-bg:rgb(var(--contrast-100));--syntax-string-color:rgb(var(--color-green-dark));--syntax-number-color:rgb(var(--color-blue-default));--syntax-boolean-color:rgb(var(--color-amber-darker));--syntax-key-color:rgb(var(--color-sky-dark));--syntax-null-color:rgb(var(--contrast-700));--syntax-punctuation-color:rgb(var(--contrast-700));--search-bar-bg:rgb(var(--contrast-100));--search-bar-border:rgb(var(--contrast-400));--limel-code-diff-line-number-padding:0.25rem;font-family:ui-sans-serif, system-ui, sans-serif;display:flex;flex-direction:column;width:100%;height:100%;color:var(--diff-text-color);border:1px solid var(--diff-border-color);border-radius:0.5rem;max-height:var(--code-diff-max-height, none)}.screen-reader-only{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap}.diff-header{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:0.125rem 0.125rem 0.125rem 0.5rem;background:var(--diff-header-bg);border-bottom:1px solid var(--diff-border-color);font-family:ui-sans-serif, system-ui, sans-serif;font-size:0.75rem;border-radius:0.5rem 0.5rem 0 0}.diff-header__labels{display:flex;gap:0.75rem;font-weight:500}.diff-header__old,.diff-header__new{padding:0.125rem 0.25rem;border-radius:0.25rem;box-shadow:var(--shadow-brighten-edges-outside)}.diff-header__old{background-color:var(--diff-removed-bg)}.diff-header__new{background-color:var(--diff-added-bg)}.diff-header__actions{display:flex;align-items:center;gap:0.25rem}.search-toggle--active{--limel-theme-on-surface-color:var(--mdc-theme-primary)}.diff-header__stats{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;display:flex;gap:0.5rem;margin-right:0.5rem}.stat{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:0.8125rem;font-weight:600}.stat--added{color:var(--diff-stat-added-color)}.stat--removed{color:var(--diff-stat-removed-color)}.search-bar{flex-shrink:0;display:flex;align-items:center;gap:0.25rem;padding:0.25rem 0 0.25rem 0.25rem;background:var(--search-bar-bg);border-bottom:1px solid var(--search-bar-border)}.search-bar limel-action-bar{--action-bar-background-color:transparent;min-width:2.5rem;flex-shrink:0}.search-bar limel-input-field{flex-grow:1}.search-bar__count{color:var(--diff-collapsed-text-color);white-space:nowrap;min-width:4rem;text-align:center;font-size:0.75rem}.search-match{background:var(--search-match-bg);color:inherit;border-radius:0.125rem}.search-match--current{background:var(--search-match-current-bg);outline:1px solid rgb(var(--color-amber-dark), 0.5)}.change-group{position:relative}.change-group__copy{--icon-background-color:rgb(var(--contrast-100));scale:0.9;position:absolute;top:0.125rem;right:0.5rem;display:none}.change-group:hover .change-group__copy{display:inline-flex}.diff-body{flex-grow:1;overflow-x:auto;font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:var(--code-diff-font-size, 0.75rem)}.diff-body:focus{outline:none}.diff-body:focus-visible{outline:0.125rem solid rgb(var(--color-blue-default));outline-offset:0.125rem;border-radius:0.25rem}.diff-line{display:flex;align-items:stretch;min-height:1.25rem;line-height:1.25rem}.diff-line:hover .line-content{transition-duration:0.2s;background:var(--diff-line-hover-bg)}.diff-line--added .line-content{background:var(--diff-added-bg)}.diff-line--added .line-indicator{color:var(--diff-indicator-added-color)}.diff-line--added:hover .line-content{background:var(--diff-added-bg-hover)}.diff-line--removed .line-content{background:var(--diff-removed-bg)}.diff-line--removed .line-indicator{color:var(--diff-indicator-removed-color)}.diff-line--removed:hover .line-content{background:var(--diff-removed-bg-hover)}.diff-line--context .line-content{background:var(--diff-context-bg)}.diff-line--collapsed{display:flex;justify-content:center;background:var(--diff-collapsed-bg);border-top:1px solid var(--diff-border-color);border-bottom:1px solid var(--diff-border-color)}.diff-line--focused{outline:0.125rem solid rgb(var(--color-blue-default));outline-offset:-0.125rem;z-index:1}.line-number{display:inline-flex;align-items:center;justify-content:flex-end;min-width:calc(1ch + 2 * var(--limel-code-diff-line-number-padding));width:var(--limel-line-number-min-width);padding:0 var(--limel-code-diff-line-number-padding);background:var(--diff-gutter-bg);color:var(--diff-gutter-text-color);user-select:none;text-align:right;flex-shrink:0}.line-number--old{border-right:1px solid var(--diff-border-color)}.line-indicator{display:inline-flex;align-items:center;justify-content:center;width:1.25rem;flex-shrink:0;user-select:none;font-weight:600;background:var(--diff-gutter-bg)}.line-content{flex:1;padding:0 0.75rem;white-space:pre;overflow-x:visible;min-width:0;transition:background-color 0.6s ease}mark{background:transparent;color:inherit;border-radius:0.125rem}mark.segment--added{background:var(--diff-added-highlight-bg)}mark.segment--removed{background:var(--diff-removed-highlight-bg)}.syntax--string{color:var(--syntax-string-color)}.syntax--number{color:var(--syntax-number-color)}.syntax--boolean{color:var(--syntax-boolean-color)}.syntax--null{color:var(--syntax-null-color);font-style:italic}.syntax--key{color:var(--syntax-key-color)}.syntax--punctuation{color:var(--syntax-punctuation-color)}.expand-button{all:unset;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}.expand-button:hover,.expand-button:focus,.expand-button:focus-visible{will-change:color, background-color, box-shadow, transform}.expand-button:hover,.expand-button:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.expand-button:hover{box-shadow:var(--button-shadow-hovered)}.expand-button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.expand-button:hover,.expand-button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.expand-button:focus{outline:none}.expand-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.expand-button{padding:0 0.75rem;border-radius:0.25rem;margin:0.125rem;width:calc(100% - 0.25rem);text-align:center}.diff-empty{padding:2rem;text-align:center;color:var(--diff-empty-text-color);font-style:italic}.diff-line--split{display:flex;align-items:stretch;min-height:1.25rem;line-height:1.25rem}.diff-line--split:hover .split-content--removed{background:var(--diff-removed-bg-hover)}.diff-line--split:hover .split-content--added{background:var(--diff-added-bg-hover)}.diff-line--split:hover .split-content--context{background:var(--diff-line-hover-bg)}.split-content{flex:1;padding:0 0.75rem;white-space:pre;overflow-x:visible;min-width:0}.split-content--left{border-right:1px solid var(--diff-split-divider-color)}.split-content--removed{background:var(--diff-removed-bg)}.split-content--added{background:var(--diff-added-bg)}.split-content--context{background:var(--diff-context-bg)}.split-content--empty{background:var(--diff-empty-cell-bg)}.split-content--left{overflow-x:hidden;text-overflow:ellipsis}.change-group:has(.diff-line--split)>.change-group__copy{right:calc(50% - var(--limel-line-number-min-width))}:host(limel-code-diff[line-wrapping]) .diff-body{overflow-x:hidden}:host(limel-code-diff[line-wrapping]) .line-content,:host(limel-code-diff[line-wrapping]) .split-content{white-space:pre-wrap;overflow-wrap:break-word;word-break:break-all}:host(limel-code-diff[line-wrapping]) .diff-line--split .split-content{flex:1 1 0%;max-width:calc(50% - var(--limel-line-number-min-width))}';export{A as limel_code_diff}