diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..50ed0a99 --- /dev/null +++ b/404.html @@ -0,0 +1,1075 @@ + + + + + + + + + + + + + + + + Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ +

404 - Not found

+ +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Architektura\360\237\217\227\357\270\217/0_podstawowe regu\305\202y/index.html" "b/Architektura\360\237\217\227\357\270\217/0_podstawowe regu\305\202y/index.html" new file mode 100644 index 00000000..fdde3ae1 --- /dev/null +++ "b/Architektura\360\237\217\227\357\270\217/0_podstawowe regu\305\202y/index.html" @@ -0,0 +1,1187 @@ + + + + + + + + + + + + + + + + Reguły wytwarzania oprogramowania i inne skrótowce - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Reguły wytwarzania oprogramowania i inne skrótowce

+

Najważniejsze zasady, którymi trzeba się kierować

+

Piramidka zasad https://medium.com/@bartoszkrajka/principle-of-software-development-principles-f0143d6f405

+

Bardzo dobry artykuł o tym link

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Architektura\360\237\217\227\357\270\217/architektura_i_paradygmaty/index.html" "b/Architektura\360\237\217\227\357\270\217/architektura_i_paradygmaty/index.html" new file mode 100644 index 00000000..0ffe8116 --- /dev/null +++ "b/Architektura\360\237\217\227\357\270\217/architektura_i_paradygmaty/index.html" @@ -0,0 +1,1274 @@ + + + + + + + + + + + + + + + + Paradygmaty i reguły - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Paradygmaty i reguły

+

Programowanie obiektowe

+

Reguły

+

Kompozycja zamiast dziedziczenia

+

Composition over Inheritance - jest to zasada mówiąca, że na ogół powinniśmy preferować zastosowanie kompozycji (czyli zawieranie klas implementujących dane interfejsy dostarczające pożądane funkcjonalności) zamiast dziedziczenia.

+

Kompozycja w przeciwieństwie do dziedziczenia pozwala na uzyskanie dużo większej elastyczności, ponieważ wykorzystywane przez nas klasy nie są tak ściśle ze sobą powiązane, jak miałoby to miejsce w wypadku dziedziczenia. Kompozycja pozwala chociażby na wstrzykiwanie zależności.

+

Jedną z oznak elastyczności jest to, że możemy mieć różne kombinacje zachowań dla danych klas.

+

//TODO opisz wstrzykiwanie zależności

+

Programowanie aspektowe

+

Inne materiały

+

Banda czworga - https://brasil.cel.agh.edu.pl/~09sbfraczek/wzorce-projektowe-wstep,1,57.html

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Architektura\360\237\217\227\357\270\217/assets/UML_association_role_example.gif" "b/Architektura\360\237\217\227\357\270\217/assets/UML_association_role_example.gif" new file mode 100644 index 00000000..7be26c31 Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/UML_association_role_example.gif" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/Uml_classes_relations.svg" "b/Architektura\360\237\217\227\357\270\217/assets/Uml_classes_relations.svg" new file mode 100644 index 00000000..105c7896 --- /dev/null +++ "b/Architektura\360\237\217\227\357\270\217/assets/Uml_classes_relations.svg" @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + Association + Inheritance + Realization / + Implementation + Dependency + Aggregation + Composition + + diff --git "a/Architektura\360\237\217\227\357\270\217/assets/piramida.png" "b/Architektura\360\237\217\227\357\270\217/assets/piramida.png" new file mode 100644 index 00000000..b1928fa6 Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/piramida.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/uml-AggregationAndComposition.svg.png" "b/Architektura\360\237\217\227\357\270\217/assets/uml-AggregationAndComposition.svg.png" new file mode 100644 index 00000000..903c7ef0 Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/uml-AggregationAndComposition.svg.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/uml-BankAccount1.svg.png" "b/Architektura\360\237\217\227\357\270\217/assets/uml-BankAccount1.svg.png" new file mode 100644 index 00000000..8d642244 Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/uml-BankAccount1.svg.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/uml_class_diagram_example.png" "b/Architektura\360\237\217\227\357\270\217/assets/uml_class_diagram_example.png" new file mode 100644 index 00000000..570a3409 Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/uml_class_diagram_example.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/uml_generalization_specialization.png" "b/Architektura\360\237\217\227\357\270\217/assets/uml_generalization_specialization.png" new file mode 100644 index 00000000..d3826264 Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/uml_generalization_specialization.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/uml_link_classes.png" "b/Architektura\360\237\217\227\357\270\217/assets/uml_link_classes.png" new file mode 100644 index 00000000..e3ece4db Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/uml_link_classes.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/use_case_basic.png" "b/Architektura\360\237\217\227\357\270\217/assets/use_case_basic.png" new file mode 100644 index 00000000..e5c22254 Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/use_case_basic.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/use_case_extend.png" "b/Architektura\360\237\217\227\357\270\217/assets/use_case_extend.png" new file mode 100644 index 00000000..867b011c Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/use_case_extend.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/use_case_include.png" "b/Architektura\360\237\217\227\357\270\217/assets/use_case_include.png" new file mode 100644 index 00000000..f4c3a376 Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/use_case_include.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/use_case_inheritance.png" "b/Architektura\360\237\217\227\357\270\217/assets/use_case_inheritance.png" new file mode 100644 index 00000000..6f4c06d7 Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/use_case_inheritance.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/assets/use_case_table_example.png" "b/Architektura\360\237\217\227\357\270\217/assets/use_case_table_example.png" new file mode 100644 index 00000000..60f4f97c Binary files /dev/null and "b/Architektura\360\237\217\227\357\270\217/assets/use_case_table_example.png" differ diff --git "a/Architektura\360\237\217\227\357\270\217/mermaid.css" "b/Architektura\360\237\217\227\357\270\217/mermaid.css" new file mode 100644 index 00000000..7e8ba824 --- /dev/null +++ "b/Architektura\360\237\217\227\357\270\217/mermaid.css" @@ -0,0 +1,274 @@ +/* Flowchart variables */ +/* Sequence Diagram variables */ +/* Gantt chart variables */ +.mermaid .label { + color: #333; +} +.node rect, +.node circle, +.node ellipse, +.node polygon { + fill: #ECECFF; + stroke: #CCCCFF; + stroke-width: 1px; +} +.edgePath .path { + stroke: #333333; +} +.edgeLabel { + background-color: #e8e8e8; +} +.cluster rect { + fill: #ffffde !important; + rx: 4 !important; + stroke: #aaaa33 !important; + stroke-width: 1px !important; +} +.cluster text { + fill: #333; +} +.actor { + stroke: #CCCCFF; + fill: #ECECFF; +} +text.actor { + fill: black; + stroke: none; +} +.actor-line { + stroke: grey; +} +.messageLine0 { + stroke-width: 1.5; + stroke-dasharray: "2 2"; + marker-end: "url(#arrowhead)"; + stroke: #333; +} +.messageLine1 { + stroke-width: 1.5; + stroke-dasharray: "2 2"; + stroke: #333; +} +#arrowhead { + fill: #333; +} +#crosshead path { + fill: #333 !important; + stroke: #333 !important; +} +.messageText { + fill: #333; + stroke: none; +} +.labelBox { + stroke: #CCCCFF; + fill: #ECECFF; +} +.labelText { + fill: black; + stroke: none; +} +.loopText { + fill: black; + stroke: none; +} +.loopLine { + stroke-width: 2; + stroke-dasharray: "2 2"; + marker-end: "url(#arrowhead)"; + stroke: #CCCCFF; +} +.note { + stroke: #aaaa33; + fill: #fff5ad; +} +.noteText { + fill: black; + stroke: none; + font-family: 'trebuchet ms', verdana, arial; + font-size: 14px; +} +/** Section styling */ +.section { + stroke: none; +/* below commented out because it conflicts with the readthedocs theme */ +/* opacity: 0.2; */ +} +.section0 { + fill: rgba(102, 102, 255, 0.49); +} +.section2 { + fill: #fff400; +} +.section1, +.section3 { + fill: white; + opacity: 0.2; +} +.sectionTitle0 { + fill: #333; +} +.sectionTitle1 { + fill: #333; +} +.sectionTitle2 { + fill: #333; +} +.sectionTitle3 { + fill: #333; +} +.sectionTitle { + text-anchor: start; + font-size: 11px; + text-height: 14px; +} +/* Grid and axis */ +.grid .tick { + stroke: lightgrey; + opacity: 0.3; + shape-rendering: crispEdges; +} +.grid path { + stroke-width: 0; +} +/* Today line */ +.today { + fill: none; + stroke: red; + stroke-width: 2px; +} +/* Task styling */ +/* Default task */ +.task { + stroke-width: 2; +} +.taskText { + text-anchor: middle; + font-size: 11px; +} +.taskTextOutsideRight { + fill: black; + text-anchor: start; + font-size: 11px; +} +.taskTextOutsideLeft { + fill: black; + text-anchor: end; + font-size: 11px; +} +/* Specific task settings for the sections*/ +.taskText0, +.taskText1, +.taskText2, +.taskText3 { + fill: white; +} +.task0, +.task1, +.task2, +.task3 { + fill: #8a90dd; + stroke: #534fbc; +} +.taskTextOutside0, +.taskTextOutside2 { + fill: black; +} +.taskTextOutside1, +.taskTextOutside3 { + fill: black; +} +/* Active task */ +.active0, +.active1, +.active2, +.active3 { + fill: #bfc7ff; + stroke: #534fbc; +} +.activeText0, +.activeText1, +.activeText2, +.activeText3 { + fill: black !important; +} +/* Completed task */ +.done0, +.done1, +.done2, +.done3 { + stroke: grey; + fill: lightgrey; + stroke-width: 2; +} +.doneText0, +.doneText1, +.doneText2, +.doneText3 { + fill: black !important; +} +/* Tasks on the critical line */ +.crit0, +.crit1, +.crit2, +.crit3 { + stroke: #ff8888; + fill: red; + stroke-width: 2; +} +.activeCrit0, +.activeCrit1, +.activeCrit2, +.activeCrit3 { + stroke: #ff8888; + fill: #bfc7ff; + stroke-width: 2; +} +.doneCrit0, +.doneCrit1, +.doneCrit2, +.doneCrit3 { + stroke: #ff8888; + fill: lightgrey; + stroke-width: 2; + cursor: pointer; + shape-rendering: crispEdges; +} +.doneCritText0, +.doneCritText1, +.doneCritText2, +.doneCritText3 { + fill: black !important; +} +.activeCritText0, +.activeCritText1, +.activeCritText2, +.activeCritText3 { + fill: black !important; +} +.titleText { + text-anchor: middle; + font-size: 18px; + fill: black; +} +/* + + +*/ +.node text { + font-family: 'trebuchet ms', verdana, arial; + font-size: 14px; +} +div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: 'trebuchet ms', verdana, arial; + font-size: 12px; + background: #ffffde; + border: 1px solid #aaaa33; + border-radius: 2px; + pointer-events: none; + z-index: 100; +} diff --git "a/Architektura\360\237\217\227\357\270\217/mermaid.min.js" "b/Architektura\360\237\217\227\357\270\217/mermaid.min.js" new file mode 100644 index 00000000..f746f856 --- /dev/null +++ "b/Architektura\360\237\217\227\357\270\217/mermaid.min.js" @@ -0,0 +1,32 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mermaid=e():t.mermaid=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=383)}([function(t,e,n){"use strict";n.r(e);var r=function(t,e){return te?1:t>=e?0:NaN},i=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return r(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)>0?i=a:r=a+1}return r}}};var a=i(r),o=a.right,s=a.left,c=o,u=function(t,e){null==e&&(e=l);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);nt?1:e>=t?0:NaN},d=function(t){return null===t?NaN:+t},p=function(t,e){var n,r,i=t.length,a=0,o=-1,s=0,c=0;if(null==e)for(;++o1)return c/(a-1)},y=function(t,e){var n=p(t,e);return n?Math.sqrt(n):n},g=function(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o=n)for(r=i=n;++on&&(r=n),i=n)for(r=i=n;++on&&(r=n),i0)return[t];if((r=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s=0?(a>=w?10:a>=E?5:a>=T?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=w?10:a>=E?5:a>=T?2:1)}function S(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=w?i*=10:a>=E?i*=5:a>=T&&(i*=2),eh;)f.pop(),--d;var p,y=new Array(d+1);for(i=0;i<=d;++i)(p=y[i]=[]).x0=i>0?f[i-1]:l,p.x1=i=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,a=Math.floor(i),o=+n(t[a],a,t);return o+(+n(t[a+1],a+1,t)-o)*(i-a)}},N=function(t,e,n){return t=b.call(t,d).sort(r),Math.ceil((n-e)/(2*(D(t,.75)-D(t,.25))*Math.pow(t.length,-1/3)))},B=function(t,e,n){return Math.ceil((n-e)/(3.5*y(t)*Math.pow(t.length,-1/3)))},L=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a=n)for(r=n;++ar&&(r=n)}else for(;++a=n)for(r=n;++ar&&(r=n);return r},F=function(t,e){var n,r=t.length,i=r,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(r=t[i]).length;--e>=0;)n[--o]=r[e];return n},j=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a=n)for(r=n;++an&&(r=n)}else for(;++a=n)for(r=n;++an&&(r=n);return r},R=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},Y=function(t,e){if(n=t.length){var n,i,a=0,o=0,s=t[o];for(null==e&&(e=r);++a=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function ct(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),a=0;ae?1:t>=e?0:NaN}var xt="http://www.w3.org/1999/xhtml",kt={svg:"http://www.w3.org/2000/svg",xhtml:xt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},wt=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),kt.hasOwnProperty(e)?{space:kt[e],local:t}:t};function Et(t){return function(){this.removeAttribute(t)}}function Tt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ct(t,e){return function(){this.setAttribute(t,e)}}function At(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function St(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Mt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var Ot=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Dt(t){return function(){this.style.removeProperty(t)}}function Nt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Bt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Lt(t,e){return t.style.getPropertyValue(e)||Ot(t).getComputedStyle(t,null).getPropertyValue(e)}function Ft(t){return function(){delete this[t]}}function Pt(t,e){return function(){this[t]=e}}function It(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function jt(t){return t.trim().split(/^|\s+/)}function Rt(t){return t.classList||new Yt(t)}function Yt(t){this._node=t,this._names=jt(t.getAttribute("class")||"")}function zt(t,e){for(var n=Rt(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Vt(){this.textContent=""}function Gt(t){return function(){this.textContent=t}}function qt(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function Xt(){this.innerHTML=""}function Zt(t){return function(){this.innerHTML=t}}function Jt(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Qt(){this.nextSibling&&this.parentNode.appendChild(this)}function Kt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function te(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===xt&&e.documentElement.namespaceURI===xt?e.createElement(t):e.createElementNS(n,t)}}function ee(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var ne=function(t){var e=wt(t);return(e.local?ee:te)(e)};function re(){return null}function ie(){var t=this.parentNode;t&&t.removeChild(this)}function ae(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function oe(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var se={},ce=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(se={mouseenter:"mouseover",mouseleave:"mouseout"}));function ue(t,e,n){return t=le(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function le(t,e,n){return function(r){var i=ce;ce=r;try{t.call(this,this.__data__,e,n)}finally{ce=i}}}function he(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function fe(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r=x&&(x=_+1);!(b=v[x])&&++x=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=_t);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==e?Dt:"function"==typeof e?Bt:Nt)(t,e,null==n?"":n)):Lt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Ft:"function"==typeof e?It:Pt)(t,e)):this.node()[t]},classed:function(t,e){var n=jt(t+"");if(arguments.length<2){for(var r=Rt(this.node()),i=-1,a=n.length;++i>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new qe(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new qe(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Le.exec(t))?new qe(e[1],e[2],e[3],1):(e=Fe.exec(t))?new qe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Pe.exec(t))?He(e[1],e[2],e[3],e[4]):(e=Ie.exec(t))?He(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=je.exec(t))?Qe(e[1],e[2]/100,e[3]/100,1):(e=Re.exec(t))?Qe(e[1],e[2]/100,e[3]/100,e[4]):Ye.hasOwnProperty(t)?We(Ye[t]):"transparent"===t?new qe(NaN,NaN,NaN,0):null}function We(t){return new qe(t>>16&255,t>>8&255,255&t,1)}function He(t,e,n,r){return r<=0&&(t=e=n=NaN),new qe(t,e,n,r)}function Ve(t){return t instanceof Me||(t=$e(t)),t?new qe((t=t.rgb()).r,t.g,t.b,t.opacity):new qe}function Ge(t,e,n,r){return 1===arguments.length?Ve(t):new qe(t,e,n,null==r?1:r)}function qe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Xe(){return"#"+Je(this.r)+Je(this.g)+Je(this.b)}function Ze(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Je(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Qe(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new en(t,e,n,r)}function Ke(t){if(t instanceof en)return new en(t.h,t.s,t.l,t.opacity);if(t instanceof Me||(t=$e(t)),!t)return new en;if(t instanceof en)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n0&&c<1?0:o,new en(o,s,c,t.opacity)}function tn(t,e,n,r){return 1===arguments.length?Ke(t):new en(t,e,n,null==r?1:r)}function en(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function nn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function rn(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}Ae(Me,$e,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ze,formatHex:ze,formatHsl:function(){return Ke(this).formatHsl()},formatRgb:Ue,toString:Ue}),Ae(qe,Ge,Se(Me,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Xe,formatHex:Xe,formatRgb:Ze,toString:Ze})),Ae(en,tn,Se(Me,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new en(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new en(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new qe(nn(t>=240?t-240:t+120,i,r),nn(t,i,r),nn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var an=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r180||n<-180?n-360*Math.round(n/360):n):sn(isNaN(t)?e:t)}function ln(t){return 1==(t=+t)?hn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):sn(isNaN(e)?n:e)}}function hn(t,e){var n=e-t;return n?cn(t,n):sn(isNaN(t)?e:t)}var fn=function t(e){var n=ln(e);function r(t,e){var r=n((t=Ge(t)).r,(e=Ge(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=hn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function dn(t){return function(e){var n,r,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(n=0;na&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,c.push({i:o,x:xn(n,r)})),a=En.lastIndex;return a=0&&e._call.call(null,t),e=e._next;--Bn}function Vn(){In=(Pn=Rn.now())+jn,Bn=Ln=0;try{Hn()}finally{Bn=0,function(){var t,e,n=Tn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Tn=e);Cn=t,qn(r)}(),In=0}}function Gn(){var t=Rn.now(),e=t-Pn;e>1e3&&(jn-=e,Pn=t)}function qn(t){Bn||(Ln&&(Ln=clearTimeout(Ln)),t-In>24?(t<1/0&&(Ln=setTimeout(Vn,t-Rn.now()-jn)),Fn&&(Fn=clearInterval(Fn))):(Fn||(Pn=Rn.now(),Fn=setInterval(Gn,1e3)),Bn=1,Yn(Vn)))}$n.prototype=Wn.prototype={constructor:$n,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?zn():+n)+(null==e?0:+e),this._next||Cn===this||(Cn?Cn._next=this:Tn=this,Cn=this),this._call=t,this._time=n,qn()},stop:function(){this._call&&(this._call=null,this._time=1/0,qn())}};var Xn=function(t,e,n){var r=new $n;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},Zn=lt("start","end","cancel","interrupt"),Jn=[],Qn=function(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(c){var u,l,h,f;if(1!==n.state)return s();for(u in i)if((f=i[u]).name===n.name){if(3===f.state)return Xn(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[u]):+u0)throw new Error("too late; already scheduled");return n}function tr(t,e){var n=er(t,e);if(n.state>3)throw new Error("too late; already running");return n}function er(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var nr,rr,ir,ar,or=function(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}},sr=180/Math.PI,cr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},ur=function(t,e,n,r,i,a){var o,s,c;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),t*r180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:xn(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,s,c),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:xn(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,s,c),function(t,e,n,r,a,o){if(t!==n||e!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:xn(t,n)},{i:s-2,x:xn(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,c),a=o=null,function(t){for(var e,n=-1,r=c.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Kn:tr;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}var Br=xe.prototype.constructor;function Lr(t){return function(){this.style.removeProperty(t)}}function Fr(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Pr(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&Fr(t,a,n)),r}return a._value=e,a}function Ir(t){return function(e){this.textContent=t.call(this,e)}}function jr(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Ir(r)),e}return r._value=t,r}var Rr=0;function Yr(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function zr(t){return xe().transition(t)}function Ur(){return++Rr}var $r=xe.prototype;function Wr(t){return t*t*t}function Hr(t){return--t*t*t+1}function Vr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Yr.prototype=zr.prototype={constructor:Yr,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=ft(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o1&&n.name===e)return new Yr([[t]],Xr,e,+r);return null},Jr=function(t){return function(){return t}},Qr=function(t,e,n){this.target=t,this.type=e,this.selection=n};function Kr(){ce.stopImmediatePropagation()}var ti=function(){ce.preventDefault(),ce.stopImmediatePropagation()},ei={name:"drag"},ni={name:"space"},ri={name:"handle"},ii={name:"center"};function ai(t){return[+t[0],+t[1]]}function oi(t){return[ai(t[0]),ai(t[1])]}function si(t){return function(e){return Dn(e,ce.touches,t)}}var ci={name:"x",handles:["w","e"].map(gi),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ui={name:"y",handles:["n","s"].map(gi),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},li={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(gi),input:function(t){return null==t?null:oi(t)},output:function(t){return t}},hi={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},fi={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},di={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},pi={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},yi={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function gi(t){return{type:t}}function vi(){return!ce.ctrlKey&&!ce.button}function mi(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function bi(){return navigator.maxTouchPoints||"ontouchstart"in this}function _i(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function xi(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function ki(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function wi(){return Ci(ci)}function Ei(){return Ci(ui)}var Ti=function(){return Ci(li)};function Ci(t){var e,n=mi,r=vi,i=bi,a=!0,o=lt("start","brush","end"),s=6;function c(e){var n=e.property("__brush",y).selectAll(".overlay").data([gi("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",hi.overlay).merge(n).each((function(){var t=_i(this).extent;ke(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([gi("selection")]).enter().append("rect").attr("class","selection").attr("cursor",hi.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return hi[t.type]})),e.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",f).filter(i).on("touchstart.brush",f).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function u(){var t=ke(this),e=_i(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-s/2:e[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-s/2:e[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+s:s}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){return!n&&t.__brush.emitter||new h(t,e)}function h(t,e){this.that=t,this.args=e,this.state=t.__brush,this.active=0}function f(){if((!e||ce.touches)&&r.apply(this,arguments)){var n,i,o,s,c,h,f,d,p,y,g,v=this,m=ce.target.__data__.type,b="selection"===(a&&ce.metaKey?m="overlay":m)?ei:a&&ce.altKey?ii:ri,_=t===ui?null:pi[m],x=t===ci?null:yi[m],k=_i(v),w=k.extent,E=k.selection,T=w[0][0],C=w[0][1],A=w[1][0],S=w[1][1],M=0,O=0,D=_&&x&&a&&ce.shiftKey,N=ce.touches?si(ce.changedTouches[0].identifier):Nn,B=N(v),L=B,F=l(v,arguments,!0).beforestart();"overlay"===m?(E&&(p=!0),k.selection=E=[[n=t===ui?T:B[0],o=t===ci?C:B[1]],[c=t===ui?A:n,f=t===ci?S:o]]):(n=E[0][0],o=E[0][1],c=E[1][0],f=E[1][1]),i=n,s=o,h=c,d=f;var P=ke(v).attr("pointer-events","none"),I=P.selectAll(".overlay").attr("cursor",hi[m]);if(ce.touches)F.moved=R,F.ended=z;else{var j=ke(ce.view).on("mousemove.brush",R,!0).on("mouseup.brush",z,!0);a&&j.on("keydown.brush",U,!0).on("keyup.brush",$,!0),Te(ce.view)}Kr(),or(v),u.call(v),F.start()}function R(){var t=N(v);!D||y||g||(Math.abs(t[0]-L[0])>Math.abs(t[1]-L[1])?g=!0:y=!0),L=t,p=!0,ti(),Y()}function Y(){var t;switch(M=L[0]-B[0],O=L[1]-B[1],b){case ni:case ei:_&&(M=Math.max(T-n,Math.min(A-c,M)),i=n+M,h=c+M),x&&(O=Math.max(C-o,Math.min(S-f,O)),s=o+O,d=f+O);break;case ri:_<0?(M=Math.max(T-n,Math.min(A-n,M)),i=n+M,h=c):_>0&&(M=Math.max(T-c,Math.min(A-c,M)),i=n,h=c+M),x<0?(O=Math.max(C-o,Math.min(S-o,O)),s=o+O,d=f):x>0&&(O=Math.max(C-f,Math.min(S-f,O)),s=o,d=f+O);break;case ii:_&&(i=Math.max(T,Math.min(A,n-M*_)),h=Math.max(T,Math.min(A,c+M*_))),x&&(s=Math.max(C,Math.min(S,o-O*x)),d=Math.max(C,Math.min(S,f+O*x)))}h0&&(n=i-M),x<0?f=d-O:x>0&&(o=s-O),b=ni,I.attr("cursor",hi.selection),Y());break;default:return}ti()}function $(){switch(ce.keyCode){case 16:D&&(y=g=D=!1,Y());break;case 18:b===ii&&(_<0?c=h:_>0&&(n=i),x<0?f=d:x>0&&(o=s),b=ri,Y());break;case 32:b===ni&&(ce.altKey?(_&&(c=h-M*_,n=i+M*_),x&&(f=d-O*x,o=s+O*x),b=ii):(_<0?c=h:_>0&&(n=i),x<0?f=d:x>0&&(o=s),b=ri),I.attr("cursor",hi[m]),Y());break;default:return}ti()}}function d(){l(this,arguments).moved()}function p(){l(this,arguments).ended()}function y(){var e=this.__brush||{selection:null};return e.extent=oi(n.apply(this,arguments)),e.dim=t,e}return c.move=function(e,n){e.selection?e.on("start.brush",(function(){l(this,arguments).beforestart().start()})).on("interrupt.brush end.brush",(function(){l(this,arguments).end()})).tween("brush",(function(){var e=this,r=e.__brush,i=l(e,arguments),a=r.selection,o=t.input("function"==typeof n?n.apply(this,arguments):n,r.extent),s=Sn(a,o);function c(t){r.selection=1===t&&null===o?null:s(t),u.call(e),i.brush()}return null!==a&&null!==o?c:c(1)})):e.each((function(){var e=this,r=arguments,i=e.__brush,a=t.input("function"==typeof n?n.apply(e,r):n,i.extent),o=l(e,r).beforestart();or(e),i.selection=null===a?null:a,u.call(e),o.start().brush().end()}))},c.clear=function(t){c.move(t,null)},h.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting?(this.starting=!1,this.emit("start")):this.emit("brush"),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(e){pe(new Qr(c,e,t.output(this.state.selection)),o.apply,o,[e,this.that,this.args])}},c.extent=function(t){return arguments.length?(n="function"==typeof t?t:Jr(oi(t)),c):n},c.filter=function(t){return arguments.length?(r="function"==typeof t?t:Jr(!!t),c):r},c.touchable=function(t){return arguments.length?(i="function"==typeof t?t:Jr(!!t),c):i},c.handleSize=function(t){return arguments.length?(s=+t,c):s},c.keyModifiers=function(t){return arguments.length?(a=!!t,c):a},c.on=function(){var t=o.on.apply(o,arguments);return t===o?c:t},c}var Ai=Math.cos,Si=Math.sin,Mi=Math.PI,Oi=Mi/2,Di=2*Mi,Ni=Math.max;function Bi(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}var Li=function(){var t=0,e=null,n=null,r=null;function i(i){var a,o,s,c,u,l,h=i.length,f=[],d=k(h),p=[],y=[],g=y.groups=new Array(h),v=new Array(h*h);for(a=0,u=-1;++u1e-6)if(Math.abs(l*s-c*u)>1e-6&&i){var f=n-a,d=r-o,p=s*s+c*c,y=f*f+d*d,g=Math.sqrt(p),v=Math.sqrt(h),m=i*Math.tan((Ii-Math.acos((p+h-y)/(2*g*v)))/2),b=m/v,_=m/g;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(e+b*l)),this._+="A"+i+","+i+",0,0,"+ +(l*f>u*d)+","+(this._x1=t+_*s)+","+(this._y1=e+_*c)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,a){t=+t,e=+e,a=!!a;var o=(n=+n)*Math.cos(r),s=n*Math.sin(r),c=t+o,u=e+s,l=1^a,h=a?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+c+","+u:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-u)>1e-6)&&(this._+="L"+c+","+u),n&&(h<0&&(h=h%ji+ji),h>Ri?this._+="A"+n+","+n+",0,1,"+l+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+l+","+(this._x1=c)+","+(this._y1=u):h>1e-6&&(this._+="A"+n+","+n+",0,"+ +(h>=Ii)+","+l+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Ui=zi;function $i(t){return t.source}function Wi(t){return t.target}function Hi(t){return t.radius}function Vi(t){return t.startAngle}function Gi(t){return t.endAngle}var qi=function(){var t=$i,e=Wi,n=Hi,r=Vi,i=Gi,a=null;function o(){var o,s=Fi.call(arguments),c=t.apply(this,s),u=e.apply(this,s),l=+n.apply(this,(s[0]=c,s)),h=r.apply(this,s)-Oi,f=i.apply(this,s)-Oi,d=l*Ai(h),p=l*Si(h),y=+n.apply(this,(s[0]=u,s)),g=r.apply(this,s)-Oi,v=i.apply(this,s)-Oi;if(a||(a=o=Ui()),a.moveTo(d,p),a.arc(0,0,l,h,f),h===g&&f===v||(a.quadraticCurveTo(0,0,y*Ai(g),y*Si(g)),a.arc(0,0,y,g,v)),a.quadraticCurveTo(0,0,d,p),a.closePath(),o)return a=null,o+""||null}return o.radius=function(t){return arguments.length?(n="function"==typeof t?t:Pi(+t),o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Pi(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Pi(+t),o):i},o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(t){return arguments.length?(e=t,o):e},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o};function Xi(){}function Zi(t,e){var n=new Xi;if(t instanceof Xi)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==e)for(;++i=r.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var c,u,l,h=-1,f=n.length,d=r[i++],p=Ji(),y=o();++hr.length)return n;var o,s=i[a-1];return null!=e&&a>=r.length?o=n.entries():(o=[],n.each((function(e,n){o.push({key:n,values:t(e,a)})}))),null!=s?o.sort((function(t,e){return s(t.key,e.key)})):o}(a(t,0,ea,na),0)},key:function(t){return r.push(t),n},sortKeys:function(t){return i[r.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}};function Ki(){return{}}function ta(t,e,n){t[e]=n}function ea(){return Ji()}function na(t,e,n){t.set(e,n)}function ra(){}var ia=Ji.prototype;function aa(t,e){var n=new ra;if(t instanceof ra)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function va(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function ma(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ba(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _a(t){if(t instanceof wa)return new wa(t.h,t.c,t.l,t.opacity);if(t instanceof ya||(t=fa(t)),0===t.a&&0===t.b)return new wa(NaN,0r!=d>r&&n<(f-u)*(r-l)/(d-l)+u&&(i=-i)}return i}function Ia(t,e,n){var r,i,a,o;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],a=n[r],o=e[r],i<=a&&a<=o||o<=a&&a<=i)}var ja=function(){},Ra=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],Ya=function(){var t=1,e=1,n=M,r=s;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(Ba);else{var r=g(t),i=r[0],o=r[1];e=S(i,o,e),e=k(Math.floor(i/e)*e,Math.floor(o/e)*e,e)}return e.map((function(e){return a(t,e)}))}function a(n,i){var a=[],s=[];return function(n,r,i){var a,s,c,u,l,h,f=new Array,d=new Array;a=s=-1,u=n[0]>=r,Ra[u<<1].forEach(p);for(;++a=r,Ra[c|u<<1].forEach(p);Ra[u<<0].forEach(p);for(;++s=r,l=n[s*t]>=r,Ra[u<<1|l<<2].forEach(p);++a=r,h=l,l=n[s*t+a+1]>=r,Ra[c|u<<1|l<<2|h<<3].forEach(p);Ra[u|l<<3].forEach(p)}a=-1,l=n[s*t]>=r,Ra[l<<2].forEach(p);for(;++a=r,Ra[l<<2|h<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+s],c=[t[1][0]+a,t[1][1]+s],u=o(r),l=o(c);(e=d[u])?(n=f[l])?(delete d[e.end],delete f[n.start],e===n?(e.ring.push(c),i(e.ring)):f[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(c),d[e.end=l]=e):(e=f[l])?(n=d[u])?(delete f[e.start],delete d[n.end],e===n?(e.ring.push(c),i(e.ring)):f[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete f[e.start],e.ring.unshift(r),f[e.start=u]=e):f[u]=d[l]={start:u,end:l,ring:[r,c]}}Ra[l<<3].forEach(p)}(n,i,(function(t){r(t,n,i),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e0?a.push([t]):s.push(t)})),s.forEach((function(t){for(var e,n=0,r=a.length;n0&&o0&&s0&&a>0))throw new Error("invalid size");return t=r,e=a,i},i.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?La(Na.call(t)):La(t),i):n},i.smooth=function(t){return arguments.length?(r=t?s:ja,i):r===s},i};function za(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o=n&&(s>=a&&(c-=t.data[s-a+o*r]),e.data[s-n+o*r]=c/Math.min(s+1,r-1+a-s,a))}function Ua(t,e,n){for(var r=t.width,i=t.height,a=1+(n<<1),o=0;o=n&&(s>=a&&(c-=t.data[o+(s-a)*r]),e.data[o+(s-n)*r]=c/Math.min(s+1,i-1+a-s,a))}function $a(t){return t[0]}function Wa(t){return t[1]}function Ha(){return 1}var Va=function(){var t=$a,e=Wa,n=Ha,r=960,i=500,a=20,o=2,s=3*a,c=r+2*s>>o,u=i+2*s>>o,l=La(20);function h(r){var i=new Float32Array(c*u),h=new Float32Array(c*u);r.forEach((function(r,a,l){var h=+t(r,a,l)+s>>o,f=+e(r,a,l)+s>>o,d=+n(r,a,l);h>=0&&h=0&&f>o),Ua({width:c,height:u,data:h},{width:c,height:u,data:i},a>>o),za({width:c,height:u,data:i},{width:c,height:u,data:h},a>>o),Ua({width:c,height:u,data:h},{width:c,height:u,data:i},a>>o),za({width:c,height:u,data:i},{width:c,height:u,data:h},a>>o),Ua({width:c,height:u,data:h},{width:c,height:u,data:i},a>>o);var d=l(i);if(!Array.isArray(d)){var p=L(i);d=S(0,p,d),(d=k(0,Math.floor(p/d)*d,d)).shift()}return Ya().thresholds(d).size([c,u])(i).map(f)}function f(t){return t.value*=Math.pow(2,-2*o),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(y)}function y(t){t[0]=t[0]*Math.pow(2,o)-s,t[1]=t[1]*Math.pow(2,o)-s}function g(){return c=r+2*(s=3*a)>>o,u=i+2*s>>o,h}return h.x=function(e){return arguments.length?(t="function"==typeof e?e:La(+e),h):t},h.y=function(t){return arguments.length?(e="function"==typeof t?t:La(+t),h):e},h.weight=function(t){return arguments.length?(n="function"==typeof t?t:La(+t),h):n},h.size=function(t){if(!arguments.length)return[r,i];var e=Math.ceil(t[0]),n=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return r=e,i=n,g()},h.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return o=Math.floor(Math.log(t)/Math.LN2),g()},h.thresholds=function(t){return arguments.length?(l="function"==typeof t?t:Array.isArray(t)?La(Na.call(t)):La(t),h):l},h.bandwidth=function(t){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return a=Math.round((Math.sqrt(4*t*t+1)-1)/2),g()},h},Ga=function(t){return function(){return t}};function qa(t,e,n,r,i,a,o,s,c,u){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=a,this.y=o,this.dx=s,this.dy=c,this._=u}function Xa(){return!ce.ctrlKey&&!ce.button}function Za(){return this.parentNode}function Ja(t){return null==t?{x:ce.x,y:ce.y}:t}function Qa(){return navigator.maxTouchPoints||"ontouchstart"in this}qa.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Ka=function(){var t,e,n,r,i=Xa,a=Za,o=Ja,s=Qa,c={},u=lt("start","drag","end"),l=0,h=0;function f(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",g).on("touchmove.drag",v).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var o=b("mouse",a.apply(this,arguments),Nn,this,arguments);o&&(ke(ce.view).on("mousemove.drag",p,!0).on("mouseup.drag",y,!0),Te(ce.view),we(),n=!1,t=ce.clientX,e=ce.clientY,o("start"))}}function p(){if(Ee(),!n){var r=ce.clientX-t,i=ce.clientY-e;n=r*r+i*i>h}c.mouse("drag")}function y(){ke(ce.view).on("mousemove.drag mouseup.drag",null),Ce(ce.view,n),Ee(),c.mouse("end")}function g(){if(i.apply(this,arguments)){var t,e,n=ce.changedTouches,r=a.apply(this,arguments),o=n.length;for(t=0;t9999?"+"+io(e,6):io(e,4))+"-"+io(t.getUTCMonth()+1,2)+"-"+io(t.getUTCDate(),2)+(a?"T"+io(n,2)+":"+io(r,2)+":"+io(i,2)+"."+io(a,3)+"Z":i?"T"+io(n,2)+":"+io(r,2)+":"+io(i,2)+"Z":r||n?"T"+io(n,2)+":"+io(r,2)+"Z":"")}var oo=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,s=0,c=a<=0,u=!1;function l(){if(c)return eo;if(u)return u=!1,to;var e,r,i=o;if(34===t.charCodeAt(i)){for(;o++=a?c=!0:10===(r=t.charCodeAt(o++))?u=!0:13===r&&(u=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o=(a=(y+v)/2))?y=a:v=a,(l=n>=(o=(g+m)/2))?g=o:m=o,i=d,!(d=d[h=l<<1|u]))return i[h]=p,t;if(s=+t._x.call(null,d.data),c=+t._y.call(null,d.data),e===s&&n===c)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(u=e>=(a=(y+v)/2))?y=a:v=a,(l=n>=(o=(g+m)/2))?g=o:m=o}while((h=l<<1|u)==(f=(c>=o)<<1|s>=a));return i[f]=d,i[h]=p,t}var xs=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function ks(t){return t[0]}function ws(t){return t[1]}function Es(t,e,n){var r=new Ts(null==e?ks:e,null==n?ws:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Ts(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Cs(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var As=Es.prototype=Ts.prototype;function Ss(t){return t.x+t.vx}function Ms(t){return t.y+t.vy}As.copy=function(){var t,e,n=new Ts(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Cs(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Cs(e));return n},As.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return _s(this.cover(e,n),e,n,t)},As.addAll=function(t){var e,n,r,i,a=t.length,o=new Array(a),s=new Array(a),c=1/0,u=1/0,l=-1/0,h=-1/0;for(n=0;nl&&(l=r),ih&&(h=i));if(c>l||u>h)return this;for(this.cover(c,u).cover(l,h),n=0;nt||t>=i||r>e||e>=a;)switch(s=(ef||(a=c.y0)>d||(o=c.x1)=v)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=c)}else{var m=t-+this._x.call(null,y.data),b=e-+this._y.call(null,y.data),_=m*m+b*b;if(_=(s=(p+g)/2))?p=s:g=s,(l=o>=(c=(y+v)/2))?y=c:v=c,e=d,!(d=d[h=l<<1|u]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,f=h)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[f]=d:this._root=d),this):(this._root=i,this)},As.removeAll=function(t){for(var e=0,n=t.length;ec+d||iu+d||as.index){var p=c-o.x-o.vx,y=u-o.y-o.vy,g=p*p+y*y;gt.r&&(t.r=t[e].r)}function s(){if(e){var r,i,a=e.length;for(n=new Array(a),r=0;r1?(null==n?s.remove(t):s.set(t,d(n)),e):s.get(t)},find:function(e,n,r){var i,a,o,s,c,u=0,l=t.length;for(null==r?r=1/0:r*=r,u=0;u1?(u.on(t,n),e):u.on(t)}}},js=function(){var t,e,n,r,i=ms(-30),a=1,o=1/0,s=.81;function c(r){var i,a=t.length,o=Es(t,Ls,Fs).visitAfter(l);for(n=r,i=0;i=o)){(t.data!==e||t.next)&&(0===l&&(d+=(l=bs())*l),0===h&&(d+=(h=bs())*h),d1?r[0]+r.slice(2):r,+t.slice(n+1)]},$s=function(t){return(t=Us(Math.abs(t)))?t[1]:NaN},Ws=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hs(t){if(!(e=Ws.exec(t)))throw new Error("invalid format: "+t);var e;return new Vs({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Vs(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}Hs.prototype=Vs.prototype,Vs.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Gs,qs,Xs,Zs,Js=function(t,e){var n=Us(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Qs={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Js(100*t,e)},r:Js,s:function(t,e){var n=Us(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Gs=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Us(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Ks=function(t){return t},tc=Array.prototype.map,ec=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],nc=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Ks:(e=tc.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Ks:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(tc.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=Hs(t)).fill,n=t.align,h=t.sign,f=t.symbol,d=t.zero,p=t.width,y=t.comma,g=t.precision,v=t.trim,m=t.type;"n"===m?(y=!0,m="g"):Qs[m]||(void 0===g&&(g=12),v=!0,m="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===f?i:"#"===f&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",_="$"===f?a:/[%p]/.test(m)?c:"",x=Qs[m],k=/[defgprs%]/.test(m);function w(t){var i,a,c,f=b,w=_;if("c"===m)w=x(t)+w,t="";else{var E=(t=+t)<0;if(t=isNaN(t)?l:x(Math.abs(t),g),v&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&(E=!1),f=(E?"("===h?h:u:"-"===h||"("===h?"":h)+f,w=("s"===m?ec[8+Gs/3]:"")+w+(E&&"("===h?")":""),k)for(i=-1,a=t.length;++i(c=t.charCodeAt(i))||c>57){w=(46===c?o+t.slice(i+1):t.slice(i))+w,t=t.slice(0,i);break}}y&&!d&&(t=r(t,1/0));var T=f.length+t.length+w.length,C=T>1)+f+t+w+C.slice(T);break;default:t=C+f+t+w}return s(t)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),w.toString=function(){return t+""},w}return{format:h,formatPrefix:function(t,e){var n=h(((t=Hs(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor($s(e)/3))),i=Math.pow(10,-r),a=ec[8+r/3];return function(t){return n(i*t)+a}}}};function rc(t){return qs=nc(t),Xs=qs.format,Zs=qs.formatPrefix,qs}rc({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var ic=function(t){return Math.max(0,-$s(Math.abs(t)))},ac=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor($s(e)/3)))-$s(Math.abs(t)))},oc=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,$s(e)-$s(t))+1},sc=function(){return new cc};function cc(){this.reset()}cc.prototype={constructor:cc,reset:function(){this.s=this.t=0},add:function(t){lc(uc,t,this.t),lc(this,uc.s,this.s),this.s?this.t+=uc.t:this.s=uc.t},valueOf:function(){return this.s}};var uc=new cc;function lc(t,e,n){var r=t.s=e+n,i=r-e,a=r-i;t.t=e-a+(n-i)}var hc=Math.PI,fc=hc/2,dc=hc/4,pc=2*hc,yc=180/hc,gc=hc/180,vc=Math.abs,mc=Math.atan,bc=Math.atan2,_c=Math.cos,xc=Math.ceil,kc=Math.exp,wc=(Math.floor,Math.log),Ec=Math.pow,Tc=Math.sin,Cc=Math.sign||function(t){return t>0?1:t<0?-1:0},Ac=Math.sqrt,Sc=Math.tan;function Mc(t){return t>1?0:t<-1?hc:Math.acos(t)}function Oc(t){return t>1?fc:t<-1?-fc:Math.asin(t)}function Dc(t){return(t=Tc(t/2))*t}function Nc(){}function Bc(t,e){t&&Fc.hasOwnProperty(t.type)&&Fc[t.type](t,e)}var Lc={Feature:function(t,e){Bc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,a=_c(e=(e*=gc)/2+dc),o=Tc(e),s=Uc*o,c=zc*a+s*_c(i),u=s*r*Tc(i);Wc.add(bc(u,c)),Yc=t,zc=a,Uc=o}var Jc=function(t){return Hc.reset(),$c(t,Vc),2*Hc};function Qc(t){return[bc(t[1],t[0]),Oc(t[2])]}function Kc(t){var e=t[0],n=t[1],r=_c(n);return[r*_c(e),r*Tc(e),Tc(n)]}function tu(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function eu(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function nu(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function ru(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function iu(t){var e=Ac(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var au,ou,su,cu,uu,lu,hu,fu,du,pu,yu=sc(),gu={point:vu,lineStart:bu,lineEnd:_u,polygonStart:function(){gu.point=xu,gu.lineStart=ku,gu.lineEnd=wu,yu.reset(),Vc.polygonStart()},polygonEnd:function(){Vc.polygonEnd(),gu.point=vu,gu.lineStart=bu,gu.lineEnd=_u,Wc<0?(au=-(su=180),ou=-(cu=90)):yu>1e-6?cu=90:yu<-1e-6&&(ou=-90),pu[0]=au,pu[1]=su},sphere:function(){au=-(su=180),ou=-(cu=90)}};function vu(t,e){du.push(pu=[au=t,su=t]),ecu&&(cu=e)}function mu(t,e){var n=Kc([t*gc,e*gc]);if(fu){var r=eu(fu,n),i=eu([r[1],-r[0],0],r);iu(i),i=Qc(i);var a,o=t-uu,s=o>0?1:-1,c=i[0]*yc*s,u=vc(o)>180;u^(s*uucu&&(cu=a):u^(s*uu<(c=(c+360)%360-180)&&ccu&&(cu=e)),u?tEu(au,su)&&(su=t):Eu(t,su)>Eu(au,su)&&(au=t):su>=au?(tsu&&(su=t)):t>uu?Eu(au,t)>Eu(au,su)&&(su=t):Eu(t,su)>Eu(au,su)&&(au=t)}else du.push(pu=[au=t,su=t]);ecu&&(cu=e),fu=n,uu=t}function bu(){gu.point=mu}function _u(){pu[0]=au,pu[1]=su,gu.point=vu,fu=null}function xu(t,e){if(fu){var n=t-uu;yu.add(vc(n)>180?n+(n>0?360:-360):n)}else lu=t,hu=e;Vc.point(t,e),mu(t,e)}function ku(){Vc.lineStart()}function wu(){xu(lu,hu),Vc.lineEnd(),vc(yu)>1e-6&&(au=-(su=180)),pu[0]=au,pu[1]=su,fu=null}function Eu(t,e){return(e-=t)<0?e+360:e}function Tu(t,e){return t[0]-e[0]}function Cu(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eEu(r[0],r[1])&&(r[1]=i[1]),Eu(i[0],r[1])>Eu(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(s=Eu(r[1],i[0]))>o&&(o=s,au=i[0],su=r[1])}return du=pu=null,au===1/0||ou===1/0?[[NaN,NaN],[NaN,NaN]]:[[au,ou],[su,cu]]},Wu={sphere:Nc,point:Hu,lineStart:Gu,lineEnd:Zu,polygonStart:function(){Wu.lineStart=Ju,Wu.lineEnd=Qu},polygonEnd:function(){Wu.lineStart=Gu,Wu.lineEnd=Zu}};function Hu(t,e){t*=gc;var n=_c(e*=gc);Vu(n*_c(t),n*Tc(t),Tc(e))}function Vu(t,e,n){++Au,Mu+=(t-Mu)/Au,Ou+=(e-Ou)/Au,Du+=(n-Du)/Au}function Gu(){Wu.point=qu}function qu(t,e){t*=gc;var n=_c(e*=gc);Yu=n*_c(t),zu=n*Tc(t),Uu=Tc(e),Wu.point=Xu,Vu(Yu,zu,Uu)}function Xu(t,e){t*=gc;var n=_c(e*=gc),r=n*_c(t),i=n*Tc(t),a=Tc(e),o=bc(Ac((o=zu*a-Uu*i)*o+(o=Uu*r-Yu*a)*o+(o=Yu*i-zu*r)*o),Yu*r+zu*i+Uu*a);Su+=o,Nu+=o*(Yu+(Yu=r)),Bu+=o*(zu+(zu=i)),Lu+=o*(Uu+(Uu=a)),Vu(Yu,zu,Uu)}function Zu(){Wu.point=Hu}function Ju(){Wu.point=Ku}function Qu(){tl(ju,Ru),Wu.point=Hu}function Ku(t,e){ju=t,Ru=e,t*=gc,e*=gc,Wu.point=tl;var n=_c(e);Yu=n*_c(t),zu=n*Tc(t),Uu=Tc(e),Vu(Yu,zu,Uu)}function tl(t,e){t*=gc;var n=_c(e*=gc),r=n*_c(t),i=n*Tc(t),a=Tc(e),o=zu*a-Uu*i,s=Uu*r-Yu*a,c=Yu*i-zu*r,u=Ac(o*o+s*s+c*c),l=Oc(u),h=u&&-l/u;Fu+=h*o,Pu+=h*s,Iu+=h*c,Su+=l,Nu+=l*(Yu+(Yu=r)),Bu+=l*(zu+(zu=i)),Lu+=l*(Uu+(Uu=a)),Vu(Yu,zu,Uu)}var el=function(t){Au=Su=Mu=Ou=Du=Nu=Bu=Lu=Fu=Pu=Iu=0,$c(t,Wu);var e=Fu,n=Pu,r=Iu,i=e*e+n*n+r*r;return i<1e-12&&(e=Nu,n=Bu,r=Lu,Su<1e-6&&(e=Mu,n=Ou,r=Du),(i=e*e+n*n+r*r)<1e-12)?[NaN,NaN]:[bc(n,e)*yc,Oc(r/Ac(i))*yc]},nl=function(t){return function(){return t}},rl=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function il(t,e){return[vc(t)>hc?t+Math.round(-t/pc)*pc:t,e]}function al(t,e,n){return(t%=pc)?e||n?rl(sl(t),cl(e,n)):sl(t):e||n?cl(e,n):il}function ol(t){return function(e,n){return[(e+=t)>hc?e-pc:e<-hc?e+pc:e,n]}}function sl(t){var e=ol(t);return e.invert=ol(-t),e}function cl(t,e){var n=_c(t),r=Tc(t),i=_c(e),a=Tc(e);function o(t,e){var o=_c(e),s=_c(t)*o,c=Tc(t)*o,u=Tc(e),l=u*n+s*r;return[bc(c*i-l*a,s*n-u*r),Oc(l*i+c*a)]}return o.invert=function(t,e){var o=_c(e),s=_c(t)*o,c=Tc(t)*o,u=Tc(e),l=u*i-c*a;return[bc(c*i+u*a,s*n+l*r),Oc(l*n-s*r)]},o}il.invert=il;var ul=function(t){function e(e){return(e=t(e[0]*gc,e[1]*gc))[0]*=yc,e[1]*=yc,e}return t=al(t[0]*gc,t[1]*gc,t.length>2?t[2]*gc:0),e.invert=function(e){return(e=t.invert(e[0]*gc,e[1]*gc))[0]*=yc,e[1]*=yc,e},e};function ll(t,e,n,r,i,a){if(n){var o=_c(e),s=Tc(e),c=r*n;null==i?(i=e+r*pc,a=e-c/2):(i=hl(o,i),a=hl(o,a),(r>0?ia)&&(i+=r*pc));for(var u,l=i;r>0?l>a:l1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},pl=function(t,e){return vc(t[0]-e[0])<1e-6&&vc(t[1]-e[1])<1e-6};function yl(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var gl=function(t,e,n,r,i){var a,o,s=[],c=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(pl(r,o)){for(i.lineStart(),a=0;a=0;--a)i.point((l=u[a])[0],l[1]);else r(f.x,f.p.x,-1,i);f=f.p}u=(f=f.o).z,d=!d}while(!f.v);i.lineEnd()}}};function vl(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,T=E*w,C=T>hc,A=y*x;if(ml.add(bc(A*E*Tc(T),g*k+A*_c(T))),o+=C?w+E*pc:w,C^d>=n^b>=n){var S=eu(Kc(f),Kc(m));iu(S);var M=eu(a,S);iu(M);var O=(C^w>=0?-1:1)*Oc(M[2]);(r>O||r===O&&(S[0]||S[1]))&&(s+=C^w>=0?1:-1)}}return(o<-1e-6||o<1e-6&&ml<-1e-6)^1&s},xl=function(t,e,n,r){return function(i){var a,o,s,c=e(i),u=dl(),l=e(u),h=!1,f={point:d,lineStart:y,lineEnd:g,polygonStart:function(){f.point=v,f.lineStart=m,f.lineEnd=b,o=[],a=[]},polygonEnd:function(){f.point=d,f.lineStart=y,f.lineEnd=g,o=I(o);var t=_l(a,r);o.length?(h||(i.polygonStart(),h=!0),gl(o,wl,t,n,i)):t&&(h||(i.polygonStart(),h=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){c.point(t,e)}function y(){f.point=p,c.lineStart()}function g(){f.point=d,c.lineEnd()}function v(t,e){s.push([t,e]),l.point(t,e)}function m(){l.lineStart(),s=[]}function b(){v(s[0][0],s[0][1]),l.lineEnd();var t,e,n,r,c=l.clean(),f=u.result(),d=f.length;if(s.pop(),a.push(s),s=null,d)if(1&c){if((e=(n=f[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),t=0;t1&&2&c&&f.push(f.pop().concat(f.shift())),o.push(f.filter(kl))}return f}};function kl(t){return t.length>1}function wl(t,e){return((t=t.x)[0]<0?t[1]-fc-1e-6:fc-t[1])-((e=e.x)[0]<0?e[1]-fc-1e-6:fc-e[1])}var El=xl((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?hc:-hc,c=vc(a-n);vc(c-hc)<1e-6?(t.point(n,r=(r+o)/2>0?fc:-fc),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&c>=hc&&(vc(n-i)<1e-6&&(n-=1e-6*i),vc(a-s)<1e-6&&(a-=1e-6*s),r=function(t,e,n,r){var i,a,o=Tc(t-n);return vc(o)>1e-6?mc((Tc(e)*(a=_c(r))*Tc(n)-Tc(r)*(i=_c(e))*Tc(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*fc,r.point(-hc,i),r.point(0,i),r.point(hc,i),r.point(hc,0),r.point(hc,-i),r.point(0,-i),r.point(-hc,-i),r.point(-hc,0),r.point(-hc,i);else if(vc(t[0]-e[0])>1e-6){var a=t[0]0,i=vc(e)>1e-6;function a(t,n){return _c(t)*_c(n)>e}function o(t,n,r){var i=[1,0,0],a=eu(Kc(t),Kc(n)),o=tu(a,a),s=a[0],c=o-s*s;if(!c)return!r&&t;var u=e*o/c,l=-e*s/c,h=eu(i,a),f=ru(i,u);nu(f,ru(a,l));var d=h,p=tu(f,d),y=tu(d,d),g=p*p-y*(tu(f,f)-1);if(!(g<0)){var v=Ac(g),m=ru(d,(-p-v)/y);if(nu(m,f),m=Qc(m),!r)return m;var b,_=t[0],x=n[0],k=t[1],w=n[1];x<_&&(b=_,_=x,x=b);var E=x-_,T=vc(E-hc)<1e-6;if(!T&&w0^m[1]<(vc(m[0]-_)<1e-6?k:w):k<=m[1]&&m[1]<=w:E>hc^(_<=m[0]&&m[0]<=x)){var C=ru(d,(-p+v)/y);return nu(C,f),[m,Qc(C)]}}}function s(e,n){var i=r?t:hc-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return xl(a,(function(t){var e,n,c,u,l;return{lineStart:function(){u=c=!1,l=1},point:function(h,f){var d,p=[h,f],y=a(h,f),g=r?y?0:s(h,f):y?s(h+(h<0?hc:-hc),f):0;if(!e&&(u=c=y)&&t.lineStart(),y!==c&&(!(d=o(e,p))||pl(e,d)||pl(p,d))&&(p[0]+=1e-6,p[1]+=1e-6,y=a(p[0],p[1])),y!==c)l=0,y?(t.lineStart(),d=o(p,e),t.point(d[0],d[1])):(d=o(e,p),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(i&&e&&r^y){var v;g&n||!(v=o(p,e,!0))||(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!y||e&&pl(e,p)||t.point(p[0],p[1]),e=p,c=y,n=g},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return l|(u&&c)<<1}}}),(function(e,r,i,a){ll(a,t,n,i,e,r)}),r?[0,-t]:[-hc,t-hc])};function Cl(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,u){var l=0,h=0;if(null==i||(l=o(i,s))!==(h=o(a,s))||c(i,a)<0^s>0)do{u.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+s+4)%4)!==h);else u.point(a[0],a[1])}function o(r,i){return vc(r[0]-t)<1e-6?i>0?0:3:vc(r[0]-n)<1e-6?i>0?2:1:vc(r[1]-e)<1e-6?i>0?1:0:i>0?3:2}function s(t,e){return c(t.x,e.x)}function c(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var c,u,l,h,f,d,p,y,g,v,m,b=o,_=dl(),x={point:k,lineStart:function(){x.point=w,u&&u.push(l=[]);v=!0,g=!1,p=y=NaN},lineEnd:function(){c&&(w(h,f),d&&g&&_.rejoin(),c.push(_.result()));x.point=k,g&&b.lineEnd()},polygonStart:function(){b=_,c=[],u=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=u.length;nr&&(f-a)*(r-o)>(d-o)*(t-a)&&++e:d<=r&&(f-a)*(r-o)<(d-o)*(t-a)&&--e;return e}(),n=m&&e,i=(c=I(c)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&gl(c,s,e,a,o),o.polygonEnd());b=o,c=u=l=null}};function k(t,e){i(t,e)&&b.point(t,e)}function w(a,o){var s=i(a,o);if(u&&l.push([a,o]),v)h=a,f=o,d=s,v=!1,s&&(b.lineStart(),b.point(a,o));else if(s&&g)b.point(a,o);else{var c=[p=Math.max(-1e9,Math.min(1e9,p)),y=Math.max(-1e9,Math.min(1e9,y))],_=[a=Math.max(-1e9,Math.min(1e9,a)),o=Math.max(-1e9,Math.min(1e9,o))];!function(t,e,n,r,i,a){var o,s=t[0],c=t[1],u=0,l=1,h=e[0]-s,f=e[1]-c;if(o=n-s,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>l)return;o>u&&(u=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>u&&(u=o)}else if(h>0){if(o0)){if(o/=f,f<0){if(o0){if(o>l)return;o>u&&(u=o)}if(o=a-c,f||!(o<0)){if(o/=f,f<0){if(o>l)return;o>u&&(u=o)}else if(f>0){if(o0&&(t[0]=s+u*h,t[1]=c+u*f),l<1&&(e[0]=s+l*h,e[1]=c+l*f),!0}}}}}(c,_,t,e,n,r)?s&&(b.lineStart(),b.point(a,o),m=!1):(g||(b.lineStart(),b.point(c[0],c[1])),b.point(_[0],_[1]),s||b.lineEnd(),m=!1)}p=a,y=o,g=s}return x}}var Al,Sl,Ml,Ol=function(){var t,e,n,r=0,i=0,a=960,o=500;return n={stream:function(n){return t&&e===n?t:t=Cl(r,i,a,o)(e=n)},extent:function(s){return arguments.length?(r=+s[0][0],i=+s[0][1],a=+s[1][0],o=+s[1][1],t=e=null,n):[[r,i],[a,o]]}}},Dl=sc(),Nl={sphere:Nc,point:Nc,lineStart:function(){Nl.point=Ll,Nl.lineEnd=Bl},lineEnd:Nc,polygonStart:Nc,polygonEnd:Nc};function Bl(){Nl.point=Nl.lineEnd=Nc}function Ll(t,e){Al=t*=gc,Sl=Tc(e*=gc),Ml=_c(e),Nl.point=Fl}function Fl(t,e){t*=gc;var n=Tc(e*=gc),r=_c(e),i=vc(t-Al),a=_c(i),o=r*Tc(i),s=Ml*n-Sl*r*a,c=Sl*n+Ml*r*a;Dl.add(bc(Ac(o*o+s*s),c)),Al=t,Sl=n,Ml=r}var Pl=function(t){return Dl.reset(),$c(t,Nl),+Dl},Il=[null,null],jl={type:"LineString",coordinates:Il},Rl=function(t,e){return Il[0]=t,Il[1]=e,Pl(jl)},Yl={Feature:function(t,e){return Ul(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Rl(t[a],t[a-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<1e-12*i)return!0;n=r}return!1}function Hl(t,e){return!!_l(t.map(Vl),Gl(e))}function Vl(t){return(t=t.map(Gl)).pop(),t}function Gl(t){return[t[0]*gc,t[1]*gc]}var ql=function(t,e){return(t&&Yl.hasOwnProperty(t.type)?Yl[t.type]:Ul)(t,e)};function Xl(t,e,n){var r=k(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function Zl(t,e,n){var r=k(t,e-1e-6,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function Jl(){var t,e,n,r,i,a,o,s,c,u,l,h,f=10,d=f,p=90,y=360,g=2.5;function v(){return{type:"MultiLineString",coordinates:m()}}function m(){return k(xc(r/p)*p,n,p).map(l).concat(k(xc(s/y)*y,o,y).map(h)).concat(k(xc(e/f)*f,t,f).filter((function(t){return vc(t%p)>1e-6})).map(c)).concat(k(xc(a/d)*d,i,d).filter((function(t){return vc(t%y)>1e-6})).map(u))}return v.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[l(r).concat(h(o).slice(1),l(n).reverse().slice(1),h(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),v.precision(g)):[[r,s],[n,o]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),v.precision(g)):[[e,a],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],y=+t[1],v):[p,y]},v.stepMinor=function(t){return arguments.length?(f=+t[0],d=+t[1],v):[f,d]},v.precision=function(f){return arguments.length?(g=+f,c=Xl(a,i,90),u=Zl(e,t,g),l=Xl(s,o,90),h=Zl(r,n,g),v):g},v.extentMajor([[-180,1e-6-90],[180,90-1e-6]]).extentMinor([[-180,-80-1e-6],[180,80+1e-6]])}function Ql(){return Jl()()}var Kl,th,eh,nh,rh=function(t,e){var n=t[0]*gc,r=t[1]*gc,i=e[0]*gc,a=e[1]*gc,o=_c(r),s=Tc(r),c=_c(a),u=Tc(a),l=o*_c(n),h=o*Tc(n),f=c*_c(i),d=c*Tc(i),p=2*Oc(Ac(Dc(a-r)+o*c*Dc(i-n))),y=Tc(p),g=p?function(t){var e=Tc(t*=p)/y,n=Tc(p-t)/y,r=n*l+e*f,i=n*h+e*d,a=n*s+e*u;return[bc(i,r)*yc,bc(a,Ac(r*r+i*i))*yc]}:function(){return[n*yc,r*yc]};return g.distance=p,g},ih=function(t){return t},ah=sc(),oh=sc(),sh={point:Nc,lineStart:Nc,lineEnd:Nc,polygonStart:function(){sh.lineStart=ch,sh.lineEnd=hh},polygonEnd:function(){sh.lineStart=sh.lineEnd=sh.point=Nc,ah.add(vc(oh)),oh.reset()},result:function(){var t=ah/2;return ah.reset(),t}};function ch(){sh.point=uh}function uh(t,e){sh.point=lh,Kl=eh=t,th=nh=e}function lh(t,e){oh.add(nh*t-eh*e),eh=t,nh=e}function hh(){lh(Kl,th)}var fh=sh,dh=1/0,ph=dh,yh=-dh,gh=yh;var vh,mh,bh,_h,xh={point:function(t,e){tyh&&(yh=t);egh&&(gh=e)},lineStart:Nc,lineEnd:Nc,polygonStart:Nc,polygonEnd:Nc,result:function(){var t=[[dh,ph],[yh,gh]];return yh=gh=-(ph=dh=1/0),t}},kh=0,wh=0,Eh=0,Th=0,Ch=0,Ah=0,Sh=0,Mh=0,Oh=0,Dh={point:Nh,lineStart:Bh,lineEnd:Ph,polygonStart:function(){Dh.lineStart=Ih,Dh.lineEnd=jh},polygonEnd:function(){Dh.point=Nh,Dh.lineStart=Bh,Dh.lineEnd=Ph},result:function(){var t=Oh?[Sh/Oh,Mh/Oh]:Ah?[Th/Ah,Ch/Ah]:Eh?[kh/Eh,wh/Eh]:[NaN,NaN];return kh=wh=Eh=Th=Ch=Ah=Sh=Mh=Oh=0,t}};function Nh(t,e){kh+=t,wh+=e,++Eh}function Bh(){Dh.point=Lh}function Lh(t,e){Dh.point=Fh,Nh(bh=t,_h=e)}function Fh(t,e){var n=t-bh,r=e-_h,i=Ac(n*n+r*r);Th+=i*(bh+t)/2,Ch+=i*(_h+e)/2,Ah+=i,Nh(bh=t,_h=e)}function Ph(){Dh.point=Nh}function Ih(){Dh.point=Rh}function jh(){Yh(vh,mh)}function Rh(t,e){Dh.point=Yh,Nh(vh=bh=t,mh=_h=e)}function Yh(t,e){var n=t-bh,r=e-_h,i=Ac(n*n+r*r);Th+=i*(bh+t)/2,Ch+=i*(_h+e)/2,Ah+=i,Sh+=(i=_h*t-bh*e)*(bh+t),Mh+=i*(_h+e),Oh+=3*i,Nh(bh=t,_h=e)}var zh=Dh;function Uh(t){this._context=t}Uh.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,pc)}},result:Nc};var $h,Wh,Hh,Vh,Gh,qh=sc(),Xh={point:Nc,lineStart:function(){Xh.point=Zh},lineEnd:function(){$h&&Jh(Wh,Hh),Xh.point=Nc},polygonStart:function(){$h=!0},polygonEnd:function(){$h=null},result:function(){var t=+qh;return qh.reset(),t}};function Zh(t,e){Xh.point=Jh,Wh=Vh=t,Hh=Gh=e}function Jh(t,e){Vh-=t,Gh-=e,qh.add(Ac(Vh*Vh+Gh*Gh)),Vh=t,Gh=e}var Qh=Xh;function Kh(){this._string=[]}function tf(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Kh.prototype={_radius:4.5,_circle:tf(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=tf(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var ef=function(t,e){var n,r,i=4.5;function a(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),$c(t,n(r))),r.result()}return a.area=function(t){return $c(t,n(fh)),fh.result()},a.measure=function(t){return $c(t,n(Qh)),Qh.result()},a.bounds=function(t){return $c(t,n(xh)),xh.result()},a.centroid=function(t){return $c(t,n(zh)),zh.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,ih):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new Kh):new Uh(e=t),"function"!=typeof i&&r.pointRadius(i),a):e},a.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),a):i},a.projection(t).context(e)},nf=function(t){return{stream:rf(t)}};function rf(t){return function(e){var n=new af;for(var r in t)n[r]=t[r];return n.stream=e,n}}function af(){}function of(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),$c(n,t.stream(xh)),e(xh.result()),null!=r&&t.clipExtent(r),t}function sf(t,e,n){return of(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}function cf(t,e,n){return sf(t,[[0,0],e],n)}function uf(t,e,n){return of(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])}),n)}function lf(t,e,n){return of(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])}),n)}af.prototype={constructor:af,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var hf=_c(30*gc),ff=function(t,e){return+e?function(t,e){function n(r,i,a,o,s,c,u,l,h,f,d,p,y,g){var v=u-r,m=l-i,b=v*v+m*m;if(b>4*e&&y--){var _=o+f,x=s+d,k=c+p,w=Ac(_*_+x*x+k*k),E=Oc(k/=w),T=vc(vc(k)-1)<1e-6||vc(a-h)<1e-6?(a+h)/2:bc(x,_),C=t(T,E),A=C[0],S=C[1],M=A-r,O=S-i,D=m*M-v*O;(D*D/b>e||vc((v*M+m*O)/b-.5)>.3||o*f+s*d+c*p2?t[2]%360*gc:0,A()):[g*yc,v*yc,m*yc]},T.angle=function(t){return arguments.length?(b=t%360*gc,A()):b*yc},T.precision=function(t){return arguments.length?(o=ff(s,E=t*t),S()):Ac(E)},T.fitExtent=function(t,e){return sf(T,t,e)},T.fitSize=function(t,e){return cf(T,t,e)},T.fitWidth=function(t,e){return uf(T,t,e)},T.fitHeight=function(t,e){return lf(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&C,A()}}function mf(t){var e=0,n=hc/3,r=vf(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*gc,n=t[1]*gc):[e*yc,n*yc]},i}function bf(t,e){var n=Tc(t),r=(n+Tc(e))/2;if(vc(r)<1e-6)return function(t){var e=_c(t);function n(t,n){return[t*e,Tc(n)/e]}return n.invert=function(t,n){return[t/e,Oc(n*e)]},n}(t);var i=1+n*(2*r-n),a=Ac(i)/r;function o(t,e){var n=Ac(i-2*r*Tc(e))/r;return[n*Tc(t*=r),a-n*_c(t)]}return o.invert=function(t,e){var n=a-e;return[bc(t,vc(n))/r*Cc(n),Oc((i-(t*t+n*n)*r*r)/(2*r))]},o}var _f=function(){return mf(bf).scale(155.424).center([0,33.6442])},xf=function(){return _f().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};var kf=function(){var t,e,n,r,i,a,o=xf(),s=_f().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=_f().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){a=[t,e]}};function l(t){var e=t[0],o=t[1];return a=null,n.point(e,o),a||(r.point(e,o),a)||(i.point(e,o),a)}function h(){return t=e=null,l}return l.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:o).invert(t)},l.stream=function(n){return t&&e===n?t:(r=[o.stream(e=n),s.stream(n),c.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n0?e<1e-6-fc&&(e=1e-6-fc):e>fc-1e-6&&(e=fc-1e-6);var n=i/Ec(Nf(e),r);return[n*Tc(r*t),i-n*_c(r*t)]}return a.invert=function(t,e){var n=i-e,a=Cc(r)*Ac(t*t+n*n);return[bc(t,vc(n))/r*Cc(n),2*mc(Ec(i/a,1/r))-fc]},a}var Lf=function(){return mf(Bf).scale(109.5).parallels([30,30])};function Ff(t,e){return[t,e]}Ff.invert=Ff;var Pf=function(){return gf(Ff).scale(152.63)};function If(t,e){var n=_c(t),r=t===e?Tc(t):(n-_c(e))/(e-t),i=n/r+t;if(vc(r)<1e-6)return Ff;function a(t,e){var n=i-e,a=r*t;return[n*Tc(a),i-n*_c(a)]}return a.invert=function(t,e){var n=i-e;return[bc(t,vc(n))/r*Cc(n),i-Cc(r)*Ac(t*t+n*n)]},a}var jf=function(){return mf(If).scale(131.154).center([0,13.9389])},Rf=1.340264,Yf=-.081106,zf=893e-6,Uf=.003796,$f=Ac(3)/2;function Wf(t,e){var n=Oc($f*Tc(e)),r=n*n,i=r*r*r;return[t*_c(n)/($f*(Rf+3*Yf*r+i*(7*zf+9*Uf*r))),n*(Rf+Yf*r+i*(zf+Uf*r))]}Wf.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(Rf+Yf*i+a*(zf+Uf*i))-e)/(Rf+3*Yf*i+a*(7*zf+9*Uf*i)))*r)*i*i,!(vc(n)<1e-12));++o);return[$f*t*(Rf+3*Yf*i+a*(7*zf+9*Uf*i))/_c(r),Oc(Tc(r)/$f)]};var Hf=function(){return gf(Wf).scale(177.158)};function Vf(t,e){var n=_c(e),r=_c(t)*n;return[n*Tc(t)/r,Tc(e)/r]}Vf.invert=Ef(mc);var Gf=function(){return gf(Vf).scale(144.049).clipAngle(60)};function qf(t,e,n,r){return 1===t&&1===e&&0===n&&0===r?ih:rf({point:function(i,a){this.stream.point(i*t+n,a*e+r)}})}var Xf=function(){var t,e,n,r,i,a,o=1,s=0,c=0,u=1,l=1,h=ih,f=null,d=ih;function p(){return r=i=null,a}return a={stream:function(t){return r&&i===t?r:r=h(d(i=t))},postclip:function(r){return arguments.length?(d=r,f=t=e=n=null,p()):d},clipExtent:function(r){return arguments.length?(d=null==r?(f=t=e=n=null,ih):Cl(f=+r[0][0],t=+r[0][1],e=+r[1][0],n=+r[1][1]),p()):null==f?null:[[f,t],[e,n]]},scale:function(t){return arguments.length?(h=qf((o=+t)*u,o*l,s,c),p()):o},translate:function(t){return arguments.length?(h=qf(o*u,o*l,s=+t[0],c=+t[1]),p()):[s,c]},reflectX:function(t){return arguments.length?(h=qf(o*(u=t?-1:1),o*l,s,c),p()):u<0},reflectY:function(t){return arguments.length?(h=qf(o*u,o*(l=t?-1:1),s,c),p()):l<0},fitExtent:function(t,e){return sf(a,t,e)},fitSize:function(t,e){return cf(a,t,e)},fitWidth:function(t,e){return uf(a,t,e)},fitHeight:function(t,e){return lf(a,t,e)}}};function Zf(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}Zf.invert=function(t,e){var n,r=e,i=25;do{var a=r*r,o=a*a;r-=n=(r*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(vc(n)>1e-6&&--i>0);return[t/(.8707+(a=r*r)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),r]};var Jf=function(){return gf(Zf).scale(175.295)};function Qf(t,e){return[_c(e)*Tc(t),Tc(e)]}Qf.invert=Ef(Oc);var Kf=function(){return gf(Qf).scale(249.5).clipAngle(90+1e-6)};function td(t,e){var n=_c(e),r=1+_c(t)*n;return[n*Tc(t)/r,Tc(e)/r]}td.invert=Ef((function(t){return 2*mc(t)}));var ed=function(){return gf(td).scale(250).clipAngle(142)};function nd(t,e){return[wc(Sc((fc+e)/2)),-t]}nd.invert=function(t,e){return[-e,2*mc(kc(t))-fc]};var rd=function(){var t=Df(nd),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};function id(t,e){return t.parent===e.parent?1:2}function ad(t,e){return t+e.x}function od(t,e){return Math.max(t,e.y)}var sd=function(){var t=id,e=1,n=1,r=!1;function i(i){var a,o=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(ad,0)/t.length}(n),e.y=function(t){return 1+t.reduce(od,0)}(n)):(e.x=a?o+=t(e,a):0,e.y=0,a=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),u=s.x-t(s,c)/2,l=c.x+t(c,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-u)/(l-u)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i};function cd(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function ud(t,e){var n,r,i,a,o,s=new dd(t),c=+t.value&&(s.value=t.value),u=[s];for(null==e&&(e=ld);n=u.pop();)if(c&&(n.value=+n.data.value),(i=e(n.data))&&(o=i.length))for(n.children=new Array(o),a=o-1;a>=0;--a)u.push(r=n.children[a]=new dd(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(fd)}function ld(t){return t.children}function hd(t){t.data=t.data.data}function fd(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function dd(t){this.data=t,this.depth=this.height=0,this.parent=null}dd.prototype=ud.prototype={constructor:dd,count:function(){return this.eachAfter(cd)},each:function(t){var e,n,r,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),n=a.children)for(r=0,i=n.length;r=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return ud(this).eachBefore(hd)}};var pd=Array.prototype.slice;var yd=function(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(pd.call(t))).length,a=[];r0&&n*n>r*r+i*i}function bd(t,e){for(var n=0;n(o*=o)?(r=(u+o-i)/(2*u),a=Math.sqrt(Math.max(0,o/u-r*r)),n.x=t.x-r*s-a*c,n.y=t.y-r*c+a*s):(r=(u+i-o)/(2*u),a=Math.sqrt(Math.max(0,i/u-r*r)),n.x=e.x+r*s-a*c,n.y=e.y+r*c+a*s)):(n.x=e.x+n.r,n.y=e.y)}function Ed(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Td(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,a=(e.y*n.r+n.y*e.r)/r;return i*i+a*a}function Cd(t){this._=t,this.next=null,this.previous=null}function Ad(t){if(!(i=t.length))return 0;var e,n,r,i,a,o,s,c,u,l,h;if((e=t[0]).x=0,e.y=0,!(i>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;wd(n,e,r=t[2]),e=new Cd(e),n=new Cd(n),r=new Cd(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(s=3;s0)throw new Error("cycle");return a}return n.id=function(e){return arguments.length?(t=Od(e),n):t},n.parentId=function(t){return arguments.length?(e=Od(t),n):e},n};function Vd(t,e){return t.parent===e.parent?1:2}function Gd(t){var e=t.children;return e?e[0]:t.t}function qd(t){var e=t.children;return e?e[e.length-1]:t.t}function Xd(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Zd(t,e,n){return t.a.parent===e.parent?t.a:n}function Jd(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}Jd.prototype=Object.create(dd.prototype);var Qd=function(){var t=Vd,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,a,o=new Jd(t,0),s=[o];e=s.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;i>=0;--i)s.push(n=e.children[i]=new Jd(r[i],i)),n.parent=e;return(o.parent=new Jd(null,0)).children=[o],o}(i);if(c.eachAfter(a),c.parent.m=-c.z,c.eachBefore(o),r)i.eachBefore(s);else{var u=i,l=i,h=i;i.eachBefore((function(t){t.xl.x&&(l=t),t.depth>h.depth&&(h=t)}));var f=u===l?1:t(u,l)/2,d=f-u.x,p=e/(l.x+f+d),y=n/(h.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*y}))}return i}function a(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,a=i.length;--a>=0;)(e=i[a]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var a=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,a=e,o=e,s=n,c=a.parent.children[0],u=a.m,l=o.m,h=s.m,f=c.m;s=qd(s),a=Gd(a),s&&a;)c=Gd(c),(o=qd(o)).a=e,(i=s.z+h-a.z-u+t(s._,a._))>0&&(Xd(Zd(s,e,r),e,i),u+=i,l+=i),h+=s.m,u+=a.m,f+=c.m,l+=o.m;s&&!qd(o)&&(o.t=s,o.m+=h-l),a&&!Gd(c)&&(c.t=a,c.m+=u-f,r=e)}return r}(e,i,e.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},Kd=function(t,e,n,r,i){for(var a,o=t.children,s=-1,c=o.length,u=t.value&&(i-n)/t.value;++sf&&(f=s),g=l*l*y,(d=Math.max(f/g,g/h))>p){l-=s;break}p=d}v.push(o={value:l,dice:c1?e:1)},n}(tp),rp=function(){var t=np,e=!1,n=1,r=1,i=[0],a=Dd,o=Dd,s=Dd,c=Dd,u=Dd;function l(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(h),i=[0],e&&t.eachBefore(jd),t}function h(e){var n=i[e.depth],r=e.x0+n,l=e.y0+n,h=e.x1-n,f=e.y1-n;h=n-1){var l=s[e];return l.x0=i,l.y0=a,l.x1=o,void(l.y1=c)}var h=u[e],f=r/2+h,d=e+1,p=n-1;for(;d>>1;u[y]c-a){var m=(i*v+o*g)/r;t(e,d,g,i,a,m,c),t(d,n,v,m,a,o,c)}else{var b=(a*v+c*g)/r;t(e,d,g,i,a,o,b),t(d,n,v,i,b,o,c)}}(0,c,t.value,e,n,r,i)},ap=function(t,e,n,r,i){(1&t.depth?Kd:Rd)(t,e,n,r,i)},op=function t(e){function n(t,n,r,i,a){if((o=t._squarify)&&o.ratio===e)for(var o,s,c,u,l,h=-1,f=o.length,d=t.value;++h1?e:1)},n}(tp),sp=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},cp=function(t,e){var n=un(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},up=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}},lp=Math.SQRT2;function hp(t){return((t=Math.exp(t))+1/t)/2}var fp=function(t,e){var n,r,i=t[0],a=t[1],o=t[2],s=e[0],c=e[1],u=e[2],l=s-i,h=c-a,f=l*l+h*h;if(f<1e-12)r=Math.log(u/o)/lp,n=function(t){return[i+t*l,a+t*h,o*Math.exp(lp*t*r)]};else{var d=Math.sqrt(f),p=(u*u-o*o+4*f)/(2*o*2*d),y=(u*u-o*o-4*f)/(2*u*2*d),g=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(y*y+1)-y);r=(v-g)/lp,n=function(t){var e,n=t*r,s=hp(g),c=o/(2*d)*(s*(e=lp*n+g,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+c*l,a+c*h,o*s/hp(lp*n+g)]}}return n.duration=1e3*r,n};function dp(t){return function(e,n){var r=t((e=tn(e)).h,(n=tn(n)).h),i=hn(e.s,n.s),a=hn(e.l,n.l),o=hn(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var pp=dp(un),yp=dp(hn);function gp(t,e){var n=hn((t=pa(t)).l,(e=pa(e)).l),r=hn(t.a,e.a),i=hn(t.b,e.b),a=hn(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=a(e),t+""}}function vp(t){return function(e,n){var r=t((e=ka(e)).h,(n=ka(n)).h),i=hn(e.c,n.c),a=hn(e.l,n.l),o=hn(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=a(t),e.opacity=o(t),e+""}}}var mp=vp(un),bp=vp(hn);function _p(t){return function e(n){function r(e,r){var i=t((e=Oa(e)).h,(r=Oa(r)).h),a=hn(e.s,r.s),o=hn(e.l,r.l),s=hn(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}var xp=_p(un),kp=_p(hn);function wp(t,e){for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n1&&(e=t[a[o-2]],n=t[a[o-1]],r=t[s],(n[0]-e[0])*(r[1]-e[1])-(n[1]-e[1])*(r[0]-e[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}var Mp=function(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e=0;--e)u.push(t[r[a[e]][2]]);for(e=+s;es!=u>s&&o<(c-n)*(s-r)/(u-r)+n&&(l=!l),c=n,u=r;return l},Dp=function(t){for(var e,n,r=-1,i=t.length,a=t[i-1],o=a[0],s=a[1],c=0;++r1);return t+n*a*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(Np),Fp=function t(e){function n(){var t=Lp.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(Np),Pp=function t(e){function n(t){return function(){for(var n=0,r=0;rr&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function ty(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?ey:ty,i=a=null,h}function h(e){return isNaN(e=+e)?n:(i||(i=r(o.map(t),s,c)))(t(u(e)))}return h.invert=function(n){return u(e((a||(a=r(s,o.map(t),xn)))(n)))},h.domain=function(t){return arguments.length?(o=Up.call(t,Xp),u===Jp||(u=Kp(o)),l()):o.slice()},h.range=function(t){return arguments.length?(s=$p.call(t),l()):s.slice()},h.rangeRound=function(t){return s=$p.call(t),c=up,l()},h.clamp=function(t){return arguments.length?(u=t?Kp(o):Jp,h):u!==Jp},h.interpolate=function(t){return arguments.length?(c=t,l()):c},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,r){return t=n,e=r,l()}}function iy(t,e){return ry()(t,e)}var ay=function(t,e,n,r){var i,a=S(t,e,n);switch((r=Hs(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=ac(a,o))||(r.precision=i),Zs(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=oc(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=ic(a))||(r.precision=i-2*("%"===r.type))}return Xs(r)};function oy(t){var e=t.domain;return t.ticks=function(t){var n=e();return C(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return ay(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),a=0,o=i.length-1,s=i[a],c=i[o];return c0?r=A(s=Math.floor(s/r)*r,c=Math.ceil(c/r)*r,n):r<0&&(r=A(s=Math.ceil(s*r)/r,c=Math.floor(c*r)/r,n)),r>0?(i[a]=Math.floor(s/r)*r,i[o]=Math.ceil(c/r)*r,e(i)):r<0&&(i[a]=Math.ceil(s*r)/r,i[o]=Math.floor(c*r)/r,e(i)),t},t}function sy(){var t=iy(Jp,Jp);return t.copy=function(){return ny(t,sy())},Rp.apply(t,arguments),oy(t)}function cy(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Up.call(e,Xp),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return cy(t).unknown(e)},t=arguments.length?Up.call(t,Xp):[0,1],oy(n)}var uy=function(t,e){var n,r=0,i=(t=t.slice()).length-1,a=t[r],o=t[i];return o0){for(;fc)break;y.push(h)}}else for(;f=1;--l)if(!((h=u*l)c)break;y.push(h)}}else y=C(f,d,Math.min(d-f,p)).map(n);return r?y.reverse():y},r.tickFormat=function(t,i){if(null==i&&(i=10===a?".0e":","),"function"!=typeof i&&(i=Xs(i)),t===1/0)return i;null==t&&(t=10);var o=Math.max(1,a*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*a0?i[r-1]:e[0],r=r?[i[r-1],n]:[i[o-1],i[o]]},o.unknown=function(e){return arguments.length?(t=e,o):o},o.thresholds=function(){return i.slice()},o.copy=function(){return My().domain([e,n]).range(a).unknown(t)},Rp.apply(oy(o),arguments)}function Oy(){var t,e=[.5],n=[0,1],r=1;function i(i){return i<=i?n[c(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=$p.call(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=$p.call(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Oy().domain(e).range(n).unknown(t)},Rp.apply(i,arguments)}var Dy=new Date,Ny=new Date;function By(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e0))return s;do{s.push(o=new Date(+n)),e(n,a),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Dy.setTime(+e),Ny.setTime(+r),t(Dy),t(Ny),Math.floor(n(Dy,Ny))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Ly=By((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Ly.every=function(t){return isFinite(t=Math.floor(t))&&t>0?By((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Fy=Ly,Py=Ly.range,Iy=By((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),jy=Iy,Ry=Iy.range;function Yy(t){return By((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var zy=Yy(0),Uy=Yy(1),$y=Yy(2),Wy=Yy(3),Hy=Yy(4),Vy=Yy(5),Gy=Yy(6),qy=zy.range,Xy=Uy.range,Zy=$y.range,Jy=Wy.range,Qy=Hy.range,Ky=Vy.range,tg=Gy.range,eg=By((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),ng=eg,rg=eg.range,ig=By((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),ag=ig,og=ig.range,sg=By((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),cg=sg,ug=sg.range,lg=By((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),hg=lg,fg=lg.range,dg=By((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));dg.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?By((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):dg:null};var pg=dg,yg=dg.range;function gg(t){return By((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var vg=gg(0),mg=gg(1),bg=gg(2),_g=gg(3),xg=gg(4),kg=gg(5),wg=gg(6),Eg=vg.range,Tg=mg.range,Cg=bg.range,Ag=_g.range,Sg=xg.range,Mg=kg.range,Og=wg.range,Dg=By((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1})),Ng=Dg,Bg=Dg.range,Lg=By((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Lg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?By((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Fg=Lg,Pg=Lg.range;function Ig(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function jg(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Rg(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function Yg(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,s=t.months,c=t.shortMonths,u=Qg(i),l=Kg(i),h=Qg(a),f=Kg(a),d=Qg(o),p=Kg(o),y=Qg(s),g=Kg(s),v=Qg(c),m=Kg(c),b={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:_v,e:_v,f:Tv,H:xv,I:kv,j:wv,L:Ev,m:Cv,M:Av,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:em,s:nm,S:Sv,u:Mv,U:Ov,V:Dv,w:Nv,W:Bv,x:null,X:null,y:Lv,Y:Fv,Z:Pv,"%":tm},_={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Iv,e:Iv,f:Uv,H:jv,I:Rv,j:Yv,L:zv,m:$v,M:Wv,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:em,s:nm,S:Hv,u:Vv,U:Gv,V:qv,w:Xv,W:Zv,x:null,X:null,y:Jv,Y:Qv,Z:Kv,"%":tm},x={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=m[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return E(t,e,n,r)},d:lv,e:lv,f:gv,H:fv,I:fv,j:hv,L:yv,m:uv,M:dv,p:function(t,e,n){var r=u.exec(e.slice(n));return r?(t.p=l[r[0].toLowerCase()],n+r[0].length):-1},q:cv,Q:mv,s:bv,S:pv,u:ev,U:nv,V:rv,w:tv,W:iv,x:function(t,e,r){return E(t,n,e,r)},X:function(t,e,n){return E(t,r,e,n)},y:ov,Y:av,Z:sv,"%":vv};function k(t,e){return function(n){var r,i,a,o=[],s=-1,c=0,u=t.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=jg(Rg(a.y,0,1))).getUTCDay(),r=i>4||0===i?mg.ceil(r):mg(r),r=Ng.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=Ig(Rg(a.y,0,1))).getDay(),r=i>4||0===i?Uy.ceil(r):Uy(r),r=ng.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?jg(Rg(a.y,0,1)).getUTCDay():Ig(Rg(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,jg(a)):Ig(a)}}function E(t,e,n,r){for(var i,a,o=0,s=e.length,c=n.length;o=c)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=x[i in Vg?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return(b.x=k(n,b),b.X=k(r,b),b.c=k(e,b),_.x=k(n,_),_.X=k(r,_),_.c=k(e,_),{format:function(t){var e=k(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=w(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=k(t+="",_);return e.toString=function(){return t},e},utcParse:function(t){var e=w(t+="",!0);return e.toString=function(){return t},e}})}var zg,Ug,$g,Wg,Hg,Vg={"-":"",_:" ",0:"0"},Gg=/^\s*\d+/,qg=/^%/,Xg=/[\\^$*+?|[\]().{}]/g;function Zg(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function sv(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function cv(t,e,n){var r=Gg.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function uv(t,e,n){var r=Gg.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function lv(t,e,n){var r=Gg.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function hv(t,e,n){var r=Gg.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function fv(t,e,n){var r=Gg.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function dv(t,e,n){var r=Gg.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function pv(t,e,n){var r=Gg.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function yv(t,e,n){var r=Gg.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function gv(t,e,n){var r=Gg.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function vv(t,e,n){var r=qg.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function mv(t,e,n){var r=Gg.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function bv(t,e,n){var r=Gg.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function _v(t,e){return Zg(t.getDate(),e,2)}function xv(t,e){return Zg(t.getHours(),e,2)}function kv(t,e){return Zg(t.getHours()%12||12,e,2)}function wv(t,e){return Zg(1+ng.count(Fy(t),t),e,3)}function Ev(t,e){return Zg(t.getMilliseconds(),e,3)}function Tv(t,e){return Ev(t,e)+"000"}function Cv(t,e){return Zg(t.getMonth()+1,e,2)}function Av(t,e){return Zg(t.getMinutes(),e,2)}function Sv(t,e){return Zg(t.getSeconds(),e,2)}function Mv(t){var e=t.getDay();return 0===e?7:e}function Ov(t,e){return Zg(zy.count(Fy(t)-1,t),e,2)}function Dv(t,e){var n=t.getDay();return t=n>=4||0===n?Hy(t):Hy.ceil(t),Zg(Hy.count(Fy(t),t)+(4===Fy(t).getDay()),e,2)}function Nv(t){return t.getDay()}function Bv(t,e){return Zg(Uy.count(Fy(t)-1,t),e,2)}function Lv(t,e){return Zg(t.getFullYear()%100,e,2)}function Fv(t,e){return Zg(t.getFullYear()%1e4,e,4)}function Pv(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Zg(e/60|0,"0",2)+Zg(e%60,"0",2)}function Iv(t,e){return Zg(t.getUTCDate(),e,2)}function jv(t,e){return Zg(t.getUTCHours(),e,2)}function Rv(t,e){return Zg(t.getUTCHours()%12||12,e,2)}function Yv(t,e){return Zg(1+Ng.count(Fg(t),t),e,3)}function zv(t,e){return Zg(t.getUTCMilliseconds(),e,3)}function Uv(t,e){return zv(t,e)+"000"}function $v(t,e){return Zg(t.getUTCMonth()+1,e,2)}function Wv(t,e){return Zg(t.getUTCMinutes(),e,2)}function Hv(t,e){return Zg(t.getUTCSeconds(),e,2)}function Vv(t){var e=t.getUTCDay();return 0===e?7:e}function Gv(t,e){return Zg(vg.count(Fg(t)-1,t),e,2)}function qv(t,e){var n=t.getUTCDay();return t=n>=4||0===n?xg(t):xg.ceil(t),Zg(xg.count(Fg(t),t)+(4===Fg(t).getUTCDay()),e,2)}function Xv(t){return t.getUTCDay()}function Zv(t,e){return Zg(mg.count(Fg(t)-1,t),e,2)}function Jv(t,e){return Zg(t.getUTCFullYear()%100,e,2)}function Qv(t,e){return Zg(t.getUTCFullYear()%1e4,e,4)}function Kv(){return"+0000"}function tm(){return"%"}function em(t){return+t}function nm(t){return Math.floor(+t/1e3)}function rm(t){return zg=Yg(t),Ug=zg.format,$g=zg.parse,Wg=zg.utcFormat,Hg=zg.utcParse,zg}rm({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function im(t){return new Date(t)}function am(t){return t instanceof Date?+t:+new Date(+t)}function om(t,e,n,r,a,o,s,c,u){var l=iy(Jp,Jp),h=l.invert,f=l.domain,d=u(".%L"),p=u(":%S"),y=u("%I:%M"),g=u("%I %p"),v=u("%a %d"),m=u("%b %d"),b=u("%B"),_=u("%Y"),x=[[s,1,1e3],[s,5,5e3],[s,15,15e3],[s,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[a,1,36e5],[a,3,108e5],[a,6,216e5],[a,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function k(i){return(s(i)1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return qb.h=360*t-100,qb.s=1.5-1.5*e,qb.l=.8-.9*e,qb+""},Zb=Ge(),Jb=Math.PI/3,Qb=2*Math.PI/3,Kb=function(t){var e;return t=(.5-t)*Math.PI,Zb.r=255*(e=Math.sin(t))*e,Zb.g=255*(e=Math.sin(t+Jb))*e,Zb.b=255*(e=Math.sin(t+Qb))*e,Zb+""},t_=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"};function e_(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var n_=e_(Nm("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),r_=e_(Nm("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),i_=e_(Nm("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),a_=e_(Nm("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),o_=function(t){return ke(ne(t).call(document.documentElement))},s_=0;function c_(){return new u_}function u_(){this._="@"+(++s_).toString(36)}u_.prototype=c_.prototype={constructor:u_,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var l_=function(t){return"string"==typeof t?new be([document.querySelectorAll(t)],[document.documentElement]):new be([null==t?[]:t],me)},h_=function(t,e){null==e&&(e=Mn().touches);for(var n=0,r=e?e.length:0,i=new Array(r);n1?0:t<-1?__:Math.acos(t)}function E_(t){return t>=1?x_:t<=-1?-x_:Math.asin(t)}function T_(t){return t.innerRadius}function C_(t){return t.outerRadius}function A_(t){return t.startAngle}function S_(t){return t.endAngle}function M_(t){return t&&t.padAngle}function O_(t,e,n,r,i,a,o,s){var c=n-t,u=r-e,l=o-i,h=s-a,f=h*c-l*u;if(!(f*f<1e-12))return[t+(f=(l*(e-a)-h*(t-i))/f)*c,e+f*u]}function D_(t,e,n,r,i,a,o){var s=t-n,c=e-r,u=(o?a:-a)/b_(s*s+c*c),l=u*c,h=-u*s,f=t+l,d=e+h,p=n+l,y=r+h,g=(f+p)/2,v=(d+y)/2,m=p-f,b=y-d,_=m*m+b*b,x=i-a,k=f*y-p*d,w=(b<0?-1:1)*b_(g_(0,x*x*_-k*k)),E=(k*b-m*w)/_,T=(-k*m-b*w)/_,C=(k*b+m*w)/_,A=(-k*m+b*w)/_,S=E-g,M=T-v,O=C-g,D=A-v;return S*S+M*M>O*O+D*D&&(E=C,T=A),{cx:E,cy:T,x01:-l,y01:-h,x11:E*(i/x-1),y11:T*(i/x-1)}}var N_=function(){var t=T_,e=C_,n=f_(0),r=null,i=A_,a=S_,o=M_,s=null;function c(){var c,u,l=+t.apply(this,arguments),h=+e.apply(this,arguments),f=i.apply(this,arguments)-x_,d=a.apply(this,arguments)-x_,p=d_(d-f),y=d>f;if(s||(s=c=Ui()),h1e-12)if(p>k_-1e-12)s.moveTo(h*y_(f),h*m_(f)),s.arc(0,0,h,f,d,!y),l>1e-12&&(s.moveTo(l*y_(d),l*m_(d)),s.arc(0,0,l,d,f,y));else{var g,v,m=f,b=d,_=f,x=d,k=p,w=p,E=o.apply(this,arguments)/2,T=E>1e-12&&(r?+r.apply(this,arguments):b_(l*l+h*h)),C=v_(d_(h-l)/2,+n.apply(this,arguments)),A=C,S=C;if(T>1e-12){var M=E_(T/l*m_(E)),O=E_(T/h*m_(E));(k-=2*M)>1e-12?(_+=M*=y?1:-1,x-=M):(k=0,_=x=(f+d)/2),(w-=2*O)>1e-12?(m+=O*=y?1:-1,b-=O):(w=0,m=b=(f+d)/2)}var D=h*y_(m),N=h*m_(m),B=l*y_(x),L=l*m_(x);if(C>1e-12){var F,P=h*y_(b),I=h*m_(b),j=l*y_(_),R=l*m_(_);if(p<__&&(F=O_(D,N,j,R,P,I,B,L))){var Y=D-F[0],z=N-F[1],U=P-F[0],$=I-F[1],W=1/m_(w_((Y*U+z*$)/(b_(Y*Y+z*z)*b_(U*U+$*$)))/2),H=b_(F[0]*F[0]+F[1]*F[1]);A=v_(C,(l-H)/(W-1)),S=v_(C,(h-H)/(W+1))}}w>1e-12?S>1e-12?(g=D_(j,R,D,N,h,S,y),v=D_(P,I,B,L,h,S,y),s.moveTo(g.cx+g.x01,g.cy+g.y01),S1e-12&&k>1e-12?A>1e-12?(g=D_(B,L,P,I,l,-A,y),v=D_(D,N,j,R,l,-A,y),s.lineTo(g.cx+g.x01,g.cy+g.y01),A=l;--h)s.point(g[h],v[h]);s.lineEnd(),s.areaEnd()}y&&(g[u]=+t(f,u,c),v[u]=+n(f,u,c),s.point(e?+e(f,u,c):g[u],r?+r(f,u,c):v[u]))}if(d)return s=null,d+""||null}function u(){return I_().defined(i).curve(o).context(a)}return c.x=function(n){return arguments.length?(t="function"==typeof n?n:f_(+n),e=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:f_(+e),c):t},c.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:f_(+t),c):e},c.y=function(t){return arguments.length?(n="function"==typeof t?t:f_(+t),r=null,c):n},c.y0=function(t){return arguments.length?(n="function"==typeof t?t:f_(+t),c):n},c.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:f_(+t),c):r},c.lineX0=c.lineY0=function(){return u().x(t).y(n)},c.lineY1=function(){return u().x(t).y(r)},c.lineX1=function(){return u().x(e).y(n)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:f_(!!t),c):i},c.curve=function(t){return arguments.length?(o=t,null!=a&&(s=o(a)),c):o},c.context=function(t){return arguments.length?(null==t?a=s=null:s=o(a=t),c):a},c},R_=function(t,e){return et?1:e>=t?0:NaN},Y_=function(t){return t},z_=function(){var t=Y_,e=R_,n=null,r=f_(0),i=f_(k_),a=f_(0);function o(o){var s,c,u,l,h,f=o.length,d=0,p=new Array(f),y=new Array(f),g=+r.apply(this,arguments),v=Math.min(k_,Math.max(-k_,i.apply(this,arguments)-g)),m=Math.min(Math.abs(v)/f,a.apply(this,arguments)),b=m*(v<0?-1:1);for(s=0;s0&&(d+=h);for(null!=e?p.sort((function(t,n){return e(y[t],y[n])})):null!=n&&p.sort((function(t,e){return n(o[t],o[e])})),s=0,u=d?(v-f*b)/d:0;s0?h*u:0)+b,y[c]={data:o[c],index:s,value:h,startAngle:g,endAngle:l,padAngle:m};return y}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:f_(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,n=null,o):e},o.sort=function(t){return arguments.length?(n=t,e=null,o):n},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:f_(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:f_(+t),o):i},o.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:f_(+t),o):a},o},U_=W_(L_);function $_(t){this._curve=t}function W_(t){function e(e){return new $_(t(e))}return e._curve=t,e}function H_(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(W_(t)):e()._curve},t}$_.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var V_=function(){return H_(I_().curve(U_))},G_=function(){var t=j_().curve(U_),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,a=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return H_(n())},delete t.lineX0,t.lineEndAngle=function(){return H_(r())},delete t.lineX1,t.lineInnerRadius=function(){return H_(i())},delete t.lineY0,t.lineOuterRadius=function(){return H_(a())},delete t.lineY1,t.curve=function(t){return arguments.length?e(W_(t)):e()._curve},t},q_=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]},X_=Array.prototype.slice;function Z_(t){return t.source}function J_(t){return t.target}function Q_(t){var e=Z_,n=J_,r=F_,i=P_,a=null;function o(){var o,s=X_.call(arguments),c=e.apply(this,s),u=n.apply(this,s);if(a||(a=o=Ui()),t(a,+r.apply(this,(s[0]=c,s)),+i.apply(this,s),+r.apply(this,(s[0]=u,s)),+i.apply(this,s)),o)return a=null,o+""||null}return o.source=function(t){return arguments.length?(e=t,o):e},o.target=function(t){return arguments.length?(n=t,o):n},o.x=function(t){return arguments.length?(r="function"==typeof t?t:f_(+t),o):r},o.y=function(t){return arguments.length?(i="function"==typeof t?t:f_(+t),o):i},o.context=function(t){return arguments.length?(a=null==t?null:t,o):a},o}function K_(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function tx(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function ex(t,e,n,r,i){var a=q_(e,n),o=q_(e,n=(n+i)/2),s=q_(r,n),c=q_(r,i);t.moveTo(a[0],a[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],c[0],c[1])}function nx(){return Q_(K_)}function rx(){return Q_(tx)}function ix(){var t=Q_(ex);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var ax={draw:function(t,e){var n=Math.sqrt(e/__);t.moveTo(n,0),t.arc(0,0,n,0,k_)}},ox={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},sx=Math.sqrt(1/3),cx=2*sx,ux={draw:function(t,e){var n=Math.sqrt(e/cx),r=n*sx;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},lx=Math.sin(__/10)/Math.sin(7*__/10),hx=Math.sin(k_/10)*lx,fx=-Math.cos(k_/10)*lx,dx={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),r=hx*n,i=fx*n;t.moveTo(0,-n),t.lineTo(r,i);for(var a=1;a<5;++a){var o=k_*a/5,s=Math.cos(o),c=Math.sin(o);t.lineTo(c*n,-s*n),t.lineTo(s*r-c*i,c*r+s*i)}t.closePath()}},px={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},yx=Math.sqrt(3),gx={draw:function(t,e){var n=-Math.sqrt(e/(3*yx));t.moveTo(0,2*n),t.lineTo(-yx*n,-n),t.lineTo(yx*n,-n),t.closePath()}},vx=Math.sqrt(3)/2,mx=1/Math.sqrt(12),bx=3*(mx/2+1),_x={draw:function(t,e){var n=Math.sqrt(e/bx),r=n/2,i=n*mx,a=r,o=n*mx+n,s=-a,c=o;t.moveTo(r,i),t.lineTo(a,o),t.lineTo(s,c),t.lineTo(-.5*r-vx*i,vx*r+-.5*i),t.lineTo(-.5*a-vx*o,vx*a+-.5*o),t.lineTo(-.5*s-vx*c,vx*s+-.5*c),t.lineTo(-.5*r+vx*i,-.5*i-vx*r),t.lineTo(-.5*a+vx*o,-.5*o-vx*a),t.lineTo(-.5*s+vx*c,-.5*c-vx*s),t.closePath()}},xx=[ax,ox,ux,px,dx,gx,_x],kx=function(){var t=f_(ax),e=f_(64),n=null;function r(){var r;if(n||(n=r=Ui()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return r.type=function(e){return arguments.length?(t="function"==typeof e?e:f_(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:f_(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r},wx=function(){};function Ex(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Tx(t){this._context=t}Tx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ex(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ex(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var Cx=function(t){return new Tx(t)};function Ax(t){this._context=t}Ax.prototype={areaStart:wx,areaEnd:wx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Ex(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var Sx=function(t){return new Ax(t)};function Mx(t){this._context=t}Mx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ex(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var Ox=function(t){return new Mx(t)};function Dx(t,e){this._basis=new Tx(t),this._beta=e}Dx.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],a=e[0],o=t[n]-i,s=e[n]-a,c=-1;++c<=n;)r=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*o),this._beta*e[c]+(1-this._beta)*(a+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Nx=function t(e){function n(t){return 1===e?new Tx(t):new Dx(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Bx(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Lx(t,e){this._context=t,this._k=(1-e)/6}Lx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Bx(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Bx(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Fx=function t(e){function n(t){return new Lx(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Px(t,e){this._context=t,this._k=(1-e)/6}Px.prototype={areaStart:wx,areaEnd:wx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Bx(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ix=function t(e){function n(t){return new Px(t,e)}return n.tension=function(e){return t(+e)},n}(0);function jx(t,e){this._context=t,this._k=(1-e)/6}jx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Bx(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Rx=function t(e){function n(t){return new jx(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Yx(t,e,n){var r=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>1e-12){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>1e-12){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*u+t._x1*t._l23_2a-e*t._l12_2a)/l,o=(o*u+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(r,i,a,o,t._x2,t._y2)}function zx(t,e){this._context=t,this._alpha=e}zx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Yx(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ux=function t(e){function n(t){return e?new zx(t,e):new Lx(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function $x(t,e){this._context=t,this._alpha=e}$x.prototype={areaStart:wx,areaEnd:wx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Yx(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Wx=function t(e){function n(t){return e?new $x(t,e):new Px(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Hx(t,e){this._context=t,this._alpha=e}Hx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Yx(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Vx=function t(e){function n(t){return e?new Hx(t,e):new jx(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Gx(t){this._context=t}Gx.prototype={areaStart:wx,areaEnd:wx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var qx=function(t){return new Gx(t)};function Xx(t){return t<0?-1:1}function Zx(t,e,n){var r=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(r||i<0&&-0),o=(n-t._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Xx(a)+Xx(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Jx(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Qx(t,e,n){var r=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-r)/3;t._context.bezierCurveTo(r+s,i+s*e,a-s,o-s*n,a,o)}function Kx(t){this._context=t}function tk(t){this._context=new ek(t)}function ek(t){this._context=t}function nk(t){return new Kx(t)}function rk(t){return new tk(t)}function ik(t){this._context=t}function ak(t){var e,n,r=t.length-1,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var ck=function(t){return new sk(t,.5)};function uk(t){return new sk(t,0)}function lk(t){return new sk(t,1)}var hk=function(t,e){if((i=t.length)>1)for(var n,r,i,a=1,o=t[e[0]],s=o.length;a=0;)n[e]=e;return n};function dk(t,e){return t[e]}var pk=function(){var t=f_([]),e=fk,n=hk,r=dk;function i(i){var a,o,s=t.apply(this,arguments),c=i.length,u=s.length,l=new Array(u);for(a=0;a0){for(var n,r,i,a=0,o=t[0].length;a0)for(var n,r,i,a,o,s,c=0,u=t[e[0]].length;c0?(r[0]=a,r[1]=a+=i):i<0?(r[1]=o,r[0]=o+=i):(r[0]=0,r[1]=i)},vk=function(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],a=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,a=0,o=1;oa&&(a=e,r=n);return r}var xk=function(t){var e=t.map(kk);return fk(t).sort((function(t,n){return e[t]-e[n]}))};function kk(t){for(var e,n=0,r=-1,i=t.length;++r0)){if(a/=f,f<0){if(a0){if(a>h)return;a>l&&(l=a)}if(a=r-c,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>h)return;a>l&&(l=a)}if(a=i-u,d||!(a<0)){if(a/=d,d<0){if(a>h)return;a>l&&(l=a)}else if(d>0){if(a0||h<1)||(l>0&&(t[0]=[c+l*f,u+l*d]),h<1&&(t[1]=[c+h*f,u+h*d]),!0)}}}}}function Uk(t,e,n,r,i){var a=t[1];if(a)return!0;var o,s,c=t[0],u=t.left,l=t.right,h=u[0],f=u[1],d=l[0],p=l[1],y=(h+d)/2,g=(f+p)/2;if(p===f){if(y=r)return;if(h>d){if(c){if(c[1]>=i)return}else c=[y,n];a=[y,i]}else{if(c){if(c[1]1)if(h>d){if(c){if(c[1]>=i)return}else c=[(n-s)/o,n];a=[(i-s)/o,i]}else{if(c){if(c[1]=r)return}else c=[e,o*e+s];a=[r,o*r+s]}else{if(c){if(c[0]=-lw)){var d=c*c+u*u,p=l*l+h*h,y=(h*d-u*p)/f,g=(c*p-l*d)/f,v=Gk.pop()||new qk;v.arc=t,v.site=i,v.x=y+o,v.y=(v.cy=g+s)+Math.sqrt(y*y+g*g),t.circle=v;for(var m=null,b=sw._;b;)if(v.yuw)s=s.L;else{if(!((i=a-iw(s,o))>uw)){r>-uw?(e=s.P,n=s):i>-uw?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){ow[t.index]={site:t,halfedges:[]}}(t);var c=Kk(t);if(aw.insert(e,c),e||n){if(e===n)return Zk(e),n=Kk(e.site),aw.insert(c,n),c.edge=n.edge=jk(e.site,c.site),Xk(e),void Xk(n);if(n){Zk(e),Zk(n);var u=e.site,l=u[0],h=u[1],f=t[0]-l,d=t[1]-h,p=n.site,y=p[0]-l,g=p[1]-h,v=2*(f*g-d*y),m=f*f+d*d,b=y*y+g*g,_=[(g*m-d*b)/v+l,(f*b-y*m)/v+h];Yk(n.edge,u,p,_),c.edge=jk(u,t,null,_),n.edge=jk(t,p,null,_),Xk(e),Xk(n)}else c.edge=jk(e.site,c.site)}}function rw(t,e){var n=t.site,r=n[0],i=n[1],a=i-e;if(!a)return r;var o=t.P;if(!o)return-1/0;var s=(n=o.site)[0],c=n[1],u=c-e;if(!u)return s;var l=s-r,h=1/a-1/u,f=l/u;return h?(-f+Math.sqrt(f*f-2*h*(l*l/(-2*u)-c+u/2+i-a/2)))/h+r:(r+s)/2}function iw(t,e){var n=t.N;if(n)return rw(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var aw,ow,sw,cw,uw=1e-6,lw=1e-12;function hw(t,e){return e[1]-t[1]||e[0]-t[0]}function fw(t,e){var n,r,i,a=t.sort(hw).pop();for(cw=[],ow=new Array(t.length),aw=new Ik,sw=new Ik;;)if(i=Vk,a&&(!i||a[1]uw||Math.abs(i[0][1]-i[1][1])>uw)||delete cw[a]}(o,s,c,u),function(t,e,n,r){var i,a,o,s,c,u,l,h,f,d,p,y,g=ow.length,v=!0;for(i=0;iuw||Math.abs(y-f)>uw)&&(c.splice(s,0,cw.push(Rk(o,d,Math.abs(p-t)uw?[t,Math.abs(h-t)uw?[Math.abs(f-r)uw?[n,Math.abs(h-n)uw?[Math.abs(f-e)=s)return null;var c=t-i.site[0],u=e-i.site[1],l=c*c+u*u;do{i=a.cells[r=o],o=null,i.halfedges.forEach((function(n){var r=a.edges[n],s=r.left;if(s!==i.site&&s||(s=r.right)){var c=t-s[0],u=e-s[1],h=c*c+u*u;hr?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}var Aw=function(){var t,e,n=xw,r=kw,i=Cw,a=Ew,o=Tw,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,l=fp,h=lt("start","zoom","end"),f=0;function d(t){t.property("__zoom",ww).on("wheel.zoom",_).on("mousedown.zoom",x).on("dblclick.zoom",k).filter(o).on("touchstart.zoom",w).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new gw(e,t.x,t.y)}function y(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new gw(t.k,r,i)}function g(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function v(t,e,n){t.on("start.zoom",(function(){m(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){m(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,a=m(t,i),o=r.apply(t,i),s=null==n?g(o):"function"==typeof n?n.apply(t,i):n,c=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),u=t.__zoom,h="function"==typeof e?e.apply(t,i):e,f=l(u.invert(s).concat(c/u.k),h.invert(s).concat(c/h.k));return function(t){if(1===t)t=h;else{var e=f(t),n=c/e[2];t=new gw(n,s[0]-e[0]*n,s[1]-e[1]*n)}a.zoom(null,t)}}))}function m(t,e,n){return!n&&t.__zooming||new b(t,e)}function b(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function _(){if(n.apply(this,arguments)){var t=m(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,a.apply(this,arguments)))),o=Nn(this);if(t.wheel)t.mouse[0][0]===o[0]&&t.mouse[0][1]===o[1]||(t.mouse[1]=e.invert(t.mouse[0]=o)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[o,e.invert(o)],or(this),t.start()}_w(),t.wheel=setTimeout(u,150),t.zoom("mouse",i(y(p(e,r),t.mouse[0],t.mouse[1]),t.extent,c))}function u(){t.wheel=null,t.end()}}function x(){if(!e&&n.apply(this,arguments)){var t=m(this,arguments,!0),r=ke(ce.view).on("mousemove.zoom",u,!0).on("mouseup.zoom",l,!0),a=Nn(this),o=ce.clientX,s=ce.clientY;Te(ce.view),bw(),t.mouse=[a,this.__zoom.invert(a)],or(this),t.start()}function u(){if(_w(),!t.moved){var e=ce.clientX-o,n=ce.clientY-s;t.moved=e*e+n*n>f}t.zoom("mouse",i(y(t.that.__zoom,t.mouse[0]=Nn(t.that),t.mouse[1]),t.extent,c))}function l(){r.on("mousemove.zoom mouseup.zoom",null),Ce(ce.view,t.moved),_w(),t.end()}}function k(){if(n.apply(this,arguments)){var t=this.__zoom,e=Nn(this),a=t.invert(e),o=t.k*(ce.shiftKey?.5:2),s=i(y(p(t,o),e,a),r.apply(this,arguments),c);_w(),u>0?ke(this).transition().duration(u).call(v,s,e):ke(this).call(d.transform,s)}}function w(){if(n.apply(this,arguments)){var e,r,i,a,o=ce.touches,s=o.length,c=m(this,arguments,ce.changedTouches.length===s);for(bw(),r=0;rh&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},M={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),56;case 1:return this.begin("type_directive"),57;case 2:return this.popState(),this.begin("arg_directive"),14;case 3:return this.popState(),this.popState(),59;case 4:return 58;case 5:return 5;case 6:case 7:case 8:case 9:case 10:break;case 11:return this.begin("ID"),16;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),48;case 13:return this.popState(),this.popState(),this.begin("LINE"),18;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),27;case 16:return this.begin("LINE"),29;case 17:return this.begin("LINE"),30;case 18:return this.begin("LINE"),31;case 19:return this.begin("LINE"),36;case 20:return this.begin("LINE"),33;case 21:return this.begin("LINE"),35;case 22:return this.popState(),19;case 23:return 28;case 24:return 43;case 25:return 44;case 26:return 39;case 27:return 37;case 28:return this.begin("ID"),22;case 29:return this.begin("ID"),23;case 30:return 25;case 31:return 7;case 32:return 21;case 33:return 42;case 34:return 5;case 35:return e.yytext=e.yytext.trim(),48;case 36:return 51;case 37:return 52;case 38:return 49;case 39:return 50;case 40:return 53;case 41:return 54;case 42:return 55;case 43:return 46;case 44:return 47;case 45:return 5;case 46:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{open_directive:{rules:[1,8],inclusive:!1},type_directive:{rules:[2,3,8],inclusive:!1},arg_directive:{rules:[3,4,8],inclusive:!1},ID:{rules:[7,8,12],inclusive:!1},ALIAS:{rules:[7,8,13,14],inclusive:!1},LINE:{rules:[7,8,22],inclusive:!1},INITIAL:{rules:[0,5,6,8,9,10,11,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};function O(){this.yy={}}return S.lexer=M,O.prototype=S,S.Parser=O,new O}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e,n){var r=n(198);t.exports={Graph:r.Graph,json:n(301),alg:n(302),version:r.version}},function(t,e,n){var r;try{r={cloneDeep:n(313),constant:n(86),defaults:n(154),each:n(87),filter:n(128),find:n(314),flatten:n(156),forEach:n(126),forIn:n(319),has:n(93),isUndefined:n(139),last:n(320),map:n(140),mapValues:n(321),max:n(322),merge:n(324),min:n(329),minBy:n(330),now:n(331),pick:n(161),range:n(162),reduce:n(142),sortBy:n(338),uniqueId:n(163),values:n(147),zipObject:n(343)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){ +/** + * @license + * Copyright (c) 2012-2013 Chris Pettitt + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +t.exports={graphlib:n(311),dagre:n(153),intersect:n(368),render:n(370),util:n(12),version:n(382)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var r=n(4),i=n(17).Graph;function a(t,e,n,i){var a;do{a=r.uniqueId(i)}while(t.hasNode(a));return n.dummy=e,t.setNode(a,n),a}function o(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:a,simplify:function(t){var e=(new i).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,a=t.y,o=e.x-i,s=e.y-a,c=t.width/2,u=t.height/2;if(!o&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*c>Math.abs(o)*u?(s<0&&(u=-u),n=u*o/s,r=u):(o<0&&(c=-c),n=c,r=c*s/o);return{x:i+n,y:a+r}},buildLayerMatrix:function(t){var e=r.map(r.range(o(t)+1),(function(){return[]}));return r.forEach(t.nodes(),(function(n){var i=t.node(n),a=i.rank;r.isUndefined(a)||(e[a][i.order]=n)})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var i=t.node(n);r.has(i,"rank")&&(i.rank-=e)}))},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,a=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%a!=0?--i:i&&r.forEach(e,(function(e){t.node(e).rank+=i}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return a(t,"border",i,e)},maxRank:o,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms")}},notime:function(t,e){return e()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(173),i=n(174),a=n(175),o={channel:r.default,lang:i.default,unit:a.default};e.default=o},function(t,e,n){var r;try{r={clone:n(199),constant:n(86),each:n(87),filter:n(128),has:n(93),isArray:n(5),isEmpty:n(276),isFunction:n(38),isUndefined:n(139),keys:n(30),map:n(140),reduce:n(142),size:n(279),transform:n(285),union:n(286),values:n(147)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(44);t.exports={isSubgraph:function(t,e){return!!t.children(e).length},edgeToId:function(t){return a(t.v)+":"+a(t.w)+":"+a(t.name)},applyStyle:function(t,e){e&&t.attr("style",e)},applyClass:function(t,e,n){e&&t.attr("class",e).attr("class",n+" "+t.attr("class"))},applyTransition:function(t,e){var n=e.graph();if(r.isPlainObject(n)){var i=n.transition;if(r.isFunction(i))return i(t)}return t}};var i=/:/g;function a(t){return t?String(t).replace(i,"\\:"):""}},function(t,e,n){(function(t,r){var i=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,7],n=[1,6],r=[1,14],i=[1,25],a=[1,28],o=[1,26],s=[1,27],c=[1,29],u=[1,30],l=[1,31],h=[1,33],f=[1,34],d=[1,35],p=[10,19],y=[1,47],g=[1,48],v=[1,49],m=[1,50],b=[1,51],_=[1,52],x=[10,19,25,32,33,41,44,45,46,47,48,49],k=[10,19,23,25,32,33,37,41,44,45,46,47,48,49,66,67,68],w=[10,13,17,19],E=[41,66,67,68],T=[41,48,49,66,67,68],C=[41,44,45,46,47,66,67,68],A=[10,19,25],S=[1,81],M={trace:function(){},yy:{},symbols_:{error:2,start:3,mermaidDoc:4,directive:5,graphConfig:6,openDirective:7,typeDirective:8,closeDirective:9,NEWLINE:10,":":11,argDirective:12,open_directive:13,type_directive:14,arg_directive:15,close_directive:16,CLASS_DIAGRAM:17,statements:18,EOF:19,statement:20,className:21,alphaNumToken:22,GENERICTYPE:23,relationStatement:24,LABEL:25,classStatement:26,methodStatement:27,annotationStatement:28,clickStatement:29,cssClassStatement:30,CLASS:31,STYLE_SEPARATOR:32,STRUCT_START:33,members:34,STRUCT_STOP:35,ANNOTATION_START:36,ANNOTATION_END:37,MEMBER:38,SEPARATOR:39,relation:40,STR:41,relationType:42,lineType:43,AGGREGATION:44,EXTENSION:45,COMPOSITION:46,DEPENDENCY:47,LINE:48,DOTTED_LINE:49,CALLBACK:50,LINK:51,CSSCLASS:52,commentToken:53,textToken:54,graphCodeTokens:55,textNoTagsToken:56,TAGSTART:57,TAGEND:58,"==":59,"--":60,PCT:61,DEFAULT:62,SPACE:63,MINUS:64,keywords:65,UNICODE_TEXT:66,NUM:67,ALPHA:68,$accept:0,$end:1},terminals_:{2:"error",10:"NEWLINE",11:":",13:"open_directive",14:"type_directive",15:"arg_directive",16:"close_directive",17:"CLASS_DIAGRAM",19:"EOF",23:"GENERICTYPE",25:"LABEL",31:"CLASS",32:"STYLE_SEPARATOR",33:"STRUCT_START",35:"STRUCT_STOP",36:"ANNOTATION_START",37:"ANNOTATION_END",38:"MEMBER",39:"SEPARATOR",41:"STR",44:"AGGREGATION",45:"EXTENSION",46:"COMPOSITION",47:"DEPENDENCY",48:"LINE",49:"DOTTED_LINE",50:"CALLBACK",51:"LINK",52:"CSSCLASS",55:"graphCodeTokens",57:"TAGSTART",58:"TAGEND",59:"==",60:"--",61:"PCT",62:"DEFAULT",63:"SPACE",64:"MINUS",65:"keywords",66:"UNICODE_TEXT",67:"NUM",68:"ALPHA"},productions_:[0,[3,1],[3,2],[4,1],[5,4],[5,6],[7,1],[8,1],[12,1],[9,1],[6,4],[18,1],[18,2],[18,3],[21,1],[21,2],[21,3],[21,2],[20,1],[20,2],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[26,2],[26,4],[26,5],[26,7],[28,4],[34,1],[34,2],[27,1],[27,2],[27,1],[27,1],[24,3],[24,4],[24,4],[24,5],[40,3],[40,2],[40,2],[40,1],[42,1],[42,1],[42,1],[42,1],[43,1],[43,1],[29,3],[29,4],[29,3],[29,4],[30,3],[53,1],[53,1],[54,1],[54,1],[54,1],[54,1],[54,1],[54,1],[54,1],[56,1],[56,1],[56,1],[56,1],[22,1],[22,1],[22,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 6:r.parseDirective("%%{","open_directive");break;case 7:r.parseDirective(a[s],"type_directive");break;case 8:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 9:r.parseDirective("}%%","close_directive","class");break;case 14:this.$=a[s];break;case 15:this.$=a[s-1]+a[s];break;case 16:this.$=a[s-2]+"~"+a[s-1]+a[s];break;case 17:this.$=a[s-1]+"~"+a[s];break;case 18:r.addRelation(a[s]);break;case 19:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 26:r.addClass(a[s]);break;case 27:r.addClass(a[s-2]),r.setCssClass(a[s-2],a[s]);break;case 28:r.addClass(a[s-3]),r.addMembers(a[s-3],a[s-1]);break;case 29:r.addClass(a[s-5]),r.setCssClass(a[s-5],a[s-3]),r.addMembers(a[s-5],a[s-1]);break;case 30:r.addAnnotation(a[s],a[s-2]);break;case 31:this.$=[a[s]];break;case 32:a[s].push(a[s-1]),this.$=a[s];break;case 33:break;case 34:r.addMember(a[s-1],r.cleanupLabel(a[s]));break;case 35:case 36:break;case 37:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 38:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 39:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 40:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 41:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 42:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 43:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 44:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 45:this.$=r.relationType.AGGREGATION;break;case 46:this.$=r.relationType.EXTENSION;break;case 47:this.$=r.relationType.COMPOSITION;break;case 48:this.$=r.relationType.DEPENDENCY;break;case 49:this.$=r.lineType.LINE;break;case 50:this.$=r.lineType.DOTTED_LINE;break;case 51:this.$=a[s-2],r.setClickEvent(a[s-1],a[s],void 0);break;case 52:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 53:this.$=a[s-2],r.setLink(a[s-1],a[s],void 0);break;case 54:this.$=a[s-3],r.setLink(a[s-2],a[s-1],a[s]);break;case 55:r.setCssClass(a[s-1],a[s])}},table:[{3:1,4:2,5:3,6:4,7:5,13:e,17:n},{1:[3]},{1:[2,1]},{3:8,4:2,5:3,6:4,7:5,13:e,17:n},{1:[2,3]},{8:9,14:[1,10]},{10:[1,11]},{14:[2,6]},{1:[2,2]},{9:12,11:[1,13],16:r},t([11,16],[2,7]),{5:23,7:5,13:e,18:15,20:16,21:24,22:32,24:17,26:18,27:19,28:20,29:21,30:22,31:i,36:a,38:o,39:s,50:c,51:u,52:l,66:h,67:f,68:d},{10:[1,36]},{12:37,15:[1,38]},{10:[2,9]},{19:[1,39]},{10:[1,40],19:[2,11]},t(p,[2,18],{25:[1,41]}),t(p,[2,20]),t(p,[2,21]),t(p,[2,22]),t(p,[2,23]),t(p,[2,24]),t(p,[2,25]),t(p,[2,33],{40:42,42:45,43:46,25:[1,44],41:[1,43],44:y,45:g,46:v,47:m,48:b,49:_}),{21:53,22:32,66:h,67:f,68:d},t(p,[2,35]),t(p,[2,36]),{22:54,66:h,67:f,68:d},{21:55,22:32,66:h,67:f,68:d},{21:56,22:32,66:h,67:f,68:d},{41:[1,57]},t(x,[2,14],{22:32,21:58,23:[1,59],66:h,67:f,68:d}),t(k,[2,69]),t(k,[2,70]),t(k,[2,71]),t(w,[2,4]),{9:60,16:r},{16:[2,8]},{1:[2,10]},{5:23,7:5,13:e,18:61,19:[2,12],20:16,21:24,22:32,24:17,26:18,27:19,28:20,29:21,30:22,31:i,36:a,38:o,39:s,50:c,51:u,52:l,66:h,67:f,68:d},t(p,[2,19]),{21:62,22:32,41:[1,63],66:h,67:f,68:d},{40:64,42:45,43:46,44:y,45:g,46:v,47:m,48:b,49:_},t(p,[2,34]),{43:65,48:b,49:_},t(E,[2,44],{42:66,44:y,45:g,46:v,47:m}),t(T,[2,45]),t(T,[2,46]),t(T,[2,47]),t(T,[2,48]),t(C,[2,49]),t(C,[2,50]),t(p,[2,26],{32:[1,67],33:[1,68]}),{37:[1,69]},{41:[1,70]},{41:[1,71]},{22:72,66:h,67:f,68:d},t(x,[2,15]),t(x,[2,17],{22:32,21:73,66:h,67:f,68:d}),{10:[1,74]},{19:[2,13]},t(A,[2,37]),{21:75,22:32,66:h,67:f,68:d},{21:76,22:32,41:[1,77],66:h,67:f,68:d},t(E,[2,43],{42:78,44:y,45:g,46:v,47:m}),t(E,[2,42]),{22:79,66:h,67:f,68:d},{34:80,38:S},{21:82,22:32,66:h,67:f,68:d},t(p,[2,51],{41:[1,83]}),t(p,[2,53],{41:[1,84]}),t(p,[2,55]),t(x,[2,16]),t(w,[2,5]),t(A,[2,39]),t(A,[2,38]),{21:85,22:32,66:h,67:f,68:d},t(E,[2,41]),t(p,[2,27],{33:[1,86]}),{35:[1,87]},{34:88,35:[2,31],38:S},t(p,[2,30]),t(p,[2,52]),t(p,[2,54]),t(A,[2,40]),{34:89,38:S},t(p,[2,28]),{35:[2,32]},{35:[1,90]},t(p,[2,29])],defaultActions:{2:[2,1],4:[2,3],7:[2,6],8:[2,2],14:[2,9],38:[2,8],39:[2,10],61:[2,13],88:[2,32]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,u=0,l=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var v=p.yylloc;a.push(v);var m=p.options&&p.options.ranges;function b(){var t;return"number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,E,T,C,A,S,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=b()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var O="";for(T in S=[],o[k])this.terminals_[T]&&T>h&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},O={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),13;case 1:return this.begin("type_directive"),14;case 2:return this.popState(),this.begin("arg_directive"),11;case 3:return this.popState(),this.popState(),16;case 4:return 15;case 5:case 6:break;case 7:return 10;case 8:break;case 9:case 10:return 17;case 11:return this.begin("struct"),33;case 12:return"EOF_IN_STRUCT";case 13:return"OPEN_IN_STRUCT";case 14:return this.popState(),35;case 15:break;case 16:return"MEMBER";case 17:return 31;case 18:return 52;case 19:return 50;case 20:return 51;case 21:return 36;case 22:return 37;case 23:this.begin("generic");break;case 24:this.popState();break;case 25:return"GENERICTYPE";case 26:this.begin("string");break;case 27:this.popState();break;case 28:return"STR";case 29:case 30:return 45;case 31:case 32:return 47;case 33:return 46;case 34:return 44;case 35:return 48;case 36:return 49;case 37:return 25;case 38:return 32;case 39:return 64;case 40:return"DOT";case 41:return"PLUS";case 42:return 61;case 43:case 44:return"EQUALS";case 45:return 68;case 46:return"PUNCTUATION";case 47:return 67;case 48:return 66;case 49:return 63;case 50:return 19}},rules:[/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:[{])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],conditions:{string:{rules:[27,28],inclusive:!1},generic:{rules:[24,25],inclusive:!1},struct:{rules:[12,13,14,15,16],inclusive:!1},open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,17,18,19,20,21,22,23,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],inclusive:!0}}};function D(){this.yy={}}return M.lexer=O,D.prototype=M,M.Parser=D,new D}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e){var n,r,i=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var c,u=[],l=!1,h=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):h=-1,u.length&&d())}function d(){if(!l){var t=s(f);l=!0;for(var e=u.length;e;){for(c=u,u=[];++h1)for(var n=1;n=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(e=o+"/"+e,i="/"===o.charAt(0))}return(i?"/":"")+(e=n(r(e.split("/"),(function(t){return!!t})),!i).join("/"))||"."},e.normalize=function(t){var a=e.isAbsolute(t),o="/"===i(t,-1);return(t=n(r(t.split("/"),(function(t){return!!t})),!a).join("/"))||a||(t="."),t&&o&&(t+="/"),(a?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(r(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),a=r(n.split("/")),o=Math.min(i.length,a.length),s=o,c=0;c=1;--a)if(47===(e=t.charCodeAt(a))){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":t.slice(0,r)},e.basename=function(t,e){var n=function(t){"string"!=typeof t&&(t+="");var e,n=0,r=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){n=e+1;break}}else-1===r&&(i=!1,r=e+1);return-1===r?"":t.slice(n,r)}(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,n=0,r=-1,i=!0,a=0,o=t.length-1;o>=0;--o){var s=t.charCodeAt(o);if(47!==s)-1===r&&(i=!1,r=o+1),46===s?-1===e?e=o:1!==a&&(a=1):-1!==e&&(a=-1);else if(!i){n=o+1;break}}return-1===e||-1===r||0===a||1===a&&e===r-1&&e===n+1?"":t.slice(e,r)};var i="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n(14))},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){(function(t,r){var i=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,2],n=[1,3],r=[1,5],i=[1,7],a=[2,5],o=[1,15],s=[1,17],c=[1,19],u=[1,20],l=[1,21],h=[1,22],f=[1,28],d=[1,23],p=[1,24],y=[1,25],g=[1,26],v=[1,29],m=[1,32],b=[1,4,5,14,15,17,19,20,22,23,24,25,26,36,39],_=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,36,39],x=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,36,39],k=[4,5,14,15,17,19,20,22,23,24,25,26,36,39],w={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,directive:6,SD:7,document:8,line:9,statement:10,idStatement:11,DESCR:12,"--\x3e":13,HIDE_EMPTY:14,scale:15,WIDTH:16,COMPOSIT_STATE:17,STRUCT_START:18,STRUCT_STOP:19,STATE_DESCR:20,AS:21,ID:22,FORK:23,JOIN:24,CONCURRENT:25,note:26,notePosition:27,NOTE_TEXT:28,openDirective:29,typeDirective:30,closeDirective:31,":":32,argDirective:33,eol:34,";":35,EDGE_STATE:36,left_of:37,right_of:38,open_directive:39,type_directive:40,arg_directive:41,close_directive:42,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"--\x3e",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CONCURRENT",26:"note",28:"NOTE_TEXT",32:":",35:";",36:"EDGE_STATE",37:"left_of",38:"right_of",39:"open_directive",40:"type_directive",41:"arg_directive",42:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[6,3],[6,5],[34,1],[34,1],[11,1],[11,1],[27,1],[27,1],[29,1],[30,1],[33,1],[31,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 4:return r.setRootDoc(a[s]),a[s];case 5:this.$=[];break;case 6:"nl"!=a[s]&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 7:case 8:this.$=a[s];break;case 9:this.$="nl";break;case 10:this.$={stmt:"state",id:a[s],type:"default",description:""};break;case 11:this.$={stmt:"state",id:a[s-1],type:"default",description:r.trimColon(a[s])};break;case 12:this.$={stmt:"relation",state1:{stmt:"state",id:a[s-2],type:"default",description:""},state2:{stmt:"state",id:a[s],type:"default",description:""}};break;case 13:this.$={stmt:"relation",state1:{stmt:"state",id:a[s-3],type:"default",description:""},state2:{stmt:"state",id:a[s-1],type:"default",description:""},description:a[s].substr(1).trim()};break;case 17:this.$={stmt:"state",id:a[s-3],type:"default",description:"",doc:a[s-1]};break;case 18:var c=a[s],u=a[s-2].trim();if(a[s].match(":")){var l=a[s].split(":");c=l[0],u=[u,l[1]]}this.$={stmt:"state",id:c,type:"default",description:u};break;case 19:this.$={stmt:"state",id:a[s-3],type:"default",description:a[s-5],doc:a[s-1]};break;case 20:this.$={stmt:"state",id:a[s],type:"fork"};break;case 21:this.$={stmt:"state",id:a[s],type:"join"};break;case 22:this.$={stmt:"state",id:r.getDividerId(),type:"divider"};break;case 23:this.$={stmt:"state",id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 30:case 31:this.$=a[s];break;case 34:r.parseDirective("%%{","open_directive");break;case 35:r.parseDirective(a[s],"type_directive");break;case 36:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 37:r.parseDirective("}%%","close_directive","state")}},table:[{3:1,4:e,5:n,6:4,7:r,29:6,39:i},{1:[3]},{3:8,4:e,5:n,6:4,7:r,29:6,39:i},{3:9,4:e,5:n,6:4,7:r,29:6,39:i},{3:10,4:e,5:n,6:4,7:r,29:6,39:i},t([1,4,5,14,15,17,20,22,23,24,25,26,36,39],a,{8:11}),{30:12,40:[1,13]},{40:[2,34]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:o,5:s,6:27,9:14,10:16,11:18,14:c,15:u,17:l,20:h,22:f,23:d,24:p,25:y,26:g,29:6,36:v,39:i},{31:30,32:[1,31],42:m},t([32,42],[2,35]),t(b,[2,6]),{6:27,10:33,11:18,14:c,15:u,17:l,20:h,22:f,23:d,24:p,25:y,26:g,29:6,36:v,39:i},t(b,[2,8]),t(b,[2,9]),t(b,[2,10],{12:[1,34],13:[1,35]}),t(b,[2,14]),{16:[1,36]},t(b,[2,16],{18:[1,37]}),{21:[1,38]},t(b,[2,20]),t(b,[2,21]),t(b,[2,22]),{27:39,28:[1,40],37:[1,41],38:[1,42]},t(b,[2,25]),t(_,[2,30]),t(_,[2,31]),t(x,[2,26]),{33:43,41:[1,44]},t(x,[2,37]),t(b,[2,7]),t(b,[2,11]),{11:45,22:f,36:v},t(b,[2,15]),t(k,a,{8:46}),{22:[1,47]},{22:[1,48]},{21:[1,49]},{22:[2,32]},{22:[2,33]},{31:50,42:m},{42:[2,36]},t(b,[2,12],{12:[1,51]}),{4:o,5:s,6:27,9:14,10:16,11:18,14:c,15:u,17:l,19:[1,52],20:h,22:f,23:d,24:p,25:y,26:g,29:6,36:v,39:i},t(b,[2,18],{18:[1,53]}),{28:[1,54]},{22:[1,55]},t(x,[2,27]),t(b,[2,13]),t(b,[2,17]),t(k,a,{8:56}),t(b,[2,23]),t(b,[2,24]),{4:o,5:s,6:27,9:14,10:16,11:18,14:c,15:u,17:l,19:[1,57],20:h,22:f,23:d,24:p,25:y,26:g,29:6,36:v,39:i},t(b,[2,19])],defaultActions:{7:[2,34],8:[2,1],9:[2,2],10:[2,3],41:[2,32],42:[2,33],44:[2,36]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,u=0,l=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var v=p.yylloc;a.push(v);var m=p.options&&p.options.ranges;function b(){var t;return"number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,E,T,C,A,S,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=b()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var O="";for(T in S=[],o[k])this.terminals_[T]&&T>h&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},E={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),39;case 1:return this.begin("type_directive"),40;case 2:return this.popState(),this.begin("arg_directive"),32;case 3:return this.popState(),this.popState(),42;case 4:return 41;case 5:break;case 6:console.log("Crap after close");break;case 7:return 5;case 8:case 9:case 10:case 11:break;case 12:return this.pushState("SCALE"),15;case 13:return 16;case 14:this.popState();break;case 15:this.pushState("STATE");break;case 16:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),23;case 17:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),24;case 18:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),23;case 19:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),24;case 20:this.begin("STATE_STRING");break;case 21:return this.popState(),this.pushState("STATE_ID"),"AS";case 22:return this.popState(),"ID";case 23:this.popState();break;case 24:return"STATE_DESCR";case 25:return 17;case 26:this.popState();break;case 27:return this.popState(),this.pushState("struct"),18;case 28:return this.popState(),19;case 29:break;case 30:return this.begin("NOTE"),26;case 31:return this.popState(),this.pushState("NOTE_ID"),37;case 32:return this.popState(),this.pushState("NOTE_ID"),38;case 33:this.popState(),this.pushState("FLOATING_NOTE");break;case 34:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 35:break;case 36:return"NOTE_TEXT";case 37:return this.popState(),"ID";case 38:return this.popState(),this.pushState("NOTE_TEXT"),22;case 39:return this.popState(),e.yytext=e.yytext.substr(2).trim(),28;case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),28;case 41:case 42:return 7;case 43:return 14;case 44:return 36;case 45:return 22;case 46:return e.yytext=e.yytext.trim(),12;case 47:return 13;case 48:return 25;case 49:return 5;case 50:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:\s*[^:;]+end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[9,10],inclusive:!1},close_directive:{rules:[9,10],inclusive:!1},arg_directive:{rules:[3,4,9,10],inclusive:!1},type_directive:{rules:[2,3,9,10],inclusive:!1},open_directive:{rules:[1,9,10],inclusive:!1},struct:{rules:[9,10,15,28,29,30,44,45,46,47,48],inclusive:!1},FLOATING_NOTE_ID:{rules:[37],inclusive:!1},FLOATING_NOTE:{rules:[34,35,36],inclusive:!1},NOTE_TEXT:{rules:[39,40],inclusive:!1},NOTE_ID:{rules:[38],inclusive:!1},NOTE:{rules:[31,32,33],inclusive:!1},SCALE:{rules:[13,14],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[22],inclusive:!1},STATE_STRING:{rules:[23,24],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,16,17,18,19,20,21,25,26,27],inclusive:!1},ID:{rules:[9,10],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,10,11,12,15,27,30,41,42,43,44,45,46,47,49,50],inclusive:!0}}};function T(){this.yy={}}return w.lexer=E,T.prototype=w,w.Parser=T,new T}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e,n){(function(t){t.exports=function(){"use strict";var e,r;function i(){return e.apply(null,arguments)}function a(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function u(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function l(t,e){var n,r=[];for(n=0;n>>0,r=0;rgt(t)?(a=t+1,s-gt(t)):(a=t,s),{year:a,dayOfYear:o}}function Ft(t,e,n){var r,i,a=Bt(t.year(),e,n),o=Math.floor((t.dayOfYear()-a-1)/7)+1;return o<1?r=o+Pt(i=t.year()-1,e,n):o>Pt(t.year(),e,n)?(r=o-Pt(t.year(),e,n),i=t.year()+1):(i=t.year(),r=o),{week:r,year:i}}function Pt(t,e,n){var r=Bt(t,e,n),i=Bt(t+1,e,n);return(gt(t)-r+i)/7}function It(t,e){return t.slice(e,7).concat(t.slice(0,e))}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),L("week","w"),L("isoWeek","W"),j("week",5),j("isoWeek",5),lt("w",Q),lt("ww",Q,q),lt("W",Q),lt("WW",Q,q),yt(["w","ww","W","WW"],(function(t,e,n,r){e[r.substr(0,1)]=w(t)})),W("d",0,"do","day"),W("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),W("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),W("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),L("day","d"),L("weekday","e"),L("isoWeekday","E"),j("day",11),j("weekday",11),j("isoWeekday",11),lt("d",Q),lt("e",Q),lt("E",Q),lt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),lt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),lt("dddd",(function(t,e){return e.weekdaysRegex(t)})),yt(["dd","ddd","dddd"],(function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:p(n).invalidWeekday=t})),yt(["d","e","E"],(function(t,e,n,r){e[r]=w(t)}));var jt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Rt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Yt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),zt=ct,Ut=ct,$t=ct;function Wt(){function t(t,e){return e.length-t.length}var e,n,r,i,a,o=[],s=[],c=[],u=[];for(e=0;e<7;e++)n=d([2e3,1]).day(e),r=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),a=this.weekdays(n,""),o.push(r),s.push(i),c.push(a),u.push(r),u.push(i),u.push(a);for(o.sort(t),s.sort(t),c.sort(t),u.sort(t),e=0;e<7;e++)s[e]=ft(s[e]),c[e]=ft(c[e]),u[e]=ft(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Ht(){return this.hours()%12||12}function Vt(t,e){W(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function Gt(t,e){return e._meridiemParse}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,Ht),W("k",["kk",2],0,(function(){return this.hours()||24})),W("hmm",0,0,(function(){return""+Ht.apply(this)+R(this.minutes(),2)})),W("hmmss",0,0,(function(){return""+Ht.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)})),W("Hmm",0,0,(function(){return""+this.hours()+R(this.minutes(),2)})),W("Hmmss",0,0,(function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)})),Vt("a",!0),Vt("A",!1),L("hour","h"),j("hour",13),lt("a",Gt),lt("A",Gt),lt("H",Q),lt("h",Q),lt("k",Q),lt("HH",Q,q),lt("hh",Q,q),lt("kk",Q,q),lt("hmm",K),lt("hmmss",tt),lt("Hmm",K),lt("Hmmss",tt),pt(["H","HH"],3),pt(["k","kk"],(function(t,e,n){var r=w(t);e[3]=24===r?0:r})),pt(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),pt(["h","hh"],(function(t,e,n){e[3]=w(t),p(n).bigHour=!0})),pt("hmm",(function(t,e,n){var r=t.length-2;e[3]=w(t.substr(0,r)),e[4]=w(t.substr(r)),p(n).bigHour=!0})),pt("hmmss",(function(t,e,n){var r=t.length-4,i=t.length-2;e[3]=w(t.substr(0,r)),e[4]=w(t.substr(r,2)),e[5]=w(t.substr(i)),p(n).bigHour=!0})),pt("Hmm",(function(t,e,n){var r=t.length-2;e[3]=w(t.substr(0,r)),e[4]=w(t.substr(r))})),pt("Hmmss",(function(t,e,n){var r=t.length-4,i=t.length-2;e[3]=w(t.substr(0,r)),e[4]=w(t.substr(r,2)),e[5]=w(t.substr(i))}));var qt,Xt=_t("Hours",!0),Zt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Tt,monthsShort:Ct,week:{dow:0,doy:6},weekdays:jt,weekdaysMin:Yt,weekdaysShort:Rt,meridiemParse:/[ap]\.?m?\.?/i},Jt={},Qt={};function Kt(t){return t?t.toLowerCase().replace("_","-"):t}function te(e){var r=null;if(!Jt[e]&&void 0!==t&&t&&t.exports)try{r=qt._abbr,n(171)("./"+e),ee(r)}catch(e){}return Jt[e]}function ee(t,e){var n;return t&&((n=s(e)?re(t):ne(t,e))?qt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),qt._abbr}function ne(t,e){if(null===e)return delete Jt[t],null;var n,r=Zt;if(e.abbr=t,null!=Jt[t])M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Jt[t]._config;else if(null!=e.parentLocale)if(null!=Jt[e.parentLocale])r=Jt[e.parentLocale]._config;else{if(null==(n=te(e.parentLocale)))return Qt[e.parentLocale]||(Qt[e.parentLocale]=[]),Qt[e.parentLocale].push({name:t,config:e}),null;r=n._config}return Jt[t]=new N(D(r,e)),Qt[t]&&Qt[t].forEach((function(t){ne(t.name,t.config)})),ee(t),Jt[t]}function re(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return qt;if(!a(t)){if(e=te(t))return e;t=[t]}return function(t){for(var e,n,r,i,a=0;a=e&&E(i,n,!0)>=e-1)break;e--}a++}return qt}(t)}function ie(t){var e,n=t._a;return n&&-2===p(t).overflow&&(e=n[1]<0||11wt(n[0],n[1])?2:n[3]<0||24Pt(n,a,o)?p(t)._overflowWeeks=!0:null!=c?p(t)._overflowWeekday=!0:(s=Lt(n,r,i,a,o),t._a[0]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=ae(t._a[0],r[0]),(t._dayOfYear>gt(o)||0===t._dayOfYear)&&(p(t)._overflowDayOfYear=!0),n=Nt(o,0,t._dayOfYear),t._a[1]=n.getUTCMonth(),t._a[2]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=r[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[3]&&0===t._a[4]&&0===t._a[5]&&0===t._a[6]&&(t._nextDay=!0,t._a[3]=0),t._d=(t._useUTC?Nt:function(t,e,n,r,i,a,o){var s;return t<100&&0<=t?(s=new Date(t+400,e,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,r,i,a,o),s}).apply(null,s),a=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[3]=24),t._w&&void 0!==t._w.d&&t._w.d!==a&&(p(t).weekdayMismatch=!0)}}var se=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ce=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ue=/Z|[+-]\d\d(?::?\d\d)?/,le=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],he=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],fe=/^\/?Date\((\-?\d+)/i;function de(t){var e,n,r,i,a,o,s=t._i,c=se.exec(s)||ce.exec(s);if(c){for(p(t).iso=!0,e=0,n=le.length;en.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},on.isLocal=function(){return!!this.isValid()&&!this._isUTC},on.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},on.isUtc=Be,on.isUTC=Be,on.zoneAbbr=function(){return this._isUTC?"UTC":""},on.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},on.dates=C("dates accessor is deprecated. Use date instead.",Ke),on.months=C("months accessor is deprecated. Use month instead",St),on.years=C("years accessor is deprecated. Use year instead",bt),on.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),on.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(m(t,this),(t=me(t))._a){var e=t._isUTC?d(t._a):_e(t._a);this._isDSTShifted=this.isValid()&&0h&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},qt={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),12;case 1:return this.begin("type_directive"),13;case 2:return this.popState(),this.begin("arg_directive"),10;case 3:return this.popState(),this.popState(),15;case 4:return 14;case 5:case 6:break;case 7:this.begin("string");break;case 8:this.popState();break;case 9:return"STR";case 10:return 75;case 11:return 84;case 12:return 76;case 13:return 90;case 14:return 77;case 15:return 78;case 16:return 79;case 17:case 18:return t.lex.firstGraph()&&this.begin("dir"),24;case 19:return 38;case 20:return 42;case 21:case 22:case 23:case 24:return 87;case 25:return this.popState(),25;case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:return this.popState(),26;case 36:return 91;case 37:return 99;case 38:return 47;case 39:return 96;case 40:return 46;case 41:return 20;case 42:return 92;case 43:return 110;case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:return 70;case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:return 69;case 84:return 51;case 85:return 52;case 86:return 53;case 87:return 54;case 88:return 55;case 89:return 56;case 90:return 57;case 91:return 58;case 92:return 97;case 93:return 100;case 94:return 111;case 95:return 108;case 96:return 101;case 97:case 98:return 109;case 99:return 102;case 100:return 61;case 101:return 81;case 102:return"SEP";case 103:return 80;case 104:return 95;case 105:return 63;case 106:return 62;case 107:return 65;case 108:return 64;case 109:return 106;case 110:return 107;case 111:return 71;case 112:return 49;case 113:return 50;case 114:return 40;case 115:return 41;case 116:return 59;case 117:return 60;case 118:return 117;case 119:return 21;case 120:return 22;case 121:return 23}},rules:[/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,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/^(?:\s*[x]-\.\s*)/,/^(?:\s*[o]-\.\s*)/,/^(?:\s*<==\s*)/,/^(?:\s*[x]==\s*)/,/^(?:\s*[o]==\s*)/,/^(?:\s*--\s*)/,/^(?:\s*-\.\s*)/,/^(?:\s*==\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\()/,/^(?:\)\])/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A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]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},vertex:{rules:[],inclusive:!1},dir:{rules:[25,26,27,28,29,30,31,32,33,34,35],inclusive:!1},string:{rules:[8,9],inclusive:!1},INITIAL:{rules:[0,5,6,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121],inclusive:!0}}};function Xt(){this.yy={}}return Gt.lexer=qt,Xt.prototype=Gt,Gt.Parser=Xt,new Xt}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e,n){(function(t,r){var i=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,3],n=[1,5],r=[7,9,11,12,13,14,15,16,17,18,20,27,32],i=[1,15],a=[1,16],o=[1,17],s=[1,18],c=[1,19],u=[1,20],l=[1,21],h=[1,23],f=[1,25],d=[1,28],p=[5,7,9,11,12,13,14,15,16,17,18,20,27,32],y={trace:function(){},yy:{},symbols_:{error:2,start:3,directive:4,gantt:5,document:6,EOF:7,line:8,SPACE:9,statement:10,NL:11,dateFormat:12,inclusiveEndDates:13,axisFormat:14,excludes:15,todayMarker:16,title:17,section:18,clickStatement:19,taskTxt:20,taskData:21,openDirective:22,typeDirective:23,closeDirective:24,":":25,argDirective:26,click:27,callbackname:28,callbackargs:29,href:30,clickStatementDebug:31,open_directive:32,type_directive:33,arg_directive:34,close_directive:35,$accept:0,$end:1},terminals_:{2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"axisFormat",15:"excludes",16:"todayMarker",17:"title",18:"section",20:"taskTxt",21:"taskData",25:":",27:"click",28:"callbackname",29:"callbackargs",30:"href",32:"open_directive",33:"type_directive",34:"arg_directive",35:"close_directive"},productions_:[0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[19,2],[19,3],[19,3],[19,4],[19,3],[19,4],[19,2],[31,2],[31,3],[31,3],[31,4],[31,3],[31,4],[31,2],[22,1],[23,1],[26,1],[24,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 2:return a[s-1];case 3:this.$=[];break;case 4:a[s-1].push(a[s]),this.$=a[s-1];break;case 5:case 6:this.$=a[s];break;case 7:case 8:this.$=[];break;case 9:r.setDateFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 10:r.enableInclusiveEndDates(),this.$=a[s].substr(18);break;case 11:r.setAxisFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 12:r.setExcludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 13:r.setTodayMarker(a[s].substr(12)),this.$=a[s].substr(12);break;case 14:r.setTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 17:r.addTask(a[s-1],a[s]),this.$="task";break;case 21:this.$=a[s-1],r.setClickEvent(a[s-1],a[s],null);break;case 22:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 23:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],null),r.setLink(a[s-2],a[s]);break;case 24:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setLink(a[s-3],a[s]);break;case 25:this.$=a[s-2],r.setClickEvent(a[s-2],a[s],null),r.setLink(a[s-2],a[s-1]);break;case 26:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-1],a[s]),r.setLink(a[s-3],a[s-2]);break;case 27:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 28:case 34:this.$=a[s-1]+" "+a[s];break;case 29:case 30:case 32:this.$=a[s-2]+" "+a[s-1]+" "+a[s];break;case 31:case 33:this.$=a[s-3]+" "+a[s-2]+" "+a[s-1]+" "+a[s];break;case 35:r.parseDirective("%%{","open_directive");break;case 36:r.parseDirective(a[s],"type_directive");break;case 37:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 38:r.parseDirective("}%%","close_directive","gantt")}},table:[{3:1,4:2,5:e,22:4,32:n},{1:[3]},{3:6,4:2,5:e,22:4,32:n},t(r,[2,3],{6:7}),{23:8,33:[1,9]},{33:[2,35]},{1:[2,1]},{4:24,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:i,13:a,14:o,15:s,16:c,17:u,18:l,19:22,20:h,22:4,27:f,32:n},{24:26,25:[1,27],35:d},t([25,35],[2,36]),t(r,[2,8],{1:[2,2]}),t(r,[2,4]),{4:24,10:29,12:i,13:a,14:o,15:s,16:c,17:u,18:l,19:22,20:h,22:4,27:f,32:n},t(r,[2,6]),t(r,[2,7]),t(r,[2,9]),t(r,[2,10]),t(r,[2,11]),t(r,[2,12]),t(r,[2,13]),t(r,[2,14]),t(r,[2,15]),t(r,[2,16]),{21:[1,30]},t(r,[2,18]),{28:[1,31],30:[1,32]},{11:[1,33]},{26:34,34:[1,35]},{11:[2,38]},t(r,[2,5]),t(r,[2,17]),t(r,[2,21],{29:[1,36],30:[1,37]}),t(r,[2,27],{28:[1,38]}),t(p,[2,19]),{24:39,35:d},{35:[2,37]},t(r,[2,22],{30:[1,40]}),t(r,[2,23]),t(r,[2,25],{29:[1,41]}),{11:[1,42]},t(r,[2,24]),t(r,[2,26]),t(p,[2,20])],defaultActions:{5:[2,35],6:[2,1],28:[2,38],35:[2,37]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,u=0,l=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var v=p.yylloc;a.push(v);var m=p.options&&p.options.ranges;function b(){var t;return"number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,E,T,C,A,S,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=b()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var O="";for(T in S=[],o[k])this.terminals_[T]&&T>h&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},g={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),32;case 1:return this.begin("type_directive"),33;case 2:return this.popState(),this.begin("arg_directive"),25;case 3:return this.popState(),this.popState(),35;case 4:return 34;case 5:case 6:case 7:break;case 8:return 11;case 9:case 10:case 11:break;case 12:this.begin("href");break;case 13:this.popState();break;case 14:return 30;case 15:this.begin("callbackname");break;case 16:this.popState();break;case 17:this.popState(),this.begin("callbackargs");break;case 18:return 28;case 19:this.popState();break;case 20:return 29;case 21:this.begin("click");break;case 22:this.popState();break;case 23:return 27;case 24:return 5;case 25:return 12;case 26:return 13;case 27:return 14;case 28:return 15;case 29:return 16;case 30:return"date";case 31:return 17;case 32:return 18;case 33:return 20;case 34:return 21;case 35:return 25;case 36:return 7;case 37:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},callbackargs:{rules:[19,20],inclusive:!1},callbackname:{rules:[16,17,18],inclusive:!1},href:{rules:[13,14],inclusive:!1},click:{rules:[22,23],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,15,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37],inclusive:!0}}};function v(){this.yy={}}return y.lexer=g,v.prototype=y,y.Parser=v,new v}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e,n){(function(t,r){var i=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,2],n=[1,5],r=[6,9,11,17,18,19,21],i=[1,15],a=[1,16],o=[1,17],s=[1,21],c=[4,6,9,11,17,18,19,21],u={trace:function(){},yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,title:17,section:18,taskName:19,taskData:20,open_directive:21,type_directive:22,arg_directive:23,close_directive:24,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"section",19:"taskName",20:"taskData",21:"open_directive",22:"type_directive",23:"arg_directive",24:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:this.$=[];break;case 4:a[s-1].push(a[s]),this.$=a[s-1];break;case 5:case 6:this.$=a[s];break;case 7:case 8:this.$=[];break;case 11:r.setTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 13:r.addTask(a[s-1],a[s]),this.$="task";break;case 15:r.parseDirective("%%{","open_directive");break;case 16:r.parseDirective(a[s],"type_directive");break;case 17:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 18:r.parseDirective("}%%","close_directive","journey")}},table:[{3:1,4:e,7:3,12:4,21:n},{1:[3]},t(r,[2,3],{5:6}),{3:7,4:e,7:3,12:4,21:n},{13:8,22:[1,9]},{22:[2,15]},{6:[1,10],7:18,8:11,9:[1,12],10:13,11:[1,14],12:4,17:i,18:a,19:o,21:n},{1:[2,2]},{14:19,15:[1,20],24:s},t([15,24],[2,16]),t(r,[2,8],{1:[2,1]}),t(r,[2,4]),{7:18,10:22,12:4,17:i,18:a,19:o,21:n},t(r,[2,6]),t(r,[2,7]),t(r,[2,11]),t(r,[2,12]),{20:[1,23]},t(r,[2,14]),{11:[1,24]},{16:25,23:[1,26]},{11:[2,18]},t(r,[2,5]),t(r,[2,13]),t(c,[2,9]),{14:27,24:s},{24:[2,17]},{11:[1,28]},t(c,[2,10])],defaultActions:{5:[2,15],7:[2,2],21:[2,18],26:[2,17]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,u=0,l=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var v=p.yylloc;a.push(v);var m=p.options&&p.options.ranges;function b(){var t;return"number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,E,T,C,A,S,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=b()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var O="";for(T in S=[],o[k])this.terminals_[T]&&T>h&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},l={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),21;case 1:return this.begin("type_directive"),22;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),24;case 4:return 23;case 5:case 6:break;case 7:return 11;case 8:case 9:break;case 10:return 4;case 11:return 17;case 12:return 18;case 13:return 19;case 14:return 20;case 15:return 15;case 16:return 6;case 17:return"INVALID"}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}};function h(){this.yy={}}return u.lexer=l,h.prototype=u,u.Parser=h,new h}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(15);e.default=function(t,e){return r.default.lang.round(i.default.parse(t)[e])}},function(t,e,n){var r=n(112),i=n(82),a=n(24);t.exports=function(t){return a(t)?r(t):i(t)}},function(t,e,n){var r;if(!r)try{r=n(0)}catch(t){}r||(r=window.d3),t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(15);e.default=function(t,e,n){var a=i.default.parse(t),o=a[e],s=r.default.channel.clamp[e](o+n);return o!==s&&(a[e]=s),i.default.stringify(a)}},function(t,e,n){var r=n(210),i=n(216);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(39),i=n(212),a=n(213),o=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":o&&o in Object(t)?i(t):a(t)}},function(t,e){t.exports=function(t){return t}},function(t){t.exports=JSON.parse('{"name":"mermaid","version":"8.7.0","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"dist/mermaid.core.js","keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"scripts":{"build:development":"webpack --progress --colors","build:production":"yarn build:development -p --config webpack.config.prod.babel.js","build":"yarn build:development && yarn build:production","postbuild":"documentation build src/mermaidAPI.js src/config.js --shallow -f md --markdown-toc false -o docs/Setup.md","build:watch":"yarn build --watch","minify":"minify ./dist/mermaid.js > ./dist/mermaid.min.js","release":"yarn build","lint":"eslint src","e2e:depr":"yarn lint && jest e2e --config e2e/jest.config.js","cypress":"percy exec -- cypress run","e2e":"start-server-and-test dev http://localhost:9000/ cypress","e2e-upd":"yarn lint && jest e2e -u --config e2e/jest.config.js","dev":"webpack-dev-server --config webpack.config.e2e.js","test":"yarn lint && jest src/.*","test:watch":"jest --watch src","prepublishOnly":"yarn build && yarn test && yarn e2e","prepare":"yarn build"},"repository":{"type":"git","url":"https://github.com/knsv/mermaid"},"author":"Knut Sveidqvist","license":"MIT","standard":{"ignore":["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],"globals":["page"]},"dependencies":{"@braintree/sanitize-url":"^3.1.0","babel-eslint":"^10.1.0","d3":"^5.7.0","dagre":"^0.8.4","dagre-d3":"^0.6.4","entity-decode":"^2.0.2","graphlib":"^2.1.7","he":"^1.2.0","khroma":"^1.1.0","minify":"^4.1.1","moment-mini":"^2.22.1","stylis":"^3.5.2"},"devDependencies":{"@babel/core":"^7.2.2","@babel/preset-env":"^7.8.4","@babel/register":"^7.0.0","@percy/cypress":"*","babel-core":"7.0.0-bridge.0","babel-jest":"^24.9.0","babel-loader":"^8.0.4","coveralls":"^3.0.2","css-loader":"^2.0.1","css-to-string-loader":"^0.1.3","cypress":"4.0.1","documentation":"^12.0.1","eslint":"^6.3.0","eslint-config-prettier":"^6.3.0","eslint-plugin-prettier":"^3.1.0","husky":"^1.2.1","identity-obj-proxy":"^3.0.0","jest":"^24.9.0","jison":"^0.4.18","moment":"^2.23.0","node-sass":"^4.12.0","prettier":"^1.18.2","puppeteer":"^1.17.0","sass-loader":"^7.1.0","start-server-and-test":"^1.10.6","terser-webpack-plugin":"^2.2.2","webpack":"^4.41.2","webpack-bundle-analyzer":"^3.7.0","webpack-cli":"^3.1.2","webpack-dev-server":"^3.4.1","webpack-node-externals":"^1.7.2","yarn-upgrade-all":"^0.5.0"},"files":["dist"],"yarn-upgrade-all":{"ignore":["babel-core"]},"sideEffects":["**/*.css","**/*.scss"],"husky":{"hooks":{"pre-push":"yarn test"}}}')},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(34),i=n(11);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(16).Symbol;t.exports=r},function(t,e,n){(function(t){var r=n(16),i=n(232),a=e&&!e.nodeType&&e,o=a&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===a?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||i;t.exports=c}).call(this,n(7)(t))},function(t,e,n){var r=n(112),i=n(236),a=n(24);t.exports=function(t){return a(t)?r(t,!0):i(t)}},function(t,e,n){var r=n(241),i=n(77),a=n(242),o=n(121),s=n(243),c=n(34),u=n(110),l=u(r),h=u(i),f=u(a),d=u(o),p=u(s),y=c;(r&&"[object DataView]"!=y(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=y(new i)||a&&"[object Promise]"!=y(a.resolve())||o&&"[object Set]"!=y(new o)||s&&"[object WeakMap]"!=y(new s))&&(y=function(t){var e=c(t),n="[object Object]"==e?t.constructor:void 0,r=n?u(n):"";if(r)switch(r){case l:return"[object DataView]";case h:return"[object Map]";case f:return"[object Promise]";case d:return"[object Set]";case p:return"[object WeakMap]"}return e}),t.exports=y},function(t,e,n){var r=n(34),i=n(21);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},function(t,e,n){var r;try{r={defaults:n(154),each:n(87),isFunction:n(38),isPlainObject:n(158),pick:n(161),has:n(93),range:n(162),uniqueId:n(163)}}catch(t){}r||(r=window._),t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=new(n(176).default)({r:0,g:0,b:0,a:0},"transparent");e.default=r},function(t,e,n){var r=n(58),i=n(59);t.exports=function(t,e,n,a){var o=!n;n||(n={});for(var s=-1,c=e.length;++s-1&&t%1==0&&t-1}(s)?s:(n=s.match(a))?(e=n[0],r.test(e)?"about:blank":s):"about:blank"}}},function(t,e,n){(function(t,r){var i=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[2,3],n=[1,7],r=[7,12,15,17,19,20,21],i=[7,11,12,15,17,19,20,21],a=[2,20],o=[1,32],s={trace:function(){},yy:{},symbols_:{error:2,start:3,GG:4,":":5,document:6,EOF:7,DIR:8,options:9,body:10,OPT:11,NL:12,line:13,statement:14,COMMIT:15,commit_arg:16,BRANCH:17,ID:18,CHECKOUT:19,MERGE:20,RESET:21,reset_arg:22,STR:23,HEAD:24,reset_parents:25,CARET:26,$accept:0,$end:1},terminals_:{2:"error",4:"GG",5:":",7:"EOF",8:"DIR",11:"OPT",12:"NL",15:"COMMIT",17:"BRANCH",18:"ID",19:"CHECKOUT",20:"MERGE",21:"RESET",23:"STR",24:"HEAD",26:"CARET"},productions_:[0,[3,4],[3,5],[6,0],[6,2],[9,2],[9,1],[10,0],[10,2],[13,2],[13,1],[14,2],[14,2],[14,2],[14,2],[14,2],[16,0],[16,1],[22,2],[22,2],[25,0],[25,2]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:return r.setDirection(a[s-3]),a[s-1];case 4:r.setOptions(a[s-1]),this.$=a[s];break;case 5:a[s-1]+=a[s],this.$=a[s-1];break;case 7:this.$=[];break;case 8:a[s-1].push(a[s]),this.$=a[s-1];break;case 9:this.$=a[s-1];break;case 11:r.commit(a[s]);break;case 12:r.branch(a[s]);break;case 13:r.checkout(a[s]);break;case 14:r.merge(a[s]);break;case 15:r.reset(a[s]);break;case 16:this.$="";break;case 17:this.$=a[s];break;case 18:this.$=a[s-1]+":"+a[s];break;case 19:this.$=a[s-1]+":"+r.count,r.count=0;break;case 20:r.count=0;break;case 21:r.count+=1}},table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3],8:[1,4]},{6:5,7:e,9:6,12:n},{5:[1,8]},{7:[1,9]},t(r,[2,7],{10:10,11:[1,11]}),t(i,[2,6]),{6:12,7:e,9:6,12:n},{1:[2,1]},{7:[2,4],12:[1,15],13:13,14:14,15:[1,16],17:[1,17],19:[1,18],20:[1,19],21:[1,20]},t(i,[2,5]),{7:[1,21]},t(r,[2,8]),{12:[1,22]},t(r,[2,10]),{12:[2,16],16:23,23:[1,24]},{18:[1,25]},{18:[1,26]},{18:[1,27]},{18:[1,30],22:28,24:[1,29]},{1:[2,2]},t(r,[2,9]),{12:[2,11]},{12:[2,17]},{12:[2,12]},{12:[2,13]},{12:[2,14]},{12:[2,15]},{12:a,25:31,26:o},{12:a,25:33,26:o},{12:[2,18]},{12:a,25:34,26:o},{12:[2,19]},{12:[2,21]}],defaultActions:{9:[2,1],21:[2,2],23:[2,11],24:[2,17],25:[2,12],26:[2,13],27:[2,14],28:[2,15],31:[2,18],33:[2,19],34:[2,21]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,u=0,l=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var v=p.yylloc;a.push(v);var m=p.options&&p.options.ranges;function b(){var t;return"number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,E,T,C,A,S,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=b()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var O="";for(T in S=[],o[k])this.terminals_[T]&&T>h&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},c={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 12;case 1:case 2:case 3:break;case 4:return 4;case 5:return 15;case 6:return 17;case 7:return 20;case 8:return 21;case 9:return 19;case 10:case 11:return 8;case 12:return 5;case 13:return 26;case 14:this.begin("options");break;case 15:this.popState();break;case 16:return 11;case 17:this.begin("string");break;case 18:this.popState();break;case 19:return 23;case 20:return 18;case 21:return 7}},rules:[/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit\b)/i,/^(?:branch\b)/i,/^(?:merge\b)/i,/^(?:reset\b)/i,/^(?:checkout\b)/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:end\r?\n)/i,/^(?:[^\n]+\r?\n)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[a-zA-Z][-_\.a-zA-Z0-9]*[-_a-zA-Z0-9])/i,/^(?:$)/i],conditions:{options:{rules:[15,16],inclusive:!1},string:{rules:[18,19],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,20,21],inclusive:!0}}};function u(){this.yy={}}return s.lexer=c,u.prototype=s,s.Parser=u,new u}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e,n){(function(t,r){var i=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[6,9,10],n={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],performAction:function(t,e,n,r,i,a,o){a.length;switch(i){case 1:return r;case 4:break;case 6:r.setInfo(!0)}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},t(e,[2,3]),t(e,[2,4]),t(e,[2,5]),t(e,[2,6])],defaultActions:{4:[2,1]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,u=0,l=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var v=p.yylloc;a.push(v);var m=p.options&&p.options.ranges;function b(){var t;return"number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,E,T,C,A,S,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=b()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var O="";for(T in S=[],o[k])this.terminals_[T]&&T>h&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},r={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return 4;case 1:return 9;case 2:return"space";case 3:return 10;case 4:return 6;case 5:return"TXT"}},rules:[/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5],inclusive:!0}}};function i(){this.yy={}}return n.lexer=r,i.prototype=n,n.Parser=i,new i}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e,n){(function(t,r){var i=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,4],n=[1,5],r=[1,6],i=[1,7],a=[1,9],o=[1,10,12,19,20,21,22],s=[1,6,10,12,19,20,21,22],c=[19,20,21],u=[1,22],l=[6,19,20,21,22],h={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,directive:5,PIE:6,document:7,line:8,statement:9,txt:10,value:11,title:12,title_value:13,openDirective:14,typeDirective:15,closeDirective:16,":":17,argDirective:18,NEWLINE:19,";":20,EOF:21,open_directive:22,type_directive:23,arg_directive:24,close_directive:25,$accept:0,$end:1},terminals_:{2:"error",6:"PIE",10:"txt",11:"value",12:"title",13:"title_value",17:":",19:"NEWLINE",20:";",21:"EOF",22:"open_directive",23:"type_directive",24:"arg_directive",25:"close_directive"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[9,0],[9,2],[9,2],[9,1],[5,3],[5,5],[4,1],[4,1],[4,1],[14,1],[15,1],[18,1],[16,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 6:this.$=a[s-1];break;case 8:r.addSection(a[s-1],r.cleanupValue(a[s]));break;case 9:this.$=a[s].trim(),r.setTitle(this.$);break;case 16:r.parseDirective("%%{","open_directive");break;case 17:r.parseDirective(a[s],"type_directive");break;case 18:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 19:r.parseDirective("}%%","close_directive","pie")}},table:[{3:1,4:2,5:3,6:e,14:8,19:n,20:r,21:i,22:a},{1:[3]},{3:10,4:2,5:3,6:e,14:8,19:n,20:r,21:i,22:a},{3:11,4:2,5:3,6:e,14:8,19:n,20:r,21:i,22:a},t(o,[2,4],{7:12}),t(s,[2,13]),t(s,[2,14]),t(s,[2,15]),{15:13,23:[1,14]},{23:[2,16]},{1:[2,1]},{1:[2,2]},t(c,[2,7],{14:8,8:15,9:16,5:19,1:[2,3],10:[1,17],12:[1,18],22:a}),{16:20,17:[1,21],25:u},t([17,25],[2,17]),t(o,[2,5]),{4:23,19:n,20:r,21:i},{11:[1,24]},{13:[1,25]},t(c,[2,10]),t(l,[2,11]),{18:26,24:[1,27]},t(l,[2,19]),t(o,[2,6]),t(c,[2,8]),t(c,[2,9]),{16:28,25:u},{25:[2,18]},t(l,[2,12])],defaultActions:{9:[2,16],10:[2,1],11:[2,2],27:[2,18]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,u=0,l=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var v=p.yylloc;a.push(v);var m=p.options&&p.options.ranges;function b(){var t;return"number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,E,T,C,A,S,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=b()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var O="";for(T in S=[],o[k])this.terminals_[T]&&T>h&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},f={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),22;case 1:return this.begin("type_directive"),23;case 2:return this.popState(),this.begin("arg_directive"),17;case 3:return this.popState(),this.popState(),25;case 4:return 24;case 5:break;case 6:console.log("Crap after close");break;case 7:return 19;case 8:case 9:break;case 10:return this.begin("title"),12;case 11:return this.popState(),"title_value";case 12:this.begin("string");break;case 13:this.popState();break;case 14:return"txt";case 15:return 6;case 16:return"value";case 17:return 21}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],conditions:{close_directive:{rules:[],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},open_directive:{rules:[1],inclusive:!1},title:{rules:[11],inclusive:!1},string:{rules:[13,14],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,12,15,16,17],inclusive:!0}}};function d(){this.yy={}}return h.lexer=f,d.prototype=h,h.Parser=d,new d}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e,n){(function(t,r){var i=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,2],n=[1,5],r=[6,9,11,20,30],i=[1,17],a=[1,20],o=[1,24],s=[1,25],c=[1,26],u=[1,27],l=[20,27,28],h=[4,6,9,11,20,30],f=[23,24,25,26],d={trace:function(){},yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,directive:7,line:8,SPACE:9,statement:10,NEWLINE:11,openDirective:12,typeDirective:13,closeDirective:14,":":15,argDirective:16,entityName:17,relSpec:18,role:19,ALPHANUM:20,cardinality:21,relType:22,ZERO_OR_ONE:23,ZERO_OR_MORE:24,ONE_OR_MORE:25,ONLY_ONE:26,NON_IDENTIFYING:27,IDENTIFYING:28,WORD:29,open_directive:30,type_directive:31,arg_directive:32,close_directive:33,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"ALPHANUM",23:"ZERO_OR_ONE",24:"ZERO_OR_MORE",25:"ONE_OR_MORE",26:"ONLY_ONE",27:"NON_IDENTIFYING",28:"IDENTIFYING",29:"WORD",30:"open_directive",31:"type_directive",32:"arg_directive",33:"close_directive"},productions_:[0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[17,1],[18,3],[21,1],[21,1],[21,1],[21,1],[22,1],[22,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]],performAction:function(t,e,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 3:this.$=[];break;case 4:a[s-1].push(a[s]),this.$=a[s-1];break;case 5:case 6:this.$=a[s];break;case 7:case 8:this.$=[];break;case 12:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]);break;case 13:this.$=a[s];break;case 14:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 15:this.$=r.Cardinality.ZERO_OR_ONE;break;case 16:this.$=r.Cardinality.ZERO_OR_MORE;break;case 17:this.$=r.Cardinality.ONE_OR_MORE;break;case 18:this.$=r.Cardinality.ONLY_ONE;break;case 19:this.$=r.Identification.NON_IDENTIFYING;break;case 20:this.$=r.Identification.IDENTIFYING;break;case 21:this.$=a[s].replace(/"/g,"");break;case 22:this.$=a[s];break;case 23:r.parseDirective("%%{","open_directive");break;case 24:r.parseDirective(a[s],"type_directive");break;case 25:a[s]=a[s].trim().replace(/'/g,'"'),r.parseDirective(a[s],"arg_directive");break;case 26:r.parseDirective("}%%","close_directive","er")}},table:[{3:1,4:e,7:3,12:4,30:n},{1:[3]},t(r,[2,3],{5:6}),{3:7,4:e,7:3,12:4,30:n},{13:8,31:[1,9]},{31:[2,23]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,20:i,30:n},{1:[2,2]},{14:18,15:[1,19],33:a},t([15,33],[2,24]),t(r,[2,8],{1:[2,1]}),t(r,[2,4]),{7:15,10:21,12:4,17:16,20:i,30:n},t(r,[2,6]),t(r,[2,7]),t(r,[2,11]),{18:22,21:23,23:o,24:s,25:c,26:u},t([15,23,24,25,26],[2,13]),{11:[1,28]},{16:29,32:[1,30]},{11:[2,26]},t(r,[2,5]),{17:31,20:i},{22:32,27:[1,33],28:[1,34]},t(l,[2,15]),t(l,[2,16]),t(l,[2,17]),t(l,[2,18]),t(h,[2,9]),{14:35,33:a},{33:[2,25]},{15:[1,36]},{21:37,23:o,24:s,25:c,26:u},t(f,[2,19]),t(f,[2,20]),{11:[1,38]},{19:39,20:[1,41],29:[1,40]},{20:[2,14]},t(h,[2,10]),t(r,[2,12]),t(r,[2,21]),t(r,[2,22])],defaultActions:{5:[2,23],7:[2,2],20:[2,26],30:[2,25],37:[2,14]},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=this,n=[0],r=[],i=[null],a=[],o=this.table,s="",c=0,u=0,l=0,h=2,f=1,d=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var v=p.yylloc;a.push(v);var m=p.options&&p.options.ranges;function b(){var t;return"number"!=typeof(t=r.pop()||p.lex()||f)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,x,k,w,E,T,C,A,S,M={};;){if(k=n[n.length-1],this.defaultActions[k]?w=this.defaultActions[k]:(null==_&&(_=b()),w=o[k]&&o[k][_]),void 0===w||!w.length||!w[0]){var O="";for(T in S=[],o[k])this.terminals_[T]&&T>h&&S.push("'"+this.terminals_[T]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(c+1)+": Unexpected "+(_==f?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:v,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+_);switch(w[0]){case 1:n.push(_),i.push(p.yytext),a.push(p.yylloc),n.push(w[1]),_=null,x?(_=x,x=null):(u=p.yyleng,s=p.yytext,c=p.yylineno,v=p.yylloc,l>0&&l--);break;case 2:if(C=this.productions_[w[1]][1],M.$=i[i.length-C],M._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(M._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(M,[s,u,c,y.yy,w[1],i,a].concat(d))))return E;C&&(n=n.slice(0,-1*C*2),i=i.slice(0,-1*C),a=a.slice(0,-1*C)),n.push(this.productions_[w[1]][0]),i.push(M.$),a.push(M._$),A=o[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;ae[0].length)){if(e=n,r=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,r){switch(n){case 0:return this.begin("open_directive"),30;case 1:return this.begin("type_directive"),31;case 2:return this.popState(),this.begin("arg_directive"),15;case 3:return this.popState(),this.popState(),33;case 4:return 32;case 5:case 6:break;case 7:return 11;case 8:break;case 9:return 9;case 10:return 29;case 11:return 4;case 12:return 23;case 13:return 24;case 14:return 25;case 15:return 26;case 16:return 23;case 17:return 24;case 18:return 25;case 19:return 27;case 20:return 28;case 21:case 22:return 27;case 23:return 20;case 24:return e.yytext[0];case 25:return 6}},rules:[/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\|o\b)/i,/^(?:\}o\b)/i,/^(?:\}\|)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z][A-Za-z0-9\-]*)/i,/^(?:.)/i,/^(?:$)/i],conditions:{open_directive:{rules:[1],inclusive:!1},type_directive:{rules:[2,3],inclusive:!1},arg_directive:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}};function y(){this.yy={}}return d.lexer=p,y.prototype=d,d.Parser=y,new y}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)},e.main=function(r){r[1]||(console.log("Usage: "+r[0]+" FILE"),t.exit(1));var i=n(19).readFileSync(n(20).normalize(r[1]),"utf8");return e.parser.parse(i)},n.c[n.s]===r&&e.main(t.argv.slice(1))}).call(this,n(14),n(7)(t))},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ALL=0]="ALL",t[t.RGB=1]="RGB",t[t.HSL=2]="HSL"}(r||(r={})),e.TYPE=r},function(t,e,n){"use strict";var r=n(10);t.exports=i;function i(t){this._isDirected=!r.has(t,"directed")||t.directed,this._isMultigraph=!!r.has(t,"multigraph")&&t.multigraph,this._isCompound=!!r.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(t,e){t[e]?t[e]++:t[e]=1}function o(t,e){--t[e]||delete t[e]}function s(t,e,n,i){var a=""+e,o=""+n;if(!t&&a>o){var s=a;a=o,o=s}return a+""+o+""+(r.isUndefined(i)?"\0":i)}function c(t,e,n,r){var i=""+e,a=""+n;if(!t&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function u(t,e){return s(t,e.v,e.w,e.name)}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(t){return this._label=t,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultNodeLabelFn=t,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return r.keys(this._nodes)},i.prototype.sources=function(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._in[e])}))},i.prototype.sinks=function(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._out[e])}))},i.prototype.setNodes=function(t,e){var n=arguments,i=this;return r.each(t,(function(t){n.length>1?i.setNode(t,e):i.setNode(t)})),this},i.prototype.setNode=function(t,e){return r.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},i.prototype.node=function(t){return this._nodes[t]},i.prototype.hasNode=function(t){return r.has(this._nodes,t)},i.prototype.removeNode=function(t){var e=this;if(r.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],r.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),r.each(r.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],r.each(r.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},i.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(e))e="\0";else{for(var n=e+="";!r.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},i.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},i.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},i.prototype.children=function(t){if(r.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return r.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},i.prototype.predecessors=function(t){var e=this._preds[t];if(e)return r.keys(e)},i.prototype.successors=function(t){var e=this._sucs[t];if(e)return r.keys(e)},i.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return r.union(e,this.successors(t))},i.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},i.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),r.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var i={};return this._isCompound&&r.each(e.nodes(),(function(t){e.setParent(t,function t(r){var a=n.parent(r);return void 0===a||e.hasNode(a)?(i[r]=a,a):a in i?i[a]:t(a)}(t))})),e},i.prototype.setDefaultEdgeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultEdgeLabelFn=t,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return r.values(this._edgeObjs)},i.prototype.setPath=function(t,e){var n=this,i=arguments;return r.reduce(t,(function(t,r){return i.length>1?n.setEdge(t,r,e):n.setEdge(t,r),r})),this},i.prototype.setEdge=function(){var t,e,n,i,o=!1,u=arguments[0];"object"==typeof u&&null!==u&&"v"in u?(t=u.v,e=u.w,n=u.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=u,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,r.isUndefined(n)||(n=""+n);var l=s(this._isDirected,t,e,n);if(r.has(this._edgeLabels,l))return o&&(this._edgeLabels[l]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[l]=o?i:this._defaultEdgeLabelFn(t,e,n);var h=c(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[l]=h,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][l]=h,this._out[t][l]=h,this._edgeCount++,this},i.prototype.edge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return this._edgeLabels[r]},i.prototype.hasEdge=function(t,e,n){var i=1===arguments.length?u(this._isDirected,arguments[0]):s(this._isDirected,t,e,n);return r.has(this._edgeLabels,i)},i.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):s(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[e],t),o(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},i.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.v===e})):i}},i.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.w===e})):i}},i.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},function(t,e,n){var r=n(33)(n(16),"Map");t.exports=r},function(t,e,n){var r=n(217),i=n(224),a=n(226),o=n(227),s=n(228);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){(function(t){var r=n(109),i=e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i&&r.process,s=function(){try{var t=a&&a.require&&a.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=s}).call(this,n(7)(t))},function(t,e,n){var r=n(62),i=n(234),a=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))a.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e,n){var r=n(116),i=n(117),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(t){return null==t?[]:(t=Object(t),r(o(t),(function(e){return a.call(t,e)})))}:i;t.exports=s},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n0&&a(l)?n>1?t(l,n-1,a,o,s):r(s,l):o||(s[s.length]=l)}return s}},function(t,e,n){var r=n(43);t.exports=function(t,e,n){for(var i=-1,a=t.length;++i4,u=c?1:17,l=c?8:4,h=s?0:-1,f=c?255:15;return i.default.set({r:(r>>l*(h+3)&f)*u,g:(r>>l*(h+2)&f)*u,b:(r>>l*(h+1)&f)*u,a:s?(r&f)*u/255:1},t)}}},stringify:function(t){return t.a<1?"#"+a.DEC2HEX[Math.round(t.r)]+a.DEC2HEX[Math.round(t.g)]+a.DEC2HEX[Math.round(t.b)]+r.default.unit.frac2hex(t.a):"#"+a.DEC2HEX[Math.round(t.r)]+a.DEC2HEX[Math.round(t.g)]+a.DEC2HEX[Math.round(t.b)]}};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(45),a=n(15);e.default=function(t,e,n,o){void 0===o&&(o=1);var s=i.default.set({h:r.default.channel.clamp.h(t),s:r.default.channel.clamp.s(e),l:r.default.channel.clamp.l(n),a:r.default.channel.clamp.a(o)});return a.default.stringify(s)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(29);e.default=function(t){return r.default(t,"a")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(15);e.default=function(t){var e=i.default.parse(t),n=e.r,a=e.g,o=e.b,s=.2126*r.default.channel.toLinear(n)+.7152*r.default.channel.toLinear(a)+.0722*r.default.channel.toLinear(o);return r.default.lang.round(s)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(102);e.default=function(t){return r.default(t)>=.5}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(32);e.default=function(t,e){return r.default(t,"a",e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(32);e.default=function(t,e){return r.default(t,"a",-e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(15),i=n(52);e.default=function(t,e){var n=r.default.parse(t),a={};for(var o in e)e[o]&&(a[o]=n[o]+e[o]);return i.default(t,a)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(15),i=n(51);e.default=function(t,e,n){void 0===n&&(n=50);var a=r.default.parse(t),o=a.r,s=a.g,c=a.b,u=a.a,l=r.default.parse(e),h=l.r,f=l.g,d=l.b,p=l.a,y=n/100,g=2*y-1,v=u-p,m=((g*v==-1?g:(g+v)/(1+g*v))+1)/2,b=1-m,_=o*m+h*b,x=s*m+f*b,k=c*m+d*b,w=u*y+p*(1-y);return i.default(_,x,k,w)}},function(t,e,n){var r=n(53),i=n(79),a=n(58),o=n(229),s=n(235),c=n(114),u=n(115),l=n(238),h=n(239),f=n(119),d=n(240),p=n(42),y=n(244),g=n(245),v=n(124),m=n(5),b=n(40),_=n(249),x=n(11),k=n(251),w=n(30),E={};E["[object Arguments]"]=E["[object Array]"]=E["[object ArrayBuffer]"]=E["[object DataView]"]=E["[object Boolean]"]=E["[object Date]"]=E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Map]"]=E["[object Number]"]=E["[object Object]"]=E["[object RegExp]"]=E["[object Set]"]=E["[object String]"]=E["[object Symbol]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E["[object Error]"]=E["[object Function]"]=E["[object WeakMap]"]=!1,t.exports=function t(e,n,T,C,A,S){var M,O=1&n,D=2&n,N=4&n;if(T&&(M=A?T(e,C,A,S):T(e)),void 0!==M)return M;if(!x(e))return e;var B=m(e);if(B){if(M=y(e),!O)return u(e,M)}else{var L=p(e),F="[object Function]"==L||"[object GeneratorFunction]"==L;if(b(e))return c(e,O);if("[object Object]"==L||"[object Arguments]"==L||F&&!A){if(M=D||F?{}:v(e),!O)return D?h(e,s(M,e)):l(e,o(M,e))}else{if(!E[L])return A?e:{};M=g(e,L,O)}}S||(S=new r);var P=S.get(e);if(P)return P;S.set(e,M),k(e)?e.forEach((function(r){M.add(t(r,n,T,r,e,S))})):_(e)&&e.forEach((function(r,i){M.set(i,t(r,n,T,i,e,S))}));var I=N?D?d:f:D?keysIn:w,j=B?void 0:I(e);return i(j||e,(function(r,i){j&&(r=e[i=r]),a(M,i,t(r,n,T,i,e,S))})),M}},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(211))},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(33),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,n){var r=n(230),i=n(47),a=n(5),o=n(40),s=n(60),c=n(48),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=a(t),l=!n&&i(t),h=!n&&!l&&o(t),f=!n&&!l&&!h&&c(t),d=n||l||h||f,p=d?r(t.length,String):[],y=p.length;for(var g in t)!e&&!u.call(t,g)||d&&("length"==g||h&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,y))||p.push(g);return p}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){(function(t){var r=n(16),i=e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,o=a&&a.exports===i?r.Buffer:void 0,s=o?o.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var n=t.length,r=s?s(n):new t.constructor(n);return t.copy(r),r}}).call(this,n(7)(t))},function(t,e){t.exports=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++nl))return!1;var f=c.get(t);if(f&&c.get(e))return f==e;var d=-1,p=!0,y=2&n?new r:void 0;for(c.set(t,e),c.set(e,t);++d0&&(a=c.removeMin(),(o=s[a]).distance!==Number.POSITIVE_INFINITY);)r(a).forEach(u);return s}(t,String(e),n||a,r||function(e){return t.outEdges(e)})};var a=r.constant(1)},function(t,e,n){var r=n(10);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,a=i.length;return n[t]=a,i.push({key:t,priority:e}),this._decrease(a),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n>1].priority2?e[2]:void 0;for(u&&a(e[0],e[1],u)&&(r=1);++n1&&o.sort((function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),o=e.x-n.x,s=e.y-n.y,c=Math.sqrt(o*o+s*s);return aMath.abs(o)*u?(s<0&&(u=-u),n=0===s?0:u*o/s,r=u):(o<0&&(c=-c),n=c,r=0===o?0:c*s/o);return{x:i+n,y:a+r}}},function(t,e,n){t.exports=function t(e){"use strict";var n=/^\0+/g,r=/[\0\r\f]/g,i=/: */g,a=/zoo|gra/,o=/([,: ])(transform)/g,s=/,+\s*(?![^(]*[)])/g,c=/ +\s*(?![^(]*[)])/g,u=/ *[\0] */g,l=/,\r+?/g,h=/([\t\r\n ])*\f?&/g,f=/:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g,d=/\W+/g,p=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,g=/:(read-only)/g,v=/\s+(?=[{\];=:>])/g,m=/([[}=:>])\s+/g,b=/(\{[^{]+?);(?=\})/g,_=/\s{2,}/g,x=/([^\(])(:+) */g,k=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,E=/([\s\S]*?);/g,T=/-self|flex-/g,C=/[^]*?(:[rp][el]a[\w-]+)[^]*/,A=/stretch|:\s*\w+\-(?:conte|avail)/,S=/([^-])(image-set\()/,M="-webkit-",O="-moz-",D="-ms-",N=1,B=1,L=0,F=1,P=1,I=1,j=0,R=0,Y=0,z=[],U=[],$=0,W=null,H=0,V=1,G="",q="",X="";function Z(t,e,i,a,o){for(var s,c,l=0,h=0,f=0,d=0,v=0,m=0,b=0,_=0,k=0,E=0,T=0,C=0,A=0,S=0,O=0,D=0,j=0,U=0,W=0,Q=i.length,it=Q-1,at="",ot="",st="",ct="",ut="",lt="";O0&&(ot=ot.replace(r,"")),ot.trim().length>0)){switch(b){case 32:case 9:case 59:case 13:case 10:break;default:ot+=i.charAt(O)}b=59}if(1===j)switch(b){case 123:case 125:case 59:case 34:case 39:case 40:case 41:case 44:j=0;case 9:case 13:case 10:case 32:break;default:for(j=0,W=O,v=b,O--,b=59;W0&&(++O,b=v);case 123:W=Q}}switch(b){case 123:for(v=(ot=ot.trim()).charCodeAt(0),T=1,W=++O;O0&&(ot=ot.replace(r,"")),m=ot.charCodeAt(1)){case 100:case 109:case 115:case 45:s=e;break;default:s=z}if(W=(st=Z(e,s,st,m,o+1)).length,Y>0&&0===W&&(W=ot.length),$>0&&(c=nt(3,st,s=J(z,ot,U),e,B,N,W,m,o,a),ot=s.join(""),void 0!==c&&0===(W=(st=c.trim()).length)&&(m=0,st="")),W>0)switch(m){case 115:ot=ot.replace(w,et);case 100:case 109:case 45:st=ot+"{"+st+"}";break;case 107:st=(ot=ot.replace(p,"$1 $2"+(V>0?G:"")))+"{"+st+"}",st=1===P||2===P&&tt("@"+st,3)?"@"+M+st+"@"+st:"@"+st;break;default:st=ot+st,112===a&&(ct+=st,st="")}else st="";break;default:st=Z(e,J(e,ot,U),st,a,o+1)}ut+=st,C=0,j=0,S=0,D=0,U=0,A=0,ot="",st="",b=i.charCodeAt(++O);break;case 125:case 59:if((W=(ot=(D>0?ot.replace(r,""):ot).trim()).length)>1)switch(0===S&&(45===(v=ot.charCodeAt(0))||v>96&&v<123)&&(W=(ot=ot.replace(" ",":")).length),$>0&&void 0!==(c=nt(1,ot,e,t,B,N,ct.length,a,o,a))&&0===(W=(ot=c.trim()).length)&&(ot="\0\0"),v=ot.charCodeAt(0),m=ot.charCodeAt(1),v){case 0:break;case 64:if(105===m||99===m){lt+=ot+i.charAt(O);break}default:if(58===ot.charCodeAt(W-1))break;ct+=K(ot,v,m,ot.charCodeAt(2))}C=0,j=0,S=0,D=0,U=0,ot="",b=i.charCodeAt(++O)}}switch(b){case 13:case 10:if(h+d+f+l+R===0)switch(E){case 41:case 39:case 34:case 64:case 126:case 62:case 42:case 43:case 47:case 45:case 58:case 44:case 59:case 123:case 125:break;default:S>0&&(j=1)}47===h?h=0:F+C===0&&107!==a&&ot.length>0&&(D=1,ot+="\0"),$*H>0&&nt(0,ot,e,t,B,N,ct.length,a,o,a),N=1,B++;break;case 59:case 125:if(h+d+f+l===0){N++;break}default:switch(N++,at=i.charAt(O),b){case 9:case 32:if(d+l+h===0)switch(_){case 44:case 58:case 9:case 32:at="";break;default:32!==b&&(at=" ")}break;case 0:at="\\0";break;case 12:at="\\f";break;case 11:at="\\v";break;case 38:d+h+l===0&&F>0&&(U=1,D=1,at="\f"+at);break;case 108:if(d+h+l+L===0&&S>0)switch(O-S){case 2:112===_&&58===i.charCodeAt(O-3)&&(L=_);case 8:111===k&&(L=k)}break;case 58:d+h+l===0&&(S=O);break;case 44:h+f+d+l===0&&(D=1,at+="\r");break;case 34:case 39:0===h&&(d=d===b?0:0===d?b:d);break;case 91:d+h+f===0&&l++;break;case 93:d+h+f===0&&l--;break;case 41:d+h+l===0&&f--;break;case 40:if(d+h+l===0){if(0===C)switch(2*_+3*k){case 533:break;default:T=0,C=1}f++}break;case 64:h+f+d+l+S+A===0&&(A=1);break;case 42:case 47:if(d+l+f>0)break;switch(h){case 0:switch(2*b+3*i.charCodeAt(O+1)){case 235:h=47;break;case 220:W=O,h=42}break;case 42:47===b&&42===_&&W+2!==O&&(33===i.charCodeAt(W+2)&&(ct+=i.substring(W,O+1)),at="",h=0)}}if(0===h){if(F+d+l+A===0&&107!==a&&59!==b)switch(b){case 44:case 126:case 62:case 43:case 41:case 40:if(0===C){switch(_){case 9:case 32:case 10:case 13:at+="\0";break;default:at="\0"+at+(44===b?"":"\0")}D=1}else switch(b){case 40:S+7===O&&108===_&&(S=0),C=++T;break;case 41:0==(C=--T)&&(D=1,at+="\0")}break;case 9:case 32:switch(_){case 0:case 123:case 125:case 59:case 44:case 12:case 9:case 32:case 10:case 13:break;default:0===C&&(D=1,at+="\0")}}ot+=at,32!==b&&9!==b&&(E=b)}}k=_,_=b,O++}if(W=ct.length,Y>0&&0===W&&0===ut.length&&0===e[0].length==0&&(109!==a||1===e.length&&(F>0?q:X)===e[0])&&(W=e.join(",").length+2),W>0){if(s=0===F&&107!==a?function(t){for(var e,n,i=0,a=t.length,o=Array(a);i1)){if(f=c.charCodeAt(c.length-1),d=n.charCodeAt(0),e="",0!==l)switch(f){case 42:case 126:case 62:case 43:case 32:case 40:break;default:e=" "}switch(d){case 38:n=e+q;case 126:case 62:case 43:case 32:case 41:case 40:break;case 91:n=e+n+q;break;case 58:switch(2*n.charCodeAt(1)+3*n.charCodeAt(2)){case 530:if(I>0){n=e+n.substring(8,h-1);break}default:(l<1||s[l-1].length<1)&&(n=e+q+n)}break;case 44:e="";default:n=h>1&&n.indexOf(":")>0?e+n.replace(x,"$1"+q+"$2"):e+n+q}c+=n}o[i]=c.replace(r,"").trim()}return o}(e):e,$>0&&void 0!==(c=nt(2,ct,s,t,B,N,W,a,o,a))&&0===(ct=c).length)return lt+ct+ut;if(ct=s.join(",")+"{"+ct+"}",P*L!=0){switch(2!==P||tt(ct,2)||(L=0),L){case 111:ct=ct.replace(g,":-moz-$1")+ct;break;case 112:ct=ct.replace(y,"::-webkit-input-$1")+ct.replace(y,"::-moz-$1")+ct.replace(y,":-ms-input-$1")+ct}L=0}}return lt+ct+ut}function J(t,e,n){var r=e.trim().split(l),i=r,a=r.length,o=t.length;switch(o){case 0:case 1:for(var s=0,c=0===o?"":t[0]+" ";s0&&F>0)return i.replace(f,"$1").replace(h,"$1"+X);break;default:return t.trim()+i.replace(h,"$1"+t.trim())}default:if(n*F>0&&i.indexOf("\f")>0)return i.replace(h,(58===t.charCodeAt(0)?"":"$1")+t.trim())}return t+i}function K(t,e,n,r){var u,l=0,h=t+";",f=2*e+3*n+4*r;if(944===f)return function(t){var e=t.length,n=t.indexOf(":",9)+1,r=t.substring(0,n).trim(),i=t.substring(n,e-1).trim();switch(t.charCodeAt(9)*V){case 0:break;case 45:if(110!==t.charCodeAt(10))break;default:var a=i.split((i="",s)),o=0;for(n=0,e=a.length;o64&&h<90||h>96&&h<123||95===h||45===h&&45!==u.charCodeAt(1)))switch(isNaN(parseFloat(u))+(-1!==u.indexOf("("))){case 1:switch(u){case"infinite":case"alternate":case"backwards":case"running":case"normal":case"forwards":case"both":case"none":case"linear":case"ease":case"ease-in":case"ease-out":case"ease-in-out":case"paused":case"reverse":case"alternate-reverse":case"inherit":case"initial":case"unset":case"step-start":case"step-end":break;default:u+=G}}l[n++]=u}i+=(0===o?"":",")+l.join(" ")}}return i=r+i+";",1===P||2===P&&tt(i,1)?M+i+i:i}(h);if(0===P||2===P&&!tt(h,1))return h;switch(f){case 1015:return 97===h.charCodeAt(10)?M+h+h:h;case 951:return 116===h.charCodeAt(3)?M+h+h:h;case 963:return 110===h.charCodeAt(5)?M+h+h:h;case 1009:if(100!==h.charCodeAt(4))break;case 969:case 942:return M+h+h;case 978:return M+h+O+h+h;case 1019:case 983:return M+h+O+h+D+h+h;case 883:return 45===h.charCodeAt(8)?M+h+h:h.indexOf("image-set(",11)>0?h.replace(S,"$1-webkit-$2")+h:h;case 932:if(45===h.charCodeAt(4))switch(h.charCodeAt(5)){case 103:return M+"box-"+h.replace("-grow","")+M+h+D+h.replace("grow","positive")+h;case 115:return M+h+D+h.replace("shrink","negative")+h;case 98:return M+h+D+h.replace("basis","preferred-size")+h}return M+h+D+h+h;case 964:return M+h+D+"flex-"+h+h;case 1023:if(99!==h.charCodeAt(8))break;return u=h.substring(h.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),M+"box-pack"+u+M+h+D+"flex-pack"+u+h;case 1005:return a.test(h)?h.replace(i,":"+M)+h.replace(i,":"+O)+h:h;case 1e3:switch(l=(u=h.substring(13).trim()).indexOf("-")+1,u.charCodeAt(0)+u.charCodeAt(l)){case 226:u=h.replace(k,"tb");break;case 232:u=h.replace(k,"tb-rl");break;case 220:u=h.replace(k,"lr");break;default:return h}return M+h+D+u+h;case 1017:if(-1===h.indexOf("sticky",9))return h;case 975:switch(l=(h=t).length-10,f=(u=(33===h.charCodeAt(l)?h.substring(0,l):h).substring(t.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|u.charCodeAt(7))){case 203:if(u.charCodeAt(8)<111)break;case 115:h=h.replace(u,M+u)+";"+h;break;case 207:case 102:h=h.replace(u,M+(f>102?"inline-":"")+"box")+";"+h.replace(u,M+u)+";"+h.replace(u,D+u+"box")+";"+h}return h+";";case 938:if(45===h.charCodeAt(5))switch(h.charCodeAt(6)){case 105:return u=h.replace("-items",""),M+h+M+"box-"+u+D+"flex-"+u+h;case 115:return M+h+D+"flex-item-"+h.replace(T,"")+h;default:return M+h+D+"flex-line-pack"+h.replace("align-content","").replace(T,"")+h}break;case 973:case 989:if(45!==h.charCodeAt(3)||122===h.charCodeAt(4))break;case 931:case 953:if(!0===A.test(t))return 115===(u=t.substring(t.indexOf(":")+1)).charCodeAt(0)?K(t.replace("stretch","fill-available"),e,n,r).replace(":fill-available",":stretch"):h.replace(u,M+u)+h.replace(u,O+u.replace("fill-",""))+h;break;case 962:if(h=M+h+(102===h.charCodeAt(5)?D+h:"")+h,n+r===211&&105===h.charCodeAt(13)&&h.indexOf("transform",10)>0)return h.substring(0,h.indexOf(";",27)+1).replace(o,"$1-webkit-$2")+h}return h}function tt(t,e){var n=t.indexOf(1===e?":":"{"),r=t.substring(0,3!==e?n:10),i=t.substring(n+1,t.length-1);return W(2!==e?r:r.replace(C,"$1"),i,e)}function et(t,e){var n=K(e,e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2));return n!==e+";"?n.replace(E," or ($1)").substring(4):"("+e+")"}function nt(t,e,n,r,i,a,o,s,c,u){for(var l,h=0,f=e;h<$;++h)switch(l=U[h].call(at,t,f,n,r,i,a,o,s,c,u)){case void 0:case!1:case!0:case null:break;default:f=l}if(f!==e)return f}function rt(t,e,n,r){for(var i=e+1;i0&&(G=i.replace(d,91===a?"":"-")),a=1,1===F?X=i:q=i;var o,s=[X];$>0&&void 0!==(o=nt(-1,n,s,s,B,N,0,0,0,0))&&"string"==typeof o&&(n=o);var c=Z(z,s,n,0,0);return $>0&&void 0!==(o=nt(-2,c,s,s,B,N,c.length,0,0,0))&&"string"!=typeof(c=o)&&(a=0),G="",X="",q="",L=0,B=1,N=1,j*a==0?c:function(t){return t.replace(r,"").replace(v,"").replace(m,"$1").replace(b,"$1").replace(_," ")}(c)}return at.use=function t(e){switch(e){case void 0:case null:$=U.length=0;break;default:if("function"==typeof e)U[$++]=e;else if("object"==typeof e)for(var n=0,r=e.length;n=255?255:t<0?0:t},g:function(t){return t>=255?255:t<0?0:t},b:function(t){return t>=255?255:t<0?0:t},h:function(t){return t%360},s:function(t){return t>=100?100:t<0?0:t},l:function(t){return t>=100?100:t<0?0:t},a:function(t){return t>=1?1:t<0?0:t}},toLinear:function(t){var e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},hsl2rgb:function(t,e){var n=t.h,i=t.s,a=t.l;if(100===i)return 2.55*a;n/=360,i/=100;var o=(a/=100)<.5?a*(1+i):a+i-a*i,s=2*a-o;switch(e){case"r":return 255*r.hue2rgb(s,o,n+1/3);case"g":return 255*r.hue2rgb(s,o,n);case"b":return 255*r.hue2rgb(s,o,n-1/3)}},rgb2hsl:function(t,e){var n=t.r,r=t.g,i=t.b;n/=255,r/=255,i/=255;var a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if("l"===e)return 100*s;if(a===o)return 0;var c=a-o;if("s"===e)return 100*(s>.5?c/(2-a-o):c/(a+o));switch(a){case n:return 60*((r-i)/c+(r1?e:"0"+e},dec2hex:function(t){var e=Math.round(t).toString(16);return e.length>1?e:"0"+e}};e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(75),a=n(177),o=function(){function t(t,e){this.color=e,this.changed=!1,this.data=t,this.type=new a.default}return t.prototype.set=function(t,e){return this.color=e,this.changed=!1,this.data=t,this.type.type=i.TYPE.ALL,this},t.prototype._ensureHSL=function(){void 0===this.data.h&&(this.data.h=r.default.channel.rgb2hsl(this.data,"h")),void 0===this.data.s&&(this.data.s=r.default.channel.rgb2hsl(this.data,"s")),void 0===this.data.l&&(this.data.l=r.default.channel.rgb2hsl(this.data,"l"))},t.prototype._ensureRGB=function(){void 0===this.data.r&&(this.data.r=r.default.channel.hsl2rgb(this.data,"r")),void 0===this.data.g&&(this.data.g=r.default.channel.hsl2rgb(this.data,"g")),void 0===this.data.b&&(this.data.b=r.default.channel.hsl2rgb(this.data,"b"))},Object.defineProperty(t.prototype,"r",{get:function(){return this.type.is(i.TYPE.HSL)||void 0===this.data.r?(this._ensureHSL(),r.default.channel.hsl2rgb(this.data,"r")):this.data.r},set:function(t){this.type.set(i.TYPE.RGB),this.changed=!0,this.data.r=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this.type.is(i.TYPE.HSL)||void 0===this.data.g?(this._ensureHSL(),r.default.channel.hsl2rgb(this.data,"g")):this.data.g},set:function(t){this.type.set(i.TYPE.RGB),this.changed=!0,this.data.g=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this.type.is(i.TYPE.HSL)||void 0===this.data.b?(this._ensureHSL(),r.default.channel.hsl2rgb(this.data,"b")):this.data.b},set:function(t){this.type.set(i.TYPE.RGB),this.changed=!0,this.data.b=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"h",{get:function(){return this.type.is(i.TYPE.RGB)||void 0===this.data.h?(this._ensureRGB(),r.default.channel.rgb2hsl(this.data,"h")):this.data.h},set:function(t){this.type.set(i.TYPE.HSL),this.changed=!0,this.data.h=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"s",{get:function(){return this.type.is(i.TYPE.RGB)||void 0===this.data.s?(this._ensureRGB(),r.default.channel.rgb2hsl(this.data,"s")):this.data.s},set:function(t){this.type.set(i.TYPE.HSL),this.changed=!0,this.data.s=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"l",{get:function(){return this.type.is(i.TYPE.RGB)||void 0===this.data.l?(this._ensureRGB(),r.default.channel.rgb2hsl(this.data,"l")):this.data.l},set:function(t){this.type.set(i.TYPE.HSL),this.changed=!0,this.data.l=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"a",{get:function(){return this.data.a},set:function(t){this.changed=!0,this.data.a=t},enumerable:!0,configurable:!0}),t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(75),i=function(){function t(){this.type=r.TYPE.ALL}return t.prototype.get=function(){return this.type},t.prototype.set=function(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t},t.prototype.reset=function(){this.type=r.TYPE.ALL},t.prototype.is=function(t){return this.type===t},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i={};e.DEC2HEX=i;for(var a=0;a<=255;a++)i[a]=r.default.unit.dec2hex(a)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(99),i={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:function(t){t=t.toLowerCase();var e=i.colors[t];if(e)return r.default.parse(e)},stringify:function(t){var e=r.default.stringify(t);for(var n in i.colors)if(i.colors[n]===e)return n}};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(45),a={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:function(t){var e=t.charCodeAt(0);if(114===e||82===e){var n=t.match(a.re);if(n){var o=n[1],s=n[2],c=n[3],u=n[4],l=n[5],h=n[6],f=n[7],d=n[8];return i.default.set({r:r.default.channel.clamp.r(s?2.55*parseFloat(o):parseFloat(o)),g:r.default.channel.clamp.g(u?2.55*parseFloat(c):parseFloat(c)),b:r.default.channel.clamp.b(h?2.55*parseFloat(l):parseFloat(l)),a:f?r.default.channel.clamp.a(d?parseFloat(f)/100:parseFloat(f)):1},t)}}},stringify:function(t){return t.a<1?"rgba("+r.default.lang.round(t.r)+", "+r.default.lang.round(t.g)+", "+r.default.lang.round(t.b)+", "+r.default.lang.round(t.a)+")":"rgb("+r.default.lang.round(t.r)+", "+r.default.lang.round(t.g)+", "+r.default.lang.round(t.b)+")"}};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(45),a={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:function(t){var e=t.match(a.hueRe);if(e){var n=e[1];switch(e[2]){case"grad":return r.default.channel.clamp.h(.9*parseFloat(n));case"rad":return r.default.channel.clamp.h(180*parseFloat(n)/Math.PI);case"turn":return r.default.channel.clamp.h(360*parseFloat(n))}}return r.default.channel.clamp.h(parseFloat(t))},parse:function(t){var e=t.charCodeAt(0);if(104===e||72===e){var n=t.match(a.re);if(n){var o=n[1],s=n[2],c=n[3],u=n[4],l=n[5];return i.default.set({h:a._hue2deg(o),s:r.default.channel.clamp.s(parseFloat(s)),l:r.default.channel.clamp.l(parseFloat(c)),a:u?r.default.channel.clamp.a(l?parseFloat(u)/100:parseFloat(u)):1},t)}}},stringify:function(t){return t.a<1?"hsla("+r.default.lang.round(t.h)+", "+r.default.lang.round(t.s)+"%, "+r.default.lang.round(t.l)+"%, "+t.a+")":"hsl("+r.default.lang.round(t.h)+", "+r.default.lang.round(t.s)+"%, "+r.default.lang.round(t.l)+"%)"}};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(29);e.default=function(t){return r.default(t,"r")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(29);e.default=function(t){return r.default(t,"g")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(29);e.default=function(t){return r.default(t,"b")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(29);e.default=function(t){return r.default(t,"h")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(29);e.default=function(t){return r.default(t,"s")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(29);e.default=function(t){return r.default(t,"l")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(103);e.default=function(t){return!r.default(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(15);e.default=function(t){try{return r.default.parse(t),!0}catch(t){return!1}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(32);e.default=function(t,e){return r.default(t,"s",e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(32);e.default=function(t,e){return r.default(t,"s",-e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(32);e.default=function(t,e){return r.default(t,"l",e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(32);e.default=function(t,e){return r.default(t,"l",-e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(32);e.default=function(t){return r.default(t,"h",180)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(52);e.default=function(t){return r.default(t,{s:0})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(15),i=n(107);e.default=function(t,e){void 0===e&&(e=100);var n=r.default.parse(t);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,i.default(n,t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),i=n(15),a=n(106);e.default=function(t,e){var n,o,s,c=i.default.parse(t),u={};for(var l in e)u[l]=(n=c[l],o=e[l],s=r.default.channel.max[l],o>0?(s-n)*o/100:n*o/100);return a.default(t,u)}},function(t,e,n){t.exports={Graph:n(76),version:n(300)}},function(t,e,n){var r=n(108);t.exports=function(t){return r(t,4)}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(55),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(55);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(55);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(55);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(54);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(54),i=n(77),a=n(78);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var o=n.__data__;if(!i||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new a(o)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(38),i=n(214),a=n(11),o=n(110),s=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,h=u.hasOwnProperty,f=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!a(t)||i(t))&&(r(t)?f:s).test(o(t))}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(39),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=a.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=o.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r,i=n(215),a=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!a&&a in t}},function(t,e,n){var r=n(16)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(218),i=n(54),a=n(77);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||i),string:new r}}},function(t,e,n){var r=n(219),i=n(220),a=n(221),o=n(222),s=n(223);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(131),i=n(292),a=n(296),o=n(132),s=n(297),c=n(90);t.exports=function(t,e,n){var u=-1,l=i,h=t.length,f=!0,d=[],p=d;if(n)f=!1,l=a;else if(h>=200){var y=e?null:s(t);if(y)return c(y);f=!1,l=o,p=new r}else p=e?[]:d;t:for(;++u-1}},function(t,e,n){var r=n(145),i=n(294),a=n(295);t.exports=function(t,e,n){return e==e?a(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r1||1===e.length&&t.hasEdge(e[0],e[0])}))}},function(t,e,n){var r=n(10);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,a=e(n);r[t][i]={distance:a,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var a=r[n];i.forEach((function(n){var r=a[t],i=e[n],o=a[n],s=r.distance+i.distance;s0;){if(n=c.removeMin(),r.has(s,n))o.setEdge(n,s[n]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(n).forEach(u)}return o}},function(t,e,n){var r;try{r=n(3)}catch(t){}r||(r=window.graphlib),t.exports=r},function(t,e,n){"use strict";var r=n(4),i=n(345),a=n(348),o=n(349),s=n(8).normalizeRanks,c=n(351),u=n(8).removeEmptyRanks,l=n(352),h=n(353),f=n(354),d=n(355),p=n(364),y=n(8),g=n(17).Graph;t.exports=function(t,e){var n=e&&e.debugTiming?y.time:y.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new g({multigraph:!0,compound:!0}),n=C(t.graph());return e.setGraph(r.merge({},m,T(n,v),r.pick(n,b))),r.forEach(t.nodes(),(function(n){var i=C(t.node(n));e.setNode(n,r.defaults(T(i,_),x)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=C(t.edge(n));e.setEdge(n,r.merge({},w,T(i,k),r.pick(i,E)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){l.run(t)})),e(" rank",(function(){o(y.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};y.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){u(t)})),e(" nestingGraph.cleanup",(function(){l.cleanup(t)})),e(" normalizeRanks",(function(){s(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){a.run(t)})),e(" parentDummyChains",(function(){c(t)})),e(" addBorderSegments",(function(){h(t)})),e(" order",(function(){d(t)})),e(" insertSelfEdges",(function(){!function(t){var e=y.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var a=t.node(e);a.order=i+n,r.forEach(a.selfEdges,(function(e){y.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:a.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete a.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){f.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),a=t.node(n.borderBottom),o=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-o.x),n.height=Math.abs(a.y-i.y),n.x=o.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){a.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){f.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,a=0,o=t.graph(),s=o.marginx||0,c=o.marginy||0;function u(t){var r=t.x,o=t.y,s=t.width,c=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,o-c/2),a=Math.max(a,o+c/2)}r.forEach(t.nodes(),(function(e){u(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&u(n)})),e-=s,i-=c,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var a=t.edge(n);r.forEach(a.points,(function(t){t.x-=e,t.y-=i})),r.has(a,"x")&&(a.x-=e),r.has(a,"y")&&(a.y-=i)})),o.width=n-e+s,o.height=a-i+c}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),a=t.node(e.v),o=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=o,r=a),i.points.unshift(y.intersectRect(a,n)),i.points.push(y.intersectRect(o,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),a=e.edge(n);i.points=a.points,r.has(a,"x")&&(i.x=a.x,i.y=a.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))};var v=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],_=["width","height"],x={width:0,height:0},k=["minlen","weight","width","height","labeloffset"],w={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},E=["labelpos"];function T(t,e){return r.mapValues(r.pick(t,e),Number)}function C(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},function(t,e,n){var r=n(108);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(315)(n(316));t.exports=r},function(t,e,n){var r=n(25),i=n(24),a=n(30);t.exports=function(t){return function(e,n,o){var s=Object(e);if(!i(e)){var c=r(n,3);e=a(e),n=function(t){return c(s[t],t,s)}}var u=t(e,n,o);return u>-1?s[c?e[u]:u]:void 0}}},function(t,e,n){var r=n(145),i=n(25),a=n(317),o=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var c=null==n?0:a(n);return c<0&&(c=o(s+c,0)),r(t,i(e,3),c)}},function(t,e,n){var r=n(155);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(11),i=n(43),a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(r(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=r(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var n=s.test(t);return n||c.test(t)?u(t.slice(2),n?2:8):o.test(t)?NaN:+t}},function(t,e,n){var r=n(89),i=n(127),a=n(41);t.exports=function(t,e){return null==t?t:r(t,i(e),a)}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(59),i=n(88),a=n(25);t.exports=function(t,e){var n={};return e=a(e,3),i(t,(function(t,i,a){r(n,i,e(t,i,a))})),n}},function(t,e,n){var r=n(95),i=n(323),a=n(35);t.exports=function(t){return t&&t.length?r(t,a,i):void 0}},function(t,e){t.exports=function(t,e){return t>e}},function(t,e,n){var r=n(325),i=n(328)((function(t,e,n){r(t,e,n)}));t.exports=i},function(t,e,n){var r=n(53),i=n(157),a=n(89),o=n(326),s=n(11),c=n(41),u=n(159);t.exports=function t(e,n,l,h,f){e!==n&&a(n,(function(a,c){if(f||(f=new r),s(a))o(e,n,c,l,t,h,f);else{var d=h?h(u(e,c),a,c+"",e,n,f):void 0;void 0===d&&(d=a),i(e,c,d)}}),c)}},function(t,e,n){var r=n(157),i=n(114),a=n(123),o=n(115),s=n(124),c=n(47),u=n(5),l=n(146),h=n(40),f=n(38),d=n(11),p=n(158),y=n(48),g=n(159),v=n(327);t.exports=function(t,e,n,m,b,_,x){var k=g(t,n),w=g(e,n),E=x.get(w);if(E)r(t,n,E);else{var T=_?_(k,w,n+"",t,e,x):void 0,C=void 0===T;if(C){var A=u(w),S=!A&&h(w),M=!A&&!S&&y(w);T=w,A||S||M?u(k)?T=k:l(k)?T=o(k):S?(C=!1,T=i(w,!0)):M?(C=!1,T=a(w,!0)):T=[]:p(w)||c(w)?(T=k,c(k)?T=v(k):d(k)&&!f(k)||(T=s(w))):C=!1}C&&(x.set(w,T),b(T,w,m,_,x),x.delete(w)),r(t,n,T)}}},function(t,e,n){var r=n(46),i=n(41);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(67),i=n(68);t.exports=function(t){return r((function(e,n){var r=-1,a=n.length,o=a>1?n[a-1]:void 0,s=a>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(n[0],n[1],s)&&(o=a<3?void 0:o,a=1),e=Object(e);++r1&&o(t,e[0],e[1])?e=[]:n>2&&o(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=s},function(t,e,n){var r=n(66),i=n(25),a=n(141),o=n(340),s=n(61),c=n(341),u=n(35);t.exports=function(t,e,n){var l=-1;e=r(e.length?e:[u],s(i));var h=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++l,value:t}}));return o(h,(function(t,e){return c(t,e,n)}))}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(342);t.exports=function(t,e,n){for(var i=-1,a=t.criteria,o=e.criteria,s=a.length,c=n.length;++i=c?u:u*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(43);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,a=t==t,o=r(t),s=void 0!==e,c=null===e,u=e==e,l=r(e);if(!c&&!l&&!o&&t>e||o&&s&&u&&!c&&!l||i&&s&&u||!n&&u||!a)return 1;if(!i&&!o&&!l&&t0;--c)if(r=e[c].dequeue()){i=i.concat(s(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(e){return t.outEdges(e.v,e.w)})),!0)};var o=r.constant(1);function s(t,e,n,i,a){var o=a?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),s=t.node(r.v);a&&o.push({v:r.v,w:r.w}),s.out-=i,c(e,n,s)})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),a=r.w,o=t.node(a);o.in-=i,c(e,n,o)})),t.removeNode(i.v),o}function c(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}},function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return r(e),e},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},function(t,e,n){"use strict";var r=n(4),i=n(8);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,a,o=e.v,s=t.node(o).rank,c=e.w,u=t.node(c).rank,l=e.name,h=t.edge(e),f=h.labelRank;if(u===s+1)return;for(t.removeEdge(e),a=0,++s;sc.lim&&(u=c,l=!0);var h=r.filter(e.edges(),(function(e){return l===m(t,t.node(e.v),u)&&l!==m(t,t.node(e.w),u)}));return r.minBy(h,(function(t){return a(e,t)}))}function v(t,e,n,i){var a=n.v,o=n.w;t.removeEdge(a,o),t.setEdge(i.v,i.w,{}),d(t),h(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),i=s(t,n);i=i.slice(1),r.forEach(i,(function(n){var r=t.node(n).parent,i=e.edge(n,r),a=!1;i||(i=e.edge(r,n),a=!0),e.node(n).rank=e.node(r).rank+(a?i.minlen:-i.minlen)}))}(t,e)}function m(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=l,l.initLowLimValues=d,l.initCutValues=h,l.calcCutValue=f,l.leaveEdge=y,l.enterEdge=g,l.exchangeEdges=v},function(t,e,n){var r=n(4);t.exports=function(t){var e=function(t){var e={},n=0;function i(a){var o=n;r.forEach(t.children(a),i),e[a]={low:o,lim:n++}}return r.forEach(t.children(),i),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,a=function(t,e,n,r){var i,a,o=[],s=[],c=Math.min(e[n].low,e[r].low),u=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),o.push(i)}while(i&&(e[i].low>c||u>e[i].lim));a=i,i=r;for(;(i=t.parent(i))!==a;)s.push(i);return{path:o.concat(s.reverse()),lca:a}}(t,e,i.v,i.w),o=a.path,s=a.lca,c=0,u=o[c],l=!0;n!==i.w;){if(r=t.node(n),l){for(;(u=o[c])!==s&&t.node(u).maxRank=2),s=l.buildLayerMatrix(t);var g=a(t,s);g0;)e%2&&(n+=c[e+1]),c[e=e-1>>1]+=t.weight;u+=t.weight*n}))),u}t.exports=function(t,e){for(var n=0,r=1;r=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var a=t.pop();e.push(a),r.forEach(a.in.reverse(),n(a)),r.forEach(a.out,i(a))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},function(t,e,n){var r=n(4),i=n(8);function a(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e){var n=i.partition(t,(function(t){return r.has(t,"barycenter")})),o=n.lhs,s=r.sortBy(n.rhs,(function(t){return-t.i})),c=[],u=0,l=0,h=0;o.sort((f=!!e,function(t,e){return t.barycentere.barycenter?1:f?e.i-t.i:t.i-e.i})),h=a(c,s,h),r.forEach(o,(function(t){h+=t.vs.length,c.push(t.vs),u+=t.barycenter*t.weight,l+=t.weight,h=a(c,s,h)}));var f;var d={vs:r.flatten(c,!0)};l&&(d.barycenter=u/l,d.weight=l);return d}},function(t,e,n){var r=n(4),i=n(17).Graph;t.exports=function(t,e,n){var a=function(t){var e;for(;t.hasNode(e=r.uniqueId("_root")););return e}(t),o=new i({compound:!0}).setGraph({root:a}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var s=t.node(i),c=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(o.setNode(i),o.setParent(i,c||a),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,a=o.edge(n,i),s=r.isUndefined(a)?0:a.weight;o.setEdge(n,i,{weight:t.edge(e).weight+s})})),r.has(s,"minRank")&&o.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),o}},function(t,e,n){var r=n(4);t.exports=function(t,e,n){var i,a={};r.forEach(n,(function(n){for(var r,o,s=t.parent(n);s;){if((r=t.parent(s))?(o=a[r],a[r]=s):(o=i,i=s),o&&o!==s)return void e.setEdge(o,s);s=r}}))}},function(t,e,n){"use strict";var r=n(4),i=n(8),a=n(365).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,a=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=a+i/2})),a+=i+n}))})(t=i.asNonCompoundGraph(t)),r.forEach(a(t),(function(e,n){t.node(n).x=e}))}},function(t,e,n){"use strict";var r=n(4),i=n(17).Graph,a=n(8);function o(t,e){var n={};return r.reduce(e,(function(e,i){var a=0,o=0,s=e.length,u=r.last(i);return r.forEach(i,(function(e,l){var h=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=h?t.node(h).order:s;(h||e===u)&&(r.forEach(i.slice(o,l+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),o=i.order;!(os)&&c(n,e,u)}))}))}return r.reduce(e,(function(e,n){var a,o=-1,s=0;return r.forEach(n,(function(r,c){if("border"===t.node(r).dummy){var u=t.predecessors(r);u.length&&(a=t.node(u[0]).order,i(n,s,c,o,a),s=c,o=a)}i(n,s,n.length,a,e.length)})),n})),n}function c(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function u(t,e,n){if(e>n){var i=e;e=n,n=i}return r.has(t[e],n)}function l(t,e,n,i){var a={},o={},s={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){a[t]=t,o[t]=t,s[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var c=i(t);if(c.length)for(var l=((c=r.sortBy(c,(function(t){return s[t]}))).length-1)/2,h=Math.floor(l),f=Math.ceil(l);h<=f;++h){var d=c[h];o[t]===t&&e0}t.exports=function(t,e,r,i){var a,o,s,c,u,l,h,f,d,p,y,g,v;if(a=e.y-t.y,s=t.x-e.x,u=e.x*t.y-t.x*e.y,d=a*r.x+s*r.y+u,p=a*i.x+s*i.y+u,0!==d&&0!==p&&n(d,p))return;if(o=i.y-r.y,c=r.x-i.x,l=i.x*r.y-r.x*i.y,h=o*t.x+c*t.y+l,f=o*e.x+c*e.y+l,0!==h&&0!==f&&n(h,f))return;if(0===(y=a*c-o*s))return;return g=Math.abs(y/2),{x:(v=s*l-c*u)<0?(v-g)/y:(v+g)/y,y:(v=o*u-a*l)<0?(v-g)/y:(v+g)/y}}},function(t,e,n){var r=n(44),i=n(31),a=n(153).layout;t.exports=function(){var t=n(371),e=n(374),i=n(375),u=n(376),l=n(377),h=n(378),f=n(379),d=n(380),p=n(381),y=function(n,y){!function(t){t.nodes().forEach((function(e){var n=t.node(e);r.has(n,"label")||t.children(e).length||(n.label=e),r.has(n,"paddingX")&&r.defaults(n,{paddingLeft:n.paddingX,paddingRight:n.paddingX}),r.has(n,"paddingY")&&r.defaults(n,{paddingTop:n.paddingY,paddingBottom:n.paddingY}),r.has(n,"padding")&&r.defaults(n,{paddingLeft:n.padding,paddingRight:n.padding,paddingTop:n.padding,paddingBottom:n.padding}),r.defaults(n,o),r.each(["paddingLeft","paddingRight","paddingTop","paddingBottom"],(function(t){n[t]=Number(n[t])})),r.has(n,"width")&&(n._prevWidth=n.width),r.has(n,"height")&&(n._prevHeight=n.height)})),t.edges().forEach((function(e){var n=t.edge(e);r.has(n,"label")||(n.label=""),r.defaults(n,s)}))}(y);var g=c(n,"output"),v=c(g,"clusters"),m=c(g,"edgePaths"),b=i(c(g,"edgeLabels"),y),_=t(c(g,"nodes"),y,d);a(y),l(_,y),h(b,y),u(m,y,p);var x=e(v,y);f(x,y),function(t){r.each(t.nodes(),(function(e){var n=t.node(e);r.has(n,"_prevWidth")?n.width=n._prevWidth:delete n.width,r.has(n,"_prevHeight")?n.height=n._prevHeight:delete n.height,delete n._prevWidth,delete n._prevHeight}))}(y)};return y.createNodes=function(e){return arguments.length?(t=e,y):t},y.createClusters=function(t){return arguments.length?(e=t,y):e},y.createEdgeLabels=function(t){return arguments.length?(i=t,y):i},y.createEdgePaths=function(t){return arguments.length?(u=t,y):u},y.shapes=function(t){return arguments.length?(d=t,y):d},y.arrows=function(t){return arguments.length?(p=t,y):p},y};var o={paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rx:0,ry:0,shape:"rect"},s={arrowhead:"normal",curve:i.curveLinear};function c(t,e){var n=t.select("g."+e);return n.empty()&&(n=t.append("g").attr("class",e)),n}},function(t,e,n){"use strict";var r=n(44),i=n(97),a=n(12),o=n(31);t.exports=function(t,e,n){var s,c=e.nodes().filter((function(t){return!a.isSubgraph(e,t)})),u=t.selectAll("g.node").data(c,(function(t){return t})).classed("update",!0);u.exit().remove(),u.enter().append("g").attr("class","node").style("opacity",0),(u=t.selectAll("g.node")).each((function(t){var s=e.node(t),c=o.select(this);a.applyClass(c,s.class,(c.classed("update")?"update ":"")+"node"),c.select("g.label").remove();var u=c.append("g").attr("class","label"),l=i(u,s),h=n[s.shape],f=r.pick(l.node().getBBox(),"width","height");s.elem=this,s.id&&c.attr("id",s.id),s.labelId&&u.attr("id",s.labelId),r.has(s,"width")&&(f.width=s.width),r.has(s,"height")&&(f.height=s.height),f.width+=s.paddingLeft+s.paddingRight,f.height+=s.paddingTop+s.paddingBottom,u.attr("transform","translate("+(s.paddingLeft-s.paddingRight)/2+","+(s.paddingTop-s.paddingBottom)/2+")");var d=o.select(this);d.select(".label-container").remove();var p=h(d,f,s).classed("label-container",!0);a.applyStyle(p,s.style);var y=p.node().getBBox();s.width=y.width,s.height=y.height})),s=u.exit?u.exit():u.selectAll(null);return a.applyTransition(s,e).style("opacity",0).remove(),u}},function(t,e,n){var r=n(12);t.exports=function(t,e){for(var n=t.append("text"),i=function(t){for(var e,n="",r=!1,i=0;i0&&void 0!==arguments[0]?arguments[0]:"fatal";isNaN(t)&&(t=t.toLowerCase(),void 0!==h[t]&&(t=h[t])),f.trace=function(){},f.debug=function(){},f.info=function(){},f.warn=function(){},f.error=function(){},f.fatal=function(){},t<=h.fatal&&(f.fatal=console.error?console.error.bind(console,p("FATAL"),"color: orange"):console.log.bind(console,"",p("FATAL"))),t<=h.error&&(f.error=console.error?console.error.bind(console,p("ERROR"),"color: orange"):console.log.bind(console,"",p("ERROR"))),t<=h.warn&&(f.warn=console.warn?console.warn.bind(console,p("WARN"),"color: orange"):console.log.bind(console,"",p("WARN"))),t<=h.info&&(f.info=console.info?console.info.bind(console,p("INFO"),"color: lightblue"):console.log.bind(console,"",p("INFO"))),t<=h.debug&&(f.debug=console.debug?console.debug.bind(console,p("DEBUG"),"color: lightgreen"):console.log.bind(console,"",p("DEBUG")))},p=function(t){var e=l()().format("ss.SSS");return"%c".concat(e," : ").concat(t," : ")},y=n(70),g=function(t){for(var e="",n=0;n>=0;){if(!((n=t.indexOf("=0)){e+=t,n=-1;break}e+=t.substr(0,n),(n=(t=t.substr(n+1)).indexOf("<\/script>"))>=0&&(n+=9,t=t.substr(n))}return e},v=//gi,m=function(t){return t.replace(v,"#br#")},b=function(t){return t.replace(/#br#/g,"
")},_={getRows:function(t){if(!t)return 1;var e=m(t);return(e=e.replace(/\\n/g,"#br#")).split("#br#")},sanitizeText:function(t,e){var n=t,r=!0;if(!e.flowchart||!1!==e.flowchart.htmlLabels&&"false"!==e.flowchart.htmlLabels||(r=!1),r){var i=e.securityLevel;"antiscript"===i?n=g(n):"loose"!==i&&(n=(n=(n=m(n)).replace(//g,">")).replace(/=/g,"="),n=b(n))}return n},hasBreaks:function(t){return//gi.test(t)},splitBreaks:function(t){return t.split(//gi)},lineBreakRegex:v,removeScript:g};function x(t){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function k(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:null;try{var n=new RegExp("[%]{2}(?![{]".concat(T.source,")(?=[}][%]{2}).*\n"),"ig");t=t.trim().replace(n,"").replace(/'/gm,'"'),f.debug("Detecting diagram directive".concat(null!==e?" type:"+e:""," based on the text:").concat(t));for(var r,i=[];null!==(r=E.exec(t));)if(r.index===E.lastIndex&&E.lastIndex++,r&&!e||e&&r[1]&&r[1].match(e)||e&&r[2]&&r[2].match(e)){var a=r[1]?r[1]:r[2],o=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:a,args:o})}return 0===i.length&&i.push({type:t,args:null}),1===i.length?i[0]:i}catch(n){return f.error("ERROR: ".concat(n.message," - Unable to parse directive").concat(null!==e?" type:"+e:""," based on the text:").concat(t)),{type:null,args:null}}},S=function(t){return t=t.replace(E,"").replace(C,"\n"),f.debug("Detecting diagram type based on the text "+t),t.match(/^\s*sequenceDiagram/)?"sequence":t.match(/^\s*gantt/)?"gantt":t.match(/^\s*classDiagram-v2/)?"classDiagram":t.match(/^\s*classDiagram/)?"class":t.match(/^\s*stateDiagram-v2/)?"stateDiagram":t.match(/^\s*stateDiagram/)?"state":t.match(/^\s*gitGraph/)?"git":t.match(/^\s*flowchart/)?"flowchart-v2":t.match(/^\s*info/)?"info":t.match(/^\s*pie/)?"pie":t.match(/^\s*erDiagram/)?"er":t.match(/^\s*journey/)?"journey":"flowchart"},M=function(t,e){var n={};return function(){for(var r=arguments.length,i=new Array(r),a=0;a"},n),_.lineBreakRegex.test(t))return t;var r=t.split(" "),i=[],a="";return r.forEach((function(t,o){var s=Y("".concat(t," "),n),c=Y(a,n);if(s>e){var u=R(t,e,"-",n),l=u.hyphenatedStrings,h=u.remainingWord;i.push.apply(i,[a].concat(k(l))),a=h}else c+s>=e?(i.push(a),a=t):a=[a,t].filter(Boolean).join(" ");o+1===r.length&&i.push(a)})),i.filter((function(t){return""!==t})).join(n.joinWith)}),(function(t,e,n){return"".concat(t,"-").concat(e,"-").concat(n.fontSize,"-").concat(n.fontWeight,"-").concat(n.fontFamily,"-").concat(n.joinWith)})),R=M((function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"-",r=arguments.length>3?arguments[3]:void 0;r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);var i=t.split(""),a=[],o="";return i.forEach((function(t,s){var c="".concat(o).concat(t);if(Y(c,r)>=e){var u=s+1,l=i.length===u,h="".concat(c).concat(n);a.push(l?c:h),o=""}else o=c})),{hyphenatedStrings:a,remainingWord:o}}),(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"-",r=arguments.length>3?arguments[3]:void 0;return"".concat(t,"-").concat(e,"-").concat(n,"-").concat(r.fontSize,"-").concat(r.fontWeight,"-").concat(r.fontFamily)})),Y=function(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e),z(t,e).width},z=M((function(t,e){var n=e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial"},e),r=n.fontSize,i=n.fontFamily,a=n.fontWeight;if(!t)return{width:0,height:0};var o=["sans-serif",i],c=t.split(_.lineBreakRegex),u=[],l=Object(s.select)("body");if(!l.remove)return{width:0,height:0,lineHeight:0};for(var h=l.append("svg"),f=0,d=o;fu[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1]}),(function(t,e){return"".concat(t,"-").concat(e.fontSize,"-").concat(e.fontWeight,"-").concat(e.fontFamily)})),U={assignWithDepth:P,wrapLabel:j,calculateTextHeight:function(t,e){return e=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:15},e),z(t,e).height},calculateTextWidth:Y,calculateTextDimensions:z,detectInit:function(t){var e=A(t,/(?:init\b)|(?:initialize\b)/),n={};if(Array.isArray(e)){var r=e.map((function(t){return t.args}));n=P(n,k(r))}else n=e.args;if(n){var i=S(t);["config"].forEach((function(t){void 0!==n[t]&&("flowchart-v2"===i&&(i="flowchart"),n[i]=n[t],delete n[t])}))}return n},detectDirective:A,detectType:S,isSubstringInArray:function(t,e){for(var n=0;n=1&&(i={x:t.x,y:t.y}),a>0&&a<1&&(i={x:(1-a)*e.x+a*t.x,y:(1-a)*e.y+a*t.y})}}e=t})),i}(t)},calcCardinalityPosition:function(t,e,n){var r;e[0]!==n&&(e=e.reverse()),e.forEach((function(t){D(t,r),r=t}));var i,a=25;r=void 0,e.forEach((function(t){if(r&&!i){var e=D(t,r);if(e=1&&(i={x:t.x,y:t.y}),n>0&&n<1&&(i={x:(1-n)*r.x+n*t.x,y:(1-n)*r.y+n*t.y})}}r=t}));var o=t?10:5,s=Math.atan2(e[0].y-i.y,e[0].x-i.x),c={x:0,y:0};return c.x=Math.sin(s)*o+(e[0].x+i.x)/2,c.y=-Math.cos(s)*o+(e[0].y+i.y)/2,c},formatUrl:function(t,e){var n=t.trim();if(n)return"loose"!==e.securityLevel?Object(y.sanitizeUrl)(n):n},getStylesFromArray:N,generateId:L,random:F,memoize:M,runFunc:function(t){for(var e,n=t.split("."),r=n.length-1,i=n[r],a=window,o=0;o1?s-1:0),u=1;u/)&&(kt="LR"),kt.match(/.*v/)&&(kt="TB")},setClass:Lt,getTooltip:function(t){return Mt[t]},setClickEvent:function(t,e,n){t.split(",").forEach((function(t){!function(t,e){var n=t;t[0].match(/\d/)&&(n=""+n),"loose"===vt().securityLevel&&void 0!==e&&void 0!==Et[n]&&Nt.push((function(){var t=document.querySelector('[id="'.concat(n,'"]'));null!==t&&t.addEventListener("click",(function(){U.runFunc(e,n)}),!1)}))}(t,e)})),Ft(t,n),Lt(t,"clickable")},setLink:function(t,e,n,r){t.split(",").forEach((function(t){var n=t;t[0].match(/\d/)&&(n=""+n),void 0!==Et[n]&&(Et[n].link=U.formatUrl(e,wt),Et[n].linkTarget=r)})),Ft(t,n),Lt(t,"clickable")},bindFunctions:function(t){Nt.forEach((function(e){e(t)}))},getDirection:function(){return kt.trim()},getVertices:function(){return Et},getEdges:function(){return Tt},getClasses:function(){return Ct},clear:function(){Et={},Ct={},Tt=[],(Nt=[]).push(Pt),At=[],St={},Ot=0,Mt=[],Dt=!0},defaultStyle:function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"},addSubGraph:function(t,e,n){var r=t.trim(),i=n;t===n&&n.match(/\s/)&&(r=void 0);var a,o,s,c=[];a=c.concat.apply(c,e),o={boolean:{},number:{},string:{}},s=[],c=a.filter((function(t){var e=xt(t);return""!==t.trim()&&(e in o?!o[e].hasOwnProperty(t)&&(o[e][t]=!0):!(s.indexOf(t)>=0)&&s.push(t))}));for(var u=0;u0&&function t(e,n){var r=At[n].nodes;if(!((jt+=1)>2e3)){if(Rt[jt]=n,At[n].id===e)return{result:!0,count:0};for(var i=0,a=1;i=0){var s=t(e,o);if(s.result)return{result:!0,count:a+s.count};a+=s.count}i+=1}return{result:!1,count:a}}}("none",At.length-1)},getSubGraphs:function(){return At},destructLink:function(t,e){var n,r=function(t){switch(t.trim()){case"--x":return{type:"arrow_cross",stroke:"normal"};case"--\x3e":return{type:"arrow_point",stroke:"normal"};case"<--\x3e":return{type:"double_arrow_point",stroke:"normal"};case"x--x":return{type:"double_arrow_cross",stroke:"normal"};case"o--o":return{type:"double_arrow_circle",stroke:"normal"};case"o.-o":return{type:"double_arrow_circle",stroke:"dotted"};case"<==>":return{type:"double_arrow_point",stroke:"thick"};case"o==o":return{type:"double_arrow_circle",stroke:"thick"};case"x==x":return{type:"double_arrow_cross",stroke:"thick"};case"x.-x":case"x-.-x":return{type:"double_arrow_cross",stroke:"dotted"};case"<.->":case"<-.->":return{type:"double_arrow_point",stroke:"dotted"};case"o-.-o":return{type:"double_arrow_circle",stroke:"dotted"};case"--o":return{type:"arrow_circle",stroke:"normal"};case"---":return{type:"arrow_open",stroke:"normal"};case"-.-x":return{type:"arrow_cross",stroke:"dotted"};case"-.->":return{type:"arrow_point",stroke:"dotted"};case"-.-o":return{type:"arrow_circle",stroke:"dotted"};case"-.-":return{type:"arrow_open",stroke:"dotted"};case".-x":return{type:"arrow_cross",stroke:"dotted"};case".->":return{type:"arrow_point",stroke:"dotted"};case".-o":return{type:"arrow_circle",stroke:"dotted"};case".-":return{type:"arrow_open",stroke:"dotted"};case"==x":return{type:"arrow_cross",stroke:"thick"};case"==>":return{type:"arrow_point",stroke:"thick"};case"==o":return{type:"arrow_circle",stroke:"thick"};case"===":return{type:"arrow_open",stroke:"thick"}}}(t);if(e){if((n=function(t){switch(t.trim()){case"<--":return{type:"arrow_point",stroke:"normal"};case"x--":return{type:"arrow_cross",stroke:"normal"};case"o--":return{type:"arrow_circle",stroke:"normal"};case"<-.":return{type:"arrow_point",stroke:"dotted"};case"x-.":return{type:"arrow_cross",stroke:"dotted"};case"o-.":return{type:"arrow_circle",stroke:"dotted"};case"<==":return{type:"arrow_point",stroke:"thick"};case"x==":return{type:"arrow_cross",stroke:"thick"};case"o==":return{type:"arrow_circle",stroke:"thick"};case"--":return{type:"arrow_open",stroke:"normal"};case"==":return{type:"arrow_open",stroke:"thick"};case"-.":return{type:"arrow_open",stroke:"dotted"}}}(e)).stroke!==r.stroke)return{type:"INVALID",stroke:"INVALID"};if("arrow_open"===n.type)n.type=r.type;else{if(n.type!==r.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}return"double_arrow"===n.type&&(n.type="double_arrow_point"),n}return r},lex:{firstGraph:function(){return!!Dt&&(Dt=!1,!0)}}},zt=n(26),Ut=n.n(zt),$t=n(6),Wt=n.n($t),Ht=n(50),Vt=n.n(Ht);function Gt(t,e,n){var r=.9*(e.width+e.height),i=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}],a=ie(t,r,r,i);return n.intersect=function(t){return Wt.a.intersect.polygon(n,i,t)},a}function qt(t,e,n){var r=e.height,i=r/4,a=e.width+2*i,o=[{x:i,y:0},{x:a-i,y:0},{x:a,y:-r/2},{x:a-i,y:-r},{x:i,y:-r},{x:0,y:-r/2}],s=ie(t,a,r,o);return n.intersect=function(t){return Wt.a.intersect.polygon(n,o,t)},s}function Xt(t,e,n){var r=e.width,i=e.height,a=[{x:-i/2,y:0},{x:r,y:0},{x:r,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}],o=ie(t,r,i,a);return n.intersect=function(t){return Wt.a.intersect.polygon(n,a,t)},o}function Zt(t,e,n){var r=e.width,i=e.height,a=[{x:-2*i/6,y:0},{x:r-i/6,y:0},{x:r+2*i/6,y:-i},{x:i/6,y:-i}],o=ie(t,r,i,a);return n.intersect=function(t){return Wt.a.intersect.polygon(n,a,t)},o}function Jt(t,e,n){var r=e.width,i=e.height,a=[{x:2*i/6,y:0},{x:r+i/6,y:0},{x:r-2*i/6,y:-i},{x:-i/6,y:-i}],o=ie(t,r,i,a);return n.intersect=function(t){return Wt.a.intersect.polygon(n,a,t)},o}function Qt(t,e,n){var r=e.width,i=e.height,a=[{x:-2*i/6,y:0},{x:r+2*i/6,y:0},{x:r-i/6,y:-i},{x:i/6,y:-i}],o=ie(t,r,i,a);return n.intersect=function(t){return Wt.a.intersect.polygon(n,a,t)},o}function Kt(t,e,n){var r=e.width,i=e.height,a=[{x:i/6,y:0},{x:r-i/6,y:0},{x:r+2*i/6,y:-i},{x:-2*i/6,y:-i}],o=ie(t,r,i,a);return n.intersect=function(t){return Wt.a.intersect.polygon(n,a,t)},o}function te(t,e,n){var r=e.width,i=e.height,a=[{x:0,y:0},{x:r+i/2,y:0},{x:r,y:-i/2},{x:r+i/2,y:-i},{x:0,y:-i}],o=ie(t,r,i,a);return n.intersect=function(t){return Wt.a.intersect.polygon(n,a,t)},o}function ee(t,e,n){var r=e.height,i=e.width+r/4,a=t.insert("rect",":first-child").attr("rx",r/2).attr("ry",r/2).attr("x",-i/2).attr("y",-r/2).attr("width",i).attr("height",r);return n.intersect=function(t){return Wt.a.intersect.rect(n,t)},a}function ne(t,e,n){var r=e.width,i=e.height,a=[{x:0,y:0},{x:r,y:0},{x:r,y:-i},{x:0,y:-i},{x:0,y:0},{x:-8,y:0},{x:r+8,y:0},{x:r+8,y:-i},{x:-8,y:-i},{x:-8,y:0}],o=ie(t,r,i,a);return n.intersect=function(t){return Wt.a.intersect.polygon(n,a,t)},o}function re(t,e,n){var r=e.width,i=r/2,a=i/(2.5+r/50),o=e.height+a,s="M 0,"+a+" a "+i+","+a+" 0,0,0 "+r+" 0 a "+i+","+a+" 0,0,0 "+-r+" 0 l 0,"+o+" a "+i+","+a+" 0,0,0 "+r+" 0 l 0,"+-o,c=t.attr("label-offset-y",a).insert("path",":first-child").attr("d",s).attr("transform","translate("+-r/2+","+-(o/2+a)+")");return n.intersect=function(t){var e=Wt.a.intersect.rect(n,t),r=e.x-n.x;if(0!=i&&(Math.abs(r)n.height/2-a)){var o=a*a*(1-r*r/(i*i));0!=o&&(o=Math.sqrt(o)),o=a-o,t.y-n.y>0&&(o=-o),e.y+=o}return e},c}function ie(t,e,n,r){return t.insert("polygon",":first-child").attr("points",r.map((function(t){return t.x+","+t.y})).join(" ")).attr("transform","translate("+-e/2+","+n/2+")")}var ae={addToRender:function(t){t.shapes().question=Gt,t.shapes().hexagon=qt,t.shapes().stadium=ee,t.shapes().subroutine=ne,t.shapes().cylinder=re,t.shapes().rect_left_inv_arrow=Xt,t.shapes().lean_right=Zt,t.shapes().lean_left=Jt,t.shapes().trapezoid=Qt,t.shapes().inv_trapezoid=Kt,t.shapes().rect_right_inv_arrow=te},addToRenderV2:function(t){t({question:Gt}),t({hexagon:qt}),t({stadium:ee}),t({subroutine:ne}),t({cylinder:re}),t({rect_left_inv_arrow:Xt}),t({lean_right:Zt}),t({lean_left:Jt}),t({trapezoid:Qt}),t({inv_trapezoid:Kt}),t({rect_right_inv_arrow:te})}},oe={},se=function(t,e,n){var r=Object(s.select)('[id="'.concat(n,'"]'));Object.keys(t).forEach((function(n){var i=t[n],a="default";i.classes.length>0&&(a=i.classes.join(" "));var o,s=N(i.styles),c=void 0!==i.text?i.text:i.id;if(vt().flowchart.htmlLabels){var u={label:c.replace(/fa[lrsb]?:fa-[\w-]+/g,(function(t){return"")}))};(o=Vt()(r,u).node()).parentNode.removeChild(o)}else{var l=document.createElementNS("http://www.w3.org/2000/svg","text");l.setAttribute("style",s.labelStyle.replace("color:","fill:"));for(var h=c.split(_.lineBreakRegex),f=0;f').concat(a.text,"")):(l.labelType="text",l.label=a.text.replace(_.lineBreakRegex,"\n"),void 0===a.style&&(l.style=l.style||"stroke: #333; stroke-width: 1.5px;fill:none"),l.labelStyle=l.labelStyle.replace("color:","fill:"))),l.id=o,l.class=c+" "+u,e.setEdge(a.start,a.end,l,i)}))},ue=function(t){for(var e=Object.keys(t),n=0;n=0;h--)i=l[h],Yt.addVertex(i.id,i.title,"group",void 0,i.classes);var d=Yt.getVertices(),p=Yt.getEdges(),y=0;for(y=l.length-1;y>=0;y--){i=l[y],Object(s.selectAll)("cluster").append("text");for(var g=0;g"),f.info("vertexText"+i),function(t){var e,n,r=Object(s.select)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=r.append("xhtml:div"),a=t.label,o=t.isNode?"nodeLabel":"edgeLabel";return i.html(''+a+""),e=i,(n=t.labelStyle)&&e.attr("style",n),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),r.node()}({isNode:r,label:i.replace(/fa[lrsb]?:fa-[\w-]+/g,(function(t){return"")}))});var a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",e.replace("color:","fill:"));var o=[];o="string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[];for(var c=0;c0)t(a,n,r,i);else{var o=n.node(a);f.info("cp ",a," to ",i," with parent ",e),r.setNode(a,o),f.debug("Setting parent",a,n.parent(a)),i!==n.parent(a)&&r.setParent(a,n.parent(a)),e!==i&&a!==e?(f.debug("Setting parent",a,e),r.setParent(a,e)):(f.info("In copy ",e,"root",i,"data",n.node(e),i),f.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==i,"node!==clusterId",a!==e));var s=n.edges(a);f.debug("Copying Edges",s),s.forEach((function(t){f.info("Edge",t);var a=n.edge(t.v,t.w,t.name);f.info("Edge data",a,i);try{!function(t,e){return f.info("Decendants of ",e," is ",xe[e]),f.info("Edge is ",t),t.v!==e&&(t.w!==e&&(xe[e]?(f.info("Here "),xe[e].indexOf(t.v)>=0||(!!we(t.v,e)||(!!we(t.w,e)||xe[e].indexOf(t.w)>=0))):(f.debug("Tilt, ",e,",not in decendants"),!1)))}(t,i)?f.info("Skipping copy of edge ",t.v,"--\x3e",t.w," rootId: ",i," clusterId:",e):(f.info("Copying as ",t.v,t.w,a,t.name),r.setEdge(t.v,t.w,a,t.name),f.info("newGraph edges ",r.edges(),r.edge(r.edges()[0])))}catch(t){f.error(t)}}))}f.debug("Removing node",a),n.removeNode(a)}))},Te=function t(e,n){f.trace("Searching",e);var r=n.children(e);if(f.trace("Searching children of id ",e,r),r.length<1)return f.trace("This is a valid node",e),e;for(var i=0;i ",a),a}},Ce=function(t){return _e[t]&&_e[t].externalConnections&&_e[t]?_e[t].id:t},Ae=function(t,e){!t||e>10?f.debug("Opting out, no graph "):(f.debug("Opting in, graph "),t.nodes().forEach((function(e){t.children(e).length>0&&(f.warn("Cluster identified",e," Replacement id in edges: ",Te(e,t)),xe[e]=function t(e,n){for(var r=n.children(e),i=[].concat(r),a=0;a0&&(f.debug("Cluster identified",e,xe),r.forEach((function(t){t.v!==e&&t.w!==e&&(we(t.v,e)^we(t.w,e)&&(f.debug("Edge: ",t," leaves cluster ",e),f.debug("Decendants of ",e,": ",xe[e]),_e[e].externalConnections=!0))})))})),Se(t,0),t.edges().forEach((function(e){var n=t.edge(e);f.trace("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),f.trace("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(t.edge(e)));var r=e.v,i=e.w;f.trace("Fix",_e,"ids:",e.v,e.w,"Translateing: ",_e[e.v],_e[e.w]),(_e[e.v]||_e[e.w])&&(f.warn("Fixing and trixing - removing",e.v,e.w,e.name),r=Ce(e.v),i=Ce(e.w),t.removeEdge(e.v,e.w,e.name),r!==e.v&&(n.fromCluster=e.v),i!==e.w&&(n.toCluster=e.w),f.warn("Replacing with",r,i,e.name),t.setEdge(r,i,n,e.name))})),f.warn("Adjusted Graph",W.a.json.write(t)),f.trace(_e))},Se=function t(e,n){if(f.debug("extractor - ",n,W.a.json.write(e),e.children("D")),n>10)f.error("Bailing out");else{for(var r=e.nodes(),i=!1,a=0;a0}if(i){f.debug("Nodes = ",r,n);for(var c=0;c0){f.debug("Cluster without external connections, without a parent and with children",u,n);var l=e.graph(),h=new W.a.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:"TB"===l.rankdir?"LR":"TB",nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}}));f.debug("Old graph before copy",W.a.json.write(e)),Ee(u,e,h,u),e.setNode(u,{clusterNode:!0,id:u,clusterData:_e[u].clusterData,labelText:_e[u].labelText,graph:h}),f.debug("New graph after copy",W.a.json.write(h)),f.debug("Old graph after copy",W.a.json.write(e))}else f.debug("Cluster ** ",u," **not meeting the criteria !externalConnections:",!_e[u].externalConnections," no parent: ",!e.parent(u)," children ",e.children(u)&&e.children(u).length>0,e.children("D"),n),f.debug(_e);else f.debug("Not a cluster",u,n)}r=e.nodes(),f.debug("New list of nodes",r);for(var d=0;d0}var Be=function(t,e,n,r){var i,a,o,s,c,u,l,h,f,d,p,y,g;if(i=e.y-t.y,o=t.x-e.x,c=e.x*t.y-t.x*e.y,f=i*n.x+o*n.y+c,d=i*r.x+o*r.y+c,!(0!==f&&0!==d&&Ne(f,d)||(a=r.y-n.y,s=n.x-r.x,u=r.x*n.y-n.x*r.y,l=a*t.x+s*t.y+u,h=a*e.x+s*e.y+u,0!==l&&0!==h&&Ne(l,h)||0==(p=i*s-a*o))))return y=Math.abs(p/2),{x:(g=o*u-s*c)<0?(g-y)/p:(g+y)/p,y:(g=a*c-i*u)<0?(g-y)/p:(g+y)/p}},Le=function(t,e,n){var r=t.x,i=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach((function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)})):(o=Math.min(o,e.x),s=Math.min(s,e.y));for(var c=r-t.width/2-o,u=i-t.height/2-s,l=0;l1&&a.sort((function(t,e){var r=t.x-n.x,i=t.y-n.y,a=Math.sqrt(r*r+i*i),o=e.x-n.x,s=e.y-n.y,c=Math.sqrt(o*o+s*s);return aMath.abs(o)*u?(s<0&&(u=-u),n=0===s?0:u*o/s,r=u):(o<0&&(c=-c),n=c,r=0===o?0:c*s/o),{x:i+n,y:a+r}},Pe={node:n.n(Me).a,circle:De,ellipse:Oe,polygon:Le,rect:Fe},Ie=function(t,e,n){var r=t.insert("g").attr("class","node default").attr("id",e.id),i=70,a=10;"LR"===n&&(i=10,a=70);var o=r.append("rect").style("stroke","black").style("fill","black").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return me(e,o),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return Pe.rect(e,t)},r},je={question:function(t,e){var n=ve(t,e,void 0,!0),r=n.shapeSvg,i=n.bbox,a=i.width+e.padding+(i.height+e.padding),o=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}];f.info("Question main (Circle)");var s=be(r,a,a,o);return me(e,s),e.intersect=function(t){return f.warn("Intersect called"),Pe.polygon(e,o,t)},r},rect:function(t,e){var n=ve(t,e,"node "+e.classes,!0),r=n.shapeSvg,i=n.bbox,a=n.halfPadding;f.trace("Classes = ",e.classes);var o=r.insert("rect",":first-child");return o.attr("class","basic label-container").attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),me(e,o),e.intersect=function(t){return Pe.rect(e,t)},r},rectWithTitle:function(t,e){var n;n=e.classes?"node "+e.classes:"node default";var r=t.insert("g").attr("class",n).attr("id",e.id),i=r.insert("rect",":first-child"),a=r.insert("line"),o=r.insert("g").attr("class","label"),c=e.labelText.flat();f.info("Label text",c[0]);var u,l=o.node().appendChild(ge(c[0],e.labelStyle,!0,!0));if(vt().flowchart.htmlLabels){var h=l.children[0],d=Object(s.select)(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}f.info("Text 2",c);var p=c.slice(1,c.length),y=l.getBBox(),g=o.node().appendChild(ge(p.join("
"),e.labelStyle,!0,!0));if(vt().flowchart.htmlLabels){var v=g.children[0],m=Object(s.select)(g);u=v.getBoundingClientRect(),m.attr("width",u.width),m.attr("height",u.height)}var b=e.padding/2;return Object(s.select)(g).attr("transform","translate( "+(u.width>y.width?0:(y.width-u.width)/2)+", "+(y.height+b+5)+")"),Object(s.select)(l).attr("transform","translate( "+(u.widthe.height/2-s)){var i=s*s*(1-r*r/(o*o));0!=i&&(i=Math.sqrt(i)),i=s-i,t.y-e.y>0&&(i=-i),n.y+=i}return n},r},start:function(t,e){var n=t.insert("g").attr("class","node default").attr("id",e.id),r=n.insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),me(e,r),e.intersect=function(t){return Pe.circle(e,7,t)},n},end:function(t,e){var n=t.insert("g").attr("class","node default").attr("id",e.id),r=n.insert("circle",":first-child"),i=n.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),me(e,i),e.intersect=function(t){return Pe.circle(e,7,t)},n},note:function(t,e){var n=ve(t,e,"node "+e.classes,!0),r=n.shapeSvg,i=n.bbox,a=n.halfPadding;f.info("Classes = ",e.classes);var o=r.insert("rect",":first-child");return o.attr("rx",e.rx).attr("ry",e.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+e.padding).attr("height",i.height+e.padding),me(e,o),e.intersect=function(t){return Pe.rect(e,t)},r},subroutine:function(t,e){var n=ve(t,e,void 0,!0),r=n.shapeSvg,i=n.bbox,a=i.width+e.padding,o=i.height+e.padding,s=be(r,a,o,[{x:0,y:0},{x:a,y:0},{x:a,y:-o},{x:0,y:-o},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-o},{x:-8,y:-o},{x:-8,y:0}]);return me(e,s),e.intersect=function(t){return Pe.polygon(e,t)},r},fork:Ie,join:Ie,class_box:function(t,e){var n,r=e.padding/2;n=e.classes?"node "+e.classes:"node default";var i=t.insert("g").attr("class",n).attr("id",e.id),a=i.insert("rect",":first-child"),o=i.insert("line"),c=i.insert("line"),u=0,l=4,h=i.insert("g").attr("class","label"),f=0,d=e.classData.annotations&&e.classData.annotations[0],p=h.node().appendChild(ge(e.classData.annotations[0],e.labelStyle,!0,!0)),y=p.getBBox();e.classData.annotations[0]&&(l+=y.height+4,u+=y.width);var g=h.node().appendChild(ge(e.labelText,e.labelStyle,!0,!0)),v=g.getBBox();l+=v.height+4,v.width>u&&(u=v.width);var m=[];e.classData.members.forEach((function(t){var n=h.node().appendChild(ge(t,e.labelStyle,!0,!0)),r=n.getBBox();r.width>u&&(u=r.width),l+=r.height+4,m.push(n)}));var b=[];e.classData.methods.forEach((function(t){var n=h.node().appendChild(ge(t,e.labelStyle,!0,!0)),r=n.getBBox();r.width>u&&(u=r.width),l+=r.height+4,b.push(n)})),l+=8,d&&(Object(s.select)(p).attr("transform","translate( "+-(u+e.padding-y.width/2)/2+", "+-1*l/2+")"),f=y.height+4);var _,x=(u-v.width)/2;if(Object(s.select)(g).attr("transform","translate( "+(-1*u/2+x)+", "+(-1*l/2+f)+")"),f+=v.height+4,o.attr("class","divider").attr("x1",-u/2-r).attr("x2",u/2+r).attr("y1",-l/2-r+8+f).attr("y2",-l/2-r+8+f),f+=8,m.forEach((function(t){Object(s.select)(t).attr("transform","translate( "+-u/2+", "+(-1*l/2+f+4)+")"),f+=v.height+4})),c.attr("class","divider").attr("x1",-u/2-r).attr("x2",u/2+r).attr("y1",-l/2-r+8+f).attr("y2",-l/2-r+8+f),f+=8,b.forEach((function(t){Object(s.select)(t).attr("transform","translate( "+-u/2+", "+(-1*l/2+f)+")"),f+=v.height+4})),vt().flowchart.htmlLabels){var k=p.children[0],w=Object(s.select)(p);_=k.getBoundingClientRect(),w.attr("width",_.width),w.attr("height",_.height)}return a.attr("class","outer title-state").attr("x",-u/2-r).attr("y",-l/2-r).attr("width",u+e.padding).attr("height",l+e.padding),me(e,a),e.intersect=function(t){return Pe.rect(e,t)},i}},Re={},Ye=function(t){var e=Re[t.id];f.trace("Transforming node",t,"translate("+(t.x-t.width/2-5)+", "+(t.y-t.height/2-5)+")");t.clusterNode?e.attr("transform","translate("+(t.x-t.width/2-8)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")")},ze={rect:function(t,e){f.trace("Creating subgraph rect for ",e.id,e);var n=t.insert("g").attr("class","cluster").attr("id",e.id),r=n.insert("rect",":first-child"),i=n.insert("g").attr("class","cluster-label"),a=i.node().appendChild(ge(e.labelText,e.labelStyle,void 0,!0)),o=a.getBBox();if(vt().flowchart.htmlLabels){var c=a.children[0],u=Object(s.select)(a);o=c.getBoundingClientRect(),u.attr("width",o.width),u.attr("height",o.height)}var l=0*e.padding,h=l/2;f.trace("Data ",e,JSON.stringify(e)),r.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-h).attr("y",e.y-e.height/2-h).attr("width",e.width+l).attr("height",e.height+l),i.attr("transform","translate("+(e.x-o.width/2)+", "+(e.y-e.height/2-e.padding/3+3)+")");var d=r.node().getBBox();return e.width=d.width,e.height=d.height,e.intersect=function(t){return Fe(e,t)},n},roundedWithTitle:function(t,e){var n=t.insert("g").attr("class",e.classes).attr("id",e.id),r=n.insert("rect",":first-child"),i=n.insert("g").attr("class","cluster-label"),a=n.append("rect"),o=i.node().appendChild(ge(e.labelText,e.labelStyle,void 0,!0)),c=o.getBBox();if(vt().flowchart.htmlLabels){var u=o.children[0],l=Object(s.select)(o);c=u.getBoundingClientRect(),l.attr("width",c.width),l.attr("height",c.height)}c=o.getBBox();var h=0*e.padding,f=h/2;r.attr("class","outer").attr("x",e.x-e.width/2-f).attr("y",e.y-e.height/2-f).attr("width",e.width+h).attr("height",e.height+h),a.attr("class","inner").attr("x",e.x-e.width/2-f).attr("y",e.y-e.height/2-f+c.height-1).attr("width",e.width+h).attr("height",e.height+h-c.height-3),i.attr("transform","translate("+(e.x-c.width/2)+", "+(e.y-e.height/2-e.padding/3+(vt().flowchart.htmlLabels?5:3))+")");var d=r.node().getBBox();return e.width=d.width,e.height=d.height,e.intersect=function(t){return Fe(e,t)},n},noteGroup:function(t,e){var n=t.insert("g").attr("class","note-cluster").attr("id",e.id),r=n.insert("rect",":first-child"),i=0*e.padding,a=i/2;r.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");var o=r.node().getBBox();return e.width=o.width,e.height=o.height,e.intersect=function(t){return Fe(e,t)},n},divider:function(t,e){var n=t.insert("g").attr("class",e.classes).attr("id",e.id),r=n.insert("rect",":first-child"),i=0*e.padding,a=i/2;r.attr("class","divider").attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2).attr("width",e.width+i).attr("height",e.height+i);var o=r.node().getBBox();return e.width=o.width,e.height=o.height,e.intersect=function(t){return Fe(e,t)},n}},Ue={},$e={},We=function(t,e){var n=t.x,r=t.y,i=Math.abs(e.x-n),a=Math.abs(e.y-r),o=t.width/2,s=t.height/2;return i>=o||a>=s},He=function(t,e,n){f.warn("intersection calc o:",e," i:",n,t);var r=t.x,i=t.y,a=Math.abs(r-n.x),o=t.width/2,s=n.xMath.abs(r-e.x)*c){var g=n.y0&&f.info("Recursive edges",n.edge(n.edges()[0]));var c=o.insert("g").attr("class","clusters"),u=o.insert("g").attr("class","edgePaths"),l=o.insert("g").attr("class","edgeLabels"),h=o.insert("g").attr("class","nodes");return n.nodes().forEach((function(e){var o=n.node(e);if(void 0!==i){var s=JSON.parse(JSON.stringify(i.clusterData));f.info("Setting data for cluster",s),n.setNode(i.id,s),n.setParent(e,i.id,s)}if(f.info("(Insert) Node "+e+": "+JSON.stringify(n.node(e))),o&&o.clusterNode){f.info("Cluster identified",e,o,n.node(e));var c=t(h,o.graph,r,n.node(e));me(o,c),function(t,e){Re[e.id]=t}(c,o),f.warn("Recursive render complete",c,o)}else n.children(e).length>0?(f.info("Cluster - the non recursive path",e,o.id,o,n),f.info(Te(o.id,n)),_e[o.id]={id:Te(o.id,n),node:o}):(f.info("Node - the non recursive path",e,o.id,o),function(t,e,n){Re[e.id]=je[e.shape](t,e,n)}(h,n.node(e),a))})),n.edges().forEach((function(t){var e=n.edge(t.v,t.w,t.name);f.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),f.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(n.edge(t))),f.info("Fix",_e,"ids:",t.v,t.w,"Translateing: ",_e[t.v],_e[t.w]),function(t,e){var n=ge(e.label,e.labelStyle),r=t.insert("g").attr("class","edgeLabel"),i=r.insert("g").attr("class","label");i.node().appendChild(n);var a=n.getBBox();if(vt().flowchart.htmlLabels){var o=n.children[0],c=Object(s.select)(n);a=o.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}i.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),$e[e.id]=r,e.width=a.width,e.height=a.height}(l,e)})),n.edges().forEach((function(t){f.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t))})),f.info("#############################################"),f.info("### Layout ###"),f.info("#############################################"),f.info(n),de.a.layout(n),f.info("Graph after layout:",W.a.json.write(n)),n.nodes().forEach((function(t){var e=n.node(t);f.info("Position "+t+": "+JSON.stringify(n.node(t))),f.info("Position "+t+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e&&e.clusterNode?Ye(e):n.children(t).length>0?(!function(t,e){f.trace("Inserting cluster");var n=e.shape||"rect";Ue[e.id]=ze[n](t,e)}(c,e),_e[e.id].node=e):Ye(e)})),n.edges().forEach((function(t){var e=n.edge(t);f.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e),e);var i=function(t,e,n,r,i,a){var o=n.points,c=!1,u=a.node(e.v),l=a.node(e.w);if(l.intersect&&u.intersect&&((o=o.slice(1,n.points.length-1)).unshift(u.intersect(o[0])),f.info("Last point",o[o.length-1],l,l.intersect(o[o.length-1])),o.push(l.intersect(o[o.length-1]))),n.toCluster){var h;f.trace("edge",n),f.trace("to cluster",r[n.toCluster]),o=[];var d=!1;n.points.forEach((function(t){var e=r[n.toCluster].node;if(We(e,t)||d)d||o.push(t);else{f.trace("inside",n.toCluster,t,h);var i=He(e,h,t),a=!1;o.forEach((function(t){a=a||t.x===i.x&&t.y===i.y})),o.find((function(t){return t.x===i.x&&t.y===i.y}))?f.warn("no intersect",i,o):o.push(i),d=!0}h=t})),c=!0}if(n.fromCluster){f.trace("edge",n),f.warn("from cluster",r[n.fromCluster]);for(var p,y=[],g=!1,v=o.length-1;v>=0;v--){var m=o[v],b=r[n.fromCluster].node;if(We(b,m)||g)f.trace("Outside point",m),g||y.unshift(m);else{f.warn("inside",n.fromCluster,m,b);var _=He(b,p,m);y.unshift(_),g=!0}p=m}o=y,c=!0}var x,k=o.filter((function(t){return!Number.isNaN(t.y)})),w=Object(s.line)().x((function(t){return t.x})).y((function(t){return t.y})).curve(s.curveBasis);switch(n.thickness){case"normal":x="edge-thickness-normal";break;case"thick":x="edge-thickness-thick";break;default:x=""}switch(n.pattern){case"solid":x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed"}var E=t.append("path").attr("d",w(k)).attr("id",n.id).attr("class"," "+x+(n.classes?" "+n.classes:"")),T="";switch(vt().state.arrowMarkerAbsolute&&(T=(T=(T=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),f.info("arrowTypeStart",n.arrowTypeStart),f.info("arrowTypeEnd",n.arrowTypeEnd),n.arrowTypeStart){case"arrow_cross":E.attr("marker-start","url("+T+"#"+i+"-crossStart)");break;case"arrow_point":E.attr("marker-start","url("+T+"#"+i+"-pointStart)");break;case"arrow_barb":E.attr("marker-start","url("+T+"#"+i+"-barbStart)");break;case"arrow_circle":E.attr("marker-start","url("+T+"#"+i+"-circleStart)");break;case"aggregation":E.attr("marker-start","url("+T+"#"+i+"-aggregationStart)");break;case"extension":E.attr("marker-start","url("+T+"#"+i+"-extensionStart)");break;case"composition":E.attr("marker-start","url("+T+"#"+i+"-compositionStart)");break;case"dependency":E.attr("marker-start","url("+T+"#"+i+"-dependencyStart)")}switch(n.arrowTypeEnd){case"arrow_cross":E.attr("marker-end","url("+T+"#"+i+"-crossEnd)");break;case"arrow_point":E.attr("marker-end","url("+T+"#"+i+"-pointEnd)");break;case"arrow_barb":E.attr("marker-end","url("+T+"#"+i+"-barbEnd)");break;case"arrow_circle":E.attr("marker-end","url("+T+"#"+i+"-circleEnd)");break;case"aggregation":E.attr("marker-end","url("+T+"#"+i+"-aggregationEnd)");break;case"extension":E.attr("marker-end","url("+T+"#"+i+"-extensionEnd)");break;case"composition":E.attr("marker-end","url("+T+"#"+i+"-compositionEnd)");break;case"dependency":E.attr("marker-end","url("+T+"#"+i+"-dependencyEnd)")}if(c)return o}(u,t,e,_e,r,n);!function(t,e){if(f.info("Moving label",t.id,t.label,$e[t.id]),t.label){var n=$e[t.id],r=t.x,i=t.y;if(e){var a=U.calcLabelPosition(e);r=a.x,i=a.y}n.attr("transform","translate("+r+", "+i+")")}}(e,i)})),o},Ge=function(t,e,n,r,i){ye(t,n,r,i),Re={},$e={},Ue={},xe={},ke={},_e={},f.warn("Graph before:",W.a.json.write(e)),Ae(e),f.warn("Graph after:",W.a.json.write(e)),f.warn("Graph ever after:",e.graph()),Ve(t,e,r)},qe={},Xe=function(t,e,n){var r=Object(s.select)('[id="'.concat(n,'"]'));Object.keys(t).forEach((function(n){var i=t[n],a="default";i.classes.length>0&&(a=i.classes.join(" "));var o,s=N(i.styles),c=void 0!==i.text?i.text:i.id;if(vt().flowchart.htmlLabels){var u={label:c.replace(/fa[lrsb]?:fa-[\w-]+/g,(function(t){return"")}))};(o=Vt()(r,u).node()).parentNode.removeChild(o)}else{var l=document.createElementNS("http://www.w3.org/2000/svg","text");l.setAttribute("style",s.labelStyle.replace("color:","fill:"));for(var h=c.split(_.lineBreakRegex),d=0;d=0;h--)i=l[h],f.info("Subgraph - ",i),Yt.addVertex(i.id,i.title,"group",void 0,i.classes);var d=Yt.getVertices(),p=Yt.getEdges();f.info(p);var y=0;for(y=l.length-1;y>=0;y--){i=l[y],Object(s.selectAll)("cluster").append("text");for(var g=0;g0)switch(e.valign){case"top":case"start":s=function(){return Math.round(e.y+e.textMargin)};break;case"middle":case"center":s=function(){return Math.round(e.y+(n+r+e.textMargin)/2)};break;case"bottom":case"end":s=function(){return Math.round(e.y+(n+r+2*e.textMargin)-e.textMargin)}}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="text-after-edge",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="text-before-edge",e.alignmentBaseline="middle"}for(var c=0;c0&&(r+=(l._groups||l)[0][0].getBBox().height,n=r),a.push(l)}return a},en=function(t,e){var n,r,i,a,o,s=t.append("polygon");return s.attr("points",(n=e.x,r=e.y,i=e.width,a=e.height,n+","+r+" "+(n+i)+","+r+" "+(n+i)+","+(r+a-(o=7))+" "+(n+i-1.2*o)+","+(r+a)+" "+n+","+(r+a))),s.attr("class","labelBox"),e.y=e.y+e.height/2,tn(t,e),s},nn=-1,rn=function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},an=function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},on=function(){function t(t,e,n,i,a,o,s){r(e.append("text").attr("x",n+a/2).attr("y",i+o/2+5).style("text-anchor","middle").text(t),s)}function e(t,e,n,i,a,o,s,c){for(var u=c.actorFontSize,l=c.actorFontFamily,h=c.actorFontWeight,f=t.split(_.lineBreakRegex),d=0;d2&&void 0!==arguments[2]?arguments[2]:{text:void 0,wrap:void 0},r=arguments.length>3?arguments[3]:void 0;if(r===kn.ACTIVE_END){var i=bn(t.actor);if(i<1){var a=new Error("Trying to inactivate an inactive participant ("+t.actor+")");throw a.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},a}}return fn.push({from:t,to:e,message:n.text,wrap:void 0===n.wrap&&xn()||!!n.wrap,type:r}),!0},xn=function(){return vn},kn={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23},wn=function(t,e,n){var r={actor:t,placement:e,message:n.text,wrap:void 0===n.wrap&&xn()||!!n.wrap},i=[].concat(t,t);dn.push(r),fn.push({from:i[0],to:i[1],message:n.text,wrap:void 0===n.wrap&&xn()||!!n.wrap,type:kn.NOTE,placement:e})},En=function(t){pn=t.text,yn=void 0===t.wrap&&xn()||!!t.wrap},Tn={addActor:mn,addMessage:function(t,e,n,r){fn.push({from:t,to:e,message:n.text,wrap:void 0===n.wrap&&xn()||!!n.wrap,answer:r})},addSignal:_n,autoWrap:xn,setWrap:function(t){vn=t},enableSequenceNumbers:function(){gn=!0},showSequenceNumbers:function(){return gn},getMessages:function(){return fn},getActors:function(){return hn},getActor:function(t){return hn[t]},getActorKeys:function(){return Object.keys(hn)},getTitle:function(){return pn},parseDirective:function(t,e,n){Bo.parseDirective(this,t,e,n)},getConfig:function(){return vt().sequence},getTitleWrapped:function(){return yn},clear:function(){hn={},fn=[]},parseMessage:function(t){var e=t.trim(),n={text:e.replace(/^[:]?(?:no)?wrap:/,"").trim(),wrap:null===e.match(/^[:]?(?:no)?wrap:/)?_.hasBreaks(e)||void 0:null!==e.match(/^[:]?wrap:/)||null===e.match(/^[:]?nowrap:/)&&void 0};return f.debug("parseMessage:",n),n},LINETYPE:kn,ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},addNote:wn,setTitle:En,apply:function t(e){if(e instanceof Array)e.forEach((function(e){t(e)}));else switch(e.type){case"addActor":mn(e.actor,e.actor,e.description);break;case"activeStart":case"activeEnd":_n(e.actor,void 0,void 0,e.signalType);break;case"addNote":wn(e.actor,e.placement,e.text);break;case"addMessage":_n(e.from,e.to,e.msg,e.signalType);break;case"loopStart":_n(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":_n(void 0,void 0,void 0,e.signalType);break;case"rectStart":_n(void 0,void 0,e.color,e.signalType);break;case"rectEnd":_n(void 0,void 0,void 0,e.signalType);break;case"optStart":_n(void 0,void 0,e.optText,e.signalType);break;case"optEnd":_n(void 0,void 0,void 0,e.signalType);break;case"altStart":case"else":_n(void 0,void 0,e.altText,e.signalType);break;case"altEnd":_n(void 0,void 0,void 0,e.signalType);break;case"setTitle":En(e.text);break;case"parStart":case"and":_n(void 0,void 0,e.parText,e.signalType);break;case"parEnd":_n(void 0,void 0,void 0,e.signalType)}}};cn.parser.yy=Tn;var Cn={},An={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((function(t){return t.height||0})))+(0===this.loops.length?0:this.loops.map((function(t){return t.height||0})).reduce((function(t,e){return t+e})))+(0===this.messages.length?0:this.messages.map((function(t){return t.height||0})).reduce((function(t,e){return t+e})))+(0===this.notes.length?0:this.notes.map((function(t){return t.height||0})).reduce((function(t,e){return t+e})))},clear:function(){this.actors=[],this.loops=[],this.messages=[],this.notes=[]},addActor:function(t){this.actors.push(t)},addLoop:function(t){this.loops.push(t)},addMessage:function(t){this.messages.push(t)},addNote:function(t){this.notes.push(t)},lastActor:function(){return this.actors[this.actors.length-1]},lastLoop:function(){return this.loops[this.loops.length-1]},lastMessage:function(){return this.messages[this.messages.length-1]},lastNote:function(){return this.notes[this.notes.length-1]},actors:[],loops:[],messages:[],notes:[]},init:function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Nn(cn.parser.yy.getConfig())},updateVal:function(t,e,n,r){void 0===t[e]?t[e]=n:t[e]=r(n,t[e])},updateBounds:function(t,e,n,r){var i=this,a=0;function o(o){return function(s){a++;var c=i.sequenceItems.length-a+1;i.updateVal(s,"starty",e-c*Cn.boxMargin,Math.min),i.updateVal(s,"stopy",r+c*Cn.boxMargin,Math.max),i.updateVal(An.data,"startx",t-c*Cn.boxMargin,Math.min),i.updateVal(An.data,"stopx",n+c*Cn.boxMargin,Math.max),"activation"!==o&&(i.updateVal(s,"startx",t-c*Cn.boxMargin,Math.min),i.updateVal(s,"stopx",n+c*Cn.boxMargin,Math.max),i.updateVal(An.data,"starty",e-c*Cn.boxMargin,Math.min),i.updateVal(An.data,"stopy",r+c*Cn.boxMargin,Math.max))}}this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},insert:function(t,e,n,r){var i=Math.min(t,n),a=Math.max(t,n),o=Math.min(e,r),s=Math.max(e,r);this.updateVal(An.data,"startx",i,Math.min),this.updateVal(An.data,"starty",o,Math.min),this.updateVal(An.data,"stopx",a,Math.max),this.updateVal(An.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},newActivation:function(t,e,n){var r=n[t.from.actor],i=Bn(t.from.actor).length||0,a=r.x+r.width/2+(i-1)*Cn.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Cn.activationWidth,stopy:void 0,actor:t.from.actor,anchored:sn.anchorElement(e)})},endActivation:function(t){var e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from.actor);return this.activations.splice(e,1)[0]},createLoop:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{message:void 0,wrap:!1,width:void 0},e=arguments.length>1?arguments[1]:void 0;return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},newLoop:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{message:void 0,wrap:!1,width:void 0},e=arguments.length>1?arguments[1]:void 0;this.sequenceItems.push(this.createLoop(t,e))},endLoop:function(){return this.sequenceItems.pop()},addSectionToLoop:function(t){var e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:An.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return console.log("here",this.data),{bounds:this.data,models:this.models}}},Sn=function(t){return{fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}},Mn=function(t){return{fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}},On=function(t){return{fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}},Dn=function(t,e,n,r){for(var i=0,a=0,o=0;o0&&o.forEach((function(r){if(n=r,i.startx===i.stopx){var a=e[t.from],o=e[t.to];n.from=Math.min(a.x-i.width/2,a.x-a.width/2,n.from),n.to=Math.max(o.x+i.width/2,o.x+a.width/2,n.to),n.width=Math.max(n.width,Math.abs(n.to-n.from))-Cn.labelBoxWidth}else n.from=Math.min(i.startx,n.from),n.to=Math.max(i.stopx,n.to),n.width=Math.max(n.width,i.width)-Cn.labelBoxWidth})))})),An.activations=[],f.debug("Loop type widths:",a),a},Rn={bounds:An,drawActors:Dn,setConf:Nn,draw:function(t,e){Cn=vt().sequence,console.log("there ",Cn),cn.parser.yy.clear(),cn.parser.yy.setWrap(Cn.wrap),cn.parser.parse(t+"\n"),An.init(),f.debug("C:".concat(JSON.stringify(Cn,null,2)));var n=Object(s.select)('[id="'.concat(e,'"]')),r=cn.parser.yy.getActors(),i=cn.parser.yy.getActorKeys(),a=cn.parser.yy.getMessages(),o=cn.parser.yy.getTitle(),c=Pn(r,a);Cn.height=In(r,c),Dn(n,r,i,0);var u=jn(a,r,c);sn.insertArrowHead(n),sn.insertArrowCrossHead(n),sn.insertSequenceNumber(n);var l=1;a.forEach((function(t){var e,i,a;switch(t.type){case cn.parser.yy.LINETYPE.NOTE:i=t.noteModel,function(t,e){An.bumpVerticalPos(Cn.boxMargin),e.height=Cn.boxMargin,e.starty=An.getVerticalPos();var n=sn.getNoteRect();n.x=e.startx,n.y=e.starty,n.width=e.width||Cn.width,n.class="note";var r=t.append("g"),i=sn.drawRect(r,n),a=sn.getTextObj();a.x=e.startx,a.y=e.starty,a.width=n.width,a.dy="1em",a.text=e.message,a.class="noteText",a.fontFamily=Cn.noteFontFamily,a.fontSize=Cn.noteFontSize,a.fontWeight=Cn.noteFontWeight,a.anchor=Cn.noteAlign,a.textMargin=Cn.noteMargin,a.valign=Cn.noteAlign,a.wrap=!0;var o=tn(r,a),s=Math.round(o.map((function(t){return(t._groups||t)[0][0].getBBox().height})).reduce((function(t,e){return t+e})));i.attr("height",s+2*Cn.noteMargin),e.height+=s+2*Cn.noteMargin,An.bumpVerticalPos(s+2*Cn.noteMargin),e.stopy=e.starty+s+2*Cn.noteMargin,e.stopx=e.startx+n.width,An.insert(e.startx,e.starty,e.stopx,e.stopy),An.models.addNote(e)}(n,i);break;case cn.parser.yy.LINETYPE.ACTIVE_START:An.newActivation(t,n,r);break;case cn.parser.yy.LINETYPE.ACTIVE_END:!function(t,e){var r=An.endActivation(t);r.starty+18>e&&(r.starty=e-6,e+=12),sn.drawActivation(n,r,e,Cn,Bn(t.from.actor).length),An.insert(r.startx,e-10,r.stopx,e)}(t,An.getVerticalPos());break;case cn.parser.yy.LINETYPE.LOOP_START:Fn(u,t,Cn.boxMargin,Cn.boxMargin+Cn.boxTextMargin,(function(t){return An.newLoop(t)}));break;case cn.parser.yy.LINETYPE.LOOP_END:e=An.endLoop(),sn.drawLoop(n,e,"loop",Cn),An.bumpVerticalPos(e.stopy-An.getVerticalPos()),An.models.addLoop(e);break;case cn.parser.yy.LINETYPE.RECT_START:Fn(u,t,Cn.boxMargin,Cn.boxMargin,(function(t){return An.newLoop(void 0,t.message)}));break;case cn.parser.yy.LINETYPE.RECT_END:e=An.endLoop(),sn.drawBackgroundRect(n,e),An.models.addLoop(e),An.bumpVerticalPos(e.stopy-An.getVerticalPos());break;case cn.parser.yy.LINETYPE.OPT_START:Fn(u,t,Cn.boxMargin,Cn.boxMargin+Cn.boxTextMargin,(function(t){return An.newLoop(t)}));break;case cn.parser.yy.LINETYPE.OPT_END:e=An.endLoop(),sn.drawLoop(n,e,"opt",Cn),An.bumpVerticalPos(e.stopy-An.getVerticalPos()),An.models.addLoop(e);break;case cn.parser.yy.LINETYPE.ALT_START:Fn(u,t,Cn.boxMargin,Cn.boxMargin+Cn.boxTextMargin,(function(t){return An.newLoop(t)}));break;case cn.parser.yy.LINETYPE.ALT_ELSE:Fn(u,t,Cn.boxMargin+Cn.boxTextMargin,Cn.boxMargin,(function(t){return An.addSectionToLoop(t)}));break;case cn.parser.yy.LINETYPE.ALT_END:e=An.endLoop(),sn.drawLoop(n,e,"alt",Cn),An.bumpVerticalPos(e.stopy-An.getVerticalPos()),An.models.addLoop(e);break;case cn.parser.yy.LINETYPE.PAR_START:Fn(u,t,Cn.boxMargin,Cn.boxMargin+Cn.boxTextMargin,(function(t){return An.newLoop(t)}));break;case cn.parser.yy.LINETYPE.PAR_AND:Fn(u,t,Cn.boxMargin+Cn.boxTextMargin,Cn.boxMargin,(function(t){return An.addSectionToLoop(t)}));break;case cn.parser.yy.LINETYPE.PAR_END:e=An.endLoop(),sn.drawLoop(n,e,"par",Cn),An.bumpVerticalPos(e.stopy-An.getVerticalPos()),An.models.addLoop(e);break;default:try{(a=t.msgModel).starty=An.getVerticalPos(),a.sequenceIndex=l,function(t,e){An.bumpVerticalPos(10);var n=e.startx,r=e.stopx,i=e.starty,a=e.message,o=e.type,s=e.sequenceIndex,c=e.wrap,u=_.splitBreaks(a).length,l=U.calculateTextDimensions(a,Sn(Cn)),h=l.height/u;e.height+=h,An.bumpVerticalPos(h);var f=sn.getTextObj();f.x=n,f.y=i+10,f.width=r-n,f.class="messageText",f.dy="1em",f.text=a,f.fontFamily=Cn.messageFontFamily,f.fontSize=Cn.messageFontSize,f.fontWeight=Cn.messageFontWeight,f.anchor=Cn.messageAlign,f.valign=Cn.messageAlign,f.textMargin=Cn.wrapPadding,f.tspan=!1,f.wrap=c,tn(t,f);var d,p,y=l.height-10,g=l.width;if(n===r){p=An.getVerticalPos()+y,Cn.rightAngles?d=t.append("path").attr("d","M ".concat(n,",").concat(p," H ").concat(n+Math.max(Cn.width/2,g/2)," V ").concat(p+25," H ").concat(n)):(y+=Cn.boxMargin,p=An.getVerticalPos()+y,d=t.append("path").attr("d","M "+n+","+p+" C "+(n+60)+","+(p-10)+" "+(n+60)+","+(p+30)+" "+n+","+(p+20))),y+=30;var v=Math.max(g/2,Cn.width/2);An.insert(n-v,An.getVerticalPos()-10+y,r+v,An.getVerticalPos()+30+y)}else y+=Cn.boxMargin,p=An.getVerticalPos()+y,(d=t.append("line")).attr("x1",n),d.attr("y1",p),d.attr("x2",r),d.attr("y2",p),An.insert(n,p-10,r,p);o===cn.parser.yy.LINETYPE.DOTTED||o===cn.parser.yy.LINETYPE.DOTTED_CROSS||o===cn.parser.yy.LINETYPE.DOTTED_OPEN?(d.style("stroke-dasharray","3, 3"),d.attr("class","messageLine1")):d.attr("class","messageLine0");var m="";Cn.arrowMarkerAbsolute&&(m=(m=(m=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),d.attr("stroke-width",2),d.attr("stroke","none"),d.style("fill","none"),o!==cn.parser.yy.LINETYPE.SOLID&&o!==cn.parser.yy.LINETYPE.DOTTED||d.attr("marker-end","url("+m+"#arrowhead)"),o!==cn.parser.yy.LINETYPE.SOLID_CROSS&&o!==cn.parser.yy.LINETYPE.DOTTED_CROSS||d.attr("marker-end","url("+m+"#crosshead)"),(Tn.showSequenceNumbers()||Cn.showSequenceNumbers)&&(d.attr("marker-start","url("+m+"#sequencenumber)"),t.append("text").attr("x",n).attr("y",p+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("textLength","16px").attr("class","sequenceNumber").text(s)),An.bumpVerticalPos(y),e.height+=y,e.stopy=e.starty+e.height,An.insert(e.fromBounds,e.starty,e.toBounds,e.stopy)}(n,a),An.models.addMessage(a)}catch(t){f.error("error while drawing message",t)}}[cn.parser.yy.LINETYPE.SOLID_OPEN,cn.parser.yy.LINETYPE.DOTTED_OPEN,cn.parser.yy.LINETYPE.SOLID,cn.parser.yy.LINETYPE.DOTTED,cn.parser.yy.LINETYPE.SOLID_CROSS,cn.parser.yy.LINETYPE.DOTTED_CROSS].includes(t.type)&&l++})),Cn.mirrorActors&&(An.bumpVerticalPos(2*Cn.boxMargin),Dn(n,r,i,An.getVerticalPos()));var h=An.getBounds().bounds;f.debug("For line height fix Querying: #"+e+" .actor-line"),Object(s.selectAll)("#"+e+" .actor-line").attr("y2",h.stopy);var d=h.stopy-h.starty+2*Cn.diagramMarginY;Cn.mirrorActors&&(d=d-Cn.boxMargin+Cn.bottomMarginAdj);var p=h.stopx-h.startx+2*Cn.diagramMarginX;o&&n.append("text").text(o).attr("x",(h.stopx-h.startx)/2-2*Cn.diagramMarginX).attr("y",-25),Cn.useMaxWidth?(n.attr("height","100%"),n.attr("width","100%"),n.attr("style","max-width:"+p+"px;")):(n.attr("height",d),n.attr("width",p));var y=o?40:0;n.attr("viewBox",h.startx-Cn.diagramMarginX+" -"+(Cn.diagramMarginY+y)+" "+p+" "+(d+y)),f.debug("models:",An.models)}},Yn=n(27),zn=n.n(Yn);function Un(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=6&&n.indexOf("weekends")>=0||(n.indexOf(t.format("dddd").toLowerCase())>=0||n.indexOf(t.format(e.trim()))>=0)},ir=function(t,e,n){if(n.length&&!t.manualEndTime){var r=l()(t.startTime,e,!0);r.add(1,"d");var i=l()(t.endTime,e,!0),a=ar(r,i,e,n);t.endTime=i.toDate(),t.renderEndTime=a}},ar=function(t,e,n,r){for(var i=!1,a=null;t<=e;)i||(a=e.toDate()),(i=rr(t,n,r))&&e.add(1,"d"),t.add(1,"d");return a},or=function(t,e,n){n=n.trim();var r=/^after\s+([\d\w- ]+)/.exec(n.trim());if(null!==r){var i=null;if(r[1].split(" ").forEach((function(t){var e=dr(t);void 0!==e&&(i?e.endTime>i.endTime&&(i=e):i=e)})),i)return i.endTime;var a=new Date;return a.setHours(0,0,0,0),a}var o=l()(n,e.trim(),!0);return o.isValid()?o.toDate():(f.debug("Invalid date:"+n),f.debug("With date format:"+e.trim()),new Date)},sr=function(t,e){if(null!==t)switch(t[2]){case"s":e.add(t[1],"seconds");break;case"m":e.add(t[1],"minutes");break;case"h":e.add(t[1],"hours");break;case"d":e.add(t[1],"days");break;case"w":e.add(t[1],"weeks")}return e.toDate()},cr=function(t,e,n,r){r=r||!1,n=n.trim();var i=l()(n,e.trim(),!0);return i.isValid()?(r&&i.add(1,"d"),i.toDate()):sr(/^([\d]+)([wdhms])/.exec(n.trim()),l()(t))},ur=0,lr=function(t){return void 0===t?"task"+(ur+=1):t},hr=[],fr={},dr=function(t){var e=fr[t];return hr[e]},pr=function(){for(var t=function(t){var e=hr[t],n="";switch(hr[t].raw.startTime.type){case"prevTaskEnd":var r=dr(e.prevTaskId);e.startTime=r.endTime;break;case"getStartDate":(n=or(0,Hn,hr[t].raw.startTime.startData))&&(hr[t].startTime=n)}return hr[t].startTime&&(hr[t].endTime=cr(hr[t].startTime,Hn,hr[t].raw.endTime.data,er),hr[t].endTime&&(hr[t].processed=!0,hr[t].manualEndTime=l()(hr[t].raw.endTime.data,"YYYY-MM-DD",!0).isValid(),ir(hr[t],Hn,qn))),hr[t].processed},e=!0,n=0;nr?i=1:n0&&(e=t.classes.join(" "));for(var n=0,r=0;rn-e?n+a+1.5*_r.leftPadding>u?e+r-5:n+r+5:(n-e)/2+e+r})).attr("y",(function(t,r){return t.order*e+_r.barHeight/2+(_r.fontSize/2-2)+n})).attr("text-height",i).attr("class",(function(t){var e=o(t.startTime),n=o(t.endTime);t.milestone&&(n=e+i);var r=this.getBBox().width,a="";t.classes.length>0&&(a=t.classes.join(" "));var s=0;console.log(_r);for(var l=0;ln-e?n+r+1.5*_r.leftPadding>u?a+" taskTextOutsideLeft taskTextOutside"+s+" "+h:a+" taskTextOutsideRight taskTextOutside"+s+" "+h+" width-"+r:a+" taskText taskText"+s+" "+h+" width-"+r}))}(t,i,u,f,r,0,e),function(t,e){for(var n=[],r=0,i=0;i0&&a.setAttribute("dy","1em"),a.textContent=e[i],r.appendChild(a)}return r})).attr("x",10).attr("y",(function(i,a){if(!(a>0))return i[1]*t/2+e;for(var o=0;o0){var r=t.split("~");n=r[0],e=r[1]}return{className:n,type:e}},Mr=function(t){var e=Sr(t);void 0===Tr[e.className]&&(Tr[e.className]={id:e.className,type:e.type,cssClasses:[],methods:[],members:[],annotations:[],domId:"classid-"+e.className+"-"+Cr},Cr++)},Or=function(t){for(var e=Object.keys(Tr),n=0;n>")?r.annotations.push(i.substring(2,i.length-2)):i.indexOf(")")>0?r.methods.push(i):i&&r.members.push(i)}},Nr=function(t,e){t.split(",").forEach((function(t){var n=t;t[0].match(/\d/)&&(n="classid-"+n),void 0!==Tr[n]&&Tr[n].cssClasses.push(e)}))},Br=function(t,e,n){var r=t,i=Or(r);"loose"===wr.securityLevel&&void 0!==e&&void 0!==Tr[r]&&(n&&(Tr[r].tooltip=_.sanitizeText(n,wr)),Ar.push((function(){var t=document.querySelector('[id="'.concat(i,'"]'));null!==t&&t.addEventListener("click",(function(){U.runFunc(e,i)}),!1)})))},Lr={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},Fr=function(t){var e=Object(s.select)(".mermaidTooltip");null===(e._groups||e)[0][0]&&(e=Object(s.select)("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),Object(s.select)(t).select("svg").selectAll("g.node").on("mouseover",(function(){var t=Object(s.select)(this);if(null!==t.attr("title")){var n=this.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.html(t.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.top-14+document.body.scrollTop+"px"),t.classed("hover",!0)}})).on("mouseout",(function(){e.transition().duration(500).style("opacity",0),Object(s.select)(this).classed("hover",!1)}))};Ar.push(Fr);var Pr={parseDirective:function(t,e,n){Bo.parseDirective(this,t,e,n)},getConfig:function(){return vt().class},addClass:Mr,bindFunctions:function(t){Ar.forEach((function(e){e(t)}))},clear:function(){Er=[],Tr={},(Ar=[]).push(Fr)},getClass:function(t){return Tr[t]},getClasses:function(){return Tr},addAnnotation:function(t,e){var n=Sr(t).className;Tr[n].annotations.push(e)},getRelations:function(){return Er},addRelation:function(t){f.debug("Adding relation: "+JSON.stringify(t)),Mr(t.id1),Mr(t.id2),t.id1=Sr(t.id1).className,t.id2=Sr(t.id2).className,Er.push(t)},addMember:Dr,addMembers:function(t,e){Array.isArray(e)&&(e.reverse(),e.forEach((function(e){return Dr(t,e)})))},cleanupLabel:function(t){return":"===t.substring(0,1)?t.substr(1).trim():t.trim()},lineType:{LINE:0,DOTTED_LINE:1},relationType:Lr,setClickEvent:function(t,e,n){t.split(",").forEach((function(t){Br(t,e,n)})),Nr(t,"clickable")},setCssClass:Nr,setLink:function(t,e,n){t.split(",").forEach((function(t){var r=t;t[0].match(/\d/)&&(r="classid-"+r),void 0!==Tr[r]&&(Tr[r].link=U.formatUrl(e,wr),n&&(Tr[r].tooltip=_.sanitizeText(n,wr)))})),Nr(t,"clickable")},lookUpDomId:Or},Ir=n(13),jr=n.n(Ir),Rr=0,Yr=function(t){var e=t.match(/(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+)/),n=t.match(/^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/);return e&&!n?zr(e):n?Ur(n):$r(t)},zr=function(t){var e="";try{e=(t[1]?t[1].trim():"")+(t[2]?t[2].trim():"")+(t[3]?Hr(t[3].trim()):"")+" "+(t[4]?t[4].trim():"")}catch(n){e=t}return{displayText:e,cssStyle:""}},Ur=function(t){var e="",n="";try{var r=t[1]?t[1].trim():"",i=t[2]?t[2].trim():"",a=t[3]?Hr(t[3].trim()):"",o=t[4]?t[4].trim():"";n=r+i+"("+a+")"+(t[5]?" : "+Hr(t[5]).trim():""),e=Vr(o)}catch(e){n=t}return{displayText:n,cssStyle:e}},$r=function(t){var e="",n="",r="",i=t.indexOf("("),a=t.indexOf(")");if(i>1&&a>i&&a<=t.length){var o="",s="",c=t.substring(0,1);c.match(/\w/)?s=t.substring(0,i).trim():(c.match(/\+|-|~|#/)&&(o=c),s=t.substring(1,i).trim());var u=t.substring(i+1,a),l=t.substring(a+1,1);n=Vr(l),e=o+s+"("+Hr(u.trim())+")",a<"".length&&""!==(r=t.substring(a+2).trim())&&(r=" : "+Hr(r))}else e=Hr(t);return{displayText:e,cssStyle:n}},Wr=function(t,e,n,r){var i=Yr(e),a=t.append("tspan").attr("x",r.padding).text(i.displayText);""!==i.cssStyle&&a.attr("style",i.cssStyle),n||a.attr("dy",r.textHeight)},Hr=function t(e){var n=e;return-1!=e.indexOf("~")?t(n=(n=n.replace("~","<")).replace("~",">")):n},Vr=function(t){switch(t){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}},Gr=function(t,e,n){f.info("Rendering class "+e);var r,i=e.id,a={id:i,label:e.id,width:0,height:0},o=t.append("g").attr("id",Or(i)).attr("class","classGroup");r=e.link?o.append("svg:a").attr("xlink:href",e.link).attr("target","_blank").append("text").attr("y",n.textHeight+n.padding).attr("x",0):o.append("text").attr("y",n.textHeight+n.padding).attr("x",0);var s=!0;e.annotations.forEach((function(t){var e=r.append("tspan").text("«"+t+"»");s||e.attr("dy",n.textHeight),s=!1}));var c=e.id;void 0!==e.type&&""!==e.type&&(c+="<"+e.type+">");var u=r.append("tspan").text(c).attr("class","title");s||u.attr("dy",n.textHeight);var l=r.node().getBBox().height,h=o.append("line").attr("x1",0).attr("y1",n.padding+l+n.dividerMargin/2).attr("y2",n.padding+l+n.dividerMargin/2),d=o.append("text").attr("x",n.padding).attr("y",l+n.dividerMargin+n.textHeight).attr("fill","white").attr("class","classText");s=!0,e.members.forEach((function(t){Wr(d,t,s,n),s=!1}));var p=d.node().getBBox(),y=o.append("line").attr("x1",0).attr("y1",n.padding+l+n.dividerMargin+p.height).attr("y2",n.padding+l+n.dividerMargin+p.height),g=o.append("text").attr("x",n.padding).attr("y",l+2*n.dividerMargin+p.height+n.textHeight).attr("fill","white").attr("class","classText");s=!0,e.methods.forEach((function(t){Wr(g,t,s,n),s=!1}));var v=o.node().getBBox(),m=" ";e.cssClasses.length>0&&(m+=e.cssClasses.join(" "));var b=o.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",v.width+2*n.padding).attr("height",v.height+n.padding+.5*n.dividerMargin).attr("class",m).node().getBBox().width;return r.node().childNodes.forEach((function(t){t.setAttribute("x",(b-t.getBBox().width)/2)})),e.tooltip&&r.insert("title").text(e.tooltip),h.attr("x2",b),y.attr("x2",b),a.width=b,a.height=v.height+n.padding+.5*n.dividerMargin,a},qr=function(t,e,n,r){var i=function(t){switch(t){case Lr.AGGREGATION:return"aggregation";case Lr.EXTENSION:return"extension";case Lr.COMPOSITION:return"composition";case Lr.DEPENDENCY:return"dependency"}};e.points=e.points.filter((function(t){return!Number.isNaN(t.y)}));var a,o,c=e.points,u=Object(s.line)().x((function(t){return t.x})).y((function(t){return t.y})).curve(s.curveBasis),l=t.append("path").attr("d",u(c)).attr("id","edge"+Rr).attr("class","relation"),h="";r.arrowMarkerAbsolute&&(h=(h=(h=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),1==n.relation.lineType&&l.attr("class","relation dashed-line"),"none"!==n.relation.type1&&l.attr("marker-start","url("+h+"#"+i(n.relation.type1)+"Start)"),"none"!==n.relation.type2&&l.attr("marker-end","url("+h+"#"+i(n.relation.type2)+"End)");var d,p,y,g,v=e.points.length,m=U.calcLabelPosition(e.points);if(a=m.x,o=m.y,v%2!=0&&v>1){var b=U.calcCardinalityPosition("none"!==n.relation.type1,e.points,e.points[0]),_=U.calcCardinalityPosition("none"!==n.relation.type2,e.points,e.points[v-1]);f.debug("cardinality_1_point "+JSON.stringify(b)),f.debug("cardinality_2_point "+JSON.stringify(_)),d=b.x,p=b.y,y=_.x,g=_.y}if(void 0!==n.title){var x=t.append("g").attr("class","classLabel"),k=x.append("text").attr("class","label").attr("x",a).attr("y",o).attr("fill","red").attr("text-anchor","middle").text(n.title);window.label=k;var w=k.node().getBBox();x.insert("rect",":first-child").attr("class","box").attr("x",w.x-r.padding/2).attr("y",w.y-r.padding/2).attr("width",w.width+r.padding).attr("height",w.height+r.padding)}(f.info("Rendering relation "+JSON.stringify(n)),void 0!==n.relationTitle1&&"none"!==n.relationTitle1)&&t.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",d).attr("y",p).attr("fill","black").attr("font-size","6").text(n.relationTitle1);void 0!==n.relationTitle2&&"none"!==n.relationTitle2&&t.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",y).attr("y",g).attr("fill","black").attr("font-size","6").text(n.relationTitle2);Rr++};Ir.parser.yy=Pr;var Xr={},Zr={dividerMargin:10,padding:5,textHeight:10},Jr=function(t){for(var e=Object.keys(Xr),n=0;n "+t.w+": "+JSON.stringify(i.edge(t))),qr(r,i.edge(t),i.edge(t).relation,Zr))}));var h=r.node().getBBox(),d=h.width+40,p=h.height+40;Zr.useMaxWidth?(r.attr("width","100%"),r.attr("style","max-width: ".concat(d,"px;"))):(r.attr("height",p),r.attr("width",d));var y="".concat(h.x-20," ").concat(h.y-20," ").concat(d," ").concat(p);f.debug("viewBox ".concat(y)),r.attr("viewBox",y)};Ir.parser.yy=Pr;var ti={dividerMargin:10,padding:5,textHeight:10},ei=function(t){Object.keys(t).forEach((function(e){ti[e]=t[e]}))},ni=function(t,e){f.info("Drawing class"),Pr.clear(),Ir.parser.parse(t);var n=vt().flowchart;f.info("config:",n);var r=n.nodeSpacing||50,i=n.rankSpacing||50,a=new W.a.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:"TD",nodesep:r,ranksep:i,marginx:8,marginy:8}).setDefaultEdgeLabel((function(){return{}})),o=Pr.getClasses(),c=Pr.getRelations();f.info(c),function(t,e){var n=Object.keys(t);f.info("keys:",n),f.info(t),n.forEach((function(n){var r=t[n],i={labelStyle:""},a=void 0!==r.text?r.text:r.id,o="";switch(r.type){case"class":o="class_box";break;default:o="class_box"}e.setNode(r.id,{labelStyle:i.labelStyle,shape:o,labelText:a,classData:r,rx:0,ry:0,class:"default",style:i.style,id:r.id,width:"group"===r.type?500:void 0,type:r.type,padding:vt().flowchart.padding}),f.info("setNode",{labelStyle:i.labelStyle,shape:o,labelText:a,rx:0,ry:0,class:"default",style:i.style,id:r.id,width:"group"===r.type?500:void 0,type:r.type,padding:vt().flowchart.padding})}))}(o,a),function(t,e){var n=0;t.forEach((function(r){n++;var i={classes:"relation"};i.pattern=1==r.relation.lineType?"dashed":"solid",i.id="id"+n,"arrow_open"===r.type?i.arrowhead="none":i.arrowhead="normal",f.info(i,r),i.arrowTypeStart=ri(r.relation.type1),i.arrowTypeEnd=ri(r.relation.type2);var a="",o="";if(void 0!==r.style){var c=N(r.style);a=c.style,o=c.labelStyle}else a="fill:none";i.style=a,i.labelStyle=o,void 0!==r.interpolate?i.curve=O(r.interpolate,s.curveLinear):void 0!==t.defaultInterpolate?i.curve=O(t.defaultInterpolate,s.curveLinear):i.curve=O(ti.curve,s.curveLinear),r.text=r.title,void 0===r.text?void 0!==r.style&&(i.arrowheadStyle="fill: #333"):(i.arrowheadStyle="fill: #333",i.labelpos="c",vt().flowchart.htmlLabels,i.labelType="text",i.label=r.text.replace(_.lineBreakRegex,"\n"),void 0===r.style&&(i.style=i.style||"stroke: #333; stroke-width: 1.5px;fill:none"),i.labelStyle=i.labelStyle.replace("color:","fill:")),e.setEdge(r.id1,r.id2,i,n)}))}(c,a);var u=Object(s.select)('[id="'.concat(e,'"]')),l=Object(s.select)("#"+e+" g");Ge(l,a,["aggregation","extension","composition","dependency"],"classDiagram",e);var h=u.node().getBBox(),d=h.width+16,p=h.height+16;if(f.debug("new ViewBox 0 0 ".concat(d," ").concat(p),"translate(".concat(8-a._label.marginx,", ").concat(8-a._label.marginy,")")),n.useMaxWidth?(u.attr("width","100%"),u.attr("style","max-width: ".concat(d,"px;"))):(u.attr("height",p),u.attr("width",d)),u.attr("viewBox","0 0 ".concat(d," ").concat(p)),u.select("g").attr("transform","translate(".concat(8-a._label.marginx,", ").concat(8-h.y,")")),!n.htmlLabels)for(var y=document.querySelectorAll('[id="'+e+'"] .edgeLabel .label'),g=0;g0&&o.length>0){var c={stmt:"state",id:L(),type:"divider",doc:oi(o)};i.push(oi(c)),n.doc=i}n.doc.forEach((function(e){return t(n,e,!0)}))}}({id:"root"},{id:"root",doc:si},!0),{id:"root",doc:si}},extract:function(t){var e;e=t.doc?t.doc:t,f.info(e),fi(),f.info("Extract",e),e.forEach((function(t){"state"===t.stmt&&hi(t.id,t.type,t.doc,t.description,t.note),"relation"===t.stmt&&di(t.state1.id,t.state2.id,t.description)}))},trimColon:function(t){return t&&":"===t[0]?t.substr(1).trim():t.trim()}},mi=n(22),bi=n.n(mi),_i={},xi=function(t,e){_i[t]=e},ki=function(t,e){var n=t.append("text").attr("x",2*vt().state.padding).attr("y",vt().state.textHeight+1.3*vt().state.padding).attr("font-size",vt().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),r=n.height,i=t.append("text").attr("x",vt().state.padding).attr("y",r+.4*vt().state.padding+vt().state.dividerMargin+vt().state.textHeight).attr("class","state-description"),a=!0,o=!0;e.descriptions.forEach((function(t){a||(!function(t,e,n){var r=t.append("tspan").attr("x",2*vt().state.padding).text(e);n||r.attr("dy",vt().state.textHeight)}(i,t,o),o=!1),a=!1}));var s=t.append("line").attr("x1",vt().state.padding).attr("y1",vt().state.padding+r+vt().state.dividerMargin/2).attr("y2",vt().state.padding+r+vt().state.dividerMargin/2).attr("class","descr-divider"),c=i.node().getBBox(),u=Math.max(c.width,n.width);return s.attr("x2",u+3*vt().state.padding),t.insert("rect",":first-child").attr("x",vt().state.padding).attr("y",vt().state.padding).attr("width",u+2*vt().state.padding).attr("height",c.height+r+2*vt().state.padding).attr("rx",vt().state.radius),t},wi=function(t,e,n){var r,i=vt().state.padding,a=2*vt().state.padding,o=t.node().getBBox(),s=o.width,c=o.x,u=t.append("text").attr("x",0).attr("y",vt().state.titleShift).attr("font-size",vt().state.fontSize).attr("class","state-title").text(e.id),l=u.node().getBBox().width+a,h=Math.max(l,s);h===s&&(h+=a);var f=t.node().getBBox();e.doc,r=c-i,l>s&&(r=(s-h)/2+i),Math.abs(c-f.x)s&&(r=c-(l-s)/2);var d=1-vt().state.textHeight;return t.insert("rect",":first-child").attr("x",r).attr("y",d).attr("class",n?"alt-composit":"composit").attr("width",h).attr("height",f.height+vt().state.textHeight+vt().state.titleShift+1).attr("rx","0"),u.attr("x",r+i),l<=s&&u.attr("x",c+(h-a)/2-l/2+i),t.insert("rect",":first-child").attr("x",r).attr("y",vt().state.titleShift-vt().state.textHeight-vt().state.padding).attr("width",h).attr("height",3*vt().state.textHeight).attr("rx",vt().state.radius),t.insert("rect",":first-child").attr("x",r).attr("y",vt().state.titleShift-vt().state.textHeight-vt().state.padding).attr("width",h).attr("height",f.height+3+2*vt().state.textHeight).attr("rx",vt().state.radius),t},Ei=function(t,e){e.attr("class","state-note");var n=e.append("rect").attr("x",0).attr("y",vt().state.padding),r=function(t,e,n,r){var i=0,a=r.append("text");a.style("text-anchor","start"),a.attr("class","noteText");var o=t.replace(/\r\n/g,"
"),s=(o=o.replace(/\n/g,"
")).split(_.lineBreakRegex),c=1.25*vt().state.noteMargin,u=!0,l=!1,h=void 0;try{for(var f,d=s[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var p=f.value.trim();if(p.length>0){var y=a.append("tspan");if(y.text(p),0===c)c+=y.node().getBBox().height;i+=c,y.attr("x",e+vt().state.noteMargin),y.attr("y",n+i+1.25*vt().state.noteMargin)}}}catch(t){l=!0,h=t}finally{try{u||null==d.return||d.return()}finally{if(l)throw h}}return{textWidth:a.node().getBBox().width,textHeight:i}}(t,0,0,e.append("g")),i=r.textWidth,a=r.textHeight;return n.attr("height",a+2*vt().state.noteMargin),n.attr("width",i+2*vt().state.noteMargin),n},Ti=function(t,e){var n=e.id,r={id:n,label:e.id,width:0,height:0},i=t.append("g").attr("id",n).attr("class","stateGroup");"start"===e.type&&function(t){t.append("circle").attr("class","start-state").attr("r",vt().state.sizeUnit).attr("cx",vt().state.padding+vt().state.sizeUnit).attr("cy",vt().state.padding+vt().state.sizeUnit)}(i),"end"===e.type&&function(t){t.append("circle").attr("class","end-state-outer").attr("r",vt().state.sizeUnit+vt().state.miniPadding).attr("cx",vt().state.padding+vt().state.sizeUnit+vt().state.miniPadding).attr("cy",vt().state.padding+vt().state.sizeUnit+vt().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",vt().state.sizeUnit).attr("cx",vt().state.padding+vt().state.sizeUnit+2).attr("cy",vt().state.padding+vt().state.sizeUnit+2)}(i),"fork"!==e.type&&"join"!==e.type||function(t,e){var n=vt().state.forkWidth,r=vt().state.forkHeight;if(e.parentId){var i=n;n=r,r=i}t.append("rect").style("stroke","black").style("fill","black").attr("width",n).attr("height",r).attr("x",vt().state.padding).attr("y",vt().state.padding)}(i,e),"note"===e.type&&Ei(e.note.text,i),"divider"===e.type&&function(t){t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",vt().state.textHeight).attr("class","divider").attr("x2",2*vt().state.textHeight).attr("y1",0).attr("y2",0)}(i),"default"===e.type&&0===e.descriptions.length&&function(t,e){var n=t.append("text").attr("x",2*vt().state.padding).attr("y",vt().state.textHeight+2*vt().state.padding).attr("font-size",vt().state.fontSize).attr("class","state-title").text(e.id),r=n.node().getBBox();t.insert("rect",":first-child").attr("x",vt().state.padding).attr("y",vt().state.padding).attr("width",r.width+2*vt().state.padding).attr("height",r.height+2*vt().state.padding).attr("rx",vt().state.radius)}(i,e),"default"===e.type&&e.descriptions.length>0&&ki(i,e);var a=i.node().getBBox();return r.width=a.width+2*vt().state.padding,r.height=a.height+2*vt().state.padding,xi(n,r),r},Ci=0;mi.parser.yy=vi;var Ai={},Si=function t(e,n,r,i){var a,o=new W.a.Graph({compound:!0,multigraph:!0}),c=!0;for(a=0;a "+t.w+": "+JSON.stringify(o.edge(t))),function(t,e,n){e.points=e.points.filter((function(t){return!Number.isNaN(t.y)}));var r=e.points,i=Object(s.line)().x((function(t){return t.x})).y((function(t){return t.y})).curve(s.curveBasis),a=t.append("path").attr("d",i(r)).attr("id","edge"+Ci).attr("class","transition"),o="";if(vt().state.arrowMarkerAbsolute&&(o=(o=(o=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),a.attr("marker-end","url("+o+"#"+function(t){switch(t){case vi.relationType.AGGREGATION:return"aggregation";case vi.relationType.EXTENSION:return"extension";case vi.relationType.COMPOSITION:return"composition";case vi.relationType.DEPENDENCY:return"dependency"}}(vi.relationType.DEPENDENCY)+"End)"),void 0!==n.title){for(var c=t.append("g").attr("class","stateLabel"),u=U.calcLabelPosition(e.points),l=u.x,h=u.y,d=_.getRows(n.title),p=0,y=[],g=0,v=0,m=0;m<=d.length;m++){var b=c.append("text").attr("text-anchor","middle").text(d[m]).attr("x",l).attr("y",h+p),x=b.node().getBBox();if(g=Math.max(g,x.width),v=Math.min(v,x.x),f.info(x.x,l,h+p),0===p){var k=b.node().getBBox();p=k.height,f.info("Title height",p,h)}y.push(b)}var w=p*d.length;if(d.length>1){var E=(d.length-1)*p*.5;y.forEach((function(t,e){return t.attr("y",h+e*p-E)})),w=p*d.length}var T=c.node().getBBox();c.insert("rect",":first-child").attr("class","box").attr("x",l-g/2-vt().state.padding/2).attr("y",h-w/2-vt().state.padding/2-3.5).attr("width",g+vt().state.padding).attr("height",w+vt().state.padding),f.info(T)}Ci++}(n,o.edge(t),o.edge(t).relation))})),w=k.getBBox();var E={id:r||"root",label:r||"root",width:0,height:0};return E.width=w.width+2*ai.padding,E.height=w.height+2*ai.padding,f.debug("Doc rendered",E,o),E},Mi=function(){},Oi=function(t,e){ai=vt().state,mi.parser.yy.clear(),mi.parser.parse(t),f.debug("Rendering diagram "+t);var n=Object(s.select)("[id='".concat(e,"']"));n.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z"),new W.a.Graph({multigraph:!0,compound:!0,rankdir:"RL"}).setDefaultEdgeLabel((function(){return{}}));var r=vi.getRootDoc();Si(r,n,void 0,!1);var i=ai.padding,a=n.node().getBBox(),o=a.width+2*i,c=a.height+2*i;ai.useMaxWidth?(n.attr("width","100%"),n.attr("style","max-width: ".concat(1.75*o,"px;"))):n.attr("width",1.75*o),n.attr("viewBox","".concat(a.x-ai.padding," ").concat(a.y-ai.padding," ")+o+" "+c)},Di={},Ni={},Bi=function(t,e,n,r){if("root"!==n.id){var i="rect";!0===n.start&&(i="start"),!1===n.start&&(i="end"),"default"!==n.type&&(i=n.type),Ni[n.id]||(Ni[n.id]={id:n.id,shape:i,description:n.id,classes:"statediagram-state"}),n.description&&(Array.isArray(Ni[n.id].description)?(Ni[n.id].shape="rectWithTitle",Ni[n.id].description.push(n.description)):Ni[n.id].description.length>0?(Ni[n.id].shape="rectWithTitle",Ni[n.id].description===n.id?Ni[n.id].description=[n.description]:Ni[n.id].description=[Ni[n.id].description,n.description]):(Ni[n.id].shape="rect",Ni[n.id].description=n.description)),!Ni[n.id].type&&n.doc&&(f.info("Setting cluser for ",n.id),Ni[n.id].type="group",Ni[n.id].shape="divider"===n.type?"divider":"roundedWithTitle",Ni[n.id].classes=Ni[n.id].classes+" "+(r?"statediagram-cluster statediagram-cluster-alt":"statediagram-cluster"));var a={labelStyle:"",shape:Ni[n.id].shape,labelText:Ni[n.id].description,classes:Ni[n.id].classes,style:"",id:n.id,type:Ni[n.id].type,padding:15};if(n.note){var o={labelStyle:"",shape:"note",labelText:n.note.text,classes:"statediagram-note",style:"",id:n.id+"----note",type:Ni[n.id].type,padding:15},s={labelStyle:"",shape:"noteGroup",labelText:n.note.text,classes:Ni[n.id].classes,style:"",id:n.id+"----parent",type:"group",padding:0};t.setNode(n.id+"----parent",s),t.setNode(o.id,o),t.setNode(n.id,a),t.setParent(n.id,n.id+"----parent"),t.setParent(o.id,n.id+"----parent");var c=n.id,u=o.id;"left of"===n.note.position&&(c=o.id,u=n.id),t.setEdge(c,u,{arrowhead:"none",arrowType:"",style:"fill:none",labelStyle:"",classes:"transition note-edge",arrowheadStyle:"fill: #333",labelpos:"c",labelType:"text",thickness:"normal"})}else t.setNode(n.id,a)}e&&"root"!==e.id&&(f.info("Setting node ",n.id," to be child of its parent ",e.id),t.setParent(n.id,e.id)),n.doc&&(f.info("Adding nodes children "),Fi(t,n,n.doc,!r))},Li=0,Fi=function(t,e,n,r){f.trace("items",n),n.forEach((function(n){if("state"===n.stmt||"default"===n.stmt)Bi(t,e,n,r);else if("relation"===n.stmt){Bi(t,e,n.state1,r),Bi(t,e,n.state2,r);var i={id:"edge"+Li,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:"fill:none",labelStyle:"",label:n.description,arrowheadStyle:"fill: #333",labelpos:"c",labelType:"text",thickness:"normal",classes:"transition"},a=n.state1.id,o=n.state2.id;t.setEdge(a,o,i,Li),Li++}}))},Pi=function(t){for(var e=Object.keys(t),n=0;ne.seq?t:e}),t[0]),n="";t.forEach((function(t){n+=t===e?"\t*":"\t|"}));var r,i,a,o=[n,e.id,e.seq];for(var s in Yi)Yi[s]===e.id&&o.push(s);if(f.debug(o.join(" ")),Array.isArray(e.parent)){var c=ji[e.parent[0]];Gi(t,e,c),t.push(ji[e.parent[1]])}else{if(null==e.parent)return;var u=ji[e.parent];Gi(t,e,u)}r=t,i=function(t){return t.id},a=Object.create(null),qi(t=r.reduce((function(t,e){var n=i(e);return a[n]||(a[n]=!0,t.push(e)),t}),[]))}var Xi,Zi=function(){var t=Object.keys(ji).map((function(t){return ji[t]}));return t.forEach((function(t){f.debug(t.id)})),t.sort((function(t,e){return e.seq-t.seq})),t},Ji={setDirection:function(t){Ui=t},setOptions:function(t){f.debug("options str",t),t=(t=t&&t.trim())||"{}";try{Vi=JSON.parse(t)}catch(t){f.error("error while parsing gitGraph options",t.message)}},getOptions:function(){return Vi},commit:function(t){var e={id:Wi(),message:t,seq:$i++,parent:null==Ri?null:Ri.id};Ri=e,ji[e.id]=e,Yi[zi]=e.id,f.debug("in pushCommit "+e.id)},branch:function(t){Yi[t]=null!=Ri?Ri.id:null,f.debug("in createBranch")},merge:function(t){var e=ji[Yi[zi]],n=ji[Yi[t]];if(function(t,e){return t.seq>e.seq&&Hi(e,t)}(e,n))f.debug("Already merged");else{if(Hi(e,n))Yi[zi]=Yi[t],Ri=ji[Yi[zi]];else{var r={id:Wi(),message:"merged branch "+t+" into "+zi,seq:$i++,parent:[null==Ri?null:Ri.id,Yi[t]]};Ri=r,ji[r.id]=r,Yi[zi]=r.id}f.debug(Yi),f.debug("in mergeBranch")}},checkout:function(t){f.debug("in checkout");var e=Yi[zi=t];Ri=ji[e]},reset:function(t){f.debug("in reset",t);var e=t.split(":")[0],n=parseInt(t.split(":")[1]),r="HEAD"===e?Ri:ji[Yi[e]];for(f.debug(r,n);n>0;)if(n--,!(r=ji[r.parent])){var i="Critical error - unique parent commit not found during reset";throw f.error(i),i}Ri=r,Yi[zi]=r.id},prettyPrint:function(){f.debug(ji),qi([Zi()[0]])},clear:function(){ji={},Yi={master:Ri=null},zi="master",$i=0},getBranchesAsObjArray:function(){var t=[];for(var e in Yi)t.push({name:e,commit:ji[Yi[e]]});return t},getBranches:function(){return Yi},getCommits:function(){return ji},getCommitsArray:Zi,getCurrentBranch:function(){return zi},getDirection:function(){return Ui},getHead:function(){return Ri}},Qi=n(71),Ki=n.n(Qi),ta={},ea={nodeSpacing:150,nodeFillColor:"yellow",nodeStrokeWidth:2,nodeStrokeColor:"grey",lineStrokeWidth:4,branchOffset:50,lineColor:"grey",leftMargin:50,branchColors:["#442f74","#983351","#609732","#AA9A39"],nodeRadius:10,nodeLabel:{width:75,height:100,x:-25,y:0}},na={};function ra(t,e,n,r){var i=O(r,s.curveBasis),a=ea.branchColors[n%ea.branchColors.length],o=Object(s.line)().x((function(t){return Math.round(t.x)})).y((function(t){return Math.round(t.y)})).curve(i);t.append("svg:path").attr("d",o(e)).style("stroke",a).style("stroke-width",ea.lineStrokeWidth).style("fill","none")}function ia(t,e){e=e||t.node().getBBox();var n=t.node().getCTM();return{left:n.e+e.x*n.a,top:n.f+e.y*n.d,width:e.width,height:e.height}}function aa(t,e,n,r,i){f.debug("svgDrawLineForCommits: ",e,n);var a=ia(t.select("#node-"+e+" circle")),o=ia(t.select("#node-"+n+" circle"));switch(r){case"LR":if(a.left-o.left>ea.nodeSpacing){var s={x:a.left-ea.nodeSpacing,y:o.top+o.height/2};ra(t,[s,{x:o.left+o.width,y:o.top+o.height/2}],i,"linear"),ra(t,[{x:a.left,y:a.top+a.height/2},{x:a.left-ea.nodeSpacing/2,y:a.top+a.height/2},{x:a.left-ea.nodeSpacing/2,y:s.y},s],i)}else ra(t,[{x:a.left,y:a.top+a.height/2},{x:a.left-ea.nodeSpacing/2,y:a.top+a.height/2},{x:a.left-ea.nodeSpacing/2,y:o.top+o.height/2},{x:o.left+o.width,y:o.top+o.height/2}],i);break;case"BT":if(o.top-a.top>ea.nodeSpacing){var c={x:o.left+o.width/2,y:a.top+a.height+ea.nodeSpacing};ra(t,[c,{x:o.left+o.width/2,y:o.top}],i,"linear"),ra(t,[{x:a.left+a.width/2,y:a.top+a.height},{x:a.left+a.width/2,y:a.top+a.height+ea.nodeSpacing/2},{x:o.left+o.width/2,y:c.y-ea.nodeSpacing/2},c],i)}else ra(t,[{x:a.left+a.width/2,y:a.top+a.height},{x:a.left+a.width/2,y:a.top+ea.nodeSpacing/2},{x:o.left+o.width/2,y:o.top-ea.nodeSpacing/2},{x:o.left+o.width/2,y:o.top}],i)}}function oa(t,e){return t.select(e).node().cloneNode(!0)}function sa(t,e,n,r){var i,a=Object.keys(ta).length;if("string"==typeof e)do{if(i=ta[e],f.debug("in renderCommitHistory",i.id,i.seq),t.select("#node-"+e).size()>0)return;t.append((function(){return oa(t,"#def-commit")})).attr("class","commit").attr("id",(function(){return"node-"+i.id})).attr("transform",(function(){switch(r){case"LR":return"translate("+(i.seq*ea.nodeSpacing+ea.leftMargin)+", "+Xi*ea.branchOffset+")";case"BT":return"translate("+(Xi*ea.branchOffset+ea.leftMargin)+", "+(a-i.seq)*ea.nodeSpacing+")"}})).attr("fill",ea.nodeFillColor).attr("stroke",ea.nodeStrokeColor).attr("stroke-width",ea.nodeStrokeWidth);var o=void 0;for(var s in n)if(n[s].commit===i){o=n[s];break}o&&(f.debug("found branch ",o.name),t.select("#node-"+i.id+" p").append("xhtml:span").attr("class","branch-label").text(o.name+", ")),t.select("#node-"+i.id+" p").append("xhtml:span").attr("class","commit-id").text(i.id),""!==i.message&&"BT"===r&&t.select("#node-"+i.id+" p").append("xhtml:span").attr("class","commit-msg").text(", "+i.message),e=i.parent}while(e&&ta[e]);Array.isArray(e)&&(f.debug("found merge commmit",e),sa(t,e[0],n,r),Xi++,sa(t,e[1],n,r),Xi--)}function ca(t,e,n,r){for(r=r||0;e.seq>0&&!e.lineDrawn;)"string"==typeof e.parent?(aa(t,e.id,e.parent,n,r),e.lineDrawn=!0,e=ta[e.parent]):Array.isArray(e.parent)&&(aa(t,e.id,e.parent[0],n,r),aa(t,e.id,e.parent[1],n,r+1),ca(t,ta[e.parent[1]],n,r+1),e.lineDrawn=!0,e=ta[e.parent[0]])}var ua,la=function(t){na=t},ha=function(t,e,n){try{var r=Ki.a.parser;r.yy=Ji,r.yy.clear(),f.debug("in gitgraph renderer",t+"\n","id:",e,n),r.parse(t+"\n"),ea=Object.assign(ea,na,Ji.getOptions()),f.debug("effective options",ea);var i=Ji.getDirection();ta=Ji.getCommits();var a=Ji.getBranchesAsObjArray();"BT"===i&&(ea.nodeLabel.x=a.length*ea.branchOffset,ea.nodeLabel.width="100%",ea.nodeLabel.y=-2*ea.nodeRadius);var o=Object(s.select)('[id="'.concat(e,'"]'));for(var c in function(t){t.append("defs").append("g").attr("id","def-commit").append("circle").attr("r",ea.nodeRadius).attr("cx",0).attr("cy",0),t.select("#def-commit").append("foreignObject").attr("width",ea.nodeLabel.width).attr("height",ea.nodeLabel.height).attr("x",ea.nodeLabel.x).attr("y",ea.nodeLabel.y).attr("class","node-label").attr("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility").append("p").html("")}(o),Xi=1,a){var u=a[c];sa(o,u.commit.id,a,i),ca(o,u.commit,i),Xi++}o.attr("height",(function(){return"BT"===i?Object.keys(ta).length*ea.nodeSpacing:(a.length+1)*ea.branchOffset}))}catch(t){f.error("Error while rendering gitgraph"),f.error(t.message)}},fa="",da=!1,pa={setMessage:function(t){f.debug("Setting message to: "+t),fa=t},getMessage:function(){return fa},setInfo:function(t){da=t},getInfo:function(){return da}},ya=n(72),ga=n.n(ya),va={},ma=function(t){Object.keys(t).forEach((function(e){va[e]=t[e]}))},ba=function(t,e,n){try{var r=ga.a.parser;r.yy=pa,f.debug("Renering info diagram\n"+t),r.parse(t),f.debug("Parsed info diagram");var i=Object(s.select)("#"+e);i.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size","32px").style("text-anchor","middle").text("v "+n),i.attr("height",100),i.attr("width",400)}catch(t){f.error("Error while rendering info diagram"),f.error(t.message)}},_a={},xa=function(t){Object.keys(t).forEach((function(e){_a[e]=t[e]}))},ka=function(t,e){try{f.debug("Renering svg for syntax error\n");var n=Object(s.select)("#"+t),r=n.append("g");r.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),r.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),r.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),r.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),r.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),r.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),r.append("text").attr("class","error-text").attr("x",1240).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in graph"),r.append("text").attr("class","error-text").attr("x",1050).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text("mermaid version "+e),n.attr("height",100),n.attr("width",400),n.attr("viewBox","768 0 512 512")}catch(t){f.error("Error while rendering info diagram"),f.error(t.message)}},wa={},Ea="",Ta={parseDirective:function(t,e,n){Bo.parseDirective(this,t,e,n)},getConfig:function(){return vt().pie},addSection:function(t,e){void 0===wa[t]&&(wa[t]=e,f.debug("Added new section :",t))},getSections:function(){return wa},cleanupValue:function(t){return":"===t.substring(0,1)?(t=t.substring(1).trim(),Number(t.trim())):Number(t.trim())},clear:function(){wa={},Ea=""},setTitle:function(t){Ea=t},getTitle:function(){return Ea}},Ca=n(73),Aa=n.n(Ca),Sa={},Ma=function(t){Object.keys(t).forEach((function(e){Sa[e]=t[e]}))},Oa=function(t,e){try{var n=Aa.a.parser;n.yy=Ta,f.debug("Rendering info diagram\n"+t),n.yy.clear(),n.parse(t),f.debug("Parsed info diagram");var r=document.getElementById(e);void 0===(ua=r.parentElement.offsetWidth)&&(ua=1200),void 0!==Sa.useWidth&&(ua=Sa.useWidth);r.setAttribute("height","100%"),r.setAttribute("viewBox","0 0 "+ua+" 450");var i=ua,a=Math.min(i,450)/2-40,o=Object(s.select)("#"+e).append("svg").attr("width",i).attr("height",450).append("g").attr("transform","translate("+i/2+",225)"),c=Ta.getSections(),u=0;Object.keys(c).forEach((function(t){u+=c[t]})),f.info(c);var l=Object(s.scaleOrdinal)().domain(c).range(s.schemeSet2),h=Object(s.pie)().value((function(t){return t.value}))(Object(s.entries)(c)),d=Object(s.arc)().innerRadius(0).outerRadius(a);o.selectAll("mySlices").data(h).enter().append("path").attr("d",d).attr("fill",(function(t){return l(t.data.key)})).attr("stroke","black").style("stroke-width","2px").style("opacity",.7),o.selectAll("mySlices").data(h).enter().append("text").text((function(t){return(t.data.value/u*100).toFixed(0)+"%"})).attr("transform",(function(t){return"translate("+d.centroid(t)+")"})).style("text-anchor","middle").attr("class","slice").style("font-size",17),o.append("text").text(n.yy.getTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");var p=o.selectAll(".legend").data(l.domain()).enter().append("g").attr("class","legend").attr("transform",(function(t,e){return"translate(216,"+(22*e-22*l.domain().length/2)+")"}));p.append("rect").attr("width",18).attr("height",18).style("fill",l).style("stroke",l),p.append("text").attr("x",22).attr("y",14).text((function(t){return t}))}catch(t){f.error("Error while rendering info diagram"),f.error(t)}},Da={},Na=[],Ba="",La={Cardinality:{ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE"},Identification:{NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},parseDirective:function(t,e,n){Bo.parseDirective(this,t,e,n)},getConfig:function(){return vt().er},addEntity:function(t){void 0===Da[t]&&(Da[t]=t,f.debug("Added new entity :",t))},getEntities:function(){return Da},addRelationship:function(t,e,n,r){var i={entityA:t,roleA:e,entityB:n,relSpec:r};Na.push(i),f.debug("Added new relationship :",i)},getRelationships:function(){return Na},clear:function(){Da={},Na=[],Ba=""},setTitle:function(t){Ba=t},getTitle:function(){return Ba}},Fa=n(74),Pa=n.n(Fa),Ia={ONLY_ONE_START:"ONLY_ONE_START",ONLY_ONE_END:"ONLY_ONE_END",ZERO_OR_ONE_START:"ZERO_OR_ONE_START",ZERO_OR_ONE_END:"ZERO_OR_ONE_END",ONE_OR_MORE_START:"ONE_OR_MORE_START",ONE_OR_MORE_END:"ONE_OR_MORE_END",ZERO_OR_MORE_START:"ZERO_OR_MORE_START",ZERO_OR_MORE_END:"ZERO_OR_MORE_END"},ja=Ia,Ra=function(t,e){var n;t.append("defs").append("marker").attr("id",Ia.ONLY_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",Ia.ONLY_ONE_END).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,0 L3,18 M9,0 L9,18"),(n=t.append("defs").append("marker").attr("id",Ia.ZERO_OR_ONE_START).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto")).append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M9,0 L9,18"),(n=t.append("defs").append("marker").attr("id",Ia.ZERO_OR_ONE_END).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto")).append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,0 L21,18"),t.append("defs").append("marker").attr("id",Ia.ONE_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",Ia.ONE_OR_MORE_END).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18"),(n=t.append("defs").append("marker").attr("id",Ia.ZERO_OR_MORE_START).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto")).append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18"),(n=t.append("defs").append("marker").attr("id",Ia.ZERO_OR_MORE_END).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto")).append("circle").attr("stroke",e.stroke).attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("stroke",e.stroke).attr("fill","none").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},Ya={},za=function(t){return(t.entityA+t.roleA+t.entityB).replace(/\s/g,"")},Ua=0,$a=function(t){for(var e=Object.keys(t),n=0;n/gi," "),r=t.append("text");r.attr("x",e.x),r.attr("y",e.y),r.attr("class","legend"),r.style("text-anchor",e.anchor),void 0!==e.class&&r.attr("class",e.class);var i=r.append("tspan");return i.attr("x",e.x+2*e.textMargin),i.text(n),r},io=-1,ao=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},oo=function(){function t(t,e,n,i,a,o,s,c){r(e.append("text").attr("x",n+a/2).attr("y",i+o/2+5).style("font-color",c).style("text-anchor","middle").text(t),s)}function e(t,e,n,i,a,o,s,c,u){for(var l=c.taskFontSize,h=c.taskFontFamily,f=t.split(//gi),d=0;d3?function(t){var e=Object(s.arc)().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+o.cx+","+(o.cy+2)+")")}(c):o.score<3?function(t){var e=Object(s.arc)().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+o.cx+","+(o.cy+7)+")")}(c):function(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",o.cx-5).attr("y1",o.cy+7).attr("x2",o.cx+5).attr("y2",o.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}(c);var u=ao();u.x=e.x,u.y=e.y,u.fill=e.fill,u.width=n.width,u.height=n.height,u.class="task task-type-"+e.num,u.rx=3,u.ry=3,eo(i,u);var l=e.x+14;e.people.forEach((function(t){var n=e.actors[t],r={cx:l,cy:e.y,r:7,fill:n,stroke:"#000",title:t};no(i,r),l+=10})),oo(n)(e.task,i,u.x,u.y,u.width,u.height,{class:"task"},n,e.colour)},ho=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")};Ha.parser.yy=to;var fo={leftMargin:150,diagramMarginX:50,diagramMarginY:20,taskMargin:50,width:150,height:50,taskFontSize:14,taskFontFamily:'"Open-Sans", "sans-serif"',boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"]},po={};var yo=fo.leftMargin,go={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,r){void 0===t[e]?t[e]=n:t[e]=r(n,t[e])},updateBounds:function(t,e,n,r){var i,a=this,o=0;this.sequenceItems.forEach((function(s){o++;var c=a.sequenceItems.length-o+1;a.updateVal(s,"starty",e-c*fo.boxMargin,Math.min),a.updateVal(s,"stopy",r+c*fo.boxMargin,Math.max),a.updateVal(go.data,"startx",t-c*fo.boxMargin,Math.min),a.updateVal(go.data,"stopx",n+c*fo.boxMargin,Math.max),"activation"!==i&&(a.updateVal(s,"startx",t-c*fo.boxMargin,Math.min),a.updateVal(s,"stopx",n+c*fo.boxMargin,Math.max),a.updateVal(go.data,"starty",e-c*fo.boxMargin,Math.min),a.updateVal(go.data,"stopy",r+c*fo.boxMargin,Math.max))}))},insert:function(t,e,n,r){var i=Math.min(t,n),a=Math.max(t,n),o=Math.min(e,r),s=Math.max(e,r);this.updateVal(go.data,"startx",i,Math.min),this.updateVal(go.data,"starty",o,Math.min),this.updateVal(go.data,"stopx",a,Math.max),this.updateVal(go.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},vo=fo.sectionFills,mo=fo.sectionColours,bo=function(t,e,n){for(var r="",i=n+(2*fo.height+fo.diagramMarginY),a=0,o="#CCC",s="black",c=0,u=0;u tspan {\n fill: ").concat(t.actorTextColor,";\n stroke: none;\n }\n\n .actor-line {\n stroke: ").concat(t.actorLineColor,";\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ").concat(t.signalColor,";\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ").concat(t.signalColor,";\n }\n\n #arrowhead path {\n fill: ").concat(t.signalColor,";\n stroke: ").concat(t.signalColor,";\n }\n\n .sequenceNumber {\n fill: ").concat(t.sequenceNumberColor,";\n }\n\n #sequencenumber {\n fill: ").concat(t.signalColor,";\n }\n\n #crosshead path {\n fill: ").concat(t.signalColor,";\n stroke: ").concat(t.signalColor,";\n }\n\n .messageText {\n fill: ").concat(t.signalTextColor,";\n stroke: ").concat(t.signalTextColor,";\n }\n\n .labelBox {\n stroke: ").concat(t.labelBoxBorderColor,";\n fill: ").concat(t.labelBoxBkgColor,";\n }\n\n .labelText, .labelText > tspan {\n fill: ").concat(t.labelTextColor,";\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ").concat(t.loopTextColor,";\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ").concat(t.labelBoxBorderColor,";\n fill: ").concat(t.labelBoxBorderColor,";\n }\n\n .note {\n //stroke: #decc93;\n stroke: ").concat(t.noteBorderColor,";\n fill: ").concat(t.noteBkgColor,";\n }\n\n .noteText, .noteText > tspan {\n fill: ").concat(t.noteTextColor,";\n stroke: none;\n }\n\n .activation0 {\n fill: ").concat(t.activationBkgColor,";\n stroke: ").concat(t.activationBorderColor,";\n }\n\n .activation1 {\n fill: ").concat(t.activationBkgColor,";\n stroke: ").concat(t.activationBorderColor,";\n }\n\n .activation2 {\n fill: ").concat(t.activationBkgColor,";\n stroke: ").concat(t.activationBorderColor,";\n }\n")},gantt:function(t){return'\n .mermaid-main-font {\n font-family: "trebuchet ms", verdana, arial;\n font-family: var(--mermaid-font-family);\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: '.concat(t.sectionBkgColor,";\n }\n\n .section2 {\n fill: ").concat(t.sectionBkgColor2,";\n }\n\n .section1,\n .section3 {\n fill: ").concat(t.altSectionBkgColor,";\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ").concat(t.titleColor,";\n }\n\n .sectionTitle1 {\n fill: ").concat(t.titleColor,";\n }\n\n .sectionTitle2 {\n fill: ").concat(t.titleColor,";\n }\n\n .sectionTitle3 {\n fill: ").concat(t.titleColor,";\n }\n\n .sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ").concat(t.gridColor,";\n opacity: 0.8;\n shape-rendering: crispEdges;\n text {\n font-family: ").concat(t.fontFamily,";\n fill: ").concat(t.textColor,";\n }\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ").concat(t.todayLineColor,";\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n }\n\n .taskText:not([font-size]) {\n font-size: 11px;\n }\n\n .taskTextOutsideRight {\n fill: ").concat(t.taskTextDarkColor,";\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n\n }\n\n .taskTextOutsideLeft {\n fill: ").concat(t.taskTextDarkColor,";\n text-anchor: end;\n font-size: 11px;\n }\n\n /* Special case clickable */\n .task.clickable {\n cursor: pointer;\n }\n .taskText.clickable {\n cursor: pointer;\n fill: ").concat(t.taskTextClickableColor," !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ").concat(t.taskTextClickableColor," !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ").concat(t.taskTextClickableColor," !important;\n font-weight: bold;\n }\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ").concat(t.taskTextColor,";\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ").concat(t.taskBkgColor,";\n stroke: ").concat(t.taskBorderColor,";\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ").concat(t.taskTextOutsideColor,";\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ").concat(t.taskTextOutsideColor,";\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ").concat(t.activeTaskBkgColor,";\n stroke: ").concat(t.activeTaskBorderColor,";\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ").concat(t.taskTextDarkColor," !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ").concat(t.doneTaskBorderColor,";\n fill: ").concat(t.doneTaskBkgColor,";\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ").concat(t.taskTextDarkColor," !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ").concat(t.critBorderColor,";\n fill: ").concat(t.critBkgColor,";\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ").concat(t.critBorderColor,";\n fill: ").concat(t.activeTaskBkgColor,";\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ").concat(t.critBorderColor,";\n fill: ").concat(t.doneTaskBkgColor,";\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ").concat(t.taskTextDarkColor," !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ").concat(t.taskTextDarkColor," !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ").concat(t.textColor," ;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n }\n")},classDiagram:ko,"classDiagram-v2":ko,class:ko,stateDiagram:Eo,state:Eo,git:function(){return"\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n }\n"},info:function(){return""},pie:function(t){return".pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: ".concat(t.taskTextDarkColor,";\n font-family: ").concat(t.fontFamily,";\n }\n .slice {\n font-family: ").concat(t.fontFamily,";\n fill: ").concat(t.textColor,";\n // fill: white;\n }\n .legend text {\n fill: ").concat(t.taskTextDarkColor,";\n font-family: ").concat(t.fontFamily,";\n font-size: 17px;\n }\n")},er:function(t){return"\n .entityBox {\n fill: ".concat(t.mainBkg,";\n stroke: ").concat(t.nodeBorder,";\n }\n\n .relationshipLabelBox {\n fill: ").concat(t.tertiaryColor,";\n opacity: 0.7;\n background-color: ").concat(t.tertiaryColor,";\n rect {\n opacity: 0.5;\n }\n }\n\n .relationshipLine {\n stroke: ").concat(t.lineColor,";\n }\n")},journey:function(t){return".label {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n color: ".concat(t.textColor,";\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ").concat(t.textColor,"\n }\n\n .legend {\n fill: ").concat(t.textColor,";\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ").concat(t.textColor,"\n }\n\n .face {\n fill: #FFF8DC;\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(t.mainBkg,";\n stroke: ").concat(t.nodeBorder,";\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ").concat(t.arrowheadColor,";\n }\n\n .edgePath .path {\n stroke: ").concat(t.lineColor,";\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ").concat(t.lineColor,";\n fill: none;\n }\n\n .edgeLabel {\n background-color: ").concat(t.edgeLabelBackground,";\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ").concat(t.titleColor,";\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ").concat(t.tertiaryColor,";\n border: 1px solid ").concat(t.border2,";\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ").concat(t.fillType0?"fill: ".concat(t.fillType0):"",";\n }\n .task-type-1, .section-type-1 {\n ").concat(t.fillType0?"fill: ".concat(t.fillType1):"",";\n }\n .task-type-2, .section-type-2 {\n ").concat(t.fillType0?"fill: ".concat(t.fillType2):"",";\n }\n .task-type-3, .section-type-3 {\n ").concat(t.fillType0?"fill: ".concat(t.fillType3):"",";\n }\n .task-type-4, .section-type-4 {\n ").concat(t.fillType0?"fill: ".concat(t.fillType4):"",";\n }\n .task-type-5, .section-type-5 {\n ").concat(t.fillType0?"fill: ".concat(t.fillType5):"",";\n }\n .task-type-6, .section-type-6 {\n ").concat(t.fillType0?"fill: ".concat(t.fillType6):"",";\n }\n .task-type-7, .section-type-7 {\n ").concat(t.fillType0?"fill: ".concat(t.fillType7):"",";\n }\n")}},Co=function(t,e,n){return" {\n font-family: ".concat(n.fontFamily,";\n font-size: ").concat(n.fontSize,";\n fill: ").concat(n.textColor,"\n }\n\n /* Classes common for multiple diagrams */\n\n .error-icon {\n fill: ").concat(n.errorBkgColor,";\n }\n .error-text {\n fill: ").concat(n.errorTextColor,";\n stroke: ").concat(n.errorTextColor,";\n }\n\n .edge-thickness-normal {\n stroke-width: 2px;\n }\n .edge-thickness-thick {\n stroke-width: 3.5px\n }\n .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n .marker {\n fill: ").concat(n.lineColor,";\n }\n .marker.cross {\n stroke: ").concat(n.lineColor,";\n }\n\n svg {\n font-family: ").concat(n.fontFamily,";\n font-size: ").concat(n.fontSize,";\n }\n\n ").concat(To[t](n),"\n\n ").concat(e,"\n\n ").concat(t," { fill: apa;}\n")};function Ao(t){return(Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var So={},Mo=function(t,e,n){switch(f.debug("Directive type=".concat(e.type," with args:"),e.args),e.type){case"init":case"initialize":["config"].forEach((function(t){void 0!==e.args[t]&&("flowchart-v2"===n&&(n="flowchart"),e.args[n]=e.args[t],delete e.args[t])})),e.args,bt(e.args);break;case"wrap":case"nowrap":t&&t.setWrap&&t.setWrap("wrap"===e.type);break;default:f.warn("Unhandled directive: source: '%%{".concat(e.type,": ").concat(JSON.stringify(e.args?e.args:{}),"}%%"),e)}};function Oo(t){la(t.git),ue(t.flowchart),Je(t.flowchart),void 0!==t.sequenceDiagram&&Rn.setConf(P(t.sequence,t.sequenceDiagram)),Rn.setConf(t.sequence),xr(t.gantt),Qr(t.class),Mi(t.state),Pi(t.state),ma(t.class),Ma(t.class),$a(t.er),_o(t.journey),xa(t.class)}function Do(){}var No=Object.freeze({render:function(t,e,n,r){_t();var i=e,a=U.detectInit(i);a&&bt(a);var u=vt();if(console.warn("Render with config after adding new directives",u.themeVariables.primaryColor),e.length>u.maxTextSize&&(i="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa"),void 0!==r)r.innerHTML="",Object(s.select)(r).append("div").attr("id","d"+t).attr("style","font-family: "+u.fontFamily).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g");else{var l=document.getElementById(t);l&&l.remove();var h=document.querySelector("#d"+t);h&&h.remove(),Object(s.select)("body").append("div").attr("id","d"+t).append("svg").attr("id",t).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg").append("g")}window.txt=i,i=function(t){var e=t;return e=(e=(e=e.replace(/style.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)}))).replace(/classDef.*:\S*#.*;/g,(function(t){return t.substring(0,t.length-1)}))).replace(/#\w+;/g,(function(t){var e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?"fl°°"+e+"¶ß":"fl°"+e+"¶ß"}))}(i);var d=Object(s.select)("#d"+t).node(),p=U.detectType(i),y=d.firstChild,g=y.firstChild,v="";if(void 0!==u.themeCSS&&(v+="\n".concat(u.themeCSS)),void 0!==u.fontFamily&&(v+="\n:root { --mermaid-font-family: ".concat(u.fontFamily,"}")),void 0!==u.altFontFamily&&(v+="\n:root { --mermaid-alt-font-family: ".concat(u.altFontFamily,"}")),"flowchart"===p||"flowchart-v2"===p||"graph"===p){var m=le(i);for(var b in m)v+="\n.".concat(b," > * { ").concat(m[b].styles.join(" !important; ")," !important; }"),m[b].textStyles&&(v+="\n.".concat(b," tspan { ").concat(m[b].textStyles.join(" !important; ")," !important; }"))}var _=(new o.a)("#".concat(t),Co(p,v,u.themeVariables)),x=document.createElement("style");x.innerHTML=_,y.insertBefore(x,g);try{switch(p){case"git":u.flowchart.arrowMarkerAbsolute=u.arrowMarkerAbsolute,la(u.git),ha(i,t,!1);break;case"flowchart":u.flowchart.arrowMarkerAbsolute=u.arrowMarkerAbsolute,ue(u.flowchart),he(i,t,!1);break;case"flowchart-v2":u.flowchart.arrowMarkerAbsolute=u.arrowMarkerAbsolute,Je(u.flowchart),Qe(i,t,!1);break;case"sequence":u.sequence.arrowMarkerAbsolute=u.arrowMarkerAbsolute,u.sequenceDiagram?(Rn.setConf(Object.assign(u.sequence,u.sequenceDiagram)),console.error("`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.")):Rn.setConf(u.sequence),Rn.draw(i,t);break;case"gantt":u.gantt.arrowMarkerAbsolute=u.arrowMarkerAbsolute,xr(u.gantt),kr(i,t);break;case"class":u.class.arrowMarkerAbsolute=u.arrowMarkerAbsolute,Qr(u.class),Kr(i,t);break;case"classDiagram":u.class.arrowMarkerAbsolute=u.arrowMarkerAbsolute,ei(u.class),ni(i,t);break;case"state":u.class.arrowMarkerAbsolute=u.arrowMarkerAbsolute,Mi(u.state),Oi(i,t);break;case"stateDiagram":u.class.arrowMarkerAbsolute=u.arrowMarkerAbsolute,Pi(u.state),Ii(i,t);break;case"info":u.class.arrowMarkerAbsolute=u.arrowMarkerAbsolute,ma(u.class),ba(i,t,c.version);break;case"pie":u.class.arrowMarkerAbsolute=u.arrowMarkerAbsolute,Ma(u.class),Oa(i,t,c.version);break;case"er":$a(u.er),Wa(i,t,c.version);break;case"journey":_o(u.journey),xo(i,t,c.version)}}catch(e){throw ka(t,c.version),e}Object(s.select)('[id="'.concat(t,'"]')).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");var k=Object(s.select)("#d"+t).node().innerHTML;if(f.debug("cnf.arrowMarkerAbsolute",u.arrowMarkerAbsolute),u.arrowMarkerAbsolute&&"false"!==u.arrowMarkerAbsolute||(k=k.replace(/marker-end="url\(.*?#/g,'marker-end="url(#',"g")),k=function(t){var e=t;return e=(e=(e=e.replace(/fl°°/g,(function(){return"&#"}))).replace(/fl°/g,(function(){return"&"}))).replace(/¶ß/g,(function(){return";"}))}(k),void 0!==n)switch(p){case"flowchart":case"flowchart-v2":n(k,Yt.bindFunctions);break;case"gantt":n(k,vr.bindFunctions);break;case"class":n(k,Pr.bindFunctions);break;default:n(k)}else f.debug("CB = undefined!");var w=Object(s.select)("#d"+t).node();return null!==w&&"function"==typeof w.remove&&Object(s.select)("#d"+t).node().remove(),k},parse:function(t){var e=U.detectInit(t);e&&f.debug("reinit ",e);var n,r=U.detectType(t);switch(f.debug("Type "+r),r){case"git":(n=Ki.a).parser.yy=Ji;break;case"flowchart":case"flowchart-v2":Yt.clear(),(n=Ut.a).parser.yy=Yt;break;case"sequence":(n=un.a).parser.yy=Tn;break;case"gantt":(n=zn.a).parser.yy=vr;break;case"class":case"classDiagram":(n=jr.a).parser.yy=Pr;break;case"state":case"stateDiagram":(n=bi.a).parser.yy=vi;break;case"info":f.debug("info info info"),(n=ga.a).parser.yy=pa;break;case"pie":f.debug("pie"),(n=Aa.a).parser.yy=Ta;break;case"er":f.debug("er"),(n=Pa.a).parser.yy=La;break;case"journey":f.debug("Journey"),(n=Va.a).parser.yy=to}return n.parser.yy.graphType=r,n.parser.yy.parseError=function(t,e){throw{str:t,hash:e}},n.parse(t),n},parseDirective:function(t,e,n,r){try{if(void 0!==e)switch(e=e.trim(),n){case"open_directive":So={};break;case"type_directive":So.type=e.toLowerCase();break;case"arg_directive":So.args=JSON.parse(e);break;case"close_directive":Mo(t,So,r),So=null}}catch(t){f.error("Error while rendering sequenceDiagram directive: ".concat(e," jison context: ").concat(n)),f.error(t.message)}},initialize:function(t){console.warn("mermaidAPI.initialize: v".concat(c.version," "),t),t&&t.theme&&ct[t.theme]?t.themeVariables=ct[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=ct.default.getThemeVariables());var e,n="object"===Ao(t)?(e=t,console.warn("Setting site config"),ft=P({},ht),ft=P(ft,e),e.theme&&(ft.themeVariables=ct[e.theme].getThemeVariables(e.themeVariables)),pt=yt(ft,dt),ft):gt();Oo(n),d(n.logLevel)},reinitialize:Do,getConfig:vt,setConfig:function(t){return P(pt,t),vt()},getSiteConfig:gt,updateSiteConfig:function(t){return ft=P(ft,t),yt(ft,dt),ft},reset:function(){_t()},globalReset:function(){_t(),Oo(vt())},defaultConfig:ht});d(vt().logLevel),_t(vt());var Bo=No,Lo=function(){Fo.startOnLoad?Bo.getConfig().startOnLoad&&Fo.init():void 0===Fo.startOnLoad&&(f.debug("In start, no config"),Bo.getConfig().startOnLoad&&Fo.init())};"undefined"!=typeof document&& +/*! + * Wait for document loaded before starting the execution + */ +window.addEventListener("load",(function(){Lo()}),!1);var Fo={startOnLoad:!0,htmlLabels:!0,mermaidAPI:Bo,parse:Bo.parse,render:Bo.render,init:function(){var t,e,n,r=this,a=Bo.getConfig();arguments.length>=2?( +/*! sequence config was passed as #1 */ +void 0!==arguments[0]&&(Fo.sequenceConfig=arguments[0]),t=arguments[1]):t=arguments[0],"function"==typeof arguments[arguments.length-1]?(e=arguments[arguments.length-1],f.debug("Callback function found")):void 0!==a.mermaid&&("function"==typeof a.mermaid.callback?(e=a.mermaid.callback,f.debug("Callback function found")):f.debug("No Callback function found")),t=void 0===t?document.querySelectorAll(".mermaid"):"string"==typeof t?document.querySelectorAll(t):t instanceof window.Node?[t]:t,f.debug("Start On Load before: "+Fo.startOnLoad),void 0!==Fo.startOnLoad&&(f.debug("Start On Load inner: "+Fo.startOnLoad),Bo.updateSiteConfig({startOnLoad:Fo.startOnLoad})),void 0!==Fo.ganttConfig&&Bo.updateSiteConfig({gantt:Fo.ganttConfig});for(var o=function(a){var o=t[a]; +/*! Check if previously processed */if(o.getAttribute("data-processed"))return"continue";o.setAttribute("data-processed",!0);var s="mermaid-".concat(Date.now());n=i(n=o.innerHTML).trim().replace(//gi,"
");var c=U.detectInit(n);c&&f.debug("Detected early reinit: ",c);try{Bo.render(s,n,(function(t,n){o.innerHTML=t,void 0!==e&&e(s),n&&n(o)}),o)}catch(t){f.warn("Syntax Error rendering"),f.warn(t),r.parseError&&r.parseError(t)}},s=0;s + + + + + + + + + + + + + + Refaktoryzacja - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Refaktoryzacja

+ +

Refaktoryzacja

+

Refactoring to zmiany w kodzie poprawiające czytelność, zmieniające strukturę kodu, ale nie zmieniające funkcjonalności.
+Jego celem jest potrzeba zrozumienia naszego kodu.

+

Jeśli chcemy

+

Prawo demeter - prawo wielu kropek...

+

Jeżeli w nazwie metody jest i lub lub to znaczy, że mamy źle opisaną nazwę - powinny być one bardziej abstrakcyjne i nie opisywać słownie tego co jest pod spodem.

+

Przydatne narzędzia

+
    +
  • sonar (albo sonarcloud) pozwala badać jakość kodu
  • +
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Architektura\360\237\217\227\357\270\217/uml/index.html" "b/Architektura\360\237\217\227\357\270\217/uml/index.html" new file mode 100644 index 00000000..d3a4ba3e --- /dev/null +++ "b/Architektura\360\237\217\227\357\270\217/uml/index.html" @@ -0,0 +1,1450 @@ + + + + + + + + + + + + + + + + UML - Unified Modelling Language - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

UML - Unified Modelling Language

+

Jest to uniwersalny język do modelowania systemów i nie tylko.

+

Istnieje wiele typów diagramów UML. Takie jak:

+
    +
  • Diagram klas - pozwala na łatwe opisanie systemów obiektowych
  • +
  • Diagram komponentów - pokazuje fizyczne elementy systemu oraz interakcje między nimi
  • +
  • Diagram stanów - opisuje stany obiektu i przejścia między nimi
  • +
  • Diagram aktywności (czynności) - podobny do diagramu stanów, z tą różnicą, że opisuje wiele obiektów
  • +
  • Diagram przypadków użycia (use case) - pokazuje aktorów oraz przypadki użycia systemu
  • +
  • ...
  • +
+

Diagram klas

+

Przedstawienie klas oraz zależności i relacji między nimi. Wikipedia

+

Przykład

+

Poszczególne klasy mają wyróżnioną nazwę oraz atrybuty takie jak:

+
    +
  • metody (funkcje)
  • +
  • właściwości
  • +
  • pola (zmienne)
  • +
+

Możemy je pokazwać jako sama nazwa, opcjonalnie wzbogacona o typ, argumenty i inne cechy. Dozwolone są tylko typy bazowe (integer, real, char, string, etc.) bez klas.

+

Ogólnny schemat:

+

[visibility] Name [: Type] [=initial value]

+

bank

+

Możemy także określać widoczność atrybutów

+
    +
  • + dla public – publiczny, dostęp globalny
  • +
  • # dla protected – chroniony, dostęp dla pochodnych klasy (wynikających z generalizacji)
  • +
  • dla private – prywatny, dostępny tylko w obrębie klasy (przy atrybucie statycznym) lub obiektu (przy atrybucie zwykłym)
  • +
  • ~ dla package – pakiet, dostępny w obrębie danego pakietu, projektu.
  • +
+

Zależności pomiędzy klasami

+

Zależności pomiędzy poszczególnymi klasami opisujemy za pomocą związków (powiązań)

+

strzałki

+
    +
  • Zależność (ang. dependency) – najsłabszy związek znaczeniowy między klasami, gdy jedna z klas używa innej. Na diagramie klas oznaczana -------> przerywaną linią zakończoną strzałką wskazującą kierunek zależności
  • +
  • Asocjacja (ang. association) wskazuje na silniejsze powiązanie pomiędzy obiektami danych klas (np. firma zatrudnia pracowników). Na diagramie asocjację oznacza się za pomocą linii. Nazwy cech (np. zatrudniony, zatrudniający) wraz z krotnością umieszcza się w punkcie docelowym asocjacji. Nazwę asocjacji podaje się pośrodku (np. zatrudnia).
    +Asocjacja
  • +
  • Generalizacja lub dziedziczenie - wypełniona strzałka wskazuje na klasę bazową względem pochodnej + Generalizacja specjalizacja
  • +
  • Agregacja (ang. aggregation) reprezentuje związek typu całość-część, czyli jakaś większa całość jest rozbita na elementy. Oznacza to, że elementy częściowe mogą należeć do większej całości, jednak również mogą istnieć bez niej (np. koła i samochód).
  • +
  • Kompozycja (ang. composition), jest silniejszą formą agregacji. W związku kompozycji, części należą tylko do jednej całości, a ich okres życia jest wspólny — razem z całością niszczone są również części. W dużej mierze jest to kwestia umowna, zależna od danego systemu.
    +Aggregation Composition
  • +
+

W wypadku asocjacji możemy także określić krotność zależności

+
    +
  • 0 brak instancji (rzadkie)
  • +
  • 0..1 Zero albo jedna
  • +
  • 1 ,1..1 dokładnie jedna
  • +
  • 0..*, * Zero albo więcej instancji
  • +
  • 1..* Jedna, albo więcej
  • +
+

Niektóre asocjacje same w sobie mogą być reprezentowane poprzez klasy. Np w wypadkach, gdy musza przechowywać więcej własnych danych.
+Są to klasy asocjacyjne (Link classes) +Link class

+

// TODO UML, a obiekty (wykład 05 i 04 z LTP na UPV) oraz przykładowe analizy

+

Diagram przypadków użycia (Use case)

+

Wikipedia

+

Jest on wykorzystywany do opisywania w jaki sposób powinien działać nasz system i jakie powinien posiadać funkcjonalności. Jest on bardzo pomocny przy definiowaniu wymagań funkcjonalnych.

+

Wyróżniamy na nich:

+
    +
  • aktorów - opisujące uczestników systemu oraz ich role. Aktorem osobowym może być osoba, zespół, dział, instytucja, organizacja, zrzeszenie organizacji lub organizacja wirtualna. Nazwy aktorów osobowych często pokryte są z nazwami funkcji jakie pełnią w organizacji, projekcie lub przedsięwzięciu bądź nazwą stanowiska jakie piastują. Natomiast aktorem bezosobowym może być system zewnętrzny (podsystemy, bazy danych), urządzenie lub czas (UWAGA Sam system nigdy nie jest aktorem)
  • +
  • przypadki użycia - opisują ciągi akcji i ich warianty. Na ogół jeden przypadek użycia opisuje jedną funkcjonalność.
  • +
  • związki - opisują relacje pomiędzy elementami
  • +
+

Use case prosty przykład

+

//TODO opisać dokładniej relację między aktorami a przypadkami, np dlaczego kupujący i przedający mogą się łączyć z jendym przypadkiem o nazwi sprzedaj książkę.

+

Przypadki użycia

+

Poszczególne przypadki użycia częśto opisuje się także za pomocą tabelek.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Use Case
Actors
Summary
Preconditions
Postconditions
Includes
Extends
Inherits from
Flow of events
ActorSystem
+
+Przykładowa wypełniona tabelka +

Przykładowa tabelka

+
+

Poszczególne przypadki użycia mogą wchodzić w związki nie tylko z aktorami, lecz także z innymi przypadkami użycia.

+

Relacja include - przypadek A zawiera przypadek B, kiedy każde wykonanie A wymaga, abyśmy wykonali także B.

+

Include

+

Aby kogoś usunąć z bazy danych musimy go najpierw wyszukać.

+

Relacja extend - przypadek B rozszerza przypadek A, kiedy podczas wykonywania A w pewnych przypadkach możemy (ale nie musimy) wykonać B.

+

Extend

+

Możemy mieć także typową relację dziedziczenia. (podobnie jak u aktorów)

+

Inherit

+

Opracowywanie diagramu

+

Podczas prac nad diagramem możemy przyjąć dwa sposoby podejścia do tematu.

+
    +
  • Top Down, czyli Szukamy aktorów -> Szukamy przypadków -> Uszczegółaiwamy
  • +
  • Bottom up Tworzymy scenariusze -> Generalizujemy -> Organizujemy wszystko w diagram
  • +
+

Podczas prac nad diagramem warto rozwazyć kto, dlaczego i jak będzie używać naszego systemu. Pomoże nam to znaleźć aktorów.

+

Każda grupa lub osoba może być znaleziona jednej z poniższych kategorii:

+
    +
  • Kto będzie używał systemu?
  • +
  • Kto będzie instalował system?
  • +
  • Kto będzie utrzymywał system?
  • +
  • Kto wyłączy system?
  • +
  • Jakie inne systemy będą się z nim komunikować?
  • +
  • Kto otrzymuje informacje?
  • +
  • Kto dostarcza informacji?
  • +
+

Jak już znajdziemy naszych aktorów warto się zastanowić nad ich przypadkami użycia. Warto tutaj zwrócić uwagę na pytania takie jak:

+
    +
  • Jakie zadania wymagane są od aktorów z systemu?
  • +
  • Czy aktor będzie mógł tworzyć, przechowywać, zmieniać lub usuwać informacje z systemu?
  • +
  • Czy aktor będzie informował system o zmianach zachodzących na zewnątrz?
  • +
  • Czy każdy aktor będzie informowany o zmianach stanu systemu?
  • +
+

Diagram aktywności

+

//TODO

+

Diagram stanów

+

//TODO

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Architektura\360\237\217\227\357\270\217/wzorce_projektowe/index.html" "b/Architektura\360\237\217\227\357\270\217/wzorce_projektowe/index.html" new file mode 100644 index 00000000..8f771afe --- /dev/null +++ "b/Architektura\360\237\217\227\357\270\217/wzorce_projektowe/index.html" @@ -0,0 +1,1454 @@ + + + + + + + + + + + + + + + + Wzorce projektowe - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Wzorce projektowe

+ + + + +

Wzorce projektowe

+

Podstawowe źródła: Wikipedia oraz Refactoring Guru

+

Wzorce projektowe dzielimy na 3 kategorie:

+
    +
  • kreacyjne - wzorce używane do generowania obiektów z określonymi zachowaniami
  • +
  • strukturalne - opisują struktury z powiązanych ze sobą obiektów
  • +
  • behawioralne - opisują zachowania oraz zadania poszczególnych obiektów
  • +
+

Wzorce kreacyjne

+

Singleton

+

Używany, kiedy chcemy mieć tylko jedną instancję danej klasy w całym programie.

+

Zdaniem wielu jest to dość kontrowersyjny wzorzec (wiki), często traktowany jako antywzorzec.
+Ma on takie wady jak:

+ +
+classDiagram + class Singleton{ + -instance + -Singleton() + +getInstance() + } +
+ +
# jest wiele sposobów implementacji
+class Singleton
+    _instance = None
+
+    def __new__(cls, *args, **kwargs):
+        if cls._instance is None:
+            cls._instance = super().__new__(cls, *args, **kwargs)
+
+        return cls._instance
+
+

Prototyp

+

Jest on wykorzystywany wtedy, kiedy chcemy uprościć sobie tworzenie nowych instancji danej klasy bazując na już istniejącym obiekcie. Np kiedy mamy jakiś plik konfiguracyjny, który musimy tylko lekko zmodyfikować na nasze potrzeby.

+

W wielu wypadkach klonowanie obiektu z zewnątrz nie jest możliwe (np z powodu prywatnych parametrów). W takiej sytuacji warto wykorzystać interfejs dostarczający metodę clone().

+

Takie podejście jest użyteczne kiedy chcemy, aby nasz kod był niezależny ok konkretnych klas obiektów, z które chcemy skopiować.

+

Strukturalne

+

Adapter

+

Proxy

+

Fasada

+

Jest to wzorzec mający na celu uproszczenie korzystania ze skomplikowanego systemu poprzez dostaczenie uproszczonego interfejsu dostarczającego tylko te funkcjonalności, które są nam naprawdę potrzebne.

+

Behawioralne

+

nieposortowane TODO

+

Wstrzykiwanie zależności

+

Zamiast tworzyć obiekty w klasie przekazujemy jej zależne klasy.

+
    +
  • inicjalizacja nie następuje w naszych klasach z logiką biznesową (PKI wykład 8 30 min to było omwione)
  • +
+

Obserwator

+

MVC - porządnie omówione

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/C i C++ \360\237\207\250/0_C/index.html" "b/C i C++ \360\237\207\250/0_C/index.html" new file mode 100644 index 00000000..1ab94c48 --- /dev/null +++ "b/C i C++ \360\237\207\250/0_C/index.html" @@ -0,0 +1,2000 @@ + + + + + + + + + + + + + + + + ANSIC C (i nie tylko) - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

ANSIC C (i nie tylko)

+

Notatki dotyczące języka C (oraz bardziej niskopoziomowych aspektów C++)

+

Kompilacja

+

Najpopularniejszym kompilatorem jest gcc

+
gcc [-options] [source_files] [object_files] -o output_file
+
+

Podstawowe flagi

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FlagaOpis
-cPreprocessing, compilation, assembly producing a binary object file (.o)
-SPreprocessing and compilation producing an assembly language file
-EPreprocessing only sending the output to the standard output (terminal)
-o pliknazwa pliku wyjściowego
-IsciezkaŚcieżka dla plików nagłówkowych (bez spacji, np -I/usr/lib)
-lNAZWABiblioteka do której mamy linkować program, mówimy kompilatorowi do jakich bibliotek linkujemy program, np -lm linkuje do biblioteki libm.so
-vVerbose gcc opisuje kroki kompilacji
+

Na ogół po prostu kompilujesz w jednej fazie

+
gcc -o executable programik.c
+
+

Zmienne

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NazwaRozmiarCzym jest
int32bLiczba całkowita
float32bLiczba zmiennoprzecinkowa
double64bDokładniejszy float
char1B=8b Jednobajtowe liczby całkowite 0-255, używane także (głównie) do przechowywania znaków
bool1(true) lub 0(false) logika (wymaga stdbool.h)
void-Typ pusty
+

int

+

Sposoby zapisu liczb:

+
    +
  • zwykły: 2, 456, 42 itp.
  • +
  • ósemkowy 010 (8) 015 (13) 0100 (64)
  • +
  • szesnastkowy 0x12 (18) 0xF (15)
  • +
+

float

+

Sposoby zapisu liczb:

+
    +
  • zwykły: 2.43, 456, 3.14 itp.
  • +
  • naukowy(wykładniczy) 6e10 (6*1010) 1.5e2 (150)
  • +
+

char

+

Zapis:

+
    +
  • zwykły: char letter1 = 'a';
  • +
  • jako kod ASCII: char letter2=97; 97 to a w kodzie ASCII + *putchar(char)-wypisuje char/tablice charów a po niej daje enter
  • +
+

Specyfikatory

+

signed -liczba będzie także mogła być ujemna +unsigned -liczba będzie nieujemna +Short i long są wskazówkami dla kompilatora, by zarezerwował dla +danego typu mniej/więcej pamięci

+

np.:

+
signed char a; /*zmienna a przyjmuje wartości od -128 do 127*/
+unsigned char b; /*zmienna b przyjmuje wartości od 0 do 255*/
+signed int i = 0; // to samo co: int i = 0;
+
+

Wskaźniki-zmienne przechowujące adres zmiennej

+
int *px;//tworzymy zmienną przechowującą wskaźnik prowadzący do
+int-a;
+int x=7;
+&x //zwraca adres zmiennej
+*px;//weź wartość znajdującą się pod danym adresem
+
+

Wskaźniki i const

+
int j = 3 ;
+int  const pj2 = &j ;
+++(pj2 ) ;//tylko to się da
+int j = 3 ;
+const int  const pj3 = &j ;
+//++pj3 ; // nie da sie − const
+//++(∗pj3 ) ; // nie da sie − const
+//pj3 = &i ; // nie da sie − const
+printf( " const : %d\n " ,  pj3 )
+
+

Podsumowując:

+
int       *      zmienny_wzkaznik_zmienny_int;
+int const *      zmienny_wzkaznik_staly_int;
+int       *const staly_wzkaznik_zmienny_int;
+int const *const staly_wzkaznik_staly_int;
+
+//Inaczej:
+const char *const stringTable[] = {
+        "Hello",
+        "World",
+        "This",
+        "Is",
+        "A",
+        "Table",
+        "Of",
+        "Strings"
+    };
+    stringTable[0]="abc"; //Niedozwolone
+    stringTable[0][0]='a'; //Niedozwolone
+
+char *const stringTable2[] = {
+        "Hello",
+        "World",
+        "This",
+        "Is",
+        "A",
+        "Table",
+        "Of",
+        "Strings"
+    };
+    stringTable2[0]="abc";  //Niedozwolone
+    stringTable2[0][0]='a';  //Dozwolone
+
+

Tablice i alokowanie pamięci

+

Definiowanie tablic

+
    int tab[2];
+    tab[0]=32; tab[1]=3;
+
+
    int tab[]={32,3};
+    int tab[2][3]={
+    {2,3,5},
+    {1,3,4}};////definiowanie tablicy
+    int tab[2][3]={
+    {4},
+    {5}};/////reszta to zera
+    int tab[2][2]={1,2,3,4};
+    int tab[2][2]={1,2,3}; //reszta to zera
+    int niePoKol [12]={1 ,2 , [5]=3 , 4 };//reszta to zera
+
+

lub dla tablic znaków

+
    char slowo[]=Ala;
+    //(od C99 mamy tablice VLA)
+    int liczbaEl=4;
+    int tablica[liczbaEl];
+    int sum2dArr(int liWierszy ,int liKolumn , int vla
+    [liWierszy][likolumn]) ;
+
+

Tablica a wskaźnik - w praktyce zmienna trzymająca tablicę jest wskaźnikiem na jej pierwszy element

+
    char tab[]= " Ala ";
+   //  Zmienna tab zawiera wskaźnik do
+   //  pierwszego elementu tablicy
+    printf(%c,tab+2)//wydrukuje a
+
+

Tablice dynamiczne+ Dynamiczna Alokacja pamięci

+
    +
  • malloc( rozmiar_w_bajtach ); – zwraca wskaźnik do zaalokowanego xobszaru lub NULL (gdy zbraknie pamięci albo innym błędzie). xPrzydzielona pamięć ma nieokreśloną zawartość
  • +
  • calloc( ile_el, rozmiar_elementu ); – to samo co malloc, tyle, że xprzydzielona pamięć zainicjowana zerami
  • +
  • free( wsk_zwrocony_przez_malloc_lub_calloc ); – zwalnia pamięć, xNULL może być jej argumentem
  • +
+

Przykładowa tablica

+
  puts("Ile int-ów?" );
+  int tabSize=0;
+  scanf("%d",&tabSize);
+  int *tab= malloc(tabSizesizeof(int));
+  if(!tab){
+   fputs("Brak pamieci\n" ,stderr);
+   return 1;
+  }
+
+

Dynamiczna tablica prostokątna -znamy szerokość przed deklaracją

+
  int SZER=5;
+  int wys=4;
+  int (pTab) [SZER ] ;
+  pTab =sprAlokPam (malloc(wys sizeof pTab));
+
+

Dynamiczna tablica prostokątna, nie znamy ani wysokości ani szerokości

+
int szer=5;
+int wys=4;
+int ∗∗tabl=sprAlokPam(malloc(wys  sizeof(int)));
+for ( int j =0; j<wys;++ j )
+   tabl[ j ]=sprAlokPam( malloc( szer  sizeof(int)));
+for(int j=0; j<wys;++j)///zwalnianie
+   free(tabl[j]);
+free(tabl);
+
+

Dynamiczna tablica prostokątna

+
int szer=5;
+int wys=4;
+int ∗∗tabl=sprAlokPam(malloc(wyssizeof(int)));
+for(int j=0;j<wys;++j)
+   tabl [ j ]=sprAlokPam(malloc(szersizeof(int)));
+
+

Struktury

+
struct struktura{
+   int zmienna;
+   bool prawda=true;//możemy je od razu definiować
+   char literka;
+   ///itp. tu mogą być tablice, zmienne, inne struktury
+};
+typedef struct {
+   int p1, p2;
+} Struktura;
+int main ()
+{
+   Struktura s = { 0, 0 };
+   Struktura \*wsk = &s;
+   wsk->p1 = 2;
+   wsk->p2 = 3;
+   return 0;
+}
+
+

*W strukturach nie działają tablice VLA +**typedef struct struktura st; pomaga skrócić zapis i od teraz +definiując strukturę zapisujemy tylko st

+

Typ wyliczeniowy - Enum

+

Każdy element wyliczenia jest widziany jako stała +Z kolejnymi elementami skojarzono kolejne liczby typu int (licząc od 0)

+
enum Miesiace{STY,LUT,MAR,KW,MAJ,CZER,LIP ,SIER
+,WRZ,PAZ,LIST, GR};
+
+

Można przypisać konkretną wartość, pozostałe elementy to kolejne liczby

+
enum Miesiace{STY=1 ,LUT,MAR,KW, MAJ,CZER,LIP ,SIER
+,WRZ, PAZ, LIST,GR};
+
+

Każdemu elementowi można przypisać liczbę, dopuszczalne są nawet +powtórzenia

+
enum ZnakiSpecj{DZWONEK=’\b ,TAB=’\t ,NOW_LINIA
+=’\n};
+
+

Logika

+

Operatory

+

1 i 0 lub true i false dla typów logicznych takich jak bool (jako, że czyste C nie ma zmiennych typu bool to dla wygody można załączyć sobie biblioteke #include <stdbool.h>)

+

Podstawowe operatory:

+
    +
  • x||y lub
  • +
  • x&&y oraz
  • +
  • !x negacja
  • +
  • a==b czy równe
  • +
  • a!=b czy różne
  • +
  • a>=b, a>b
  • +
+

Porównania zwracają stany logiczne (np dla int a,b)

+

Wartość boola można dodawać do zmiennych liczbowych typu int (ale polecam unikać takich zabaw)

+
bool x=true; x++; //x nadal jest równe 1
+
+

Warunkowe

+
if(warunek)
+{
+   //kod jeśli tak
+}else{
+   //kod jeśli nie
+}
+
+

switcha można wykorzystywać gdy chcemy uniknąć tworzenia tzw "drabinki" if-ów.
+Na ogół jest używamy, gdy chcemy sprawdzić wartość enuma.

+
switch(jakaś_zmienna) {
+
+   case wartość1:
+      //kod
+      break;
+
+   case wartość2 :
+      //kod
+      break;
+
+   default : /* Optional */
+      //kod jeśli nic z powyższych nie pasuje
+}
+
+

Pętle

+

Sterowanie przebiegiem pętli

+
    +
  • break – przerwanie działania pętli
  • +
  • continue – rozpoczęcie kolejnego obiegu pętli
  • +
+

Nadmierne stosowanie instrukcji sterujących break, continue jest złą praktyką programistyczną

+
while(warunek){
+//nasze polecenia
+}//wykonuje się dopóki warunek jest spełniony
+
+do{
+//kod
+}while(warunek)//warunek jest sprawdzany dopiero po pierwszym obrocie
+
+//for(deklaracja zm ;warunek trwania; co ma się dziać po obrocie pętli){
+for(int i=0;i<5;i++){
+//będzie 5 obrotów pętli dla 01234
+}
+
+

include

+

typedef unsigned char uchar ; +typedef unsigned short ushort ; +enum Miesiace{STY=1 ,LUT,MAR,KW, MAJ,CZER,LIP ,SIER +,WRZ, PAZ, LIST,GR}; +const uchar dlMies[13]={0 ,31 ,29 ,31 ,30 ,31 ,30 ,31 +,31 ,30 ,31 ,30 ,31};//dlugosc miesiąca +extern inline bool rokPrzest(const ushort r ) ; +inline stosuje się do krótkich, prostych funkcji aby uniknąć kosztownego +mechanizmu wołania funkcji. Bez +extern w C nie skompiluje się. assert(true) nic nie robi, assert(false) kończy +działanie programu. Asercje +stosuje się do debugowania, lub do sprawdzania czy spełnione są założenia +projektantów funkcji +Inne Funkcje +Liczby losowe +rand() - zwraca liczbę z zakresu 0-RAND_MAX, losowane wartości +zależą od funkcji: +srand(ziarno) (nie woła się przed każdym rand, woła się tylko przed +pierwszym losowaniem!)-ustala ziarno losowania dla funkcji rand często +wewnątrz podaje się time(NULL) -jeżeli tego nie zrobimy to za każdym +razem program wygeneruje to samo +Lista słów kluczowych C11 +Lista słów kluczowych języka C : +auto, double, int, struct, break, else, long, switch, +case, enum, register, typedef, char, extern, return, +union, const, float, short, unsigned, continue, for, +signed, void, default, goto, sizeof, volatile, do, if, +static, while,_Bool, _Imaginary, restrict,_Complex, +inline, _Alignas,_Generic, _Thread_local,_Alignof, +Noreturn, _Atomic,_Static_assert +Źródła jeżeli potrzeba dodatkowych informacji:

+
    +
  1. https://pl.wikibooks.org/wiki/C/Zmienne
  2. +
  3. https://codeforwin.org/2015/05/list-of-all- + format-specifiers-in-c-programming.html
  4. +
  5. https://pl.wikibooks.org/wiki/C/scanf + pojęcia?: stdout + wykłady pozostałe 5,6,7
  6. +
+

Budowa programu

+

W każdym programie punktem początkowym jest funkcja main

+

Przyjmuje ona argumenty:

+
    +
  • argc - liczba argumentów przekazanych do programu
  • +
  • argv - tablica ze stringami argumentów
  • +
+

A zwraca ona int-a będącego kodem wyjścia (0-sukces)

+
#include <stdio.h>
+
+int main(int argc, char* argv[])
+{
+   //program
+}
+
+

Czytanie argumentów

+

Funkcje

+

Argumenty funkcji

+

Zmienna liczba argumentów (Variadic)

+

W C i C++ funkcje na ogół przyjmują ściśle określoną liczbę argumentów, ale możliwe jest także zdefiniowanie funkcji przyjmującej zmienną liczbę argumentów. (Tak jak printf()). Oznaczamy to za pomocą wielokropka ...

+
int fun(int i, char c, ...){}
+
+

Zaś aby dostać się do wartości przekazanych dalej należy użyć makr va_arg, va_copy, va_end, va_start. Dokumentacja

+
#include <stdio.h>      /* printf */
+#include <stdarg.h>     /* va_list, va_start, va_arg, va_end */
+
+int FindMax (int n, ...)
+{
+  int i,val,largest;
+  va_list vl;
+  va_start(vl,n); //zaczynamy pracę ze zmiennymi
+  largest=va_arg(vl,int);
+  for (i=1;i<n;i++)
+  {
+    val=va_arg(vl,int);
+    largest=(largest>val)?largest:val;
+  }
+  va_end(vl);
+  return largest;
+}
+
+
    +
  • va_list - Przed uzyskaniem dostępu do dowolnych argumentów zmiennych należy ustanowić znacznik listy jako zmienną typu va_list
  • +
  • va_start - wywołujemy jak zaczymany pracę. Drugim argumentem jest ostatni znany argument. (to co znajduje się przed ...)
  • +
  • va_end - musimy je wywołać jak już zakończymy pracę ze zmiennymi
  • +
  • va_arg - pozwala pobrać wartość typ zmienna=va_arg(lista_va,typ)
  • +
  • va_copy (od C++11) -Tworzy kopię listy argumentów w bieżącym stanie
  • +
+

W C++ możliwe jest jednak nieco bezpieczniejsze obchodzenie się z tymi argumentami.
+Od C++11 pojawiły się templatki Cppreference packs i prostsze docsy

+
template<typename T>
+T adder(T v) {
+  return v;
+}
+
+template<typename T, typename... Args>
+T adder(T first, Args... args) {
+  return first + adder(args...);
+}
+
+adder(1,4,56,7);
+
+

Biblioteka standardowa

+

Pisanie/czytanie

+

Cla C standardową biblioteką jest stdio.h

+
#include <stdio.h>
+
+int main(){
+   //printf(<control string> [, <arguments list> ] )
+
+printf("\n Podaj liczbe: ");
+
+//scanf( <control_string>, <arguments_list >)
+int num;
+scanf("%d", &num);
+};
+
+

W kontrolnych ciągach znaków wykorzystujemy specyfikatory formatu z tabelki poniżej

+

Tabelka z typami formatów

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FormatDescriptionSupported data types
%cCharacterchar,unsigned char
%dSigned Integer short ,unsigned short ,int ,long
%e or %EScientific notation of float valuesfloat,double
%fFloating point float
%g or %GSimilar as %e or %EFloat, double
%hiSigned Integer(Short)short
%huUnsigned Integer(Short)unsigned short
%iSigned Integershort, unsigned short, int,long
%lor %ld or %li Signed Integerlong
%lfFloating pointdouble
%LfFloating pointlong double
%luUnsigned integerunsigned int unsigned long
%lli, %lldSigned Integerlong long
%lluUnsigned Integerunsigned long long
%oOctal representation of Integer.short, unsigned short, int, unsigned int, long
%pAddress of pointer to void *, (wskaźnik)void *
%sStringchar *
%uUnsigned Integerunsigned int unsigned long
%xor %X Hexadecimal representation of Unsigned Integershort, unsigned short, int, unsigned int, long
%nPrints nothing
%%Prints % character
+

Znaki specjalne

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZnakZnaczenie/akcja
\nNowa linia (ASCII 010)
\tTabulacja pozioma (ASCII 009)
\vTabulacja pionowa
\fNowa strona
\rPowrót kursora (ASCII 013)
\\Znak \ (ASCII 092)
\"Znak " (ASCII 034)
+

Preprocesor

+

Preprocesor jest to program, który analizuje plik źródłowy (programu, biblioteki) w poszukiwaniu wszystkich wyrażeń zaczynających się od "#". Na podstawie tych instrukcji generuje on kod w "czystym" języku C/C++, który dopiero potem jest analizowany przez kompilator

+

Link do artykułu

+
    +
  • #define: Służy do definiowania makr, które są zastępowane przez określone fragmenty kodu podczas procesu preprocesowania.
  • +
  • #include: Służy do importowania plików nagłówkowych do kodu źródłowego. Pliki nagłówkowe zawierają definicje funkcji, zmiennych i innych elementów, które są używane w kodzie źródłowym.
  • +
  • #ifdef/#ifndef: Służą do sprawdzenia, czy dana makrodefinicja została zdefiniowana lub nie. Jeśli warunek jest spełniony, to preprocesor wykonuje określony fragment kodu.
  • +
  • #if/#else/#endif: Służą do warunkowego wykonywania fragmentów kodu. Jeśli warunek jest spełniony, to preprocesor wykonuje pierwszy fragment kodu, w przeciwnym razie wykonuje drugi fragment kodu.
  • +
  • #pragma: Służy do określenia specjalnych instrukcji dla kompilatora. Może być używana do ustawienia opcji kompilacji lub do włączania/wyłączania określonych funkcji.
  • +
+

//TODO przykłady

+

Define

+

// TODO przykłady funkcji wołanych przez makra +#define PRINT_STDERR() StreamPrinter(stderr, __LINE__, __FILE__)

+

//TODO kopiuj obrazki o oryginalnych notatek +// TODO opisz const dla const int* var vs int const *var

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/C i C++ \360\237\207\250/1_cpp/index.html" "b/C i C++ \360\237\207\250/1_cpp/index.html" new file mode 100644 index 00000000..9a3eb9f5 --- /dev/null +++ "b/C i C++ \360\237\207\250/1_cpp/index.html" @@ -0,0 +1,1719 @@ + + + + + + + + + + + + + + + + Zbiór informacji o C++ - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Zbiór informacji o C++

+

Oficjalna dokumentacja i zalecenia: ISO CPP GUIDELINES

+

Elementy języka i jego mechanizmy

+

Zarządzanie pamięcią new i delete

+

Zarządzanie pamięcią w C++ jest podobne do zarządzania w C. Jednak jest oparta o słowa kluczowe new i delete. (NIGDY nie mieszajmy tych dwóch sposobów)

+

artykuł

+

new służy do tworzenia nowych obiektów i alokowania pamięci dla nich, natomiast delete służy do zwalniania zarezerwowanej wcześniej pamięci.

+

Przykład użycia słowa kluczowego new:

+
int *p = new int; // alokuje pamięć dla zmiennej typu int
+*p = 5; // przypisuje wartość 5 do zmiennej
+delete p; // zwalnia pamięć zarezerwowaną dla zmiennej p
+
+

Możliwe jest także użycie słowa kluczowego new do tworzenia tablic dynamicznych:

+
int *tab = new int[10]; // alokuje pamięć dla tablicy 10-elementowej
+tab[0] = 5; // przypisuje wartość 5 do pierwszego elementu tablicy
+delete[] tab; // zwalnia pamięć zarezerwowaną dla tablicy tab
+
+

Pętle

+

Typy pętli:

+
    +
  • Podstawowa pętla for
  • +
+
for (int i = 0; i < 5; ++i)
+
+
    +
  • pętla while
  • +
+
int j = 0;
+while (j < 10) {
+    // rób coś
+    ++j;
+}
+
+
    +
  • pętla do-while
  • +
+
int k = 0;
+do {
+    // Wykonuj przynajmniej raz, potem sprawdzaj warunek
+    ++k;
+} while (k < 3);
+
+
    +
  • range-based for - jest to zalecana metoda dla zbiorów iterowalnych
  • +
+
std::vector<int> numbers = {1, 2, 3, 4, 5};
+for (int num : numbers) {
+    // Iteracja po elementach kontenera
+}
+
+

W wypadku bardziej złożonych obiektów można użyć też referencji

+
for(auto&& element: lista)
+
+

może być też używany do rozpakowywania link

+
for (auto&& [first, second] : mymap)
+
+

Funkcje

+

Lambdy

+

Składnia lambdy:

+
    +
  • [] - Tu podajemy listę przechwytywania
  • +
  • [x] - przechwytuje obiekt x (tylko odczyt)
  • +
  • [&x] - przechwytuje obiekt x (odczyt i zapis)
  • +
  • [=] - dowolny obiekt ze scope'a do odczytu
  • +
  • [&] - dowolny obiekt ze scope'a do odczytu i zapisu
  • +
  • () - argumenty, jakie ma przyjmować wyrażenie lambda. (Opcjonalne)
  • +
  • atrybuty wyrażenia lambda, z możliwych atrybutów w tym momencie najistotniejszy jest mutable, który sprawia że zmienne przechwycone przez wartość mogą być modyfikowane wewnątrz ciała wyrażenia. (Opcjonalne)
  • +
  • -> T - typ zwracany (Opcjonalne)
  • +
  • {} - ciało wyrażenia
  • +
+
//Najprostsza możliwa lambda
+[] { }();
+
+[]( int a )->float
+{
+    if( a < 0 )
+         return 0;
+
+    return a * 0.5f;
+}
+
+

Przekazywanie argumentów do funkcji

+

W C++ istnieją różne sposoby na przekazywanie argumentów do funkcji.

+
    +
  • poprzez kopię - w domyślnym wypadku do naszej funkcji przekazywana jest kopia naszego obiektu. + O ile to nie jest problem przy liczbach to przy większych obiektach to to może być już problem.
  • +
  • poprzez wskaźnik - jest to opcja zalecana bardziej przy kodzie napisanym w czystym C, czy też w wypadku, gdy chcemy sobie zastrzec możliwość przekazania pustego wskaźnika.
  • +
  • poprzez referencję - jest to sposób zbliżony do wskaźnika, do funkcji przekazujemy referencję do naszego obiektu.
  • +
+
class Klasa
+{
+private:
+    /* data */
+public:
+    Klasa(/* args */)
+    {
+        std::cout << "Wołanie konstruktora\n";
+    }
+
+    Klasa(const Klasa& other)
+    {
+        std::cout << "Wołanie konstruktora kopiującego\n";
+    }
+};
+
+void funkcja_zwykla(Klasa k) {}
+void funkcja_pointer(Klasa *k) {}
+void funkcja_referencja(Klasa &k) {}
+
+int main()
+{
+    Klasa k = Klasa();
+    std::cout << "funkcja_zwykla:\n";
+    funkcja_zwykla(k);
+    std::cout << "funkcja_pointer:\n";
+    funkcja_pointer(&k);
+    std::cout << "funkcja_referencja:\n";
+    funkcja_referencja(k);
+}
+
+

program wypisze:

+
Wołanie konstruktora
+funkcja_zwykla:
+Wołanie konstruktora kopiującego
+funkcja_pointer:
+funkcja_referencja:
+
+

W wypadku przekazywania poprzez referencję lub wskaźnik należy pamiętać o tym, że zmiany obiektu, które miały miejsce wewnątrz funkcji będą nadal widoczne z zewnątrz, ponieważ operujemy tam na tej samej instancji obiektu. +Aby uniknąć takich problemów warto przekazywać te argumenty jako const, albo zastanowić się, czy jednak kopia nie będzie lepsza.

+

Klasy

+

Funkcje wirtualne

+

są oznaczane za pomocą słowa kluczowego virtual.

+
class Base {
+   public:
+    virtual void print() {
+        cout << "Base Function" << endl;
+    }
+};
+
+class Derived : public Base {
+   public:
+    void print() {
+        cout << "Derived Function" << endl;
+    }
+};
+
+int main() {
+    Derived derived1;
+
+    // pointer of Base type that points to derived1
+    Base* base1 = &derived1;
+
+    // calls member function of Derived class
+    base1->print();
+
+    return 0;
+}
+
+

Podczas pracy z funkcjami wirtualnymi dobrą praktyką jest korzystanie ze specyfikatora override.
+Dzięki jego użyciu w klasie potomnej będziemy mieć pewność, że ta funkcja w klasie bazowej jest wirtualna.

+
struct A
+{
+    virtual void foo();
+    void bar();
+    virtual ~A();
+};
+
+// member functions definitions of struct A:
+void A::foo() { std::cout << "A::foo();\n"; }
+A::~A() { std::cout << "A::~A();\n"; }
+
+struct B : A
+{
+//  void foo() const override; // Error: B::foo does not override A::foo
+                               // (signature mismatch)
+    void foo() override; // OK: B::foo overrides A::foo
+//  void bar() override; // Error: A::bar is not virtual
+    ~B() override; // OK: `override` can also be applied to virtual
+                   // special member functions, e.g. destructors
+};
+
+

Templatki

+

Pozwalają kompilatorowi na łatwą autogenerację kodu.

+

Templatka metody

+
template <class myType>
+myType GetMax (myType a, myType b) {
+ return (a>b?a:b);
+}
+
+

Templatka klasy

+
template <class T>
+class mypair {
+    T values [2];
+  public:
+    mypair (T first, T second)
+    {
+      values[0]=first; values[1]=second;
+    }
+};
+
+

Specjalizacje templatek - pozwalają na łatwe doprecyzowanie implementacji dla pewnych ścićle określonych typów.

+
template <class T> class mycontainer { ... };
+template <> class mycontainer <char> { ... };
+
+

Typy castów (operatorów rzutowania)

+

Używając tych operatorów na ogół powinno się operować na wskaźnikach (albo referencjach)

+
    +
  • static_cast<naCoChcemyZrzutowac>(wyrazenie) - wykorzystywany do konwersji danych w zmiennych różnych typów (np pomiędzy typami reprezentującymi liczby), jest on wykonywany w trakcie kompilacji.
  • +
  • dynamic_cast<naCoChcemyZrzutowac>(wyrazenie) - służy do przekształcania typów klas pomiędzy klasami które po sobie dziedziczą. W wypadku niepowodzenia zwraca null Wyróżniamy:
  • +
  • Downcasting - kastujemy klasę bazową na potomną
  • +
  • Upcasting - gdy chcemy uzyskać instancję klasy bazowej
  • +
  • reinterpret_cast<naCoChcemyZrzutowac>(wyrazenie) - działa podobnie do dynamic casta, ale nie zwraca nulla, zaleca się używanie tylko kiedy dobrze wiesz co robisz.
  • +
  • const_cast<naCoChcemyZrzutowac>(wyrazenie) - pozwala zmienić stałą na zmienną i na odwrót na ogół jego używanie nie jest zalecane
  • +
+
     const double liczbaPI = 3.14;
+     const double *wskDoStalej = &liczbaPI;
+
+     double *wskaznik = const_cast<double *>(wskDoStalej); //przypisujemy dane ze stałej do zwykłego wskaźnika
+
+     cout << *wskaznik << endl; //wypisze 3.14
+     *wskaznik = 43;
+     // *wskDoStalej = 43; ERROR
+     cout << *wskaznik << endl; //wypisze 3.14
+
+

Biblioteki

+

Wątki

+

Jest wiele sposobów na wątki, ale najprostszym do użycia jest std::thread

+
#include <thread>
+
+// Start thread t1
+    std::thread t1(callable);
+
+    // Wait for t1 to finish
+    t1.join();
+
+    // t1 has finished do other stuff
+
+    //Wywołanie dla metody w klasie
+    std::thread t2(&Klasa::moja_metoda,&instancja_klasy, argument1, argument2, argument3);
+    t2.join();
+
+

Inne Słowa kluczowe

+

explicit TODO

+

Nowe standardy

+

C++17

+

Artykuł

+

C++20

+

Pełna lista z omówieniem

+

Do zrobienia

+

TODO: std::move, lvalue i rvalue, &&, ogólnie o klasach i dziedziczeniu, explicit C- czyli co musi być kompilowane jako czyste C, typy smart pointerów.

+

//TODO VOLATILE https://en.cppreference.com/w/cpp/language/cv

+

//TODO C++ contracts https://www.modernescpp.com/index.php/c-core-guidelines-a-detour-to-contracts (similar to java JML, or Dafny for C#)

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/C i C++ \360\237\207\250/2_gdb/index.html" "b/C i C++ \360\237\207\250/2_gdb/index.html" new file mode 100644 index 00000000..1c6b83a8 --- /dev/null +++ "b/C i C++ \360\237\207\250/2_gdb/index.html" @@ -0,0 +1,1295 @@ + + + + + + + + + + + + + + + + Praca z GDB - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+ +
+ + +
+
+ + + + + + + + +

Praca z GDB

+

Kompilacja z flagami debugowymi

+

W wypadku najprostszych aplikacji kompilowanych za pomocą gcc g++ wystarczy dodanie flagi -g

+
gcc -g hello.c
+
+

Uruchomienie aplikacji za pomocą GDB

+

Aby uruchomić aplikację z pomocą debugera wystarczy wpisać:

+
gdb a.out
+
+

Wtedy uruchamiamy nasz program w trybie terminalowym.

+

Praca ze zrzuconą pamięcią (coredump)

+

Przygotowania

+

Do stworzenia zrzutu często należy zwiększyć ilość dozwolonej ilości pamięci:
+ulimit -c unlimited

+

Kompilujemy nasz program z flagami debugowymi: - Cmake - cmake .. -DCMAKE_BUILD_TYPE=Debug && cmake --build . - make - TODO

+

Zbieranie stosu

+

Na ogół zrzuty ze stosu są pzechowywane w folderze /var/crash są to pliki z rozszerzeniem .crash
+Np _usr_share_teams_teams.1000.crash = "http://127.0.0.1:5000/"; +// let url2 = "https://httpbin.org/post";

+

// xhr.open("POST", url, true); +// xhr.setRequestHeader("Content-Type", "application/json"); +// xhr.onreadystatechange = function () { +// console.log("Jest git"); +// console.log(this.responseText); +// }; +// var data = JSON.stringify({ name: "xxx", code: "xx=12" }); +// xhr.send(data);

+

Analiza (w terminalu)

+

Uruchomienie gdb ./plik/wykonywalny ./plik/zrzutu/core

+

backtrace / bt full - pokazywanie stanu stosu

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/C i C++ \360\237\207\250/5_openMP/index.html" "b/C i C++ \360\237\207\250/5_openMP/index.html" new file mode 100644 index 00000000..08649dae --- /dev/null +++ "b/C i C++ \360\237\207\250/5_openMP/index.html" @@ -0,0 +1,1769 @@ + + + + + + + + + + + + + + + + Programming with OpenMP - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Programming with OpenMP

+

OpenMP is an open, multi-platform API specification for easy parallel programming in Fortran, C and C++. Main website

+

OpenMP programming is mainly based on compiler directives.

+

#pragma omp <directive> [clause [...]]

+

For function usage you have to include omp.h

+
#include <omp.h>
+...
+iam = omp_get_thread_num();
+
+

Simple usage example

+
void daxpy(int n, double a, double *x, double *y, double *z)
+{
+int i;
+#pragma omp parallel for //the loop below will be executed on multiple cores
+for (i=0; i<n; i++)
+  z[i] = a*x[i] + y[i];
+}
+
+

Compile it with

+
gcc -fopenmp prg-omp.c
+
+

Loop iterations are shared among threads. All the variables are shared except loop variable i, which is private.

+

Cmake

+

//TODO

+

Threads management

+

Link do docs

+

Managing threads numbers

+
omp_set_num_threads(x);
+omp_get_num_threads(); // returns the number of threads
+omp_get_thread_num(); // returns the identifier of the thread (starting from 0, main thread is always 0)
+
+

We can also use env variable OMP_NUM_THREADS

+
OMP_NUM_THREADS=10 app
+
+

Scheduling

+

schedule(type[,chunk])

+

//TODO S2 - slajd 24

+

Loop Parallelization

+

General usage

+
#pragma omp parallel for [clause [...]]
+for (index=first; test_expr; increment_expr) {
+// loop body
+}
+
+

NOTE - inside of loop we can't use break continue etc (//TODO check this sentence)

+

Thank to clause we may define variables scope, way of obtaining results etc.

+

Clauses:

+
    +
  • private -each thread has a different replica
  • +
  • shared - each threads can read and write
  • +
  • reduction - used when neither private or shared can be used
  • +
  • firstprivate, lastprivate
  • +
  • default - forces to specify scope of all of variables
  • +
+

By default all of variables are shared with following exceptions:

+
    +
  • Index variable of the parallelized loop
  • +
  • Local variables of the called subroutines (except if they are declared static)
  • +
  • Automatic variables declared inside the loop
  • +
+
sum = 0;
+//for sum shared we have races for private we won't get any result
+#pragma omp parallel for reduction(+:sum)
+for (i=0; i<n; i++) {
+  sum = sum + x[i]*x[i];
+}
+
+

Reduction - allows easy aggregation of results

+

reduction (operator : list)

+

Available operators: +, *, -, &, |, ˆ, &&, ||, max, min

+

firstprivate, lastprivate - in general private variables have undefined value during the first execution and after execution

+
    +
  • firstprivate initializes to the value of selected variable the begining of the block.
  • +
+
#include <stdio.h>
+#include <omp.h>
+
+int main (void)
+{
+    int i = 10;
+    #pragma omp parallel firstprivate(i)
+    {
+        //in case of regular private variable we would get random values
+        printf("thread %d: i = %d\n", omp_get_thread_num(), i);
+        i = 1000;
+    }
+    printf("i = %d\n", i);
+    return 0;
+}
+
+
    +
  • lastprivate the value of the variable after the block is the one of the “last” iteration of the loop
  • +
+
alpha = 5.0;
+#pragma omp parallel for firstprivate(alpha) lastprivate(i)
+for (i=0; i<n; i++) {
+  z[i] = alpha*x[i];
+}
+k = i;
+/* i has value n*/
+
+

if clause - runs loop in pararell only if the expression is true (because of the overhead linked with initializing threads)

+
#pragma omp parallel for if(n>5000)
+for (i=0; i<n; i++)
+  z[i] = a*x[i] + y[i];
+
+

Parallel Regions

+

Pragma parallel executes block of code in replicated threads.

+
#pragma omp parallel [clause [clause ...]]
+{
+// block
+}
+
+

Example

+
#pragma omp parallel private(myid)
+{
+  myid = omp_get_thread_num();
+  printf("I am thread %d\n",myid);
+}
+
+

They are used for sharing work in a bit different manner.

+
    +
  • Each thread works on a part of the data structure, or
  • +
  • Each thread performs a different operation
  • +
+

Possible mechanisms for worksharing:

+
    +
  • Based on the thread identifier
  • +
+
#pragma omp parallel private(myid)
+{
+  nthreads = omp_get_num_threads();
+  myid = omp_get_thread_num();
+  dowork(myid, nthreads);
+}
+
+
    +
  • Parallel task queue
  • +
+
int get_next_task() {
+  static int index = 0;
+  int result;
+  #pragma omp critical
+  {
+    if (index==MAXIDX) result=-1;
+    else { index++; result=index; }
+  }
+  return result;
+}
+...
+int myindex;
+#pragma omp parallel private(myindex)
+{
+  myindex = get_next_task();
+  while (myindex>-1) {
+    process_task(myindex);
+    myindex = get_next_task();
+  }
+}
+
+
    +
  • Using OpenMP specific constructs - thank to them programmer doesn't have to worry about splitting workload. Types:
  • +
  • for construct to split iterations of loops
  • +
  • Sections to distinguish different parts of the code
  • +
  • Code to be executed by a single thread
  • +
+

Worksharing constructs

+

The for construct

+
#pragma omp parallel
+{
+  ...
+  #pragma omp for
+  for (i=1; i<n; i++)
+    b[i] = (a[i] + a[i-1]) / 2.0;
+}
+
+

The loop iterations are not replicated but shared among the threads +parallel and for directives can be combined in one.

+

Loop Construct - nowait

+

nowait Clause - removes implicit barrier after for loop

+
void a8(int n, int m, float *a, float *b, float *y, float *z)
+{
+  int i;
+  #pragma omp parallel
+  {
+    #pragma omp for nowait
+    for (i=1; i<n; i++)
+      b[i] = (a[i] + a[i-1]) / 2.0;
+
+    //loop below can start execution before the one above will finish
+    #pragma omp for
+    for (i=0; i<m; i++)
+      y[i] = sqrt(z[i]);
+  }
+}
+
+

sections Construct

+

represents pliece of code, which can be split into small independent sections

+
    +
  • Individually they represent little work, or
  • +
  • Each fragment is inherently sequential + It can also be combined with parallel
  • +
+
#pragma omp parallel sections
+{
+  #pragma omp section
+  Xaxis();
+  #pragma omp section
+  Yaxis();
+  #pragma omp section
+  Zaxis();
+}
+
+

A thread may execute more than one section +Clauses: private, first/lastprivate, reduction, nowait

+

single and master Construct

+

Code fragments that must be executed by a single thread

+
#pragma omp parallel
+{
+  // we will see info about starting and ending work1
+  // only once
+  #pragma omp single
+    printf("work1 starts\n");
+
+  //Other threads will wait until "work1 starts" will be printed
+  work1();
+
+  #pragma omp single
+    printf("work1 ends\n");
+
+
+  #pragma omp single nowait
+    printf("work1 ended in all of the threads, work2 started\n");
+  work2();
+}
+
+

master Directive

+

Differences with single:

+
    +
  • It does not require all threads to reach this construction
  • +
  • There is no implicit barrier (other threads simply skip this code)
  • +
+
#pragma omp parallel
+{
+  #pragma omp master
+    printf("Begin work\n");
+  #pragma omp for
+    for (i=0; i<n; i++)
+      calc1();
+
+  //this will be launched after finishing loop above
+  #pragma omp master
+    printf("Work finished\n");
+}
+
+

Some allowed clauses: private, firstprivate, nowait

+

Synchronization

+

The main point of synchronization is avoiding race conditions.

+

The most basic way of avoiding this is mutual exclusion. (directive critical, atomic or locks - _lock routines).

+

critical directive

+

#pragma omp critical [(Name)]

+

Allows execution of critical section by only one thread at once

+
cur_max = -100000;
+#pragma omp parallel for
+for (i=0; i<n; i++) {
+  #pragma omp critical
+  if (a[i] > cur_max) {
+    cur_max = a[i];
+  }
+}
+
+

When a thread reaches the if block (the critical section), it waits until no other thread is executing it at the same time.

+

Code above is not optimal, because entering critical section costs, and we can limit it

+
cur_max = -100000;
+#pragma omp parallel for
+for (i=0; i<n; i++) {
+  if (a[i] > cur_max) {
+    #pragma omp critical
+    if (a[i] > cur_max)
+      cur_max = a[i];
+  }
+}
+
+

We can also use named critical sections

+
cur_max = -100000;
+cur_min = 100000;
+#pragma omp parallel for
+for (i=0; i<n; i++) {
+  if (a[i] > cur_max) {
+    #pragma omp critical (maxlock)
+    if (a[i] > cur_max)
+      cur_max = a[i];
+  }
+  if (a[i] < cur_min) {
+    #pragma omp critical (minlock)
+    if (a[i] < cur_min)
+      cur_min = a[i];
+  }
+}
+
+

atomic directive

+

It is much more efficient than critical section, but supports only very simple operations.

+
#pragma omp atomic
+x <binop>= exp
+
+

where <binop> can be +, *, -, /, %, &, |, ^, <<, >>

+
#pragma omp parallel for shared(x, index, n)
+for (i=0; i<n; i++) {
+  #pragma omp atomic
+  x[index[i]] += work1(i);
+}
+
+

barrier directive

+

When reaching a barrier, threads wait for the rest to arrive

+
#pragma omp parallel private(index)
+{
+  index = generate_next_index();
+  while (index>0) {
+    add_index(index);
+    index = generate_next_index();
+  }
+  #pragma omp barrier
+  index = get_next_index();
+  while (index>0) {
+    process_index(index);
+    index = get_next_index();
+  }
+}
+
+

ordered directive

+

Ensures, that portions of code in the loops are executed in the original sequential order

+
#pragma omp parallel for ordered
+for (i=0; i<n; i++) {
+  a[i] = ...
+  /* complex computation */
+  #pragma omp ordered
+  fprintf(fd, "%d %g\n", i, a[i]);
+}
+
+

Only one ordered section is allowed per iteration

+

//TODO ask about this ❗ +// std::cout << "xx"

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/C i C++ \360\237\207\250/Cmake/index.html" "b/C i C++ \360\237\207\250/Cmake/index.html" new file mode 100644 index 00000000..0e08702b --- /dev/null +++ "b/C i C++ \360\237\207\250/Cmake/index.html" @@ -0,0 +1,1608 @@ + + + + + + + + + + + + + + + + Cmake - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Cmake

+

Na podstawie: https://cmake.org/cmake/help/latest/guide/tutorial/index.html

+

Inny tutorial: Cmake in 15 min

+

Podstawy

+

Mamy tu minimalny przykład

+
#na początku zawsze określamy min wersję CMake'a
+cmake_minimum_required(VERSION 3.10)
+
+# set the project name
+project(Tutorial)
+
+# Tworzymy tylko jeden plik wyjściowy `Tutorial` ze skompilowanego pliku tutorial.cxx
+add_executable(Tutorial tutorial.cxx)
+
+

Budowanie

+
#warto stworzyć sobie nowy folder i w nim budować
+mkdir build; cd build
+
+cmake SCIEZKA_DO_FOLDERU_GLOWNEGO # zwykle do folderu z plikiem CMakeLists.txt
+cmake --build . #można tu też użyć po prostu make (Linux)
+
+

Inne użyteczne komendy

+
cmake --build . --target help # wypisanie celów w ramach projektu
+
+cmake --build . --target # budowanie danego celu
+
+

Konfigurowalne pliki nagłówkowe

+

Za pomocą CMake'a możemy generować pliki nagłówkowe zawierające zmienne oraz parametry zawarte w plikach CMake.

+

Przykładowo możemy w ten sposób zapisywać wersję naszego programu.

+
cmake_minimum_required(VERSION 3.10)
+
+# set the project name and version
+project(Tutorial VERSION 1.0)
+
+# opisujemy tu na podstawie czego ma być wygenerowany nasz plik nagłówkowy
+configure_file(TutorialConfig.h.in TutorialConfig.h)
+
+# Skoro utworzony zostanie plik TutorialConfig.h to warto dodać ścieżkę na krórej się znajduje do listy ścieżek w których będą szukane pliki
+target_include_directories(Tutorial PUBLIC
+                           "${PROJECT_BINARY_DIR}"
+                           )
+
+

Zawartość pliku TutorialConfig.h.in

+
// the configured options and settings for Tutorial
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
+
+

Określenie wymaganej wersji C++

+
# specify the C++ standard
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+

Biblioteki

+

Tworzenie własnych

+

Podobnie jak programy, za pomocą cmake'a możemy definiować też biblioteki +W wypadku prostych bibliotek wewnątrz naszych preojektów wystarczy jednolinijkowy plik CMakeLists.txt w ich folderze.

+
# Dodaj bibliotekę o nazwie MathFunctions zawierającą plik mysqrt.cxx
+add_library(MathFunctions mysqrt.cxx)
+
+

(Ta biblioteka znajduje się w folderze MathFunctions w głównym folderze projektu. W folderze tym mamy jeszcze plik nagłówkowy MathFunctions.h)

+

Linkowanie bibliotek

+
# add the MathFunctions library
+add_subdirectory(MathFunctions)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+
+# Musimy podlinkować wszystkie biblioteki używane przez plik Tutorial
+target_link_libraries(Tutorial PUBLIC MathFunctions)
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+                          "${PROJECT_BINARY_DIR}"
+                          "${PROJECT_SOURCE_DIR}/MathFunctions"
+                          )
+
+

Logika

+

Zmienne

+

Zmienne są definiowane podczas przypisywania im wartości.

+
    +
  • listy
  • +
+
# Dodanie elementu do listy
+list(APPEND EXTRA_LIBS MathFunctions)
+
+# Dodanie elementów do listy regexem (warto tu pamiętać, że domyślnie te
+# te ścieżki są globalne, więc aby je potem złapać regexem trzeba załóżyć, że zaczynają się od /
+file(GLOB TARGET_SRC "src/*.cpp" )
+
+# Usuwanie elementu z listy
+list(REMOVE_ITEM TARGET_SRC "/*main.cpp" )
+
+

Aby zmienna została podmieniona przez generator na jej zawartość musi być ona umieszczona w klamrach, bez nich po prostu przekazujemy stringa.

+
message(HEADERS)
+#>>> [cmake] HEADERS
+
+
message(${HEADERS})
+#>>> [cmake] /include/plik.hpp /inlude/plik2.hpp
+
+

TODO-uporządkować ten punkt

+

Opcje

+

Są to parametry dla buildu, które będą potem także widoczne w narzędziach z GUI dla CMake.

+
option(USE_MYMATH "Use tutorial provided math implementation" ON)
+
+

Ta opcja będzie widoczna z domyślną wartością ON

+

IF-y

+

W CMake'u możemy tworzyć całe wyrażenia warunkowe za pomocą wcześniej predefiniowanych amiennych.

+
if(USE_MYMATH)
+  add_subdirectory(MathFunctions)
+  list(APPEND EXTRA_LIBS MathFunctions)
+  list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/MathFunctions")
+endif()
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+                           "${PROJECT_BINARY_DIR}"
+                           ${EXTRA_INCLUDES}
+                           )
+
+

Pliki

+

Szukanie i dodawanie plików

+
#prosty sposób na wczytanie wszystkich plików z danego folderu do zmiennej
+file(GLOB_RECURSE SOURCES ${CMAKE_SOURCE_DIR} "src/*")
+
+

Domyślne ścieżki w CMake

+
    +
  • CMAKE_SOURCE_DIR
  • +
+

TODO

+

+
+

+
+

Instalacja

+

dokumentacja

+

Lepsze wsparcie dla IDE

+

Poniższa komenda wygeneruje przy budowie plik compile_commands.json, który może być potem używane przez IDE.

+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+

Np aby VScode użył tego pliku należy go podać w ustawieniach:

+
  "configurations": [
+    {
+      "name": "Mac",
+      "intelliSenseMode": "clang-x64",
+      "includePath": ["${myDefaultIncludePath}", "/another/path"],
+      "macFrameworkPath": ["/System/Library/Frameworks"],
+      "defines": ["FOO", "BAR=100"],
+      "forcedInclude": ["${workspaceFolder}/include/config.h"],
+      "compilerPath": "/usr/bin/clang",
+      "cStandard": "c11",
+      "cppStandard": "c++17",
+      "compileCommands": "/path/to/compile_commands.json",
+      "browse": {
+        "path": ["${workspaceFolder}"],
+        "limitSymbolsToIncludedHeaders": true,
+        "databaseFilename": ""
+      }
+    }
+  ],
+
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/C i C++ \360\237\207\250/Narz\304\231dzia" "b/C i C++ \360\237\207\250/Narz\304\231dzia" new file mode 100644 index 00000000..4de0d264 --- /dev/null +++ "b/C i C++ \360\237\207\250/Narz\304\231dzia" @@ -0,0 +1,11 @@ +Profilowanie +``` +valgrind --tool=callgrind ./my_binary +kcachegrind callgrind.out.* +``` + + +Wycieki +``` +valgrind --leak-check=full -v ./your_program +``` \ No newline at end of file diff --git "a/C i C++ \360\237\207\250/assets/C_arguments_reading.png" "b/C i C++ \360\237\207\250/assets/C_arguments_reading.png" new file mode 100644 index 00000000..878edfa2 Binary files /dev/null and "b/C i C++ \360\237\207\250/assets/C_arguments_reading.png" differ diff --git "a/C i C++ \360\237\207\250/dokumentowanie_kodu/index.html" "b/C i C++ \360\237\207\250/dokumentowanie_kodu/index.html" new file mode 100644 index 00000000..15bea92f --- /dev/null +++ "b/C i C++ \360\237\207\250/dokumentowanie_kodu/index.html" @@ -0,0 +1,1302 @@ + + + + + + + + + + + + + + + + Dokumentowanie kodu - Doxygen - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Dokumentowanie kodu - Doxygen

+

Z pomocą doxygena można łatwo udokumentować kod z jego poziomu w sposób zarówno łatwy do odczytania w surowym kodzie, jak i umożliwiający automatyczne generowanie dokumentacji i podpowiadanie opisów funkcji w różnych IDE.

+

Jest on poza tym dość uniwersalny, wspiera języki takie jak:

+
    +
  • C++
  • +
  • Java
  • +
  • C#
  • +
  • Python +etc.
  • +
+

Syntax

+

O ile sam wygląd bloków doxygenowych w różnych językach może nieco się różnić to komendy (znaczniki) pozostają takie same.

+

Oficjalna dokumentacja
+Pełna lista komend
+instrukcja2

+

Język C++

+
/**
+ * @brief krótki opis funkcji
+ *
+ * Dłuższy opis
+ *
+ * @param argument1 - opis argumentu, do czego służy
+ * @exception opis rzucanego wyjątku 
+ * @return opis tego co jest zwracane
+ */
+int fun(const int &argument1);
+
+/**
+ * @brief Klasa będąca przykładem
+ * 
+ */
+class A
+{
+private:
+    int var1; //!< Krótki opis
+    int var2; ///< Dłuższy
+              ///< opis
+
+public:
+    A(/* args */);
+
+};
+
+

Python

+
## @package pyexample
+#  Documentation for this module.
+#
+#  More details.
+
+## Documentation for a function.
+#
+#  More details.
+def func():
+    pass
+
+## Documentation for a class.
+#
+#  More details.
+class PyClass:
+
+    ## The constructor.
+    def __init__(self):
+        self._memVar = 0;
+
+    ## Documentation for a method.
+    #  @param self The object pointer.
+    def PyMethod(self):
+        pass
+
+    ## A class variable.
+    classVar = 0;
+
+    ## @var _memVar
+    #  a member variable
+
+

Generowanie dokumentacji

+

TODO

+

Gnerowanie diagramów klas

+

TODO

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Inne/assets/haskell_tail.png b/Inne/assets/haskell_tail.png new file mode 100644 index 00000000..f5b18352 Binary files /dev/null and b/Inne/assets/haskell_tail.png differ diff --git a/Inne/haskell/index.html b/Inne/haskell/index.html new file mode 100644 index 00000000..2a1a6c41 --- /dev/null +++ b/Inne/haskell/index.html @@ -0,0 +1,1589 @@ + + + + + + + + + + + + + + + + Haskell λ - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Haskell λ

+

Jest to statycznie typowany, głównie deklaratywny, czysto funkcyjny język programowania.

+

Jego najpopularniejszym kompilatorem jest GHC (Glasgow Haskell Compiler).

+

Podczas programowania korzystamy z wyrażeń (opisujących coś) a nie z instrukcji (mówiących co ma być zrobione).

+

Jedną z najważniejszych właściwości tego języka jest to, że funkcje zawsze zwracają tą samą wartość dla tych samych argumentów wejściowych. (nie ma żadnych zmiennych globalnych, statycznych ani innych rzeczy, które mogłyby wpływać na wynik).

+

Zmienne

+

Większość przydatnych rzeczy jest w dokumentacji

+
    +
  • Char - znak
  • +
  • isAlpha, isAlphaNum, isDigit, isLower, isUpper :: Char -> Bool
  • +
  • toLower, toUpper :: Char -> Char
  • +
  • putChar :: Char -> IO ()
  • +
  • String - type String = [Char]
  • +
  • Num, Int, Float - liczba
  • +
  • div, mod
  • +
  • () krotka
  • +
  • fst - zwraca pierwszy element
  • +
  • snd - zwraca drugi element
  • +
  • Bool
  • +
  • Operatory
  • +
  • [] - lista (patrz Operacje na listach)
  • +
+

Do zdefiniowania zmiennej możemy użyć słowa kluczowego let

+
let x = 4 in x * x
+
+

Int <-> Char konwersja pomiędzy tymi typami jest możliwa

+
ord b
+>98
+chr 98
+>b
+
+

Typy

+

Poza wbudowanymi typami zmiennych możemy definiować własne

+

Synonymous types - używają już istniejących typów używamy tu słowa kluczowego type

+
type Name = String
+type Position = String
+type Age = Int
+type Course = Int
+
+type Point = (Float, Float)
+type Path = [Point]
+
+

Algebraic types - typy algebraiczne są typami złożonymi zdefiniowanymi przez użytkownika. Używamy tu słowa kluczowego data

+
data Person =   Student Age Name Course |
+                Professor Name Position |
+                Director Name
+
+namePerson :: Person -> Name
+namePerson (Student e n c) = n
+namePerson (Professor n c) = n
+namePerson (Director n) = n
+
+stud1 = Student 21 "Marian" 12
+
+

Tutaj słowa Student, Professor, Director służą do określenia typu danej struktury. (data constructor symbols)

+

Wykorzystując same symbole konstruktorów możemy tworzyć enumy

+
data Day = Mon | Tue | Wed | Thu | Fri | Sat | Sun
+
+

Functional types - budują i opisują funkcje

+
type MyType = (Int -> Int)
+fib :: MyType
+
+

Przykłady:

+
    +
  • not to wartość typu Bool -> Bool
  • +
  • (2 +) ma typ Int -> Int
  • +
  • map daje (a -> b) -> [a] -> [b] (przyjmuje funkcję robiązą z a b oraz tablicę a z potem zwraca tablicę b)
  • +
+

Operator -> zwija się z prawej strony

+

Tzn a -> b -> c jest równoznaczne z a -> (b -> c)
+a nie (a -> b) -> c

+

Należy jednocześnie pamiętać, że funkcje zwijają się od prawej

+

f a b to ekwiwalent (f a) b a nie f (a b)
+Czyli
+$ not not false da nam error

+

Operacje

+

Funkcje są wywoływane poprzez podanie ich nazwy oraz argumentów

+
sort [42,13,22]
+> [13,22,42]:: (Num a, Ord a) => [a]
+
+

Listy

+

Tworzenie i dodawanie

+

Aby dodać element do listy używamy :

+
'a' : []
+> "a":: [Char]
+
+

Tutaj do pustej listy dodaliśmy literę a dzięki czemu dostaliśmy stringa.

+

Do tworzenia list możemy też używać automatycznego generowania

+

Przykłady:

+
    +
  • [2..10] is [2,3,4,5,6,7,8,9,10]
  • +
  • [1..] is [1,2,3,4,...
  • +
  • [1,3..10] is [1,3,5,7,9]
  • +
  • [’a’..’e’] is “abcde”
  • +
+

Lub mechanizmu List comprehension

+

[wyrażenie przyjmujące zmienne | generator, filtry, generator, filtry, ...]

+

Na przykład

+
[ x*x | x<-[1..5], odd x ]
+> [1, 9, 25]
+
+

repeat nieskończone listy

+
Prelude> repeat 3
+[3,3,3,3,3...]
+
+

Operacje

+

Pobieranie - poniżej

+

pobieranie z list

+

Inne - operator ++

+
-- Łączenie list
+Prelude> [3,4]++[5]
+[3,4,5]
+
+-- Indeksowane elementy
+Prelude> [45,43,12,54] !! 2
+12
+
+-- branie x elementów z listy
+Prelude> take 3 (repeat 1)
+[1,1,1]
+
+-- usuwanie elementu z listy
+Prelude>
+
+

Funkcje dla list

+

Funkcja zip łączy dwie listy w listę krotek

+
zip [1,2] ["a","b"]
+> [ (1,"a"), (2,"b")]
+
+
> length [1,2,3]
+3
+
+

filter (a -> Bool) -> [a] -> [a] - przefiltrowuje wybraną listę, otrzymujemy tylko elementy dla których nasza funkcja zwraca True

+
> filter even [1,2,4,5,32]
+[2,4,32]
+
+

map :: (a -> b) -> [a] -> [b] - aplikuje wybraną funkcję na wszystkie elementy wybranej listy i zwraca listę wyników

+
> map square [9,3]
+[81,9]
+> map (<3) [1,2,3]
+[True,True,False]
+
+

foldr :: (a -> b -> b) -> b -> [a] -> b - funkcja, która pozwala łączyć wartości w tablicy. Podajemy jej argumenty:

+
    +
  • funkcja
  • +
  • pierwszy element typu docelowego
  • +
  • lista
  • +
+
suma = foldr (+) 0
+iloczyn = foldr (*) 1
+
+

Funkcje

+

FUnkcje są podstawotą częścią języka. Mogą być przekazywane jako argumenty, lub modyfikowane i częściowo aplikowane (partial application)

+

partial applications:

+
(+) :: Int -> Int -> Int
+$ (2 +) 5
+7
+
+
add_2 :: (Int -> Int)
+add_2 = (2 +)
+$ add_2 5
+7
+
+

Definiowanie

+

Funkcja składa się z opcjonalnego opisu typów
+nazwaFun :: Typ -> Typ -> Typ...
+Oraz samej definicji, tutaj mamy 2 warianty:

+
addRange :: Int -> Int -> Int
+addRange x y
+  | x == y = x
+  | x < y = x + addRange (x + 1) y
+  | otherwise = y + addRange (y + 1) x
+
+

oraz

+
numCbetw2 :: Char -> Char -> Int
+numCbetw2 c1 c2 =
+  let x = ord c2 - ord c1
+   in if abs x == 0 then abs 0 else abs x - 1
+
+

TODO +Argumenty przekazywane do funkcji mogą mieć formę listy (łączonej strzałkami ->) lub krotek (el1,el2,...).

+

Łączenie funkcji

+

Wykorzystując kropkę . możemy łączyć funkcje w ciągi

+
(sum . map square . filter even) [1 .. 10]
+
+

Powyższy kod zwróci nam sumę kwadratów liczb parzystych dla liczb z zakresu 1-10.

+

Moduły

+

Moduły są odpowiednikami paczek/bibliotek dla innych języków.

+

Aby go włączyć należy go zaimportować

+
import MojModul
+-- jest to plik MojModul
+
+

Przy tworzeniu nowego modułu od razu zaznaczamy jakie inne moduły improstujemy

+
module ModuleNameX where
+  import ModuleNameY
+
+

Przy plikach w folderach używamy kropek. Np jeśli w folderze A/B/C mamy plik EjemImport.hs to importujemy go tak:

+
import A.B.C.EjemImport
+
+

Eksportowanie - przy definiowaniu modułu możemy zaznaczyć co chcemy z niego eksportować.

+
-- Tutaj widać że eksportujemy tylko 2 funkcje
+module Geometry2D (areaSquare, perimeterSquare) where
+  areaRectangle :: Float -> Float -> Float
+  areaRectangle base height = base * height
+  perimeterRectangle :: Float -> Float -> Float
+  perimeterRectangle base height = 2 * (base + height)
+  areaSquare :: Float -> Float
+  areaSquare side = areaRectangle side side
+  perimeterSquare :: Float -> Float
+  perimeterSquare side = perimeterRectangle side side
+
+

W wypadku, gdy występuje kolizja nazw możemy użyć słowa kluczowego qualified

+
module NormalizeAll where
+  import qualified NormalizeSpaces
+  import qualified NormalizeCase as NC
+  normalizeAll :: String -> String
+  normalizeAll =NormalizeSpaces.normalize . NC.normalize
+
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Java\342\230\225/assets/Diagram_stan\303\263w_w\304\205tku.jpg" "b/Java\342\230\225/assets/Diagram_stan\303\263w_w\304\205tku.jpg" new file mode 100644 index 00000000..e3b2c56f Binary files /dev/null and "b/Java\342\230\225/assets/Diagram_stan\303\263w_w\304\205tku.jpg" differ diff --git "a/Java\342\230\225/assets/Kolekcje.jpg" "b/Java\342\230\225/assets/Kolekcje.jpg" new file mode 100644 index 00000000..ae98c2d8 Binary files /dev/null and "b/Java\342\230\225/assets/Kolekcje.jpg" differ diff --git "a/Java\342\230\225/assets/KolekcjeBiblioteczne.png" "b/Java\342\230\225/assets/KolekcjeBiblioteczne.png" new file mode 100644 index 00000000..21291372 Binary files /dev/null and "b/Java\342\230\225/assets/KolekcjeBiblioteczne.png" differ diff --git "a/Java\342\230\225/assets/MapMethods.png" "b/Java\342\230\225/assets/MapMethods.png" new file mode 100644 index 00000000..0988841d Binary files /dev/null and "b/Java\342\230\225/assets/MapMethods.png" differ diff --git "a/Java\342\230\225/assets/Zablokowany.jpg" "b/Java\342\230\225/assets/Zablokowany.jpg" new file mode 100644 index 00000000..a5c82718 Binary files /dev/null and "b/Java\342\230\225/assets/Zablokowany.jpg" differ diff --git "a/Java\342\230\225/java_podstawy/index.html" "b/Java\342\230\225/java_podstawy/index.html" new file mode 100644 index 00000000..9be45943 --- /dev/null +++ "b/Java\342\230\225/java_podstawy/index.html" @@ -0,0 +1,2709 @@ + + + + + + + + + + + + + + + + Java podstawy - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + +
+
+ + + + + + + + +

Java podstawy

+

Narzędzia

+
    +
  • jshell – interpretator interaktywny ?jak importować w nim własne pakiety?
  • +
  • jlink – generacja modułu aplikacji
  • +
+

HelloWorld w javie

+
public class HelloWorldApp {
+    public static void main(String[] args) {
+        System.out.println("Hello world from Java!");
+    }
+}
+
+

Wszystko jest tu klasą, nasza apka też. Jeżeli chcemy, aby jakaś klasa zaczęła coś robić przy jej samodzielnym uruchomieniu to dodajemy funkcję: public static void main(String[] args)

+

Pakiety

+

W jednym pliku .java można zdefiniować wiele klas, ale tylko jedna z nich może bypubliczna i jej nazwa musi odpowiadać nazwie pliku.

+

Każda klasa należy do jakiegoś pakietu. Jeśli w pliku z kodem źródłowym klasy nie występuje na początku deklaracja przynależności tej klasy do konkretnego pakietu, wówczas klasa ta będzie należeć do domyślnego pakietu. +Klasy należące do tego samego pakietu mogą odwoływać się do siebie bez konieczności stosowania nazw kwalifikowanych (bez przedrostka)

+

Konwencja nazewnicza dla nazw pakietów: nazwa_firmy.nazwa_pakietu.

+
import java.applet.Applet;
+public class App extends Applet {////kod
+}
+//LUB
+public class App extends java.applet.Applet {////kod
+}
+
+

Klasa System jest zawarta w java.lang, importowanym automatycznie

+

Typy danych

+

Wbudowane – określone przez twórców języka +– typy proste (albo: typy dla wartości, value-type): zmienne tych typów zawierają wartości tychże typów +– typy referencyjne: zmienne tych typów zawierają odniesienie do tablicy lub obiektu, który reprezentują +Definiowane przez programistę +– klasy +– typy wyliczeniowe (enumeration)

+

Java ma statyczne typowanie tzn, że raz zdefiniowana zmienna nie zmienia swojego typu (jak np. w pythonie)

+

Wbudowane typy proste

+
    +
  • całkowitoliczbowe, kodowane U2
  • +
  • byte jednobajtowy
  • +
  • short dwubajtowy
  • +
  • int czterobajtowy
  • +
  • long ośmiobajtowy
  • +
  • zmiennoprzecinkowe, kodowane IEEE 754
  • +
  • float czterobajtowy
  • +
  • double ośmiobajtowy
  • +
  • inne
  • +
  • char dwubajtowy, kodowany Unicode (utf-16)
  • +
  • boolean wartość logiczna true lub false
  • +
+

do javy 11 można stosować identyfikator typu wywnioskowanego: +var s = "test";

+

Stałe

+

Literały – stałe bez nazwy, o typie wynikającym ze sposobu zapisu literału, np.

+ + + + + + + + + + + + + + + + + + + + + + + +
78,8864L,37.266,37.266D,37.266F,’c’,true, null
intlongdoubledoublefloatcharboolean
+

oraz łańcuchy znaków, typu String: "ala ma kota" +Stałe symboliczne – stałe opatrzone nazwą i jawną deklaracją typu

+
final typ NAZWA_STAŁEJ = wartość;
+//np.
+final float PI= 3.14;
+
+

Lokalną stałą symboliczną można zainicjować później – najpierw wystąpi sama +deklaracja, a później przypisanie pierwszej (i ostatecznej) wartości.

+
final int STAŁA_CZYSTA; // Definicja stałej
+/**/
+STAŁA_CZYSTA = 0; // Inicjalizacja stałej
+
+

Typ wyliczeniowy

+
enum Season { WINTER, SPRING, SUMMER, FALL }
+
+

– kompilator sprawdza zgodność typu +– może być użyty w instrukcji switch

+
Season anything=Season.WINTER;
+switch(anything){
+case SUMMER: System.out.println("Lato");
+//…
+}
+
+

Referencja

+

Referencja to zmienna, której wartością jest adres. +Typy referencyjne:

+
    +
  • tablice,
  • +
  • klasy,
  • +
  • interfejsy.
  • +
+

Zmienna referencyjna odnosi się do miejsca pamięci, w którym pomieszczono daną lub +wektor danych reprezentowanych tą zmienną. +Java nie zna typu wskaźnikowego, tzn. jawnego korzystania z adresów.

+

Konwencje nazewnicze dla nazw zmiennych i klas

+
    +
  • nazwa zmiennej rozpoczyna się małą literą,
  • +
  • nazwa klasy rozpoczyna się wielką literą,
  • +
  • kolejne słowa w nazwie rozpoczyna się wielką literą, np. isVisible,
  • +
  • znak podkreślenia (_) jest wprawdzie poprawny w nazwie, ale powinien być używany jedynie w nazwach stałych.
  • +
+

Cykl życia obiektu

+
    +
  1. Utworzenie zmiennej typu referencji do obiektu (typ nazwa;) Dla typu klasy lub interfejsu zmienna przechowuje adres do obiektu klasy – nie jest on dostępny bezpośrednio, lecz stanowi referencję. Do momentu przypisania jej adresu ma ona wartość zerową (null).
  2. +
  3. Utworzenie obiektu (new alokuje obszar pamięci) nazwa=new typ(argumenty) Operator new zwraca referencję do nowo utworzonego obiektu.
  4. +
  5. Inicjalizacja -wywołanie konstruktora
  6. +
  7. Używanie
  8. +
  9. Usuwanie obiektu - "Garbage Collector" środowisko samodzielnie usuwa obiekt, jeżeli wykryje, że już więcej nie będzie używane w programie, wywołuje się on samoczynnie co jakiś czas, ale można to zrobić ręcznie System.gc()
  10. +
  11. Ewentualne wykonanie metody finalize() dziedziczona po klasie Obiect- pozwala wykonać dodatkowe czynności związane z usuwaniem obiektu
  12. +
+

Operatory

+

Operator – funkcja podana w notacji operatorowej - z 1, 2 lub 3 argumentami +(operandami).

+
    +
  • 1-argumentowe operatory mogą być przedrostkowe i przyrostkowe: + operator operand // notacja przedrostkowa + operand operator // notacja przyrostkowa
  • +
  • przedrostkowe i przyrostkowe ++ i --
  • +
  • 2-argumentowe operatory występują pomiędzy swoimi operandami: + operand1 operator operand2
  • +
  • Działania matematyczne+,-,*,/,%
  • +
  • Porównania >,>=,==,<=,<,!=
  • +
  • Tylko dla wartości logicznych:
      +
    • && , & "and"
    • +
    • ||, | "or"
    • +
    • ! negacja
    • +
    • ^ op1 ^ op2 true, gdy op1 i op2 mają różne wartości
    • +
    +
  • +
  • Przesunięcia
      +
    • >> np op1>>op2 przesuń op1 w prawo o op2 bitów
    • +
    • << np op1<<op2 przesuń op1 w lewo o op2 bitów
    • +
    • >>> op1>>>op2 przesuń op1 w prawo o op2 bitów, zastępując bit znaku zerem
    • +
    +
  • +
  • Bitowe logiczne
      +
    • & op1 & op2 iloczyn bitowy op1 i op2
    • +
    • | op1 | op2 suma bitowa op1 i op2
    • +
    • ^ op1 ^ op2 bitowa różnica symetryczna op1 i op2
    • +
    • ~ ~op bitowa negacja op
    • +
    +
  • +
  • Przypisania
      +
    • op1=op2
    • +
    • *=,+=,-=,|=,%=itp...
    • +
    +
  • +
  • 3-argumentowy operator (jedyny w Javie): + operand1 ? operand2 : operand3
  • +
  • op1?op2:op3 gdy op1 jest „true”, zwraca op2, w przeciwnym razie zwraca op3
  • +
  • Inne
  • +
  • typ[]/typ[liczba] deklaracja tablicy
  • +
  • op[liczba] pobranie elementu z tablicy
  • +
  • (typ)op konwersja wyrażenia op do typu typ
  • +
  • net op1 utowrzenie obiektu lub tablicy
  • +
  • op1 instanceof op2 zwraca „true”, gdy obiekt op1 jest instancją klasy op2
  • +
+

Za wyjątkiem operatora + używanego też do łączenia napisów, operatory arytmetyczne są przeznaczone tylko dla operandów liczbowych.

+

Kolekcje

+

Kolekcja to obiekt:

+
    +
  • zawierający wiele elementów (teoretycznie dowolna liczba, nieokreślona zawczasu),
  • +
  • udostępniający operacje
  • +
  • wstawiania,
  • +
  • przeglądania,
  • +
  • usuwania.
  • +
  • stosowany do magazynowania, przetwarzania i transmisji danych.
  • +
+

Biblioteka kolekcji w Javie:

+
    +
  • Interfejsy – definiujące zachowanie kolekcji,
  • +
  • Implementacje interfejsów (na różne sposoby),
  • +
  • Algorytmy – typowe operacje na kolekcjach różnego rodzaju
  • +
+

Kolekcje w Javie zostały umieszczone w java.util. +Mimo, że w java.util występuje interfejs Collection, nie wszystkie +kolekcje go implementują czy dziedziczą. Dlatego terminu kolekcja +używamy w szerszym sensie.

+

Kolekcje a typy uogólnione:

+
    +
  • Wersje podstawowe – nieparametryzowane typem przechowywanych danych – np. List.insert(Object o)
  • +
  • Wersje parametryzowane typem – np. List<MojTyp>.insert(MojTyp o)
  • +
  • Klasy parametryzowane typem - przykład
  • +
+
public class CircularBuffer<T> {
+    private T[] buffer;
+    private int head = 0, tail = 0;
+
+    public CircularBuffer() {
+        buffer = (T[]) new Object[10];
+    }
+
+    public void add(T f) {
+        if (head == tail - 1) // nadpisanie
+            tail = ++tail % buffer.length;
+        buffer[head++] = f;
+        head = head % buffer.length;
+    }
+
+    public T get() {
+        int adjTail = tail > head ? tail - buffer.length : tail;
+        if (adjTail < head) {
+            T t = buffer[tail++];
+            tail = tail % buffer.length;
+            return t;
+        } else {
+            throw new Error();
+        }
+    }
+}
+
+

Posługując się interfejsami, możemy tworzyć algorytmy operujące na kolekcjach niezależnie od sposobu, w jaki zaimplementowano kolekcję (programowanie abstrakcyjne) +alt text +Są 2 niezależne hierarchie: „właściwych kolekcji” oraz wykazy asocjacyjne, czyli kolekcje par {klucz,wartość}. +Oprócz tego dysponujemy obiektami do przeglądania kolekcji: +jednokierunkowym (Iterator) i dwukierunkowym (ListIterator). Kolekcje można również przeglądać, korzystając z obiektów funkcyjnych w połączeniu z metodą forEach().

+

Podstawowe zależności pomiędzy interfejsami kolekcji:

+
    +
  • Collection określa zachowanie najogólniejszego zbioru obiektów,mogącego zawierać obiekty identyczne
  • +
  • Set „rozszerza” Collection: nie dopuszcza duplikatów
  • +
  • List rozszerza Collection, dopuszczając indeksowanie przez pozycję obiektu
  • +
  • Map definiuje funkcjonalności podobne do Collection, ale nie jest z nim spokrewniony
  • +
+

Metody interfejsów

+

Collection i Iterator:

+
    +
  • Metody „jednostkowe” + add, contains, remove
  • +
  • Metody zbiorcze + addAll, containsAll, removeAll, retainAll (dla teorii zbiorów różnica zbiorów iloczyn itp.)
  • +
  • Inne + clear, isEmpty, size, toArray
  • +
  • iterator – produkuje nowy iterator (na początku na nic nie wskazuje, jest przed pierwszym elementem)
  • +
  • hasNext
  • +
  • next - przeskakuje dalej i zwraca kolejny element (wskazywał pierwszy, po przeskoku zwraca drugi itd.)
  • +
  • remove – usuwa ostatnio „przeskoczony” element
  • +
  • forEach(), Spliterator – do iterowania równoległego (pojedynczego lub w blokach)
  • +
+

Interfejs Map:

+
    +
  • get(key)
  • +
  • containsKey(key)
  • +
  • containsValue(value)
  • +
+

alt text

+

Parametryzacja np: +Map<String,Float>

+

Standardowe algorytmy: klasa Collections +• sort – sortowanie listy +• binarySearch – przeszukiwanie metodą bisekcji +• shuffle – tasowanie elementów +• reverse – odwrócenie kolejności elementów +• rotate – przesunięcie elementów +• fill – nadanie wszystkim elementom takiej samej wartości +• copy, swap, addAll (typowe działania pomocnicze) +• binarySearch – wyszukiwanie w liście +• frequency – zliczanie wystąpień +• disjoint – test rozłączności +• min, max – szukanie ekstremów

+

Uporządkowanie elementów kolekcji

+

Mamy dwa sposoby porządkowania kolekcji obiektów:

+
    +
  • Interfejs Comparable zapewnia automatyczny naturalny porządek dla klas go implementujących. + W interfejsie deklarowana jest metoda compareTo(obj)
  • +
  • Interfejs Comparator umożliwia programiście wyznaczenie własnego sposobu porządkowania obiektów.
  • +
+

Implementacje Biblioteczne kolekcji

+

alt text +Właściwości:

+
    +
  1. Implementują wszystkie opcjonalne operacje + Mamy gwarancję, że nie wystąpi UnsupportedOperationException
  2. +
  3. Nie są synchronizowane + Mamy gwarancję, że przy współbieżnej modyfikacji i przeglądaniu wystąpi + ConcurrentModificationException
  4. +
  5. +

    Są serializowalne i posiadają metodę clone().

    +
  6. +
  7. +

    HashSet – funkcja skrótu indeksuje miejsce w tablicy, gdzie znajduje się element; jeśli skrót się powiela, tworzona jest lista elementów. Średni czas dostępu do elementu praktycznie stały. Tablica może zmieniać swój rozmiar.

    +
  8. +
  9. LinkedHashSet – j.w. ale zapamiętuje kolejność dodania elementów do zbioru; minimalnie wolniejsza.
  10. +
  11. TreeSet – elementy przechowywane w posortowanym i wyważonym drzewie binarnym (wymaga określenia relacji większości na elementach)
  12. +
  13. ArrayList – zapewnia stały czas wykonywania operacji size, +isEmpty, get, set, iterator i listIterator oraz stały czas operacji add.
  14. +
  15. LinkedList – implementacja wykorzystująca listy dwukierunkowe. W związku z tym realizacja dostępu do elementów tej kolekcji za pomocą indeksów jest nieefektywna. Natomiast może być szybsza od ArrayList w przypadku częstego usuwania i wstawiania elementów. Ponadto implementuje interfejsy Queue i Deque, więc nadaje do implementowania stosów i kolejek. LinkedList zawiera min. operacje addFirst, getFirst, removeFirst, addLast, getLast, removeLast.
  16. +
+

Instrukcje sterujące (pętle i warunki)

+
while (wyrażenie) {
+    instrukcje
+} // Wykonuj pętlę gdy wyrażenie jest prawdziwe
+
+do {
+    instrukcje
+} while (wyrażenie);
+// Sprawdzenie warunku następuje po zakończeniu pętli
+
+for (inicjalizacja; warunek; inkrementacja) {
+instrukcje
+} // Wszystkie trzy wyrażenia są opcjonalne; może być: for(;;)
+
+for (typ zm_lokalna:ref_obiekt_iterowany_lub_tablica) {
+instrukcje
+}
+
+if( wyrażenie ) {
+    instrukcje
+} else {
+    instrukcje
+}
+
+switch( zmienna ) {
+    case wartość1: instrukcje; break;
+    case wartość2: instrukcje; break;
+    
+    default: instrukcje; break;
+}
+
+

Słowa kluczowe:

+
    +
  • break bez etykiety – kończy wykonywanie aktualnej wewnętrznej instrukcji sterującej switch, for, while, do-while
  • +
  • instrukcja break z etykietą – kończy wykonywanie zewnętrznego switch, for, while, do-while o danej etykiecie: + break etykieta_instrukcji;
  • +
  • continue kończy bieżącą iterację wewnętrznej pętli
  • +
  • continue z etykietą -analogicznie
  • +
  • return – powrót z wykonywanej metody
  • +
+

Klasa

+

Definicja klasys kłada się z

+
    +
  • nagłówka definicji klasy
  • +
  • class nazwa_klasy (obligatoryjnie)
  • +
  • specyfikacje: dostępu i dziedziczenia (opcjonalnie)
  • +
  • bloku definicji klasy
  • +
+

Specyfikacje domyślne klasy:

+
    +
  • niepubliczna (istnieją restrykcje dostępu)
  • +
  • nieabstrakcyjna (można tworzyć obiekty tej klasy)
  • +
  • niefinalna (może mieć klasy pochodne)
  • +
  • dziedziczy niejawnie po klasie Object
  • +
  • nie implementuje niejawnie żadnych interfejsów
  • +
+

Specyfikacje dodatkowe (niedomyślne) klasy:

+
    +
  • public – klasa jest dostępna dla wszystkich klas (domyślnie: tylko dla klas z tego samego pakietu)
  • +
  • abstract – nie można tworzyć obiektów tej klasy
  • +
  • final – nie można dziedziczyć z tej klasy
  • +
  • extends klasa_bazowa – deklaruje dziedziczenie po klasie bazowej
  • +
  • implements interfejs1, interfejs2 – deklaruje implementowanie jednego lub więcej interfejsów
  • +
+

Blok definicji klasy – ograniczony parą nawiasów klamrowych, zawiera

+
    +
  • deklaracje wszystkich zmiennych składowych - pól (w tym obiektów i pól statycznych)
  • +
  • deklaracje i definicje wszystkich funkcji składowych - metod (w tym metod wywoływanych na rzecz obiektu lub metod statycznych)
  • +
  • ewentualnie, definicje jednego lub więcej konstruktorów
  • +
+

Konstruktory +Nazwy konstruktorów są takie same jak nazwa konstruowanej klasy. +Wywołania konstruktorów: +new Stack(); +new Stack(123); +Odpowiednikiem destrukotrów jest metoda finalize() +Jeśli w klasie nie zdefiniowano żadnego konstruktora, tworzony jest automatycznie domyślny konstruktor (pusty) +Klasy dziedziczące korzystają z konstruktora pustego, jeżeli go nie ma to należy samodzielnie wywołać inny +Konstruktory – specyfikacja dostępu

+
    +
  • private - żadna inna klasa nie może bezpośrednio użyć takiego konstruktora do tworzenia obiektów danej klasy
  • +
  • protected – obiekty mogą być tworzone przez klasy pochodne danej klasy i klasy należące do tego samego pakietu
  • +
  • public - każda klasa może tworzyć obiekty danej klasy
  • +
  • brak specyfikatora dostępu - każda klasa z tego samego pakietu może tworzyć obiekty danej klasy
  • +
+

Pola klasy

+

Specyfikatory

+
    +
  • private, public, protected, (package) – specyfikacja dostępu
  • +
  • static – deklaracja pola statycznego (przynależnego do klasy, a nie – jej obiektów)
  • +
  • final – deklaracja pola stałego
  • +
  • transient – specyfikacja pola, które nie powinno podlegać serializacji
  • +
  • volatile – specyfikacja pola ulotnego, niepodlegającego optymalizacji: przypisanie zmiennej wartości odbywa się zawsze w pamięci (współdzielonej przez wątki), a nie w rejestrze procesora, więc jest od razu widoczne dla współbieżnych wątków
  • +
+

Dostęp do pól

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Specyfikator DostępuKlasaPodklasa z tego samego pakietuPodklasy z innego pakietuWszystkie klasy
private✔️
protected✔️✔️✔️
public✔️✔️✔️✔️
(package)✔️✔️
+

*Tylko przy odwołaniu niejawnym do pól klasy bazowej

+

Pole i metoda jednej klasy mogą nosić taką samą nazwę:

+
public class CircularBuffer{
+private float[] buffer; // pole buffer
+private float[] buffer(); // metoda buffer
+}
+
+

Inicjalizacja

+

Składowe zwykłe i statyczne mogą być inicjalizowane w miejscu +deklaracji. Np.:

+
public class StaticInit {
+    static int MAX_LINES = 1000;
+    int maxLines = 300;
+}
+
+

Ograniczenia inicjalizowania w miejscu deklaracji:

+
    +
  • wykonywana tyko operatorem przypisania.
  • +
  • tylko wyrażeniem, które nie deklaruje, że może zgłosić wyjątek.
  • +
  • wystąpienie wyjątku w wyrażeniu kończy program.
  • +
+

W każdym innym przypadku trzeba użyć bloku statycznej inicjalizacji lub konstruktora.

+
public class StaticInit {
+    static int MAX_LINES;
+    static {//Przykład dla bloku inicjalizacji
+        try{
+            MAX_LINES = Integer.parseInt(new java.util.Properties().getProperty("maxLinesLimit"));
+        }
+        catch(Exception e){ // obsługa wyjątku
+        }
+    }
+}
+
+

Liczba bloków statycznej inicjalizacji w programie jest dowolna (wykonywane wg ich kolejności wystąpienia w kodzie źródłowym).

+

Metody

+

Deklaracja metody – specyfikacja

+
    +
  • poziomu dostępu
  • +
  • typu wyniku
  • +
  • nazwy
  • +
  • listy argumentów formalnych (typy proste lub referencje do obiektów) + public Object push(Object item)
  • +
+

Wszystkie możliwe elementy nagłówka definicji metody (w ich kolejności)

+
    +
  • poziom dostępu - public, protected, package, private
  • +
  • static - deklaruje metodę jako statyczną
  • +
  • abstract – metoda nie posiada definicji, jej klasa musi być abstrakcyjna
  • +
  • final - nie może być nadpisana przez metody klas pochodnych
  • +
  • native - metoda rodzima, napisana w innym języku programowania
  • +
  • synchronized – może być jednocześnie wykonywana (na rzecz konkretnego obiektu) tylko przez jeden wątek
  • +
  • typ wyniku OBOWIĄZKOWE
  • +
  • nazwa metody OBOWIĄZKOWE
  • +
  • lista parametrów (w nawiasach) OBOWIĄZKOWE
  • +
  • throws wyjątki - lista wyjątków zgłaszanych przez metodę
  • +
+

Wynik metody +Można zwrócić

+
    +
  • nic -void return;
  • +
  • zmienną np int return 10;
  • +
  • +

    obiekt (referencja) np. return new String();

    +
  • +
  • +

    Metody przeciążone różnią się liczbą lub typem parametrów

    +
  • +
  • Metoda nadpisana (polimorficzna) ma tę samą sygnaturę, co metoda w klasie bazowej. Nie może rozszerzać zbioru zgłaszanych wyjątków.
  • +
+

Odwołania w metodach

+
    +
  • this-odwołanie do obiektu, na rzecz którego wykonywana jest metoda
  • +
  • super - odwołanie do "nadobiektu", określonego przez klasę bazową
  • +
+

Dziedziczenie

+
    +
  • Można dziedziczyć (extends) tylko z jednej klasy
  • +
  • Wszystkie obiekty dziedziczą (niejawnie, obowiązkowo, pośrednio lub bezpośrednio) z klasy java.lang.Object
  • +
  • Klasa pochodna dziedziczy wszystkie składowe, które są dostępne dla niej i których sama nie przesłania (pola) lub nie nadpisuje (metody)
  • +
  • Konstruktorów nie dziedziczy się
  • +
  • Nadpisana metoda może deklarować zgłaszanie tylko podzbioru wyjątków zgłaszanych przez metodę dziedziczoną.
  • +
  • +

    Specyfikator dostępu do metody nadpisanej może zezwolić na większy dostęp niż metoda dziedziczona ale nie na mniejszy. Np. metoda chroniona (protected) w klasie bazowej może zostać upubliczniona, ale nie "uprywatniona"

    +
  • +
  • +

    Metody klasy bazowej, których nie można nadpisać w klasie pochodnej:

    +
  • +
  • metoda zadeklarowana jako final w klasie bazowej
  • +
  • metoda statyczna (można jedynie ukryć metodę statyczną dziedziczoną przez jej ponowne zadeklarowanie)
  • +
  • Metody klasy bazowej, które muszą zostać nadpisane w klasie pochodnej:
  • +
  • metody zadeklarowane jako abstrakcyjne w klasie bazowej
  • +
  • wszystkie metody bazowej klasy abstrakcyjnej
  • +
+

Dziedziczenie po java.lang.Object +Metody klasy Object, które mogą być nadpisane:

+
    +
  • clone
  • +
  • equals, hashCode - porównywanie obiektów
  • +
  • finalize - destruktor
  • +
  • toString - zamienia obiekt w klasę String pozwalając na "tekstowy wydruk" zawartości za pomocą System.out.println
  • +
+

Metody final (nie mogą być nadpisane):

+
    +
  • getClass -Metoda zwraca reprezentację "run-time" klasy obiektu w postaci obiektu typu Class. Można dowiedzieć się z niego o nazwie klasy, jej klasie bazowej i interfejsach, które implementuje klasa
  • +
+
void PrintClassName(Object obj) {
+        System.out.println("Klasa obiektu to "+ obj.getClass().getName()); }
+Object createNewInstanceOf(Object obj) {
+    return obj.getClass().newInstance(); //Nowa instancja tego samego obiektu
+    }
+
+
    +
  • notify
  • +
  • notifyAll
  • +
  • wait
  • +
+

Interfejs

+

Interfejs – typ referencyjny, zawierający deklaracje metod, implementacje domyślne metod, pola stałe, metody statyczne, interfejsy i klasy

+
[modyfikatory] interface NazwaInterfejsu [extends Interfejs1,]
+{
+   // ciało interfejsu
+}
+
+

Interfejs jest domyślnie publiczny i obowiązkowo abstrakcyjny +Metody interfejsu – domyślnie publiczne; albo abstrakcyjne, albo domyślne, albo statyczne +Pola interfejsu – domyślnie publiczne, statyczne i finalne.

+

Przykład

+
interface A {int i=2;}
+interface B {void foo();}
+interface C extends A, B{
+    int i=3; //przesłoni to i z interfejsu A
+}
+class D implements C{
+    void foo(){System.out.println(i);}
+}
+
+

implementacje domyślne i statyczne metod

+
public interface Addressable {
+    String getStreet();
+    String getCity();
+    default String getFullAddress() {
+        return getStreet()+", "+getCity();
+    }
+    static void foo(){
+        System.out.println("foo");
+}
+
+

Umożliwiają zdefiniowanie metod, których działanie jest niezależne od potencjalnych sposobów implementacji interfejsu. +Metody domyślne mogą być nadpisywane w klasach implementujących interfejs.

+

Wyjątki

+

Java wymaga, aby metody obsługiwały lub specyfikowały wszystkie sprawdzalne +wyjątki, które mogą wystąpić podczas wykonania programu. +Wyjątki, które są powodowane przez złą logikę samego programu (np. błędy +arytmetyczne lub błędy dostępu do pamięci danych programu), nie są sprawdzane przez kompilator. Nie ma wymogu ich obsługi lub deklarowania ich wystąpienia. +Np. są nimi:

+
    +
  • wyjątki arytmetyczne (np. dzielenie przez zero),
  • +
  • wyjątki wskazań (np. próba odwołania do obiektu poprzez zerową referencję, próba rzutowania na obiekt niewłaściwej klasy),
  • +
  • wyjątki indeksowania (np. odwołanie do elementu tablicy poprzez zły indeks).
  • +
+

Wyrzucenie wyjątku: +throw obiekt +Obsługa:

+
try {
+    instrukcje // tu może wystąpić throw
+} catch (typ_wyjątku|inny_typ nazwa) { // obsługa wyjątków dwóch typów
+    instrukcje
+} finally { // wykonywana zawsze niezależnie od zaistnienia wyjątku
+    instrukcje
+}
+
+

Jako wyjątek może być zgłoszony jedynie obiekt klasy Throwable lub klasy pochodnej od Throwable. W innym razie wystąpi błąd kompilacji

+

Hierarchia klas wyjątków

+
    +
  • Error. Błąd dynamicznej konsolidacji programu lub inny "ciężki" błąd w JVM. Programy nie powinny obsługiwać ani zgłaszać takich wyjątków. (błąd w maszynie albo np brak pamięci itp.)
  • +
  • Exception. Jest to klasa bazowa wyjątków w programach Javy. Są już liczne klasy pochodne tej klasy, np. IllegalAccessException, NegativeArraySizeException.
  • +
  • RuntimeException. Specjalna klasa pochodna od Exception, która dotyczy wyjątków niesprawdzalnych, zgłaszanych przez Runtime (środowisko czasu wykonania programu). np dzielenie przez 0
  • +
+

Delegowanie wyjątków "w górę"

+
 public class Example3 {
+    public static void notMainYet(String[] args) throws IOException {
+    try(BufferedReader br = new BufferedReader(new FileReader("/testing.txt")))
+    {
+        String line;
+        while ((line = br.readLine()) != null) {
+            System.out.println(line);
+        }
+    }
+}
+
+
try{
+    notMainYet(null);
+}
+catch(IOException e){
+    e.getSuppressed(); // zwraca tablicę wyjątków powstałych przy zwalnianiu zasobów
+}
+
+

Kompilator automatycznie generuje niejawny blok finally z kodem bezpiecznie zamykającym zasoby.

+

Moduł

+

Moduł grupuje powiązane ze sobą pakiety, określając, które z nich zostaną udostępnione oraz to jakie pakiety i moduły są jemu potrzebne.

+

Budowa:

+
    +
  • Katalog bazowy (root direcotry) modułu nazwany tak samo jak nazwa modułu.
  • +
  • deskryptor modułu module-info.java -zawiera opis modułu
  • +
+
module com.mycompany.factories {
+    exports com.mycompany.interfaces;  //exports opisuje które paczki mają być dostępne w pozostałych modułach
+    exports com.mycompany.factories;
+
+    requires modulename;  //requires opisujeod jakich modułów zależy ten moduł
+}
+
+

exports and exports…to. An exports module directive specifies one of the module’s packages whose public types (and their nested public and protected types) should be accessible to code in all other modules. An exports…to directive enables you to specify in a comma-separated list precisely which module’s or modules’ code can access the exported package—this is known as a qualified export.

+

uses. A uses module directive specifies a service used by this module—making the module a service consumer. A service is an object of a class that implements the interface or extends the abstract class specified in the uses directive.

+

provides…with. A provides…with module directive specifies that a module provides a service implementation—making the module a service provider. The provides part of the directive specifies an interface or abstract class listed in a module’s uses directive and the with part of the directive specifies the name of the service provider class that implements the interface or extends the abstract class. +//TODO

+

javac --module-source-path . -d out -m com.mycompany.factories

+
import com.mycompany.interfaces.*;
+import com.mycompany.factories.*;
+
+public class Test{
+    public static void main(String args[]){
+        RestClientInterface i = RestClientFactory().makeClient(null,null);
+        String[] query = {"key?2389fg38","loc:21.1,50.9"};
+        i.runQuery(query);
+    }
+}
+
+

Kompilacja: +javac --module-path out --add-modules com.mycompany.factories Test.java

+

Uruchomienie: +java --module-path out --add-modules com.mycompany.factories Test

+

//TODO Beans + Swing (w3 i w4 w6)

+

Programowanie współbieżne

+

Uruchomienie nowego wątku – zadanie do wykonania przez nowy wątek zdefiniowane w metodzie run()

+

Są 2 sposoby:

+

Klasa implementująca Runnable

+
public class MyRunnable implements Runnable {
+    public void run() {
+        System.out.println("Hello from a thread!");
+    }
+    public static void main(String args[])
+    {
+        (new Thread(new MyRunnable())).start();
+    }
+}
+
+

Klasa dziedzicząca po Thread

+
public class HelloThread extends Thread {
+    public void run() {
+    System.out.println("Hello from a thread!");
+    }
+    public static void main(String args[])
+    {
+        (new HelloThread()).start();
+    }
+}
+
+

Diagram stanów wątku

+
class MyThread extends Thread{public void run(){}}
+
+

alt text

+

Przyczyny blokowania wątków

+

alt text

+

III

+
public class Test3 {
+    public static void main(String args[]) {
+        Thread p = new Producent();
+        p.setDaemon(true);
+        p.start();
+        try {
+            p.join(); //join-oczekiwanie
+        }
+        catch(InterruptedException e)
+        {
+            e.printStackTrace();
+        }
+    }
+}
+
+

IV

+

słowo kluczowe synchronized sprawia, że dane obiekty /metody nie mogą być używane dednocześnie przez kilka wątków i jeżeli jeden wątek właśnie korzysta z takiego obiektu to wszystkie pozostałe muszą poczekać

+
class Schowek {int wartosc = -1;}
+class Producent []
+    Schowek schowek;
+    Producent(Schowek s) {schowek=s};
+    public void run []
+    System.out.print(" p"+i);
+    synchronized(schowek) {
+    schowek.wartosc=i;
+} []
+
+class Konsument []
+    public void run() {
+        try
+        {
+            for(int i=0; i<6; i++)
+            {
+                int w;
+                synchronized(schowek) {
+                    w=schowek.wartosc;
+                }
+            System.out.print(" k"+w);
+            sleep((long)(Math.random()*3000));
+    }
+} []
+    public static void main(String args[]) {
+        Schowek s = new Schowek();
+        Thread p = new Producent(s);
+        Thread k = new Konsument(s);[]
+
+

V +Tak jak ma to miejsce w monitorach

+
class Schowek []
+    boolean jestZapelniony = false; []
+
+class Producent []
+    synchronized(schowek) {
+        while( schowek.jestZapelniony )
+            schowek.wait();
+        schowek.wartosc=i;
+        schowek.jestZapelniony=true;
+        schowek.notifyAll();
+    } []
+
+class Konsument []
+    synchronized(schowek) {
+        while(!schowek.jestZapelniony )
+            schowek.wait();
+        w=schowek.wartosc;
+        schowek.jestZapelniony=false;
+        schowek.notifyAll();
+}
+
+

Przy takim schemacie działania należy zawsze:

+
    +
  • Sprawdzać zmienną warunkową w schemacie while(warunek) wait() […] notify/All()
  • +
  • Pamiętać o nadaniu zmiennej warunkowej odpowiedniej wartości (unikanie zakleszczeń)
  • +
  • Obsługiwać monitor po zajęciu zamka (IllegalStateException)
  • +
+

java.util.concurrent.locks.*

+

Obiekty ułatwiające synchronizację wątków - Połączenie funkcjonalności zamka i monitora w jednym obiekcie, implementującym interfejs Lock

+
    +
  • Ułatwienie podziału i obsługi wątków oczekujących na zasób ze zróżnicowanymi warunkami wznowienia – obiekt Condition
  • +
  • Dodatkowe możliwości, w zależności od implementacji – np. wybór strategii aktywacji wątków wznawianych do wykonania (ReentrantLock)
  • +
+
void schowaj(int i) []
+    zamek.lock();
+    while(!warunek_zapisu)
+        zapis.await();
+    [] // zapis do bufora
+    odczyt.signal();
+[] finally {zamek.unlock();}
+
+void schowaj(int i) []
+    zamek.lock();
+    while(!warunek_zapisu)
+        zapis.await();
+    [] // zapis do bufora
+    odczyt.signal();
+[] finally {zamek.unlock();}
+
+

//TODO fork/join

+

Sieć

+

Dwa podstawowe rodzaje protokołów oparte na IP: +▪ TCP – Transmission Control Protocol – połączeniowy kontroluje poprawność przesłanych danych, dostosowuje się do przepustowości łącza, wymagając informacji zwrotnej od odbiorcy +▪ UDP – User Datagram Protocol – bezpołączeniowy całe sterowanie transmisją pozostawione użytkownikowi, możliwość transmisji rozgłoszeniowej

+

Pakiet java.net zawiera podstawowe klasy związane z komunikacją sieciową: URL, socket i pochodne, itp

+

TCP - przykładowy serwer:

+
import...
+public class MyHttpServer {
+    public static void main(String[] args) throws Exception {
+        ServerSocket sSocket = new ServerSocket(1777);
+        while(true) {
+            Socket newSocket = sSocket.accept(); //zawiesza w oczekiwaniu na połączenie
+            OutputStream os = newSocket.getOutputStream();
+            StringBuffer sb = new StringBuffer();
+            sb.append("<html><body>HTTPServer works!</body></html>");
+            byte[] byteArray = sb.toString().getBytes();
+            os.write("HTTP/1.0 200 OK\n".getBytes());
+            os.write(new String("Content-Length: "+byteArray.length+"\n").getBytes());
+            os.write("Content-Type: text/html\n\n".getBytes());
+            os.write(byteArray);
+            os.flush();
+            os.close();
+            br.close();
+            newSocket.close();
+        }
+    }
+}
+
+

http://www.java2s.com/Code/Java/Network-Protocol/BufferedReaderforServerSocket.htm

+

RMI - Remote Method Invocation

+

Pozwala odnosić się poprzez referencję do obiektów na innych maszynach

+

Hello world of RMI – wywołanie zwrotne

+

Klient udostępnia usługę:

+
public interface Callback extends Remote{
+    public void callback() throws RemoteException;
+}
+public static class CallbackImpl extends UnicastRemoteObject implements Callback{
+    protected CallbackImpl() throws RemoteException {
+        super();
+    }
+    public void callback(){
+        System.out.println("Hello from the callback");
+    }
+}
+
+

Serwer definiuje nową usługę (asynchroniczną):

+
public void hello(Object o) throws RemoteException{
+    ((Client.Callback)o).callback();
+}
+
+

Wywołanie u klienta:

+
worker.hello(UnicastRemoteObject.toStub(new CallbackImpl()));
+
+

Java Messaging System (JMS)

+

Komunikacja pomiędzy wieloma JVM – typowe zadania: +▪ kolejka komunikatów (z buforowaniem) +▪ transmisja rozgłoszeniowa do wybranych odbiorców +▪ filtrowanie komunikatów w transmisji rozgłoszeniowej +▪ synchroniczne i asynchroniczne modele komunikacji +▪ zarządzanie trwałością i ważnością komunikatów (data ważności, priorytet, przechowywanie, gdy nie ma odbiorcy) +▪ gwarancja dostarczenia +▪ grupowanie serii komunikatów w niepodzielną transakcję +▪ również: komunikacja z komponentami stworzonymi w innych językach

+

//TODO jms

+

Atrybuty Systemowe

+

Są to dane na temat środowiska takie jak:

+
    +
  • nazwa komputera
  • +
  • nazwa użytkownika
  • +
  • katalog roboczy
  • +
  • identyfikator systemu operacyjnego
  • +
  • itp
  • +
+

Atrybuty przechowywane w postaci par: (nazwa,wartość). +Ustawiane na trzy sposoby:

+
    +
  • ładowane przez klasę java.util.Properties – na sposób trwały między uruchomieniami maszyny wirtualnej
  • +
  • poprzez argumenty wiersza poleceń – na czas wykonania aplikacji -Dnazwa=wartość
  • +
  • poprzez parametry apletu – na czas wykonania apletu
  • +
+

+

Metody klasy Properties:

+
    +
  • contains(Object value), containsKey(Object key) – sprawdzają, czy obiekt zawiera daną wartość bądź nazwę atrybutu (podawane jako String)
  • +
  • getProperty(String key), getProperty(String key, String default)–zwraca wartość danego atrybutu / wartość domyślną jeśli atrybut nie istnieje
  • +
  • setProperty(String key, String value) – zapisuje wartość atrybutu
  • +
  • list(PrintStream s), list(PrintWriter w) – zapisuje wszystkie własności do strumienia
  • +
  • elements(), keys() – zwraca iteratory wartości i nazw atrybutów
  • +
  • +

    load(From)/store(ToXML) – umożliwia pobranie/zapis atrybutów (w formacie XML)

    +
  • +
  • +

    Załadowanie atrybutów przy starcie

    +
  • +
+
Properties p=new Properties();
+FileInputStream is=new FileInputStream("my.properties");
+p.load(is);
+is.close();
+
+
    +
  1. +

    Odczyt/wykorzystanie/modyfikacja atrybutów podczas pracy programu

    +
  2. +
  3. +

    Zapamiętanie (zmodyfikowanych) atrybutów przy wyjściu z programu

    +
  4. +
+
FileOutputStream os=new FileOutputStream("my.properties");
+p.store(os, "---No Comment---");
+os.close();
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Nazwa atrybutuOpis
file.separatorseparator nazw plików i katalogów
java.class.pathścieżka przeszukiwania klas Javy
java.class.versionwersja biblioteki systemowej Javy
java.homekatalog, w którym zainstalowano Javę
java.vendornazwa producenta używanego JRE
java.vendor.urladres www producenta używanego JRE
java.versionwersja Javy
line.separatorseparator wierszy tj. znak nowego wiersza
os.archarchitektura sprzętowa syst. operacyjnego
os.namenazwa systemu operacyjnego
os.versionwersja systemu operacyjnego
path.separatorseparator wpisów na ścieżce (set)
user.dirkatalog roboczy
user.homekatalog domowy użytkownika
user.namenazwa użytkownika uruchamiającego JRE
+

Runtime

+

Większość potrzeb aplikacji dostępu do systemu obsługuje klasa System. +W rzadkich przypadkach aplikacja może odwołać się bezpośrednio do środowiska czasu wykonania, reprezentowanego przez jeden obiekt klasy java.lang.Runtime, będący sprzęgiem aplikacji ze środowiskiem wykonania VM w systemie operacyjnym.

+
public static Runtime getRuntime();//zwraca akt. obiekt Runtime
+
+

Obiekt Runtime umożliwia m.in. +• wykonanie programu funkcją systemową exec +• pobranie informacji o liczbie dostępnych procesorów, pamięci operacyjnej +• zlecenie załadowania biblioteki dynamicznej +• bezwarunkowe zatrzymanie maszyny wirtualnej

+

//TODO wyżej też są todo

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Linux\360\237\220\247 i Bash/assets/linux_directories.jpeg" "b/Linux\360\237\220\247 i Bash/assets/linux_directories.jpeg" new file mode 100644 index 00000000..6c86fbc9 Binary files /dev/null and "b/Linux\360\237\220\247 i Bash/assets/linux_directories.jpeg" differ diff --git "a/Linux\360\237\220\247 i Bash/bash_cheatsheet/index.html" "b/Linux\360\237\220\247 i Bash/bash_cheatsheet/index.html" new file mode 100644 index 00000000..9c17b35d --- /dev/null +++ "b/Linux\360\237\220\247 i Bash/bash_cheatsheet/index.html" @@ -0,0 +1,1842 @@ + + + + + + + + + + + + + + + + Bash - podstawowe komendy ściągawka - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Bash - podstawowe komendy ściągawka

+

Szukanie pomocy

+

Sprawdzanie co jest czym oraz do czego służy

+
    +
  • man - manual
  • +
  • apropos - wyszukujemy nim słów kluczowych (np w opisach programów etc)
  • +
  • whatis -
  • +
  • file - opisuje typ pliku
  • +
+

Wyrażenia regularne

+

link do regexów

+

Pliki

+

Szukanie plików

+
find -name a*n.java
+
+

Rozmiary folderów

+

domyślne ls ni pokauje rozmiarów folderów. Do tego należy użyć komandy du

+
du -s /home/ja
+
+

Przydatne flagi:

+
    +
  • -s -pokaż tylko wybrany folder bez podfolderóœ
  • +
  • -h - human readable, zaokrągla do GB, MB etc.
  • +
  • --max-depth=2 - maksymalna głębokość przy pokazywaniu podfolderów
  • +
+

Pisanie do plików

+

Każda aplikacja ma wejście (stdin) oraz dwa wyjścia (stdout-zwykłe i stderr-dla błędów)

+

Z pomocą poniższych komend możemy przekierowywać wyjścia programów do urządzeń lub plików

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KomendaDziałanie
<deviceredirects stdin to the device
>>deviceredirects stdout to the device (appends to the end)
> deviceredirects stdout to the device (overwrites previous content)
2> deviceredirects stderr to the device (overwrites previous content)
2>&1redirects stderr to the device associated to stdout
+
cat logi.log | grep "10-10-2022" > logs_from_10-10-2022.log
+
+

Obróbka tekstu

+

Wyszukiwanie wzorca

+
cat PLIKI | grep wyszukiwane_slowo
+
+
grep -r . #przeszukanie wszystkich plików (nawet binarnych) w danym folderze
+
+

strings służy do wypisywania stringów z plików binarnych (dobrze współdziała z grep)

+
strings PLIK
+
+

Inne przydatne flagi grepa

+ + + + + + + + + + + + + + + + + + + + + +
-v --invert-matchodwrócony grep, przekazuje tylko to, co nie pasuje
-B, --before-context=ILEWypisz ILE linii po przed znaleziskiem wyświetlić
-A, --after-context=ILEWypisz ILE linii po znalezisku wyświetlić
+

Dzielenie dłuższych łańcuchów znaków

+

cut - proste wycinanie fragmentów tekstu

+
    +
  • -b byte - wydziela poszczególne bajty
  • +
+
echo "abcdefgh" | cut -b 1,3,5-6
+# acef
+
+
echo "qwer tyui xxx" | cut -d " " -f 2 #-d delimiter (separator) -f pole
+#tyui
+
+

-f przyjmuje liczby w następujących formatach: N, N-M, -M, N-, X,Y,Z

+

head - służy do pokazywania tylko wybranych linii.

+
cat ./dlugi_plik.log | head -n 100 #drukuje tylko 100 pierwszych linii
+
+

W wypadku, gdy chcemy wydzielić samą nazwę pliku ze ścieżki warto użyć komendy basename

+
basename /sciezka/do/pliku/plik.txt
+# plik.txt
+
+

Manipulacja tekstem

+

sed służy do nieco bardziej zaawansowanych manipulacji

+
echo "abcdefbc" | sed "s/bc/BC/" # zamień pierwszy pasujący ciąg (bc) na BC
+#aBCdefbc
+
+
TODO
+
+

Zmienne

+

Zmienną tworzymy za pomocą znaku =, który przypisuje wartość do dane identyfikatora. identyfikator=wartość.
+Aby uzyskać dostęp do zawartości używamy $ przed nazwą zmiennej.

+
$ msg=”Hello World”
+$ echo $msg
+Hello World
+
+

Wstawianie zmiennych w tekst

+

Jest kilka sposobów, aby mieć w sktyptach tekst, który jest zależny od sytuacji. Możemy do tego wykorzystywać:

+
    +
  • Zmienne /my/path/to/${EDITED_FILE}
  • +
  • +

    Wyniki funkcji ` dsd

    +
  • +
+

Argumenty

+

Każda funkcja, czy też skrypt bashowy może mieć przekazywane poprzez proste podanie ich po wywołaniu.

+

Dla skryptu:

+
#!/bin/bash
+
+wyprintuj_argument()
+{
+    #tutaj odwołujemy się do pierwszego argumentu przekazanego do funkcji
+    #a nie do skryptu
+    echo "argument $1"
+}
+
+wyprintuj_argument $1
+wyprintuj_argument $2
+
+

przy wywołaniu ./skr.sh Hello 222 +Otrzymamy

+
argument Hello
+argument 222
+
+

Zwroty przydatne przy obsłudze argumentów

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
$0Nazwa wołanej komendy/skryptu
$1 $2 $3poszczególne argumenty (pierwszy, drugi, trzeci)
$#Liczba argumentów
$*Wszystkie argumenty jako jeden string
$@Wszystkie argumenty jako lista
+

xargs

+

Jeśli chcemy wykorzystywać wyjścia mechanizm strumieni do przekazywania argumentów to możemy użyć także komendy xargs

+
#Wywołanie komendy rm dla każdego znalezionego pliku
+find /path -type f -print | xargs rm
+
+

Flagi:

+
    +
  • -n - maksymalna liczba argumentów
  • +
  • -d, --delimiter - podział na części (komenda zostanie wywołana wielokrotnie)
  • +
+
echo -n 123-456-7890 | xargs echo
+#> 123-456-7890
+echo -n "123-456-789" | xargs -n 1 -d - echo
+#> 123
+#> 456
+#> 789
+
+
    +
  • -I, -i, --replace= pozwala na elastyczne wstawianie otrzymanego argumentu
  • +
+
#Stworzy pliki 123.txt 456.txt 789.txt
+echo -n "123-456-789" | xargs -d - -n 1 -I{} echo {}.txt
+
+

Procesy

+

Łączniki:

+
    +
  • && -wykonaj kolejny proces, jeśli poprzedni się powiedzie (retcode 0)
  • +
  • || - wykonaj następny, gdy poprzedni to porażka
  • +
  • & - proces jest utuchamiany w tle (jego pid można zdobyć za pomocą $!)
  • +
+

TODO więcej

+

Warunki

+

Warunki sprawdza się za pomocą komendy test z odpowiednimi flagami. +Można to także robić za pomocą wmieszczając warunek w nawiasach []. +Możliwy jest też wariant z dwoma nawiasami [[ cośtam ]] jest on wspierany przez wszystkie nowsze systemy używające Basha, ale mimo wszystko może byc on niekompatybilny ze starszymi.

+

Warto pamiętać, że bardzo ważne tu są spacje i aby o nich nie zapomnieć.

+

Samo test jako komenda nie robi nic po prostu sprawdza warunek i zależnie od niego zwraca jakiś kod.

+
[ 1 -gt 100 ]
+echo "Ret: $?" #zwraca kod ostatnio działającej aplikacji
+# Ret: 1
+
+[ 100 -gt 1 ]
+echo "Ret: $?"
+# Ret: 0
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperatorDescription
! EXPRESSIONThe EXPRESSION is false.
-n STRINGThe length of STRING is greater than zero.
-z STRINGThe lengh of STRING is zero (ie it is empty).
STRING1 = STRING2STRING1 is equal to STRING2
STRING1 != STRING2STRING1 is not equal to STRING2
INTEGER1 -eq INTEGER2INTEGER1 is numerically equal to INTEGER2
INTEGER1 -gt INTEGER2INTEGER1 is numerically greater than INTEGER2
INTEGER1 -lt INTEGER2INTEGER1 is numerically less than INTEGER2
-d FILEFILE exists and is a directory.
-e FILEFILE exists.
-r FILEFILE exists and the read permission is granted.
-s FILEFILE exists and it's size is greater than zero (ie. it is not empty).
-w FILEFILE exists and the write permission is granted.
-x FILEFILE exists and the execute permission is granted.
+

Dopiero po połączeniu z wyrażeniami warunkowymi się przydaje.

+

Uwagi

+
    +
  • = oraz -eq działają inaczej np 01 = 1 da fałsz, ale 01 -eq 1 da prawdę
  • +
+

Warunki if

+
 #nie musi tu być koniecznie test, może to być dowolna. Jeśli zwraca ona 0 to mamy sukces i wchodzimy do środka
+if apka_zwracająca_jakiś_kod
+then
+    komendy
+fi
+
+#wariant z else
+if apka_zwracająca_jakiś_kod
+then
+    komendy
+else
+    inne komendy
+fi
+
+

Pętle

+

for - iteruje po liście

+
for variable in valuelist
+do
+    something
+done
+
+

Listą mogą być argumenty programu

+
#!/bin/bash
+echo The number of arguments is: $#
+echo The entered command line is: $0 $@
+echo The command arguments are:
+for i in "$@"
+do
+    echo $i
+done
+
+

... albo pliki w folderze

+
for k in *
+do
+    cp $k $k.bak
+    echo $k copy created
+done
+
+

lub wynik komendy (używamy do tego $())

+
for i in $(ls)
+do
+    echo $i
+done
+
+

//TODO opis skrótów klawiszowych Ctrl-C Ctrl-D etc +// https://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Linux\360\237\220\247 i Bash/o_systemie/index.html" "b/Linux\360\237\220\247 i Bash/o_systemie/index.html" new file mode 100644 index 00000000..7399b85e --- /dev/null +++ "b/Linux\360\237\220\247 i Bash/o_systemie/index.html" @@ -0,0 +1,1227 @@ + + + + + + + + + + + + + + + + Zarządzanie systemem - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Zarządzanie systemem

+

Serwisy i demony

+

/etc/systemd/system/

+

systemctl

+

TODO

+

Domślne foldery systemowe

+

Schemat

+

TODO opisz te najważniejsze dla mnie

+
    +
  • /home/
  • +
  • /mnt
  • +
  • /tmp
  • +
  • /
  • +
+

Firewalle i sieć

+

TODO

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Linux\360\237\220\247 i Bash/programy/index.html" "b/Linux\360\237\220\247 i Bash/programy/index.html" new file mode 100644 index 00000000..dffc7c2c --- /dev/null +++ "b/Linux\360\237\220\247 i Bash/programy/index.html" @@ -0,0 +1,1574 @@ + + + + + + + + + + + + + + + + Programy - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + +
+
+ + + + + + + + +

Programy

+ +

Screen

+

Otwarcie nowej sesji +screeen []

+

Wyjście z sesji +Ctrl+a , potem

+

lista aktywnych sesji +screen -ls

+
+

There is a screen on: +21512.pts-4.komp-pc (07.08.2020 12:54:54) (Attached) +1 Socket in /run/screen/S-komp.

+
+

Dołącz do jednej z sesji +screen -r [numer_sesji]

+

Uruchom skrypt w sesji i odłącz się od sesji (dobre do startupu)

+
screen -d -m moj_skrypt_albo_komenda
+
+

Większość komend wewnątrz obsługuje się za pomocą kombinacji Ctrl+a (C-a) i po puszczeniu wciśnięciu danego przycisku.

+

Podstawowe:

+
    +
  • C-a + d -detach, wyjdź z sesji nie zamykając jej (sesja to nie terminal/ekran)
  • +
  • C-a + N - wyświetl numer obecnego ekranu
  • +
  • C-a c/C-a C-c - utwórz nowy ekran
  • +
  • C-a + [0-9] - przejdź do ekranu o danym numerze
  • +
  • C-a + C-a - przełącz na poprzedni ekran
  • +
  • C-a \ - zakmnij wszystkie okna i zakończ sesję
  • +
+

Inne użyteczne (pełna lista jest w man screen):

+
┌──────────────┬────────────────┬─────────────────────────────────────────────────────┐
+│C-a '         │ (select)       │ Prompt for a window name or number to switch to.    │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a "         │ (windowlist -b)│ Present a list of all windows for selection.        │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a digit     │ (select 0-9)   │ Switch to window number 0 - 9                       │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a C-a       │ (other)        │ Toggle to the window  displayed  previously.   Note │
+│              │                │ that this binding defaults to the command character │
+│              │                │ typed twice, unless overridden.  For  instance,  if │
+│              │                │ you  use  the  option  "-e]x", this command becomes │
+│              │                │ "]]".                                               │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a A         │ (title)        │ Allow the user to enter a name for the current win‐ │
+│              │                │ dow.                                                │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a c,        │ (screen)       │ Create a new window with a shell and switch to that │
+│C-a C-c       │                │ window.                                             │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a C         │ (clear)        │ Clear the screen.                                   │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a d,        │ (detach)       │ Detach screen from this terminal.                   │
+│C-a C-d       │                │                                                     │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a D D       │ (pow_detach)   │ Detach and logout.                                  │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a space,    │ (next)         │ Switch to the next window.                          │
+│C-a n,        │                │                                                     │
+│C-a C-n       │                │                                                     │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a N         │ (number)       │ Show the number (and title) of the current window.  │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a backspace,│ (prev)         │ Switch to the previous window (opposite of C-a n).  │
+│C-a C-h,      │                │                                                     │
+│C-a p,        │                │                                                     │
+│C-a C-p       │                │                                                     │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a q,        │ (xon)          │ Send a control-q to the current window.             │
+│C-a C-q       │                │                                                     │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a Q         │ (only)         │ Delete  all  regions but the current one.  See also │
+│              │                │ split, remove, focus.                               │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a r,        │ (wrap)         │ Toggle the current window's line-wrap setting (turn │
+│C-a C-r       │                │ the current window's automatic margins on and off). │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a s,        │ (xoff)         │ Send a control-s to the current window.             │
+│C-a C-s;      │                │                                                     │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a S         │ (split)        │ Split  the current region horizontally into two new │
+│              │                │ ones.  See also only, remove, focus.                │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a t,        │ (time)         │ Show system information.                            │
+│C-a C-t       │                │                                                     │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a v         │ (version)      │ Display the version and compilation date.           │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a C-v       │ (digraph)      │ Enter digraph.                                      │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a w,        │ (windows)      │ Show a list of window.                              │
+│C-a C-w       │                │                                                     │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a X         │ (remove)       │ Kill the current region.   See  also  split,  only, │
+│              │                │ focus.                                              │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a z,        │ (suspend)      │ Suspend screen.  Your system must support BSD-style │
+│C-a C-z       │                │ job-control.                                        │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a ?         │ (help)         │ Show key bindings.                                  │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a \         │ (quit)         │ Kill all windows and terminate screen.              │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a {,        │ (history)      │ Copy and paste a previous (command) line.           │
+│C-a }         │                │                                                     │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a |         │ (split -v)     │ Split  the  current  region vertically into two new │
+│              │                │ ones.                                               │
+├──────────────┼────────────────┼─────────────────────────────────────────────────────┤
+│C-a *         │ (displays)     │ Show a listing of all currently attached displays.  │
+└──────────────┴────────────────┴─────────────────────────────────────────────────────┘
+
+

Zdobywanie informacji o systemie

+

Ogólne informacje o systemie

+

uname przydaje się do ogólnych informacji o systemi operacyjnym, architekturze procesora i kernelu.

+
uname
+
+

Miejsce na dyskach

+
df
+
+#df --block-size=1M poda ci rozmiar w gigabajtach
+
+

Może być przydatne w bombinacji z du, które może pokazywać ile miejsca zajmują dane foldery i pliki. +(terminalowa alternatywa dla apki baobab link)

+
du -d 1
+# 1760    ./docs
+# 9876    ./.git
+# 12      ./.github
+# 8       ./.vscode
+# 11672   .
+
+

Hardware

+

lsusb - przydatne do sprawdzania tego, jakie urządzenia usb mamy podłączone

+
lsusb
+
+

Networking

+

ip - kombajn do sieciówki w Linuxie

+

ifconfig (już przestarzałe) - zwraca informacje o wszystkich odstępnych interfejsach sieciowych, IP, adresy MAC etc. Zamiast niego zaleca się ip addr

+

Listowanie urządzeń w sieci lokalnej

+
sudo nmap -sn 192.168.1.0/24
+
+

Wypisywanie portów na których maszyna nasłuchuje

+

ss apka do badania gniazd

+
ss -plnt #p - procesy l-listening n-numeric t-tcp
+
+

Montowanie

+

mount +TODO

+

SSH

+

SSH służy do zdalnego podłącznia się do powłoki systemów.

+

Łączymy się komendą ssh login@adres

+

Na przykład

+
marian@192.168.0.32
+
+root@serwer.moj.pl
+
+# Tutaj loginem jest pracownik@firma.com a adresem serwer.com
+pracownik@firma.com@serwer.com
+
+

SSH klucze

+

Po zalogowaniu na ogół musimy ręcznie wpisywać hasło.
+Aby tego nie robić możemy dodać klucz publiczny do naszej maszyny.

+

Dodatanie klucza do maszyny

+
ssh-copy-id login@adres
+
+

Aby uprościć wpisywanie adresów maszyn (oraz konfigurację) w terminalu możemy dopisać je do pliku ~/.ssh/config

+
Host fajnyserwer
+  HostName 198.43.32.33
+  User pawel
+  Port 9999
+
+

SSH tunelowanie

+

Inną przydatną rzeczą jest tunelowanie portów za pomocą ssh. Pozwala to na dostęp do zdalnych usług na danych portach tak, jakby były u nas lokalnie. link do artykułu

+

Na przykład komenda:

+
ssh -L 9999:localhost:9090 marian@moj_serwer
+
+

Sprawi, że na naszej lokalnej maszynie pod portem 9999 będzie dostępna usługa, która jest dostępna pod portem 9090 naszego serwera.

+

Możliwe jest także odwrócone tunelowanie portów za pomocą SSH

+
ssh -R [REMOTE:]REMOTE_PORT:DESTINATION:DESTINATION_PORT [USER@]SSH_SERVER
+
+

Na przykład komenda ssh -R 3000:192.168.1.11:9090 marian@moj_serwer sprawi, że na serwerze pod porcie 3000 będzie dostępna usługa widoczna u nas pod adresem 192.168.1.11:9090

+

Jest on najczęściej używany, aby dać komuś z zewnątrz dostęp do wewnętrznego serwisu.

+

Razem z tymi komendami przydają się flagi:

+
    +
  • -N - sprawia, że nie wykonujemy żadnych zdalnych komend bashowych
  • +
  • -f - uruchamia ssh w tle
  • +
+

Np: ssh -R 8080:127.0.0.1:3000 -N -f user@remote.host

+

W wypadku tunelowania czasem mogą być problemy przy dostępie z zewnętrznych maszyn do udostępnionych portów link

+

SSH aplikacje okienkowe

+

W niektórych wypadkach możemy potrzebobować jakiejś aplikacji okienkowej, wtedy używamy flagi -X (forwardowanie dla X11)

+
ssh -X jkowalski@adres
+
+

Wtedy po uruchomieniu w tym terminalu aplikacji z GUI jak np gedit to będziemy mogli zobaczyć jej okienko na naszej maszynie.

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Linux\360\237\220\247 i Bash/regex/index.html" "b/Linux\360\237\220\247 i Bash/regex/index.html" new file mode 100644 index 00000000..aabdb4ed --- /dev/null +++ "b/Linux\360\237\220\247 i Bash/regex/index.html" @@ -0,0 +1,1348 @@ + + + + + + + + + + + + + + + + Wyrażenia regularne (Regexy) - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Wyrażenia regularne (Regexy)

+

Świetna strona do ekspreymentowania z wyrażeniami regularnymi Regex101 +Ściągawka z BulldogJobs https://bulldogjob.pl/readme/samouczek-regex-sciagawka-z-przykladami

+

Znaki

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
symbolOpis
\swhitespace
\Snie whitespace
\dcyfra
\Dnie cyfra
\wsłowo
\Wnie słowo
\nnowa linia
\ttabulacja
\APoczątek wyrażenia
$koniec wyrażenia lub/EOL/EOF
\Zkoniec wyrażenia
.Jakikolwiek znak (nie licząc nowej linii \n)
\.Kropka . (w grepie jednak trzeba dać \\.
+

Znaki specjalne: ^ [ . $ { * ( \+ ) | ? < >
+Do ich escape'owania na ogół wystarcza \.

+

Grupy i zakresy

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[a-c]znaki z zakresu a-c. Mogą być łączone w większe grupy (np. [a-deA-D1-4])
[^a-c]Zaprzeczenie znakom z danego zakresu (nie a nie b i nie c)
(aIbIc)Alternatywa a lub lub c (zamiast I powinny tam być linie pionowe)
*Znak/wyrażenie znajdujący się przed gwiazdką może pojawić się dowolną ilość razy
+Znak/wyrażenie sprzed plusa pojawi się dowolnie wiele razy (ale co najmniej 1 raz)
?Znak/wyrażenie pojawia się 0 lub 1 raz
(?!slowo)zaprzeczenie - wyklucz wyniki zawierające slowo (negative lookahead)
Ialternatywa(nie litera i, lecz beleczka) - rzecz polewej albo po prawej
+

Podmienianie znaków

+

Używając regexów można w łatwy sposób podmieniać części naszych wyrażeń na inne.

+

Wystarczy tutaj opakować część wyrażenia, którą chcemy wymienić w nawiasy () i potem w wyrażeniu docelowym możemy się odwoływać do zawartości poszczególnych nawiasów.

+

Najbardziej przydatne odwołania:

+ + + + + + + + + + + + + + + + + +
$1, $2Pierwszy, drugi nawias
$&Całe wyrażenie
+
Find        Carrots(With)Dip(Are)Yummy
+Replace     Bananas$1Mustard$2Gross
+Result      BananasWithMustardAreGross
+
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Narz\304\231dzia\360\237\233\240\357\270\217/assets/Docker-ports.png" "b/Narz\304\231dzia\360\237\233\240\357\270\217/assets/Docker-ports.png" new file mode 100644 index 00000000..67722fe7 Binary files /dev/null and "b/Narz\304\231dzia\360\237\233\240\357\270\217/assets/Docker-ports.png" differ diff --git "a/Narz\304\231dzia\360\237\233\240\357\270\217/docker/index.html" "b/Narz\304\231dzia\360\237\233\240\357\270\217/docker/index.html" new file mode 100644 index 00000000..e51bd545 --- /dev/null +++ "b/Narz\304\231dzia\360\237\233\240\357\270\217/docker/index.html" @@ -0,0 +1,1976 @@ + + + + + + + + + + + + + + + + Docker🐋 - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Docker🐋

+

Docker jest jednym z najpopularniejszych obecnie systemów do wirtualizacji systemu operacyjnego.
+Pozwala w prosty sposób stworzyć instancję systemu będącą niemalże zupełnie niezależnym bytem od systemu maszyny na której się znajduje, może mieć ona zainstalowane zupełnie inne oprogramowanie, różnić się konfiguracją sieciową etc.
+Różni się on od zwyczajnej maszyny wirtualnej tym, że taki kontener jest dużo bardziej elastyczny od maszyny wirtualnej, ponieważ nie ma na stałe przydzielonych zasobów takich jak RAM, CPU etc.

+

Docker często jest wykorzystywany do pracy z różnorodnym oprogramowaniem bez niepotrzebnego zaśmiecania środowiska deweloperskiego. Jest to także jeden ze sposobów uniknięcia piekła zależności.

+

Podstawowe Pojęcia

+

Obraz/Image - obrazy dockerowe są już gotowymi, wcześniej przygotowanymi paczkami zawierające systemy w dockerze. Przykładem obrazu jest ubuntu:latest.

+

Kontener/Container - jest to uruchomiona instancja naszego dockera bazująca na danym obrazie. Zawiera on konfigurację oraz wszystkie dane unikalne dla danej instancji.

+

Repozytorium - miejsce z którego pobierane są obrazy oraz ich aktualizacje. Jest to dockerhub, ale można też pobierać z innych repozytoriów (np z gitlaba).

+

Obsługa

+

Mamy kilka grup komend

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GrupaOpis
configZarządzanie konfiguracją
containerOperacje na kontenerach
contextContexts for distributed deployment (k8s, …)
imageZarządzanie obrazami
networkZarządzanie siecią
serviceService (i.e. multiple containers that run the same image) management in distributed deployments (e.g.with docker-compose or docker swarm)
systemGlobal management
volumeSecondary storage management
+

Do zarządzania możemy też używać apek GUI, albo pluginów do IDE.

+

Zarządzanie obrazami

+

Do zarządzania obrazami na naszej maszynie służy polecenie docker image.

+

Nowy obraz

+
Baza
+

W większości wypadków warto wykorzystywać obrazy znajdujące się na stronie hub.docker.com - zawiera ona zarówno obrazy większości dystrybucji Linuxa, jak i obrazy z systemami zawierające już przygotowane narzędzia deweloperskie (np obrazy zawierające zainstalowane i skonfigurowane bazy danych).

+

Aby pobrać taki obraz na naszą maszynę należy użyć komendy:

+
docker image pull [OPTIONS] NAME[:TAG|@DIGEST]
+
+

Na przykład:

+
docker image pull alpine:latest # pobiera najnowszy obraz systemu alpine
+
+
Budowanie z konfiguracji
+

Jeśli potrzebujemy stworzyć własny obraz to możemy go samodzielnie zbudować za pomocą komendy:

+
docker image build .
+
+

Pozwala ona zbudować nam własny obraz dockerowy na bazie pliku dockerfile. (Opis składni)

+
Stworzenie poprzez commita
+

Do wygenerowania nowego obrazu możemy też wykorzystać już istniejący kontener, wystarczy użyć komendy commit

+
docker commit containerName ImageName
+
+

Zarządzanie posiadanymi obrazami

+

Za pomocy komendy docker image ls możemy łatwo wypisać lokalnie pobrane obrazy.

+
docker image ls
+REPOSITORY                                                TAG             IMAGE ID       CREATED         SIZE
+<none>                                                    <none>          93c4e800ab68   2 weeks ago     677MB
+postgres                                                  11-alpine       ec1e25ef56d1   5 weeks ago     156MB
+alpine                                                    latest          6dbb9cc54074   5 weeks ago     5.61MB
+nginx                                                     1.19.0-alpine   7d0cdcc60a96   11 months ago   21.3MB
+
+

docker image rm usuwa dany obraz.

+
docker image rm [OPTIONS] IMAGE [IMAGE...]
+
+

Ale do czyszczenia jednak lepsze jest docker image prune, które usuwa wszystkie "wiszące" (dangling) obrazy, czyli np stare kopie obrazów, które zostały już przebudowane (na liście obrazów podpisane są jako <none>).
+Dodanie flagi -a usuwa także wszystkie obrazy, które są nie są używane przez żadne kontenery.

+
$ docker image prune -a
+WARNING! This will remove all images without at least one container associated to them.
+Are you sure you want to continue? [y/N] y
+Deleted Images:
+untagged: alpine:latest
+
+

Zarządzanie kontenerami

+

docker container ls - wypisuje kontenery obecnie uruchomione w systemie, dodanie flagi -a sprawia, że pokazuje także te wyłączone.

+
$ docker container ls -a
+CONTAINER ID   IMAGE                                     COMMAND                CREATED       STATUS                PORTS  NAMES
+bd1415cdc985   server_nginx                              "/docker-entrypoint.…" 25 hours ago  Exited(0) 24 hours ago       server_nginx_1
+2474e0650b34   registry.gitlab.com/toolkit/server:latest "sh -c 'python manag…" 25 hours ago  Exited(0) 25 hours ago       server_web_1
+ce6a641e20c1   postgres:11-alpine                        "docker-entrypoint.s…" 2 weeks ago   Exited(0) 21 hours ago       server_db_1
+
+

Uruchamianie

+

Do podstawowej pracy z kontenerem możemy używać komend:

+
    +
  • docker container run albo też docker run
  • +
  • docker container create
  • +
  • docker container pause / unpause - wstrzymuje (i wznawia) procesy w kontenerze
  • +
  • docker container start / stop - zabija wszystkie procesy w kontenerze i go zamyka
  • +
  • docker container restart
  • +
  • docker commit containerName ImageName -zapisujemy zmiany wprowadzone w danym kontenerze jako nowy obraz
  • +
+

Do usuwania kontenerów służą docker container prune i docker container rm.

+

docker container create [OPTIONS] IMAGE [COMMAND] [ARG...] - tworzy nam nowy kontener bazujący na danym obrazie, możemy także wybrać jaka komenda ma zostać w nim uruchomiona. (ale go nie uruchamia)
+Możemy go potem uruchomić komendą docker container start ID.

+

Do stworzenia nowego kontenera i natychmiastowego uruchomienia służy docker container run.

+

Przydatne flagi dla docker run [flagi] nazwa-obrazu:

+
    +
  • -rm usuwa kontener po zakończeniu pracy
  • +
  • -i, --interactive po odpaleniu nadal mamy podłączone STDIN
  • +
  • -t, --tty Podłączamy się terminalem do kontenera (warto użyć razem z -i)
  • +
  • -d, --detach Uruchom kontener w tle i wypisz jego ID
  • +
  • -e, --env Jakie zmienne środowiskowe mają być w naszym kontenerze (np docker run -e BROKER_PORT=9999 client)
  • +
  • -p, --publish udostępnij wewnętrzne porty obrazu na portach hosta np -p 8089:80 wystawia port 80 z wnętrza kontenera na porcie 8089 hosta. (możemy teraz na naszej maszynie otworzyć to pod adresem localhost:8089) + porty
  • +
  • -v, --volume określa jakie pliki/foldery z hosta mamy udostępnić kontenerowi i pod jakimi adresami np -v /tmp/logs.log:/tmp/runlog sprawi że apka w kontenerze pisząc do plików w folderze tmp/runlog/ będzie tak na prawdę pisać do folderu /tmp/logs.log/ na hoście.
  • +
  • --rm - usuwa kontener po zakończeniu
  • +
  • --device - pozwala na udostępnienie urządzeń kontenerowi dockerowemu (np. kamery) --device=/dev/video0:/dev/video0 link
  • +
+
docker container run -i -t ubuntu bash
+
+

Interakcje z działającym kontenerem

+

attach - podpinanie stdin i stdouta to działającego kontenera.
+docker attach [OPTIONS] CONTAINER lub docker container attach

+

cp - kopiowanie plików

+

exec - uruchom w już działającym kontenerze. Bardzo przydatne gdy chcemy np wejść tam z shellem.
+docker exec [OPTIONS] CONTAINER COMMAND [ARG...] lub docker container exec ...

+
docker exec -it worker bash #-it podpina input i output
+
+

Składnia pliku dockerfile

+

Plik dockerfile opisuje kolejne operacje pokazujące, jak powinien być zbudowany nasz obraz.

+

Przykładowy plik dockerfile:

+
# wybierz obraz bazowy od którego zaczynasz konstruowanie
+FROM ubuntu:latest
+
+# Ustaw zmienne środowiskowe
+ENV APP_USER=user
+
+# Wykonaj daną komendę, np zainstaluj potrzebne pakiety etc.
+RUN apt install -y firefox
+
+# określ położenie folderu roboczego w którym odpalane są komendy
+WORKDIR /home/user
+
+# Kopiuj pliki z hosta do systemu plików wewnątrz kontenera
+COPY ./plik /home/user/
+
+

Tak zdefiniowany obraz budujemy komendą docker build ./sciezka/folderu.

+

Każda nowa linia/polecenie zaczyna się od komendy DUŻYMI_LITERAMI (taka konwencja).

+

Komendy:

+
    +
  • FROM imageBase to jest zawsze pierwsza instrukcja pokazująca na jakim innym obrazie ma bazować nasz nowy obraz
  • +
  • RUN command wykonuje komendy w powłoce kontenera przy budowaniu
  • +
  • ENV variable value ustawia wartości w środowisku (mogą być używane przez wszystko co będzie od teraz chodzić w kontenerze)
  • +
  • COPY source destination kopiuje pliki ze źródła (URL, plik, folder) do miejsca w kontenerze (UWAGA! z przycyn bezpieczeństwa pozwala on tylko na kopie rzeczy tylko z folderu w którym uruchamiamy komendę, czyli nie możemy np skopiować sobie czegoś z katalogu /home/jkowalski/pobrane)
  • +
  • ADD source destination to samo co ADD z różnicą, że gdy potrafi zorpakować archiwum, gdy jest ono podane jako plik
  • +
  • WORKDIR path określa folder roboczy w którym mają się wykonywać pozostałe komendy jak RUN, CMD, ENTRYPOINT
  • +
  • CMD command arg1 arg2 ... dostarcza domyślnych komend i wartości argumentów, które zostaną uruchomione w kontenerze
  • +
  • ENTRYPOINT command arg1 arg2 ... uruchamia tą komendę, kiedy kontener jest uruchamiany (kontener jest zamykany kiedy ta komenda się kończy)
  • +
  • EXPOSE port pokazuje na jakim porcie słucha kontaner, sama go nie wystawia, pełni raczej funkcję informacyjną dla użytkownika link
  • +
  • VOLUME pozwala kontenerowi podłączyć się do innego systemu plików więcej info
  • +
+

Uwaga - w pliku dockerowym może być tylko jeden CMD albo ENTRYPOINT, jak nie to tylko ENTRYPOINT jest używany (na ogół).

+

ENTRYPOINT i CMD

+

ENTRYPOINT ma 2 warianty

+
    +
  • bazujący na samej komendzie
  • +
+
 ENTRYPOINT node app.js 9000 9001
+
+
    +
  • używany razem z CMD
  • +
+
ENTRYPOINT ["/bin/node","app.js"]
+CMD ["9000","9001"]
+
+

I możemy to potem odpalić tak

+
docker build -t app
+docker run app
+docker run app 5555 5556 # gdy chcemy użyć własnych argumentów
+
+

Możliwe jest też ustawienie własnego entrypointa przy uruchomieniu.

+
# Executes bash -c "ls /"
+docker run --entrypoint bash my-image:latest -c "ls /"
+
+

Docker compose

+

Jest on wykorzystywany, kiedy potrzebujemy uruchomić wiele aplikacji, które będą się ze sobą komunikować (a odpalenie w dockerze skryptu, który wszystko nam poodpala nie jest opcją).

+

Quick start

+

Wyobraźmy sobie, że potrzebujemy 3 apek, które gadają ze sobą.

+

Tworzymy plik docker-compose.yml

+
version: '2'
+services:
+#Każdy z serwisów jest tutaj oddzielony
+    cli:
+        image: client #obraz z którego korzystamy
+        build: ./client/
+        links:
+            - bro
+        environment:
+            - BROKER_HOST=bro
+            - BROKER_PORT=9998
+    wor:
+        image: worker
+        build: ./worker/
+        links:
+            - bro
+        environment:
+            - BROKER_HOST=bro
+            - BROKER_PORT=9999
+    bro:
+        image: broker
+        build: ./broker/
+        # z wnętrza kontenera bro wystawiamy porty 9998 i 9999 aby inne
+        # kontenery w composie mogły się do nich podpiąć (ale maszyna hosta nie)
+        expose:
+            - "9998“
+            - "9999"
+
+

I uruchamiamy komendę docker-compose up -d, która:

+
    +
  • Buduje wszystkie wymagane obrazy (jeśli ich nie mamy)
  • +
  • Uruchamia kolejne instancje każdego z nich w odpowiedniej kolejności
  • +
+

Do wyłączenia tego, co uruchomiliśmy wystarczy komenda docker-compose down

+

Plik konfiguracyjny

+

//TODO opisz dokładniej syntax docker-compose na podstawie pliku tsr-ud04-eng-DockerReferenceDocs2122.pdf oraz https://docs.docker.com/compose/compose-file/

+

Plik docker-compose.yml służy do zdefiniowania całych grup kontenerów, która mają być odpalone razem na jednej maszynie (pełna dokumentacja).Zawiera on opisy kolejno:

+
    +
  • serwisów (services:) - czyli poszczególnych obrazów dockerowych, które mają tworzyć całość (to jedyna obowiązkowa część, pozostałe są opcjonalne)
  • +
  • sieci (networks) - czyli poszczególnych sieci
  • +
  • woluminów (volumes) - trwałych miejsc do przechowywania plików
  • +
  • sekretów (secrets)
  • +
  • konfiguracji (configs)
  • +
+
+Przykładowy docker compose +
services:
+  frontend:
+    image: awesome/webapp
+    ports:
+      - "443:8043"
+    networks:
+      - front-tier
+      - back-tier
+    configs:
+      - httpd-config
+    secrets:
+      - server-certificate
+
+  backend:
+    image: awesome/database
+    volumes:
+      - db-data:/etc/data
+    networks:
+      - back-tier
+
+volumes:
+  db-data:
+    driver: flocker
+    driver_opts:
+      size: "10GiB"
+
+configs:
+  httpd-config:
+    external: true
+
+secrets:
+  server-certificate:
+    external: true
+
+networks:
+  # The presence of these objects is sufficient to define them
+  front-tier: {}
+  back-tier: {}
+
+
+

serwisy

+

Podstawowe parametry dla serwisów dokumentacja:

+
    +
  • image - obraz, którego ma używać dany serwis
  • +
  • expose - lista portów, które mają być udostępnione innym serwisom wewnątrz dockera (host ich nie widzi)
  • +
  • ports - lista portów wystawionych na zewnątrz dockera (są one także dostępne dla innych serwisów w dockerze)
  • +
  • links - lista serwisów, które muszą zostać wystartowane przed uruchomieniem tego serwisu
  • +
  • environment - lista zmiennych środowiskowych w danym kontenerze
  • +
  • build - ścieżka do folderu z plikiem Dockerfile, aby go zbudować, gdyby jeszcze nie było odpowiedniego obrazu
  • +
+

//TODO dopisz przykłady

+

Inne parametry dla serwisów:

+
    +
  • extra_hosts - lista mapowań adresów na nazwy (pojawią się w pliku /etc/hosts na maszynie) link
  • +
+
extra_hosts:
+  - "somehost:162.242.195.82"
+  - "innyhost.local:50.31.209.229"
+
+

Wolumeny

+

Za ich pomocą możemy tworzyć trwałe miejsca do przechowywania danych. Trwałych, czyli takich, które nie ulegają skasowaniu, kiedy usuwany jest kontener.
+Dlatego często są one wykorzystywane min. do przechowywania baz danych, abyśmy nic nie tracili wtdy, kiedy np. przy aktualizacji będziemy chcieli zmienić wersję kontenera na świeższą.
+Kolejną zaletą wolumenów w kontekście compose'a jest to, że mogą one być współdzielone pomiędzy poszczególnymi serwisami. dokumentacja

+

Przykład:

+
services:
+  backend:
+    image: awesome/database
+    volumes:
+      - db-data:/etc/data
+    #db-data będzie zamontowane w backendzie pod ścieżką /etc/data
+
+  backup:
+    image: backup-service
+    volumes:
+      - db-data:/var/lib/backup/data
+
+#db-data to automatycznie zdefioniowany wolumen
+#system stworzy go sobie najpewniej w lokacji /var/lib/docker
+volumes:
+  db-data:
+
+

Uruchamiając docker compose up docker tworzy wolument jeśli jeszcze nie istnieje.

+

Warto tytaj wiedzieć o atrybutach takich jak:

+
    +
  • external(true, false) - określa, czy ten wolumen jest zarządzany poza danym serwerem. Jeśli ustawiony na true to wszystkie pozostałe flagi są ignorowane (za wyjątkiem name). Jeśli taki wolumen nie istnieje to zwracany jest błąd, jeśli istnieje to jest on podłączany. +
    volumes:
    +  db-data:
    +    external: true #szukamy czy volume o nazwie db-data istnieje
    +
  • +
  • driver_opts - pozwala na zamontowanie wolumentu za pomocą jakiegoś sterownika. Pozwala np. na stworzenie wolumenu znajdującego się na serwerze NFS +
    volumes:
    +example:
    +  driver_opts:
    +    type: "nfs"
    +    o: "addr=10.40.0.199,nolock,soft,rw"
    +    device: ":/docker/example"
    +
    + lub zwyczajne określenie na jaki folder hosta ma być on zmapowany +
    volumes:
    +  cvat_share:
    +    driver_opts:
    +      type: none
    +      device: /mnt/duzy_dysk/pliki_dla_cvata/
    +      o: bind
    +
  • +
+

inne

+

//TODO opisz pozostałe

+

Komendy

+

UWAGA wkrótce komenda docker-ckompose powinna zostać zmieniona na docker compose link

+

docker-compose up -

+

Parametry:

+
    +
  • --scale service=num pozwala odpalić więcej instancji danego serwisu (jednak gdy skalujemy serwisy, które wystawiają porty expose to tylko jedna z instancji będzie widoczna dla innych) //TODO sprawdź to
  • +
  • -d -//TODO
  • +
  • -f - flaga do uruchamiania wielu plików docker compose jednocześnie Jeśli wszystkie wysecyfikowane pliki znajdują się w tym samym folderze wtedy docker łączy je w jedną wspólną konfigurację. + przykład apki z wtórej w dodatkowym pliku jest dodane szyfrowanie HTTPS: +
    docker compose -f docker-compose.yml -f docker-compose.https.yml up -d
    +
  • +
+

docker-compose down - zatrzymuje i usuwa kontenery z danego compose'a

+

docker compose stop - zatrzymuje, ale bez usuwania

+

docker compose start - uruchamia istniejące kontenery dla serwisu

+

Przydatne snippety

+

Tworzenie użytkownika

+
RUN useradd -ms /bin/bash -G sudo,inna_grupa dockeruser
+#Wyłączenie promptu o hasło przy sudo
+RUN echo "dockeruser ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ubuntu
+#ustawienie kolorowego terminala
+ENV TERM=xterm-256color
+#przełączenie na użytkownika przy dalszych komendach
+USER dockeruser
+WORKDIR /home/dockeruser
+
+

Uruchamianie z dostępem do GUI

+

W wypadku aplikacji dockerowych możliwe jest ich uruchamianie aplikacji GUI z ich poziomu.

+

Wymaga to najpierw nadania uprawnień do otwierania okien

+
xhost +local: #Ta opcja jest aktywna do restartu komputera
+
+

Poza tym należy dać dockerowi dostęp do odpowiedniego gniazda oraz ustawić zmienną DISPLAY

+
docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY ubuntu bash
+
+

Do przetestowania działania całości warto użyć aplikacji xeyes zjandującą się w pakiecie x11-apps dla Ubuntu.

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Narz\304\231dzia\360\237\233\240\357\270\217/git/index.html" "b/Narz\304\231dzia\360\237\233\240\357\270\217/git/index.html" new file mode 100644 index 00000000..5d84b5e8 --- /dev/null +++ "b/Narz\304\231dzia\360\237\233\240\357\270\217/git/index.html" @@ -0,0 +1,1273 @@ + + + + + + + + + + + + + + + + Przydatne komendy git - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+ +
+ + +
+
+ + + + + + + + +

Przydatne komendy git

+

Włączanie i wyłączanie ignorowania zmian dla danego pliku

+
git update-index --skip-worktree default_values.txt
+
+git update-index --no-skip-worktree default_values.txt
+
+#list of files marked as skipped
+git ls-files -v . | grep ^S
+
+

Albo:

+
git update-index --assume-unchanged <file>
+
+#i aby cofnąć
+git update-index --no-assume-unchanged <file>
+
+

Sprzątanie

+
git reset #unstage all of files
+git checkout . #revert all local uncommitted changes
+git clean -fdx #remove all local untracked files
+
+

Usuwa wszystkie niezacommitowane zmiany.

+

Sprzątanie w commitach (interactive rebase)

+

Inspirowane artykułem.

+
git rebase -i JAK_DALEKO
+#np
+git rebase -i HEAD~3 #3 commity do tyłu
+#lub
+git rebase -i master
+
+

To jak głęboki ma być nasz rebase możemy określić jako ilość commitów (HEAD~9 - czyli 9 commitów do tyłu), czy też względem innego brancha (np. mając feature branch wychodzęcy z mastera możemy zrobić rebase względem mastera).

+

Po zatwierdzeniu otrzymujemy listę commitów z którymi decydujemy co zrobić.

+
pick 56dc78c Poprawki do manipulacji tekstem
+pick 57d9877 Podstawy templatek
+pick b0675c9 Wykluczanie słów w regexach
+pick 1c30565 Cockpit dodany do narzędzi
+
+# Przestawianie 578f646..1c30565 na 1c30565 (4 polecenia)
+#
+# Polecenia:
+# p, pick <zapis> = dobierz zapis
+# r, reword <zapis> = użyj zapisu, ale przeredaguj jego komunikat
+# e, edit <zapis> = użyj zapisu, ale zatrzymaj się, żeby go poprawić
+# s, squash <zapis> = użyj zapisu, ale połącz go z poprzednim (spłaszcz)
+# f, fixup <zapis> = jak „squash”, ale odrzuć komunikat tego zapisu
+# x, exec <polecenie> = wykonaj polecenie (resztę wiersza) w powłoce
+# b, break = zatrzymaj się tu (kontynuuj przestawianie przez „git rebase --continue”)
+# d, drop <zapis> = usuń zapis
+# l, label <etykietka> = nazwij bieżące HEAD
+# t, reset <etykietka> = zresetuj HEAD do etykietki
+# m, merge [-C <zapis> | -c <zapis>] <etykietka> [# <wiersz>]
+# .       utwórz zapis scalenia używając pierwotnego komunikatu scalenia
+# .       (albo <wiersza>, jeśli nie podano pierwotnego zapisu scalenia.
+# .       Użyj -c <zapis>, aby przeredagować komunikat zapisu.
+# Kolejność wierszy może być zmieniona; są wykonywane z góry na dół.
+#
+# Jeśli usuniesz tutaj wiersz, TEN ZAPIS BĘDZIE STRACONY.
+#
+# Jeśli jednak usuniesz wszystko, przestawianie zostanie przerwane.
+#
+# Zważ, że puste zapisy są wykomentowane
+
+

Następnie po wybraniu operacji zatwierdzamy i rozpoczynamy zmiany.

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Narz\304\231dzia\360\237\233\240\357\270\217/narzedzia/index.html" "b/Narz\304\231dzia\360\237\233\240\357\270\217/narzedzia/index.html" new file mode 100644 index 00000000..455bb35e --- /dev/null +++ "b/Narz\304\231dzia\360\237\233\240\357\270\217/narzedzia/index.html" @@ -0,0 +1,1248 @@ + + + + + + + + + + + + + + + + Zbiór różnych użytecznych narzędzi, frameworków , stron i bibliotek z któymi się spotkałem - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Zbiór różnych użytecznych narzędzi, frameworków , stron i bibliotek z któymi się spotkałem

+

Dokumentacja

+ +

Statystyki githuba i repozytoriów

+ +

Inne

+
    +
  • SearchCode - przeszukiwanie baz z kodem źródłowym. Przydatne, gdy chcesz znaleźć przykłady wywoływania danej funkcji.
  • +
  • +

    zerotier - chyba najprostszy VPN

    +
  • +
  • +

    Gdy chcemy w sieci zerotiera postawić serwer DNS https://github.com/zerotier/zeronsd

    +
  • +
  • +

    Xonsh - odmiana shella (zamiennik dla klasycznego basha) bazujący na pythonie

    +
  • +
+
len($(curl -L https://xon.sh))
+
+for filename in `.*`:
+    print(filename)
+    du -sh @(filename)
+
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Narz\304\231dzia\360\237\233\240\357\270\217/serwery_i_homelaby/index.html" "b/Narz\304\231dzia\360\237\233\240\357\270\217/serwery_i_homelaby/index.html" new file mode 100644 index 00000000..460b7b57 --- /dev/null +++ "b/Narz\304\231dzia\360\237\233\240\357\270\217/serwery_i_homelaby/index.html" @@ -0,0 +1,1349 @@ + + + + + + + + + + + + + + + + Narzędzia serwerowe☁️ - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + +
+
+ + + + + + + + +

Narzędzia serwerowe☁️

+

Na dobry początek można zajrzeć na wiki reddita homelab

+

Monitoring i zarządzanie infrastrukturą

+

Przydatne narzędzia dla każdej osoby, która zamierza rozpocząć swoją przygodę z serwerami/homelabem.

+
    +
  • +

    cockpit - pozwala w prosty sposób monitorować serwer (poprzez apkę webową możemy się zalogować, uruchomić terminal, sprawdzać obciążenie, logi etc) ( link to konfiguracji)

    +
  • +
  • +

    Jeśli chcemy w cockpicie wygodnie zarządzać także portami warto doinstalować

    +
  • +
  • +

    linux-dash - nieco prostsza alternatywa od cockpita

    +
  • +
+

Narzędzia do monitorowania - długa lista https://www.ubuntupit.com/most-comprehensive-list-of-linux-monitoring-tools-for-sysadmin/

+
+Cockpit + cloudflare tunnel +

Wymagana edycja pliku +

cat /etc/cockpit/cockpit.conf
+

+

[WebService]
+Origins = https://dashboard.xxxxx.ca wss://dashboard.xxxxx.ca
+ProtocolHeader = X-Forwarded-Proto
+AllowUnencrypted = true
+
+Potem w panelu Cloudflate mapujemy nasz adres na http://localhost:9090 +źródło +Inną ważną rzeczą jest ograniczenie poziomu domeny. Nie powinno się używać pod-poddomen. może być cockpit-serwer.domena.pl, ale nie cockpit.serwer.domena.pl żródło

+
+

Monitorowanie dockerów 🐋

+
    +
  • portainer aplikacja służąca do wygodnej pracy oraz monitorowania dockerów w systemie
  • +
  • Yacht - alternatywa dla portainera (trochę młodszy i prostszy projekt)
  • +
+

Sieć, łączenie się i udostępnianie

+
    +
  • ngrok - pozwala łatwo udostępniać serwisy z urządzeń w sieci lokalnej. Dobre do prototypowania oraz prostych stron
  • +
  • cloudflare - must-have gdy masz jakąś domenę i nią zarządzasz
  • +
  • Cloudflare Proxy - zwiększa wydajność twoich stron oraz pozwala tunelować ruch IPv4 na adresy PIv6
  • +
  • Tunelowanie - pozwala wystawiać do sieci serwery z sieci lokalnych pozbawione publicznych adresów. Można użyć tego chociażby do udostępnienia cockpita, czy też SSH (instrukcje)
  • +
+

VPN-y

+
    +
  • Wireguard - jeden z dwóch popularnych protokołów VPNa.
  • +
  • +

    OpenVPN - również popularny, lecz troche przestarzały protokół VPNa

    +
  • +
  • +

    PiVPN - prosty i uniwersalny VPN. Ma UI webowe oraz wpiera Wireguarda i OpenVPN-a.

    +
  • +
+

Obsługa PiVPN-a i Wireguarda

+

Zakładam, że PiVPN jest skonfigurowany z Wireguardem.

+

Aby dodać nowego nowe połączenie do naszego serwera wireguarda nalezy wywołać komendę pivpn add, tam określamy nazwę połączenia.

+
pawel@amd:~$ pivpn add
+Enter a Name for the Client: superserwer
+::: Client Keys generated
+::: Client config generated
+::: Updated server config
+::: WireGuard reloaded
+======================================================================
+::: Done! superserwer.conf successfully created!
+::: superserwer.conf was copied to /home/opc/configs for easytransfer.
+::: Please use this profile only on one device and create additional
+::: profiles for other devices. You can also use pivpn -qr
+::: to generate a QR Code you can scan with the mobile app.
+======================================================================
+
+

Konfigi są też zapisywane w /etc/wireguard/configs

+

Instrukcja podłączenia się - Aby się podłączyć na maszynie klienckiej umieszczamy ten konfig w folderze /etc/wireguard/ i wołamy komendę wg-quick up nazwapliku🟩 any wystartować i wg-quick down nazwapliku🟥 aby zatrzymać. +(przydać się może paczka resolvconf)

+

Storage

+ +

Dla chcących postawić sobie jakiś serwer

+

Poszukiwanie VPS-a:

+ +
+Oracle odblokowywanie portów +

Jako, że maszyny od Oracle mają domyślnie publiczne IP to mają domyślnie nieco bardziej restrykcyjny firewall. +link do dokumentacji +Najpierw trzeba zmienić ustawienia w panelu na stronie oracle, a potem jeszcze dodać zasadę do iptables +sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT +i jeśli to działa to możemy zapisać naszą zmianę +sudo netfilter-persistent save

+
+

Oganianie domen:

+
    +
  • tld-list - porównywarka cen domen
  • +
  • seohost - moim zdaniem najlepszy dostawca domen w Polsce
  • +
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Python\360\237\220\215/1_ogolne_notatki/index.html" "b/Python\360\237\220\215/1_ogolne_notatki/index.html" new file mode 100644 index 00000000..5c863992 --- /dev/null +++ "b/Python\360\237\220\215/1_ogolne_notatki/index.html" @@ -0,0 +1,3382 @@ + + + + + + + + + + + + + + + + Podstawy Pythona 🐍 - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Podstawy Pythona 🐍

+

Quickstart

+

Shebang

+

Jest to pierwsza linia skryptu (nie tylko w pythonie), która określa za pomocą czego ma być wykonany skrypt (może być to bash, zsh, python) +Mamy tutaj 2 możliwości:

+

Ta bardziej uniwersalna (działa z wieloma systemami operacyjnymi)

+
#!/usr/bin/env python3
+
+

Ta mniej uniwersalna, ale pozwalająca używać pythona z różnymi parametrami

+
#!/usr/bin/python3
+
+

Np z po dodaniu parametru -i nadal pozostaniemy w pythonie po wykonaniu skryptu, co pozwoli nam np zajrzeć do zmiennych, które były użyte, lub łatwo użyć klas, albo metod, które zostały zdefiniowane w skrypcie.

+

Funkcja main

+

wykonuje się, gdy skrypt jest uruchamiany jako samodzielny program, a nie jako moduł czegoś innego

+
#!/usr/bin/python3 #warto to dać, aby system widział, że to skrypt w pythonie a nie np. w shellu
+def main():
+    print("Witaj świecie!")
+
+if __name__ == "__main__":
+    main()
+
+

Argumenty programu

+
# Print total number of arguments
+print ('Total number of arguments:', format(len(sys.argv)))
+
+# Print all arguments
+print ('Argument List:', str(sys.argv))
+
+# Print arguments one by one
+print ('First argument:',  str(sys.argv[0]))
+print ('Second argument:',  str(sys.argv[1]))
+
+

Do parsowania bardziej skomplikowanych argumentów warto użyć biblioteki argparse

+

Zwracanie wartości

+
sys.exit(numer)
+
+

Funkcje we/wy

+
pobrany_napis = input()
+print("Twój napis to: " + pobrany_napis)
+
+

input() jest funkcją, która pobiera napis podany przez użytkownika ze standardowego wejścia (do entera) zwraca zmienną typu str

+

Dla strumieni:

+
import sys
+
+for line in sys.stdin:
+    sys.stdout.write(line)
+
+

Importowanie bibliotek etc

+

TODO

+

Przykładowe importy.

+
import math
+
+from collections import namedtuple
+
+from django.contrib.auth.forms import (
+    AuthenticationForm, PasswordChangeForm, PasswordResetForm, SetPasswordForm,
+)
+
+

więcej informacji w opisie paczek.

+

Podstawy

+

Komentarze

+
"""
+Komentarz na
+kilka linii
+"""
+#komentarz na jedną linię
+
+

Zmienne

+

Deklarujemy je be określania ich typu a=5 (interpreter automatycznie uzna, że to będzie int) +W odróżnieniu od takich języków jak C++, C# czy Java, w języku Python występuje typowanie dynamiczne. Oznacza to, że konkretny identyfikator, konkretna zmienna, np. a, może raz przechowywać napis ("Ala ma kota") by po chwili przechowywać liczbę całkowitą (3). +Do sprawdzania typu danych służy funkcja type().

+
logiczna = True
+print(type(logiczna))
+## <class 'bool'>
+
+

Najważniejsze typy zmiennych:

+
    +
  • bool, wartość logiczna, tak lub nie, prawda (True) albo fałsz (False)
  • +
  • int, liczba całkowita, np. -7, 0 czy 3:
  • +
  • float, czyli wartość zmiennopozycyjna, można ją utożsamiać z wartościami rzeczywistymi, np. -0.67, 1.0, 3.14
  • +
  • complex, czyli liczba zespolona, np. -7+8.5j. Warto pamiętać, że w Pythonie jednostką urojoną jest j, a nie i
  • +
  • str, powszechnie znany w innych językach jako string, czyli napis. Napis poznajemy głównie po tym, że jest zapisany w cudzysłowie (i to odróżnia go choćby od nazwy zmiennej czy liczby, które nie są w cudzysłowach). Dodamy, że w języku Python nie ma znaczenia, czy posługujemy się pojedynczymi (') czy podwójnymi (") cudzysłowami
  • +
+

Konwersja typów analogiczna dla przykładu poniżej

+
print(int(5.3))
+## 5
+
+

Operatory:

+
    +
  • dodawanie (+)
  • +
  • odejmowanie (-)
  • +
  • mnożenie (*)
  • +
  • dzielenie (/)
  • +
  • reszta z dzielenia, modulo (%) + Analogiczne co C operatory -=, *=, /=, %=... + UWAGA! Brak operatorów ++ i --
  • +
  • ** potęga
  • +
  • 2+3j liczba zespolona
  • +
+

Operatory Logiczne zwracają wartość logiczną (True/False)

+
    +
  • < - mniejsze
  • +
  • <= - mniejsze równe, zwróćmy uwagę, że zapisujemy tak jak czytamy, nie ma operatora =< (równe mniejsze)
  • +
  • > - większe
  • +
  • >= - większe równe
  • +
  • == - równa się. Tutaj bardzo ważne jest, aby odróżniać operator przypisania (=) od operatora porównania równa się (==). To bardzo częsty błąd wśród początkujących programistów. Operator = nie jest symetryczny, ma na celu przekopiowanie wartości z prawej do lewej. W niektórych językach zapisuje się go jako <- (ale nie w Pythonie). Operator = nie ma nic wspólnego z wartościami logicznymi. Za to operator == jest operatorem zwracającym wartość logiczną, a co więcej, jest on operatorem symetrycznym (nie ma znaczenia zamienienie kolejnością argumentów).
  • +
  • != - nie równa się + Operator koniunkcji, and, utożsamiany z polskim i. Zwraca wartość True wtedy i tylko wtedy, gdy oba argumenty są równe True + Operator alternatywy, or, utożsamiany z polskim lub. Zwraca wartość True wtedy i tylko wtedy, gdy przynajmniej jeden argument jest równy True + Operator zaprzeczenia, not, utożsamiany z polskim nie. Zwraca wartość przeciwną, niż argument
  • +
+

Można łączyć kilka operatorów np: +czy_wiek_produkcyjny = 18 <= wiek <= 65 - w pythonie porównania rozwijane są tak jak w matematyce, czyli np możemy też napisać 2 <= 4 < 8, co zwróci nam True

+

Inne operatory:

+
    +
  • is - czy dwie zmienne są różnymi instancjami tego samego obiektu
  • +
+
s1={}
+s2={}
+
+s1==s2
+#True
+
+s1 is s2
+#False ##ponieważ to nie jest ten sam słownik
+
+
    +
  • in używany do sprawdzenia, czy dana wartość/obiekt zawiera się w liście/słowniku/secie...
  • +
+
zbior = {1, 3, 5}
+zbior_pusty = {}
+
+print(1 in zbiorPusty)
+## False
+print(1 in zbior)
+## True
+
+

Instrukcja warunkowa if

+
if warunek:
+    instrukcja1
+    instrukcja2
+elif warunek2: # gdy warunek nieprawdziwy, sprawdź warunek2
+    instrukcja3
+    instrukcja4
+elif warunek3: #gdy warunek2 nieprawdziwy, sprawdź warunek3
+    instrukcja5
+    instrukcja6
+else: #gdy zaden z warunków nie byl prawdziwy
+    instrukcja7
+    instrukcja8
+
+

Warto także pamiętać o jedno-linijkowym wariancie if-a:

+
# a if condition else b
+print("Prawda") if True else print("Fałsz")
+#Prawda
+
+

Pusta zmienna

+

Czasem _ jest używane jako pusta zmienna jest to swego rodzaju odpowiednik /dev/null

+

TODO dopisać i omówić przykłady: +https://stackoverflow.com/questions/5893163/what-is-the-purpose-of-the-single-underscore-variable-in-python

+

Pętle

+

Po for (foreach) może się znajdować lista (obrót dla każdego elementu) +Po while warunek logiczny (obroty dopóki prawda)

+
for i in range(0, 4):
+print(i)
+
+## 0
+## 1
+## 2
+## 3
+
+#lub
+i = 0
+while i < 4:
+print(i)
+i+=1
+
+liczby = [2, 3, 5]
+for liczba in liczby:
+print(liczba)
+## 2
+## 3
+## 5
+
+

Słowo kluczowe continue przerywa dany obrót pętli +Słowo kluczowe break przerywa całą pętlę

+

Jeśli iterujemy po liście krotek możemy sobie je rozbić

+
for i, line in enumerate(strings_list): #enumerate zwraca dla danej listy krotkę zawierającą numer i element z listy
+    ###jakiś kod
+
+

Pętle jednolinijkowe (List Comprehensions)

+

Jednolinijkowe pętle zwracające np listę dobre dla prostych operacji, użyteczne do szybkiego generowania tablic.

+
newlist = [expression for item in iterable if condition == True]
+#albo bez if-a
+newlist = [x for x in range(10)]
+
+fruits = ["apple", "banana", "cherry", "kiwi", "mango"]
+newlist = []
+
+for x in fruits:
+  if "a" in x:
+    newlist.append(x)
+
+#daje to samo co:
+
+newlist = [x for x in fruits if "a" in x]
+
+

Krotka (tuple)

+

Pewną specyficzną dla języka Python strukturą jest krotka. Polega ona na grupowaniu paru wartości w jeden byt. Warto zaznaczyć, że krotka, która raz została stworzona, nie może być modyfikowana: nie możemy podmienić jednej ze składowych krotki

+
krotka = (2,3)
+print(krotka)
+## (2, 3)
+
+

Gdybyśmy chcieli uzyskać poszczególne składowe krotki, możemy to zrobić przy użyciu operatora kwadratowych nawiasów. W Pythonie, tak jak w wielu językach programowania, numerujemy składowe od 0:

+
pierwsza = krotka[0]
+druga = krotka[1]
+print(pierwsza)
+## 2
+print(druga)
+## 3
+W krotce możemy mieszać typy danych:
+krotka = (2, "Napis")
+print(krotka)
+## (2, 'Napis')
+len(krotka) #długość krotki
+## 2
+
+

Kiedy krotka może być przydatna? Np. gdy chcemy zwrócić więcej niż jedną wartość w funkcji.

+
def f(x):
+    y0 = x + 1
+    y1 = x * 3
+    y2 = y0 ** y3
+    return (y0, y1, y2)
+
+

Jeśli chcemy możemy rozbić krotkę na poszczególne zmienne

+
a,b,c = (1,2,3)
+
+

named tuple

+

Specjalne obiekty działające jak krotki i kompatybilne z nimi.

+
from collections import namedtuple
+Point = namedtuple('Point', 'x y')
+pt1 = Point(1.0, 5.0)
+pt2 = Point(2.5, 1.5)
+
+from math import sqrt
+# wskazanie poprzez indeks
+line_length = sqrt((pt1[0]-pt2[0])**2 + (pt1[1]-pt2[1])**2)
+ # rozpakowanie krotki
+x1, y1 = pt1
+
+

Funkcja zip

+

Do operowania na krotkach przydatna jest funkcja wbudowana zip zwracająca iterator (nie listę) pozwalający iterować po krotkach tworzonych z obiektów danych w funkcji.

+
a = ("John", "Charles", "Mike")
+b = ("Jenny", "Christy", "Monica", "Vicky") # wartości nadmiarowe są pomijane
+
+for kr in zip(a, b):
+    print(kr)
+
+#('John', 'Jenny')
+#('Charles', 'Christy')
+#('Mike', 'Monica')
+
+

Lista

+

Podobną, przynajmniej na pozór, strukturą danych do krotki jest lista. Tutaj także możemy grupować dane oraz nie muszą one być tego samego typu. Jednak główną różnicą jest to, że listę możemy modyfikować. Możemy dodawać nowe elementy czy zastępować dotychczasowe.

+
lista = [1, False, "Napis"]
+print(lista)
+## [1, False, 'Napis']
+print(len(lista))
+## 3
+lista.append(2.5+3.7j)
+print(lista)
+## [1, False, 'Napis', (2.5+3.7j)]
+lista.extend([97,98,99]) # metoda podobna po append, która przyjmuje jako argument całą listę i dodaje z niej kolejne elementy
+print(lista)
+## [1, False, 'Napis', (2.5+3.7j), 97, 98, 99]
+
+

Operatory + i * mają zdefiniowane działanie w kontekście list. ++, tak jak w przypadku napisu, to konkatenacja, czyli połączenie dwóch list w jedną +* zaś pozwala nam powielić daną listę:

+
print(lista + [7,8,9])
+## [1, False, 'Napis', (2.5+3.7j), 97, 98, 99, 7, 8, 9]
+print([7,8,9] * 3)
+## [7, 8, 9, 7, 8, 9, 7, 8, 9]
+
+

Odwołanie się do konkretnego elementu następuje tak jak w krotce:

+
print(lista[2])
+## Napis
+! ujemne indeksy oznaczają pozycje liczone od tyłu
+print(lista[-1])
+## 99
+Odwoływanie się do wycinka listy
+print(lista[2:5])
+## ['Nowy', (2.5+3.7j), 97]
+Elementy o numerach 2, 3, 4 (bez 5)
+
+"ala ma kota"[-4::] #elementy od trzeciego od końca aż do ostatniego
+#"kota"
+
+

Podmiana

+
lista[0:3] = [98,99,101,102]
+print(lista)
+## [98, 99, 101, 102, (2.5+3.7j), 97, 98, 99]
+
+

Usuwa 3 pierwsze elementy i na ich miejsce wstawia te podane

+

Wstawienie elementu w innym miejscufor klucz in bazaDanychPolakow.keys():

+
print(klucz)
+
+for wartosc in bazaDanychPolakow.values():
+print(wartosc)
+
+for klucz, wartosc in bazaDanychPolakow.items(): ##Tutaj items() zwraca krotkę
+print(klucz)
+print(wartosc)
+print("-----")
+
+
+lista.insert(1, "Nowy2")
+print(lista)
+## [98, 'Nowy2', 99, 101, 102, (2.5+3.7j), 97, 98, 99]
+Usunięcie elementu
+del lista[1]
+print(lista)
+## [98, 99, 101, 102, (2.5+3.7j), 97, 98, 99]
+Napisy
+Zmienna w napisie
+zmienna = 7
+napis = f"wartość zmiennej to {zmienna}"
+print(napis)
+## wartość zmiennej to 7
+wieleWierszy = """Tutaj pierwszy
+a tu drugi
+tutaj trzeci"""
+print(wieleWierszy)
+## Tutaj pierwszy
+## a tu drugi
+## tutaj trzeci
+
+

Kolejność alfabetyczna

+
print("a" < "b")
+## True
+
+

Więcej na: +https://www.kodolamacz.pl/blog/wyzwanie-python-3-algorytmy-i-struktury-danych/

+

Zbiór (set)

+

to tablica (tyle, że bez indeksowania), w których nie ma dwóch lub więcej identycznych elementów. (jest szybszy od listy)

+
zbiorPusty = set()
+zbior = {1, 3, 5}
+print(zbiorPusty)
+## set()
+print(zbior)
+## {1, 3, 5}
+zbior.add(2) ##Dodawanie elementu
+zbior.discard(2) ##Usuwanie elementu
+Można w nim łatwo sprawdzać, czy dany element należy do zbioru
+print(1 in zbiorPusty)
+## False
+print(1 in zbior)
+## True
+print(1 not in zbiorPusty)
+## True
+
+

Możemy na nich wykonać typowe operacje teoriomnogościowe, jak suma, różnica czy przecięcie dwóch zbiorów

+
print({1,5,8} | {1,5,9}) # suma
+## {1, 5, 8, 9}
+print({1, 5, 8} - {1, 5, 9}) # różnica
+
+## {8}
+print({1, 5, 8} & {1, 5, 9}) # przecięcie
+## {1, 5}
+Można zapytać, czy jeden zbiór jest podzbiorem drugiego
+print({1, 5}.issubset({1, 5, 9}))
+## True
+
+

Słownik

+

Jest to rozszerzenie idei zbioru. +Słownik zawiera pary klucz-wartość. Wyszukiwanie po kluczu jest szybkie, tak jak w zbiorze, jednak gdy już odnajdziemy klucz, możemy odzyskać także stowarzyszoną z nim wartość. Gdy usuniemy ze słownika wartości, a zostawimy same klucze, otrzymamy zbiór. Tak jak w zbiorze, w słowniku klucze nie mogą się powtarzać.

+
bazaDanychPolakow = {"89082911111" : ["Jan", "Kowalski", 29],
+"95092200000" : ["Ania", "Nowak", 23],
+"98122422222" : ["Adam", "Mickiewicz", 220]
+}
+bazaDanychPolakow["88081244444"] = ["Magda", "K", 30] #Dodanie nowej pary klucz-wartość
+del bazaDanychPolakow["88081244444"] #Usunięcie danej pary
+
+

Tak jak w zbiorze możemy sprawdzać, czy klucz znajduje się w słowniku.

+

Uzyskanie wartości stowarzyszonej z kluczem

+
print(bazaDanychPolakow["98122422222"])
+## ['Adam', 'Mickiewicz', 220]
+Gdy chcemy zabezpieczyć się przed odwołaniem do nieistniejącego elementu (i w tym wypadku zwrócić wartość domyślną), użyjemy metody get():
+print(bazaDanychPolakow.get("89082911111", "wartość domyślna"))
+## ['Jan', 'Kowalski', 29]
+print(bazaDanychPolakow.get("95092200022", "wartość domyślna"))
+## wartość domyślna
+
+

Przejście w pętli

+
for klucz in bazaDanychPolakow.keys():
+print(klucz)
+
+for wartosc in bazaDanychPolakow.values():
+print(wartosc)
+
+for klucz, wartosc in bazaDanychPolakow.items(): ##Tutaj items() zwraca krotkę
+print(klucz)
+print(wartosc)
+print("-----")
+
+

Przy printowaniu słowników (zwłaszcza tych skomplikowanych) warto użyć pprint

+
import pprint
+pprint.pprint(duzy_slownik)
+
+

Funkcje

+

Funkcje

+
def nazwaFunkcji(parametry, oddzielone, przecinkami):
+return wynik
+Wartości domyślne parametrów
+def potega(podstawa, wykladnik=1):
+#ciało funkcji
+Argumenty nazwane Możemy podawać argumenty w dowolnej kolejności, gdy podamy ich nazwy
+print(potega(wykladnik = 4, podstawa = 3))
+## 81
+
+
def printinfo( name, age = 35 ):
+   "Prosta funkcja z domyślnymi wartościami"
+   print("Name: ", name)
+   print("Age ", age)
+   return
+
+

Funkcja może także przyjmować wiele argumentów

+
#** - zmienne będą interpretowane jako krotka
+def printinfo( arg1, *krotka ):
+   print("Output is: ")
+   print(arg1)
+   for var in krotka:
+      print(var)
+   return
+#** - zmienne będą interpretowane jako słownik
+def printinfo2( arg1, **slownik ):
+   print( "Output is: ")
+   print(arg1)
+   for key in slownik.keys():
+      print(key)
+   return
+
+printinfo( 10 )
+printinfo( 70, 60, 50 )
+printinfo2("argum1",klucz1=wart1,klucz2=wart2,klucz3=523,pusty=None) #ważne, aby słownik był definiowany jako słownik, czyli klucz=wartosc
+
+

W pythonie jedna funkcja może zwracać różne rzeczy, obiekty, zmienne, nic.

+
def returnOrNot(return_bool=True):
+    if return_bool:
+        return True
+    return
+
+

Adnotacje

+

W wypadku funkcji możemy też dodać adnotacje (typowanie zmiennych) do ich argumentów oraz wartości zwracanych (nie są one wykorzystywane przez interpreter, ale ułatwiają dokumentowanie). +(Uwaga, tej funkcji nie ma w pythonie 2, dla niego jest workaround o nazwie type comments )

+
def funkcja( liczba1:99=12 , slowo1:str="sl", slowo2:"inne slowo"="inne") -> str:
+    #some code
+    return "slowo"
+
+
+slowo: str = "inne_slowo"
+
+

Można potem je sprawdzić poprzez sięgnięcie do atrybutu __annotations__

+
>>>funkcja.__annotations__
+{'liczba1': 99, 'slowo1': <class 'str'>, 'slowo2': 'inne slowo', 'return': <class 'str'>}
+
+

W niektórych wypadkach może pojawić się potrzeba zaimportowania oczekiwanych elementów

+
from typing import Tuple
+def foo(x:int, y:int) -> Tuple[int, int]:
+    return (x*y, y//2)
+
+

Możliwe są też adnotacje dla elementów klasy PEP-526

+
class Starship:
+    stats: ClassVar[dict[str, int]] = {} # class variable - pole klasy
+    damage: int = 10                     # instance variable - pole instancji
+
+

W razie problemów spowodowanych kolejnością deklaracji różnych elementów w pliku warto użyć specjalnego importu

+
from __future__ import annotations # bez niego poniższy kod by nie działał
+
+def fun(i: A): #moglibyśmy otzymać błąd mówiący o odnoszeniu się do nieistniejącej klasy
+    pass
+
+class A:
+    pass
+
+

Wyrażenia lambda

+

Lambdy to są funkcje, które można w dość podręczny sposób zdefiniować

+
#Ogólna definicja
+lambda arg1, arg2, arg3: nasze_wyrazenie #ta lambda zwróci wartość naszego wyrażenia
+
+nasza_lambda = lambda x: x*2
+nasza_lambda(2)
+#>4
+
+

Argumenty w lambdach można zapisywać tak samo jak w zwykłych funkcjach, mogą tam być wartości domyślne,

+

Zasięg i zmienne globalne

+

W pythonie na ogół funkcje nie mogą edytować (mogą mieć dostęp, ale nie edytować) zmienne poza swoim zakresem.

+
c = 1 # global variable
+
+def add():
+    print(c)
+    c = c + 2 # increment c by 2
+    print(c)
+
+add()
+#>2
+#>UnboundLocalError: local variable 'c' referenced before assignment
+
+

Aby móc je jednak zmieniać jest używane słowo kluczowe global.

+
c = 0 # global variable
+
+def add():
+    global c
+    c = c + 2 # increment by 2
+    print("Inside add():", c)
+
+add()
+print("In main:", c)
+#>Inside add(): 2
+#>In main: 2
+
+

Przekazywanie dowolnych argumentów (**kwargs i *args)

+

Pozwalają one na umieszczeanie argumentów o dowolnej liczbie i nazwie w naszej funkcji. args przyjmuje je jako listę kolejnych elementów, zaś kwargs przyjmuje je jak słownik.

+
def parametr_args(*args):
+    print("zawartość args: {}".format(args))
+
+parametr_args('python', 'spam', 'eggs', 'test')
+###zawartość args: ('spam', 'eggs', 'test')
+
+def parametr_kwargs(argument, **kwargs):
+    print("argument: {}".format(argument))
+    print("zawartość kwargs: {}".format(kwargs))
+
+parametr_kwargs(dodatkowy=48, nastepny=111, argument=12)
+
+# argument: 12
+# zawartość kwargs: {'dodatkowy': 48, 'nastepny': 111}
+
+

//TODO https://printpython.pl/poczatki/zadanie-z-gwiazdka/

+

Dekoratory funkcji

+

Jest to element pozwalający na opakowanie naszej funkcji za pomocą innej funkcji, aby wzbogacić jej funkcjonalność.
+Funkcja dekorująca najczęściej przyjmuje funkcję dekorowaną i zwraca nową, wynikową funkcję, która ma zostać wykonana.

+
#foo jest dekoratorem, który wzbogaci naszą funkcję
+def foo(to_be_wrapped):
+    def new_func(args,**kwargs):
+        print("uwaga, będzie sześcian")
+        return to_be_wrapped(*args,**kwargs)  # warto je dodać aby argumenty zostały przekazane dalej do funkcji docelowej
+
+    return new_func
+
+@foo #jeśli dodamy ten dekorator to użycie tej funkcji zostanie zmienione, tzn zamiast oryginalnej funkcji cube() otrzymamy "wzbogacone" cube drukujące komunikat przed drukowaniem
+def cube(d):
+    return d ** 3 #podniesienie do potęgi 3
+
+cube(2)
+#uwaga, będzie sześcian
+#8
+
+

Ale warto pamiętać, że jeśli chcemy przygotowywać takie dekoratory wewnątrz klas to musimy pamiętać, żę nieco inaczej wygląda dostęp do self

+
class Myclass:
+    # wydaje mi się, że tutaj dekorator musi być zdefiniowany jako pierwszy
+    def _add_loaded_location_to_token(decorated_fun, *args, **kwargs):
+        def output_fun(*args, **kwargs):
+            t = decorated_fun(*args, **kwargs)
+            t.location = args[0].current_location # po prostu self jest schowany pod pierwszym z argumentów
+            return t
+
+        return output_fun
+
+    @_add_loaded_location_to_token
+    def get_token(self):
+        #kod
+        return token
+
+

Statyczne pola funkcji

+

Odpowiednikiem zmiennych typu static wewnątrz funkcji jest pole funkcji. źródło

+
def myfunc():
+  myfunc.counter += 1
+  print myfunc.counter
+
+# atrybut musi być gdzieś zainicjalizowany
+myfunc.counter = 0
+
+

Można też dodać atrybut w ten sposób:

+
def myfunc():
+  if not hasattr(myfunc, "counter"):
+     myfunc.counter = 0  # it doesn't exist yet, so initialize it
+  myfunc.counter += 1
+
+

Obiektówka

+

Obiekt

+
class Osoba: #Definicja klasy o nazwie Osoba
+    ile = 0 # pole klasy
+    imie: str # adnotacja typu dla pola instancji
+    def __init__(self, imie, nazwisko, wiek): #Definicja konstruktora
+        self.imie = imie
+        self.nazwisko = nazwisko
+        self.wiek = wiek
+    def przedstaw_sie(self):
+        print(f"Jestem {self.imie} {self.nazwisko}. Mam {self.wiek} lat.")
+    def urodziny(self):
+        wiek_przed = self.wiek
+        self.wiek += 1
+    return wiek_przed
+    def __del__(self): # destruktor, czyli kod, który wykonuje się podczas niszczenia obiektu
+    @staticmethod
+    def policz():
+        return Osoba.ile
+
+

Obiekty w pythonie nie mają pól statycznych działających tak jak w innych językach (jak np C++). Tutaj zmiana pola klasy nie zmienia wartości tego pola dla innych instancji link.

+

Metody

+

Metodę możemy poznać min. także po pierwszym argumencie: self. +W języku Python metody przyjmują jako pierwszy parametr obiekt, na rzecz którego są wywoływane. W samym wywołaniu nie musimy go sami podawać. Wystarczy, że metoda jest napisana po kropce. Następnie następują trzy zwykłe parametry: imie, nazwisko oraz wiek.

+
Konstruktor i destruktor
+

Jest to taka metoda, która jest wywoływana, gdy obiekt jest tworzony. Jej celem jest zainicjowanie pól w instancji. Tu są definiowane parametry klasy. +Konstruktor poznajemy po jego specjalnej nazwie: __init__. +Analogicznie działa destruktor (nazwa: __del__) +Przy wywołaniu pomijamy argument self.

+
Jan = Osoba("Jan", "Nowak", 48)
+Jan = None #Wymuszenie destrukcji obiektu
+
+
Własne operatory
+

W pythonie można w prosty sposób dodawać własne operatory do klas. Możemy w prosty sposób sprawić, że korzystanie z naszych klas będzie wygodniejsze.

+
class C:
+    __str__(self):
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperatorNazwa funkcjiOpis
str()__str__(self)Funkcja generująca stringa dla danej klasy. Przydatne do debugowania i nie tylko
+__add__(a,b)Dodawanie
[]__getitem__(self,index)Te kilka jest potrzebne do poprawnego zaimplementowania operatora []
[]__setitem__(self,index,item)
[]__delitem__(self.index)
+

Pełniejsza lista operatorów +TODO popraw i rozbuduj

+

Widoczność elementów

+

W języku Python nie ma pól prywatnych w klasie: nie jesteśmy w stanie w praktyce czegokolwiek “ukryć”. Jednak są pewne zasady nazewnictwa, które działają raczej na zasadzie porozumienia, niż będące prawdziwą barierą. I tak, gdy poprzedzimy nazwę jednym znakiem podkreślenia _, oznajmiamy, że dany element nie jest uwzględniony w dokumentacji, może się zmienić, raczej nie należy z niego korzystać, a środowisko programistyczne nie będzie nam go podpowiadać. Przykładowo pole _imie, np. self._imie, czy self._metoda().

+

Gdy użyjemy dwóch znaków podkreślenia __, zachowanie jest trochę inne: dane pole czy metoda nie będzie widoczna pod tą nazwą wcale, ale za to będzie można się do niego odwołać (dla nazwy __element) poprzez _nazwaklasy.__element.

+

Statyczne

+

Dla odmiany są one tworzone poza konstruktorem. Do pola tego odwołujemy się poprzez nazwę klasy. Np Osoba.ile +Sama metoda statyczna ma nad sobą napis @staticmethod. To tzw. dekorator. +Metoda statyczna nie może odwoływać się do instancyjnych pól (czyli tych zwykłych, jak imie z poprzedniego przykładu), a jedynie do statycznych. Wynika to z faktu, że metoda statyczna nie jest wywoływana na rzecz konkretnego obiektu, który by takie właśnie pola miał.

+

Jeśli jednak chcemy aby nasza metoda miała jakieś informacje na temat naszej klasy można użyć dekoratora @classmethod, który różni się tym, że klasaobiektu (nie instancja) jest przekazywana dalej. Porównanie na stacku

+
class A(object):
+    def foo(self, x):
+        print(f"executing foo({self}, {x})")
+
+    @classmethod
+    def class_foo(cls, x):
+        print(f"executing class_foo({cls}, {x})")
+
+    @staticmethod
+    def static_foo(x):
+        print(f"executing static_foo({x})")
+
+

Dziedziczenie

+
class Zwierze:
+    def __init__(self, nazwa, wiek, waga):
+        self.nazwa = nazwa
+        self.wiek = wiek
+        self.waga = waga
+    def przedstaw_sie(self):
+        print(f"Jestem zwierzęciem {self.nazwa}, mam {self.wiek} lat oraz wazę {self.waga} kg.")
+    def urodziny(self):
+        self.wiek += 1
+
+class Mrowka(Zwierze):
+    pass #Oznacza, że ciało jest puste
+
+class Slon(Zwierze):
+    def przedstaw_sie(self):
+        print(f"Jestem słoniem {self.nazwa}, mam {self.wiek} lat oraz wazę {self.waga} kg.")
+
+class Lew(Zwierze):
+    def przedstaw_sie(self):
+        super().przedstaw_sie()
+        print("A tak w ogóle to jestem lwem")
+
+class Papuga(Zwierze):
+    def __init__(self, nazwa, wiek, waga, kolor):
+        super().__init__(nazwa, wiek, waga)
+        self.kolor = kolor
+    def przedstaw_sie(self):
+        super().przedstaw_sie()
+        print(f"Jako papuga mój kolor to {self.kolor}")
+
+

super() zwraca nam instancję klasy bazowej: są to wszystkie pola i metody naszego obiektu, jakie otrzymaliśmy dzięki klasie bazowej.

+

Polimorfizm

+

Pozwala na używanie klasy dziedziczącej wszędzie tam, gdzie może być użyta klasa bazowa. +Oznacza to, że instancja klasy dziedziczącej jest uznawana za instancję klasy bazowej. W języku Python sprawdzenie przynależności danego obiektu do klasy wykonuje się metodą isinstance():

+
def main():
+    Dumboo = Slon("Dumboo", 77, 6000)
+    Simba = Lew("Simba", 24, 100)
+    Jago = Papuga("Jago", 32, 3, "czerwony")
+    jakis_zwierz = Zwierze("Katarzyna", 31, 80)
+    print(f"isinstance(Dumboo, Slon): {isinstance(Dumboo, Slon)}")
+    print(f"isinstance(Dumboo, Lew): {isinstance(Dumboo, Lew)}")
+    print(f"isinstance(Jago, Papuga): {isinstance(Jago, Papuga)}")
+    print(f"isinstance(Jago, Zwierze): {isinstance(Jago, Zwierze)}")
+    print(f"isinstance(jakis_zwierz, Zwierze): {isinstance(jakis_zwierz, Zwierze)}")
+    print(f"isinstance(jakis_zwierz, Papuga): {isinstance(jakis_zwierz, Papuga)}")
+
+if __name__ == "__main__":
+    main()
+
+## isinstance(Dumboo, Slon): True
+## isinstance(Dumboo, Lew): False
+## isinstance(Jago, Papuga): True
+## isinstance(Jago, Zwierze): True
+## isinstance(jakis_zwierz, Zwierze): True
+## isinstance(jakis_zwierz, Papuga): False
+
+

Abstrakcja

+

Uniemożliwia tworzenie instancji danej klasy. Przydatne przy klasach bazowych dokumentacja

+
from abc import ABC
+
+class Zwierze(ABC):
+    def __init__(self,nazwa, wiek, waga):
+        self.nazwa=nazwa
+        self.wiek=wiek
+        self.waga=waga
+
+    @abstractmethod #tutaj wymuszamy implementację tej metody w klasach pochodnych
+    def nazwa_gatunku(self):
+        pass
+    def przedstaw_sie(self):
+        print(f"Jestem {self.nazwa_gatunku()}. Mam na imię {self.nazwa}, mam {self.wiek} lat oraz wazę {self.waga} kg.")
+    def urodziny(self):
+        self.wiek += 1
+
+class Slon(Zwierze):
+    def nazwa_gatunku(self):
+        return "Słoń"
+
+class Lew(Zwierze):
+    def nazwa_gatunku(self):
+        return "Lew"
+
+

Niestety, mechanizm klas i metod abstrakcyjnych (klasa jest abstrakcyjna gdy ma co najmniej jedną metodę abstrakcyjną) w języku Python jest wprowadzony trochę sztucznie. Klasa bazowa (abstrakcyjna) musi dziedziczyć po sztucznej klasie ABC, a metoda abstrakcyjna jest opatrzona dekoratorem @abstractmethod. Zwróćmy uwagę, że jedno i drugie zostało zaimportowane. Jednak po tych czynnościach rzeczywiście nie jesteśmy w stanie stworzyć instancji klasy bazowej.

+

Zwróćmy uwagę na ten zaawansowany mechanizm: w klasie Zwierze tworzymy metodę, zakładamy, co ta metoda będzie zwracać, a następnie korzystamy z niej w innej metodzie, pomimo, że prawdziwa jej implementacja nastąpi dopiero w klasie pochodnej. Dzięki temu musimy napisać mniej kodu w klasach pochodnych: musimy jedynie zaimplementować metodę nazwa_gatunku(), jednak nie musimy już od zera pisać kodu na przedstawienie zwierzęta. Jedynie w klasie Papuga, gdzie wprowadziliśmy nowe pole, dopisujemy kod odpowiedzialny za wypisanie jego wartości.

+

/TODO jak poradzić sobie z tym?

+
class Zwierze(ABC):
+    def __init__(self,nazwa, wiek, waga):
+        self.nazwa=nazwa
+        self.wiek=wiek
+        self.waga=waga
+
+    @abstractmethod #tutaj wymuszamy implementację tej metody w klasach pochodnych
+    def nazwa_gatunku(self):
+        pass
+
+    def urodziny(self):
+        self.wiek += 1
+
+class Slon(Zwierze):
+    def __init__(self,nazwa, wiek, waga):
+        syper().__init__(self,nazwa, wiek, waga)
+    def nazwa_gatunku(self):
+        return self.nazwa
+
+class Slon(Zwierze):
+    def __init__(self,nazwa, wiek, waga):
+        syper().__init__(self,nazwa, wiek, waga)
+
+    # def nazwa_gatunku(self): bez implementowania nazwy, bo przecież zwykły skoń ma dobrą
+    #     return self.nazwa
+
+

Hermetyzacja

+

Polega na odcinanie użytkownikowi dostępu do pól, aby operował tylko metodami klasy. +Jednak oczywiście używanie metod, zwłaszcza z przedrostkiem get, czy set, jest mniej wygodne. Dlatego nowoczesne języki programowania umożliwiają tworzenie tzw. właściwości (ang. property). Z punktu widzenia możliwości, są to po prostu metody, jednak z punktu widzenia zapisu i wygody, przypominają one pola.

+
class Zwierze:
+    def __init__(self, wiek):
+        self.wiek = wiek
+
+    @property
+    def wiek(self):
+        return self.__wiek
+    @wiek.setter
+    def wiek(self, wiek):
+        if wiek < 0:
+            self.__wiek = 0
+        elif wiek > 200:
+            self.__wiek = 200
+        else:
+            self.__wiek = wiek
+def main():
+    jakis_zwierz = Zwierze(202)
+    print(jakis_zwierz.wiek)
+    jakis_zwierz.wiek = -10
+    print(jakis_zwierz.wiek)
+    jakis_zwierz.wiek = 30
+    print(jakis_zwierz.wiek)
+
+if __name__ == "__main__":
+    main()
+## 200
+## 0
+## 30
+
+

Specjalne typy obiektów

+

Jest lika szczególnie użytecznych typów obiektów nad którymi warto się pochylić

+

Enum - Obiekty wyliczeniowe. Jest kilka rodzajów enumów: Enum, IntEnum, Flag oraz IntFlag. link

+
from enum import Enum, auto
+class Color(Enum):
+    RED = auto()
+    BLUE = auto()
+    GREEN = auto()
+
+

dataclass - specjalny dekorator dla obiektu dodający automatycznie wiele dodatkowych udogodnień pozwalających uniknąć mozolnego pisania logiki. link

+
from dataclasses import dataclass
+
+@dataclass
+class InventoryItem:
+    """Class for keeping track of an item in inventory."""
+    name: str
+    unit_price: float
+    quantity_on_hand: int = 0
+    tags: List[str] = = field(default_factory=list)
+
+    def total_cost(self) -> float:
+        return self.unit_price * self.quantity_on_hand
+
+

Możliwe jest tutaj podawanie spodziewanych typów oraz domyślnych wartości (ale w wypadku typów mutowalnych należy użyć fabryk )

+

Taki obiekt może otrzymać (w zależności od paramterów):

+
    +
  • automatycznie wygenerowany konstruktor:
  • +
+
def __init__(self, name: str, unit_price: float, quantity_on_hand: int = 0):
+    self.name = name
+    self.unit_price = unit_price
+    self.quantity_on_hand = quantity_on_hand
+
+
    +
  • operatory porównania (=, <,> etc.)
  • +
  • funkcję haszującą
  • +
  • etc...
  • +
+

Inne

+

Wyjątki

+
def silnia(n):
+    if n < 0:
+    raise ValueError("silnia niezdefiniowana dla liczb ujemnych")
+    wynik = 1
+    for i in range(1, n+1):
+        wynik *= i
+    return wynik
+
+try:
+    print("Pozyskuję zasób")
+    print(f"Silnia z -5 to {silnia(-5)}")
+except ValueError as e:
+    print("Och nie, coś poszło nie tak! Szczegóły poniżej:")
+    print(e)
+else:
+    print("Obyło się bez wyjątków")
+finally:
+    print("Zwalniam zasób")
+
+

Gdy spodziewamy się, że dany fragment kodu może rzucać wyjątkami, opakowujemy go w konstrukcję try-except. Kod, który chcemy wykonać, a który może rzucić wyjątek, zapisujemy po try:. Następnie, na dole tego kodu, piszemy except, po czym piszemy nazwę klasy wyjątku, a także as, po którym mówimy, jakim identyfikatorem (w jakiej zmiennej) chcemy się odnosić do instancji tego wyjątku. Najważniejsza jest nazwa klasy, aby ustalić, jaki typ błędów łapiemy. Konkretna instancja, w przykładzie e, przydaje się, gdy np. chcemy wyświetlić komunikat błędu na ekran. Teoretycznie instancja ma swoje pola, do których możemy się odnieść, jednak rzadko się z nich korzysta.

+

Listę wbudowanych klas wyjątków znajdziemy tutaj. Szczególnej uwadze polecamy IndexError, gdy odwołujemy się do nieistniejącego elementu listy, FileNotFoundError, gdy plik nie istnieje, ZeroDivisionError dla dzielenia przez zero i wymieniony w przykładzie ValueError, gdy argumenty funkcji są błędne

+
try:
+    fun()
+except RuntimeError as err:
+    print(f"Dostaliśmy wyjątek Runtime o treści: {err.args[0]}")
+except TypeError as err:
+    print("Niedozwolona operacja")
+except (MojError, NameError):
+    print("Wystąpił jeszcze inny error")
+finally:
+    print("Podczas wykonywania wystąpił błąd, zamykam apkę") # ten wykona się po każdym z wyjątków
+
+

With

+

Słowo kluczowe with pozwala na alternatywną (czystszą i czytelniejszą obsługę wyjątków)

+
# file handling
+
+# 1) without using with statement
+file = open('file', 'w')
+file.write('hello world !')
+file.close()
+
+# 2) without using with statement
+file = open('file', 'w')
+try:
+ file.write('hello world')
+finally:
+ file.close()
+
+# using with statement
+with open('file', 'w') as file:
+ file.write('hello world !')
+
+

Słowo with pozwala na automatyczne zwalnianie zasobów (na przykładzie powyżej widać, że nie trzeba wołać close()) przy wyjątku. +Mechanizm ten korzysta z metod __enter__() i __exit__() dla używanego obiektu.

+

Możemy wykorzystać ten mechanizm we własnych klasach

+
# a simple file writer object
+
+class Manager(object):
+ def __init__(self, file_name):
+  self.file_name = file_name
+
+ def __enter__(self):
+  self.file = open(self.file_name, 'w')
+  return self.file
+
+ def __exit__(self):
+  self.file.close()
+
+with Manager('file.txt') as xfile:
+ xfile.write('hello world')
+
+

Pliki

+
ścieżka_do_pliku = r"C:\przykladowy.txt"
+#r sprawia, że / nie jest znakiem specjalnym
+f = open(sciezka_do_pliku)
+print(f.read())
+f.close()
+
+

Tutaj mamy wszystko: open() służy otworzeniu połączenia do pliku. Jest to wspomniane wcześniej pozyskanie zasobu. Następnie następuje użycie metody read(). Odczytuje ona całą treść pliku za jednym zamachu. Po pojedynczym odczytaniu, drugie wywołanie zwróci nam napis pusty. Na końcu jest close(), zamknięcie połączenia do pliku. Jest to zwolnienie zasobu.

+

Jednak istnieje jeszcze drugi zapis. Używamy słowa kluczowego with. Wtedy definiujemy zasób, mówimy co chcemy zrobić, (open/write) gdy go pozyskamy, a na końcu, po wykonaniu całej klauzuli, zasób jest zwolniony, niezależnie od tego, czy wydarzyła się sytuacja wyjątkowa czy też nie

+
try:
+    with open(sciezka_do_pliku) as f:
+    print(f.read())
+    print(2/0)
+except ZeroDivisionError as e:
+    print(e)
+
+
with open(sciezka_do_pliku, 'w') as f:
+f.write("Trzeci wiersz")
+f.write("Czwarty wiersz")#jeżeli nie damy \n to oba wiersze są zapisane w tej samej linijce
+
+
#Pozostałe przydatne metody
+f.readline()
+f.read()
+f.closed #informuje czy już zamknięte
+
+

With open flagi:

+
    +
  • r -read
  • +
  • w -write otwiera plik (i nadpisuje, jeżeli tam już coś jest)
  • +
  • a -append (otwiera do zapisu i zaczyna na końcu tzn dopisuje)
  • +
+

Dane o plikach

+
import os
+print(os.path.exists(sciezka_do_pliku))
+## True
+print(os.listdir("C:\folder\"))
+## ['Wyzwanie6', 'pomysly.txt', inne pliki...]
+print(os.path.join("folder1", "folder2", "plik.txt"))
+## folder1/folder2/plik.txt #funkcja ta wstawia \ / zależnie od systemu
+os.remove(sciezka_do_pliku) #usuwamy plik
+
+
import datetime
+(mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) = os.stat(sciezka_do_pliku)
+data_modyfikacji = datetime.datetime.fromtimestamp(mtime)
+print(data_modyfikacji)
+## 2018-12-21 10:46:54
+
+

Poprawianie wydajności

+

Najczęściej, aby poprawić wydajność aplikacji pisanych w pythonie trzeba się skoncentrować na pełniejszym wykorzystaniu mocy procesora. Jest na to kilka sposobów.

+

Wielowątkowość

+

Wielowątkowość w pythonie jest nieco śliskim tematem, ponieważ w najpopularniejszej implementacji pythona (CPython) mamy do czynienie z mechanizmem GIL, który uniemożliwia pracę wielu wątkom jednocześnie. dłuższy artykuł
+Z tego powodu domyślnie wątki są dobrym pomysłem w wypadku operacji IO, czy też innych zadaniach, które działając w tle nie konsumują czasu procesora.
+Jeśli zaś chcemy w naszej pracy wykorzystać wiele rdzeni procesora równocześnie to warto użyć biblioteki multiprocessing

+
import threading
+
+def foo(argument):
+  print("Hello threading! with argument: ", argument)
+
+my_thread = threading.Thread(target=foo, args = ("slowo"))
+
+my_thread.start()
+#>> Hello threading with argument: slowo
+# kolejne uruchomienie za pomocą start rzuci nam RuntimeError
+
+

Przy dłuższym czasie wykonywania możemy poczekać na wątki za pomocą join

+
my_thread.join()
+
+

lub

+
my_thread.join(timeout=10)
+
+

Wieloprocesowość

+

Biblioteka multiprocessing opiera się na obrabianiu danych w ramach różnych procesów, dzięki czemu każdy proces ma własnego GIL-a, który nie wchodzi w drogę innym procesom. Poza tym jest w obsłudze dość podobna do wątków. +(niby są takie metody w bibliotece jak os.fork(), ale są one dość niskopoziomowe i niezbyt przenośne)

+
from multiprocessing import Process
+import os
+
+def work(id):
+    print(f'this is process {os.getpid()} called by {id}')
+
+
+def main():
+    procesy = [Process(target=work, args=(number, )) for number in range(5)]
+    for proces in procesy:
+        proces.start()
+
+    while procesy:
+        procesy.pop().join()
+
+#> this is process 10749 called by 0
+#> this is process 10750 called by 1
+#> this is process 10751 called by 2
+#> this is process 10753 called by 4
+#> this is process 10752 called by 3
+
+

Komunikacja międzyprocesowa

+

W tym wypadku nie mamy już wspólnej pamięci z której możemy korzystać.
+Dlatego stworzone są następujące mechanizmy:

+
    +
  • multiprocessing.Queque - prawie to samo co zwykła kolejka (queque.Queque. Praktycznie nie ma różnic w użyciu.
  • +
  • multiprocessing.Pipe - mechanizm nieco zbliżony do gniazd sieciowych
  • +
  • multiprocessing.sharedtypes - pozwala stworzyć typy z C we wspólnej puli pamięci międzyprocesowej
  • +
+

Do łatwego zarządzani pulą dostępnych procesów mamy obiekt Pool. Pozwala ustalić liczbę procesów, które możemy stworzyć jednocześnie. Dla wygody pracy i łatwego przełączania się między procesami i wątkami przy użyciu tego API mamy paczkę multiprocessing.dummy.Pool (te same interfejsy, tylko, że działa na wątkach).

+

Pipe

+

Pipe - jest to w pełni dupleksowe połączenie działające podobnie do gniazd (patrz socket module ) z tą różnicą, że pozwala on na wysyłanie nie tylko ciągów bajtów, lecz także serializowalne obiekty (patrz pickle ).

+

Konstruktor tworzy dwa obiekty do odbioru i nadawania, które możemy przekazać do naszego procesu.

+
from multiprocessing import Process, Pipe
+
+def f(conn):
+    conn.send([42, None, 'hello'])
+    conn.close()
+
+if __name__ == '__main__':
+    parent_conn, child_conn = Pipe()
+    p = Process(target=f, args=(child_conn,))
+    p.start()
+    print(parent_conn.recv())   # prints "[42, None, 'hello']"
+    p.join()
+
+

Sharedtypes

+

Mamy tutaj klasy Value i Array, warto tu pamiętać o tym, że aby zabezpieczyć się przed równoczesnym pisaniem i czytaniem trzeba używać dołączonych mutexów (Lock, RLock, Semaphore).

+
class Point(Structure):
+    _fields_ = [('x', c_double), ('y', c_double)]
+
+def modify(n, x, s, A):
+    n.value **= 2
+    x.value **= 2
+    s.value = s.value.upper()
+    for a in A:
+        a.x **= 2
+        a.y **= 2
+
+if __name__ == '__main__':
+    lock = Lock()
+
+    n = Value('i', 7)
+    x = Value(c_double, 1.0/3.0, lock=False)
+    s = Array('c', b'hello world', lock=lock)
+    A = Array(Point, [(1.875,-6.25), (-5.75,2.0), (2.375,9.5)], lock=lock)
+
+    p = Process(target=modify, args=(n, x, s, A))
+    p.start()
+    p.join()
+
+    print(n.value)
+    print(x.value)
+    print(s.value)
+    print([(a.x, a.y) for a in A])
+
+#> 49
+#> 0.1111111111111111
+#> HELLO WORLD
+#> [(3.515625, 39.0625), (33.0625, 4.0), (5.640625, 90.25)]
+
+

Asynchroniczność

+

Wykorzystuje ona korutyny (coroutines).

+

Biblioteką wykorzystywaną do asynchroniczności jest asyncio. Tutoriale pythondocs, realpython.

+
>>> import asyncio
+
+>>> async def main():
+...     print('hello')
+...     await asyncio.sleep(1) #w tym momencie oddajemy kontrolę na sekundę
+                               #w tym czasie CPU może popracować nad czymś innym
+...     print('world')
+
+>>> asyncio.run(main())
+hello
+world
+
+

Słowa kluczowe:

+
    +
  • async i async with - służą do oznaczania funkcji, które są korutynami
  • +
  • await - służy do oznaczania momentu w którym musimy poczekać na wykonanie jakiejś korutyny. W tym momencie przekazujemy kontrolę do pętli zdarzeń.
  • +
+
async def g():
+    # Pause here and come back to g() when f() is ready
+    r = await f()
+    return r
+
+
async def main():
+    task1 = asyncio.create_task(
+        say_after(1, 'hello'))
+
+    task2 = asyncio.create_task(
+        say_after(2, 'world'))
+
+    print(f"started at {time.strftime('%X')}")
+
+    # Wait until both tasks are completed (should take
+    # around 2 seconds.)
+    await task1
+    await task2
+
+    print(f"finished at {time.strftime('%X')}")
+
+

TODO ukończyć ten rozdział

+

Rzeczy na które należy uważać⚠️

+

Różne cechy oraz właściwości pythona na które trzeba uważać podczas pisania w pythonie zwłaszcza, gdy nie jest on pierwszym językiem.

+

Wszystko jest referencją

+

Warto pamiętać, że w pythonie prawie wszystko jest referencją.
+Np przekazując coś do funkcji przekazujemy tan naprawdę referencję do tego obiektu, z tego powodu wewnątrz funkcji nasz obiekt może ulec zmianie.

+

Warto tutaj zapoznać się z pojęciem mutowalności.
+Obiekty niemutowalne to takie, których nowe instancje są tworzone podczas zmiany wartości.

+
def fun(x):
+    print(id(x)) #id() wypisuje identyfikator danej zmiennej
+    x+=1
+    print(id(x))
+
+num=32
+print(id(num))
+fun(num)
+
+>> 9789984
+>> 9789984 # Widać tutaj, że funkcja operuje na tej samej instancji liczby
+>> 9790016 # po zmianie wartości do identyfikatora x jest już przypisany inny obiekt
+
+

Z tego powodu przekazywanie mutowalnej wartości do funkcji można traktować jako przekazanie kopii, a przekazanie niemutowalnej jako przekazanie referencji lub wskaźnika (w języku C++).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NiemutowalneMutowalne
intlista
floatsłownik
complexbytearray
boolobiekty użytkownika
string
tuple
range
frozenset
bytes
+

Przykłady działania:

+
def fun(num):
+    num = num+10
+    print(num)
+
+liczba = 1
+fun(liczba)
+# 10
+print(liczba)
+#1
+
+
class Numer:
+    def __init__(self,num):
+        self.num = num
+
+n = Numer(1)
+
+def fun2(numer):
+    numer.num = numer.num+10
+    print(numer.num)
+
+print(n.num)
+# 1
+fun2(n)
+# 11
+print(n.num)
+# 11
+
+

Jeśli chcemy tutaj zapobiec takim problemom warto zastanowić się nad użyciem modułu copy

+
import copy
+
+x = copy.copy(y)        # płytka kopia
+x = copy.deepcopy(y)    # kopia głęboka rekursywnie kopiująca wszystkie elementy naszej klasy
+
+

Inicjalizowanie zmiennych

+

Skoro wszystko jest referencją to trzeba też o tym pamiętać przy podawaniu domyślnych wartości dla funkcji.
+link

+
from dataclasses import dataclass
+
+@dataclass
+class Node(object):
+    num: int
+    children: list
+    def __init__(self, num, children=[]):
+        self.num = num
+        self.children = children
+
+
+n1 = Node(1)
+n2 = Node(2)
+print(n1)
+# Node(num=1, children=[])
+print(n2)
+# Node(num=2, children=[])
+
+n1.children.append(3)
+print(n1)
+#Node(num=1, children=[3])
+print(n2)
+#Node(num=2, children=[3])
+
+

Dlatego też wielu uważa, że lepiej dać None jako domyślną wartość i inicjalizować to dopiero, wewnątrz konstruktora.

+

//TODO lista: mixin, importowanie, biblioteka sys, instance methods +// yield, operator := +// from future import annotations (ewaluacja definicji z kodu, które pojawiają się później)

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Python\360\237\220\215/3_modu\305\202y_i_paczki/index.html" "b/Python\360\237\220\215/3_modu\305\202y_i_paczki/index.html" new file mode 100644 index 00000000..0dec3381 --- /dev/null +++ "b/Python\360\237\220\215/3_modu\305\202y_i_paczki/index.html" @@ -0,0 +1,1307 @@ + + + + + + + + + + + + + + + + Podział na Moduły i Paczki📦 - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Podział na Moduły i Paczki📦

+

Moduł - plik pythonowy zawierający definicje i wyrażenia, nazwa pliku jest nazwą modułu z dodanym rozszerzeniem .py (nazwa_modułu.py). Wewnątrz modułu ta nazwa jest dostępna jako zmienna globalna __name__.
+Moduł jest jednym ze sposobów organizacji kodu w pythonie, na ogół w jednym module trzyma się blisko powiązane ze sobą definicje funkcji, klas etc.
+Jeśli chodzi tu o grupowanie to warto zadbać tutaj o złoty środek (pliki nie muszą być duże, ani małe, muszą po prostu spójnie tworzyć logiczną całość).

+

Paczka - sposób na ustrukturyzowanie modułów ( pozwala to łatwo ustrukturyzować projekt)

+

Zarządzanie paczkami

+

pip i pip3 #TODO

+

Do instalacji można używać samodzielnych aplikacji pip (i pip3)

+
pip3 install numpy
+
+

Można też wymusić od danej instancji pythona, aby zainstalował dla siebie daną paczkę (użyteczne gdy mamy wiele wersji).

+
python3 -m pip install numpy
+
+

Tworzenie i używanie własnych paczek

+

Struktura

+

Przykładowa struktura paczki

+
sound/                          Top-level package
+      __init__.py               Initialize the sound package
+      formats/                  Subpackage for file format conversions
+              __init__.py
+              wavread.py
+              wavwrite.py
+              aiffread.py
+              aiffwrite.py
+              auread.py
+              auwrite.py
+              ...
+      effects/                  Subpackage for sound effects
+              __init__.py
+              echo.py
+              surround.py
+              reverse.py
+              ...
+      filters/                  Subpackage for filters
+              __init__.py
+              equalizer.py
+              vocoder.py
+              karaoke.py
+              ...
+
+

Aby wykorzystać zawartość pliku karaoke.py należy zaimportować:

+
import sound.filters.karaoke
+
+

Wewnętrzne linkowanie

+

Przy linkowaniu pomiędzy poszczególnymi elementami paczki zaleca się używanie poniższej konwencji:

+
#zakładamy, że jesteśmy w pliku filters/karaoke.py
+from . import echo
+from .. import formats
+from ..filters import equalizer
+
+

Wczytywanie paczki z danego folderu

+

Kiedy nasza paczka jest w niestandardowym folderze można ją wczytać tak

+
#tu zakładam, że paczka jest umieszczona w jakimś folderze umieszczonym gdzieś względem pliku ze skryptem, ale module_path może być dowolne
+module_path = os.path.dirname(os.path.realpath(__file__)) + "/.."
+sys.path.append(module_path)
+
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Python\360\237\220\215/4_biblioteki_i_narz\304\231dzia/index.html" "b/Python\360\237\220\215/4_biblioteki_i_narz\304\231dzia/index.html" new file mode 100644 index 00000000..452a15c4 --- /dev/null +++ "b/Python\360\237\220\215/4_biblioteki_i_narz\304\231dzia/index.html" @@ -0,0 +1,1889 @@ + + + + + + + + + + + + + + + + Różne użyteczne biblioteki i narzędzia - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + +
+
+ + + + + + + + +

Różne użyteczne biblioteki i narzędzia

+

Różne linki

+ +

Parsowanie argumentów

+

Do parsowania argumentów na ogół korzysta się z biblioteki argparse.

+

Przykładowy kod

+
parser = argparse.ArgumentParser(
+                    prog='ProgramName',
+                    description='What the program does',
+                    epilog='Text at the bottom of help')
+parser.add_argument('filename')           # positional argument
+parser.add_argument('-c', '--count')      # option that takes a value
+parser.add_argument('-v', '--verbose',
+                    action='store_true')  # on/off flag - czyli przy podaniu -v args.verbose to true
+args = parser.parse_args() #parsowanie argumentów,aby uzyskać obiekt z argumentami
+
+

Najważniejszą metodą klasy ArgumentParser jest add_argument().
+Może przyjmować on różne argumenty.
+Najważniejsze wydają się:

+
    +
  • help - opis argumentu
  • +
  • type - typ argumentu do jakiego wartość ma być przekonwertowana link. +można tutaj podać typ (int, str), argparse.FileType (aby sprawdzić poprawność ścieżki do pliku), bądź funkcja koonwertująca +
    # kiedy chcemy sprawdzić czy plik istnieje, ale chcemy otrzymać stringa
    +def _readable_file_string(path):
    +    reader = argparse.FileType("r")
    +    reader(path)  # if not exists, then raises Exception
    +    return path
    +
    +parser.add_argument('input_file', type=argparse.FileType('w', encoding='latin-1'))
    +parser.add_argument('file_path', type=_readable_file_string)
    +
  • +
  • default
  • +
  • required
  • +
  • choices
  • +
  • nargs - ile razy może się pojawić ten argument
  • +
+

Logowanie (logging)

+

Wbudowane biblioteka logging w Pythonie dostarcza gotowych mechanizmów do generowania, formatowania oraz zarządzania logami systemowymi. Oficjalny tutorial

+

Minimalny przykład:

+
import logging
+
+logging.debug("This is a debug")
+logging.info("This is an info")
+logging.warning("This is a warning")
+logging.error("This is an error")
+logging.critical("This is a critical message")
+#> WARNING:root:This is a warning
+#> ERROR:root:This is an error
+#> CRITICAL:root:This is a critical message
+
+

Dla takiego sktyptu otrzymany tylko ostatnie 3 linijki, ponieważ domyślny poziom logów jest za niski.

+

Do odpowiedniego ustawienia tego parametru można użyć funkcji logging.basicConfig

+
logging.basicConfig(level=logging.DEBUG)
+logging.debug('To już się wyświetli')
+
+

Za pomocą tej funkcji możemy określić inne podstawowe parametry jak format, kodowanie, styl, format daty, plik z logami etc.

+

Formatowanie logów

+

Format logów można zdefiniować za pomocą jednego stringa odpowiadającego określonej składni.

+
import logging
+logging.basicConfig(format='%(asctime)s %(message)s')
+logging.warning('is when this event was logged.')
+# 2019-12-12 11:51:42,692 is when this event was logged.
+
+

W definicjach logów odwołujemy się do atrybutów klasy LogRecord.

+

Z pomocą basicConfig możemy też łatwo określić używany format czasu (ściągawka) (milisekundy lepiej określać w ramach formatu z LogRecord-a)

+
import logging
+logging.basicConfig(format='%(asctime)s%(msecs)d %(message)s', datefmt='%m/%d/%Y %I:%M:%S.')
+logging.warning('is when this event was logged.')
+#> 12/12/2010 11:46:36.423 is when this event was logged.
+
+

Poziomy logowania

+

Każdy poziom logowania ma własną przyporządkowaną wartość liczbową link.

+

Im wyższa tym ważniejszy log (Debug to 10, CRITICAL to 50). Dzięki temu możliwe jest dodawanie własnych poziomów logowania. Możliwe jest tutaj wykorzystanie funkcji addLevelName.

+
    #tutaj nadpisuję aby mieć fajniejszą nazwę
+    logging.addLevelName(logging.DEBUG, "🐞DEBUG")
+    # a tutaj dodaję nowy poziom
+    logging.addLevelName(15, "VERBOSE")
+
+

Manipulacja tekstem

+

Stringi wielolinijkowe

+
slowa=""" linia1
+linia2
+linia3
+"""
+
+

Rozbijanie stringów po słowach

+

string.split(separator, maxsplit) - domyślny separator to jakikolwiek whitespace, maxsplit- domyślnie -1 (opisuje na ile fragmentów maksymalnie możemy dzielić stringa)

+
slowo="slowo1 slowo2 sl3"
+slowo.split()
+>>>['slowo1', 'slowo2', 'sl3']
+
+

Formatowanie tekstu

+

Formatowanie tekstu nie tylko w kontekście funkcji print()

+

str.format()

+
def hello(name):
+    print("Hello {name}".format(name=name))
+
+

f-stringi (Python 3.6+)

+
def hello(name):
+    print(f"Hello {name}")
+
+

Wg dokumentacji używając tej metody możemy wprowadzać dodatkowe zmiany w tekście

+
width = 10
+precision = 4
+value = decimal.Decimal('12.34567')
+f'result: {value:{width}.{precision}}'
+#12.35
+
+

Pobieranie ścieżki/folderu obecnego skryptu

+
import os
+
+os.path.abspath('') # obecny folder
+
+__file__ # zmiennna zawierająca obecnie uruchamiany plik (nie zawsze działa)
+
+

Używanie kodu z C++

+

boost lub ctypes
+Przykład dla boosta: link

+

Przetwarzanie strumieniowe

+

Czas

+
import time
+time.sleep(60)#minuta
+
+

Aplikacje webowe

+

Wykonywanie zapytań w HTMLu - requests

+

Najprostszą i najwygodniejszą biblioteką jest requests +Może ona służyć zarówno do pobierania treści z neta jak i do web scrappingu.

+
import requests
+
+data = {"name": "Marian"}
+response = requests.get("http://127.0.0.1:5000/", json=data)
+r.text
+# { "id": "3123424", ...
+r.json() # zwróci ospowiedź jako słownik
+r.status
+# 200
+
+

Proste hostowanie folderu

+

KIedy chcesz w prosty sposób udostępnić dany folder w sieci.

+
python -m http.server #to udostępni pod adresem 8000
+
+#można też samodzielni wybrać port
+python -m http.server 8888
+
+

Django

+

jest to dość duża zabawka link

+

Flask

+

Jeden z mikroframeworków, pozwala dość szybko napisać jakąś aplikację REST-ową.

+
from flask import Flask, request, response
+
+app = Flask(__name__)
+
+@app.route('/', methods=["GET", "POST"])
+def hello_world():
+    if request.method == "GET":
+        return "Hello"
+
+    if request.method == "POST":
+        return "you posted something"
+
+if __name__ == '__main__':
+    app.run()
+
+

Bottle

+

Mniejsza i dużo prostsza biblioteka (mieści się w jednym pliku).
+Podobna do flaska.

+
from bottle import route,run,template
+
+@route('/hello/<name>') #@route to dekorator
+def index(name):
+    return template('<b>Hello {{name}} <br/>?',name=name) #otrzymamy prostego html-a
+
+#index = route('//hello/<name>')(index) #ten sam wynik, w sytuacji bez @route
+
+
+run(host='0.0.0.0',port=8080) #nasza strona będzie dostępna tutaj
+
+

albo możemy też chcieć wygenerować jsona

+
def index(name):
+    return {"klucz":"wartosc","a_tu":["bedzie","lista"]}
+
+

Aplikacje z GUI

+

TODO rozpisać się trochę

+

https://wiki.python.org/moin/GuiProgramming

+

Zapisywanie

+

Pickle - zapisywanie zmiennych

+

Pythonowa biblioteka Pickle pozwala na zapisywanie (i odczytywanie) danych i obiektów w pythonie w formie binarnej poprzez serializację. +Serializacja polega na przekształceniu obiektu w postać, która może być zapisana do pliku lub przesłana przez sieć.

+
import pickle
+
+# tworzenie obiektu do serializacji
+data = {'name': 'John Smith', 'age': 30, 'country': 'USA'}
+
+with open('data.pkl', 'wb') as f:
+    # serializacja obiektu i zapis do pliku
+    pickle.dump(data, f)
+
+# otwieranie pliku z serializowanym obiektem
+with open('data.pkl', 'rb') as f:
+    # deserializacja obiektu z pliku
+    data2 = pickle.load(f)
+
+print(data2)  # {'name': 'John Smith', 'age': 30, 'country': 'USA'}
+
+

Dill -zapisywanie całej sesji w pythonie

+

Rozszerzeniem do pickla jest dill, pozwala on na zapisywanie załej sesji w pythonie do pliku, który można potem przywrócić.

+

//todo przykład

+

Debugowanie

+

pdb

+
import pdb
+pdb.set_trace() #w tej linii skrypt się zatrzyma i będzie można się rozejrzeć
+# (Pdb)
+
+

zapytania w trybie debuggera :

+
    +
  • w - where (na stosie)
  • +
  • u -up
  • +
  • d - down
  • +
  • c/continue - continue
  • +
  • args - wyświetla wszystkie argumenty, jakie dana funkcja otrzymała (ta w której obecnie jesteśmy) + Poza tym reszta rzeczy odpowiada zwykłemu pisaniu w pythonie, możemy zmieniać zmienne, printować je, uruchamiać pętle etc.
  • +
+

Warto wtedy używać też: +locals() - ładuje do słownika wszystkie obecnie dostępne funkcje

+

inspect

+
import inspect
+
+inspect.getsource(xyz)# wypisuje jak dana funkcja jest napisana
+
+

ast

+
#podobnie jak wyżej
+import ast
+
+

GDB

+

LINK

+

/TODO opisać dokładniej

+

/TODO opisać działanie libki subprocess (czyli jak ogarnąć prawdziwą wielowątkowość w pythonie), oraz uruchamianie procesów.

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Python\360\237\220\215/5_inne/index.html" "b/Python\360\237\220\215/5_inne/index.html" new file mode 100644 index 00000000..f4876ee0 --- /dev/null +++ "b/Python\360\237\220\215/5_inne/index.html" @@ -0,0 +1,1355 @@ + + + + + + + + + + + + + + + + Inne - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+ +
+
+ + +
+
+ + + + + + + + +

Inne

+

VENV - wirtualne środowisko

+

Jest to bardzo potrzebne gdy nie chcemy przypadkiem namieszać w naszych już zainstalowanych paczkach pythonowych, a chcemy odpalić jakiś projekt wymagający konkretnych wersji danych pakietów. Dokumentacja

+

Instalacja dla debianów: sudo apt install python3-venv.

+

Tworzenie nowego venva

+
python3 -m venv /path/to/new/virtual/environment
+
+

Aby aktywować venva (czyli odpalić w pythona korzystającego z pakietów w tym venvie) trzeba użyć komendy

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ShellCommand to activate virtual environment
bash/zsh$ source <venv>/bin/activate
fish$ source <venv>/bin/activate.fish csh/tcsh $ source <venv>/bin/activate.csh
PowerShell$ <venv>/bin/Activate.ps1
(Windows)cmd.exeC:\> <venv>\Scripts\activate.bat
(Windows)PowerShellPS C:\> <venv>\Scripts\Activate.ps1
+

Uruchamianie skryptu w trybie interaktywnym

+

Z poziomu basha:

+
python -i ./skrypt.py
+
+

Z poziomu pythona:

+
exec(open("./first.py").read())
+
+

Dzięki temu po zakończeniu wykonywania nie wyjdziemy ze skryptu i będziemy mogli kontynuować jego pracę używając już zaimportowanych przez niego bibliotek oraz zmiennych, które utworzył.

+

Użycie modułów z C/C++

+

Do tego warto użyć bibliotek booosta.

+

Przykładowy Github Gist zawierający prosty projekt obrazujący działanie: TUTAJ

+

Guideline'y

+ +

Implementacje Pythonowe

+

Warto wiedzieć, że jest wiele implementacji pythona. Najbardziej znaną jest CPython napisany w C.
+Ze względu na wydajność warto się zapoznać z:

+
    +
  • PyPy - kompilator typu JIT
  • +
  • Nuitka link - o ile dobrze rozumiem to taki jakby kompilator pythona
  • +
+

Ze względu na kompatybilność:

+
    +
  • Jython (java)
  • +
  • IronPython (C#)
  • +
+

Pełna lista implementacji link

+

Dokumentowanie

+

Diagramy klas

+

Do tego można użyć:

+
    +
  • pyreverse - chyba najprostsze (do pobrania z pipa)
  • +
+
pyreverse -o png moje_klasy.py
+
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Python\360\237\220\215/6_testowanie/index.html" "b/Python\360\237\220\215/6_testowanie/index.html" new file mode 100644 index 00000000..9cbf02b1 --- /dev/null +++ "b/Python\360\237\220\215/6_testowanie/index.html" @@ -0,0 +1,1342 @@ + + + + + + + + + + + + + + + + Testowanie - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Testowanie

+

Do testów wykorzystujemy słowo kluczowe assert

+
x = "hello"
+
+#if condition returns False, AssertionError is raised:
+assert x == "goodbye", "x should be 'hello'"
+
+

jeśli to co znajdzie się w assercie zwraca true to nic się nie dzieje, zaś jeśli jest to fałsz to rzuca wyjątek AssertionError. Wiadommość zawartą w tym wyjątku możemy podać po przecinku.

+

W pythonie jest kilka frameworków do testów: pytest, doctest i unittest

+

Jeśli chodzi o strukturę testów to warto zwrócić uwagę na to, jak są one znajdowane. Conventions for Python test discovery (pytest)

+

Unittest

+

Jest to domyślny sposób testowania wbudowany w język, jest też najmniej rozbudowany.

+

Testy z doctest

+

Jest to sposób na pisanie testów funkcji w jej definicji, testy stanowią cześc opisu naszej funkcji

+

Składnia:

+
    +
  • znajduje się pomiędzy """ i """
  • +
  • linie kodu są umieszczane po >>>
  • +
  • oczekiwane wyniki wpisujemy w miejscach w których powinny się wyświetlić po wykonaniu
  • +
+

Np:

+
"""
+This is the "example" module.
+
+The example module supplies one function, factorial().  For example,
+
+>>> factorial(5)
+120
+"""
+
+def factorial(n):
+    """Return the factorial of n, an exact integer >= 0.
+
+    >>> [factorial(n) for n in range(6)]
+    [1, 1, 2, 6, 24, 120]
+    >>> factorial(30)
+    265252859812191058636308480000000
+    >>> factorial(-1)
+    Traceback (most recent call last):
+        ...
+    ValueError: n must be >= 0
+
+    Factorials of floats are OK, but the float must be an exact integer:
+    >>> factorial(30.1)
+    Traceback (most recent call last):
+        ...
+    ValueError: n must be exact integer
+    >>> factorial(30.0)
+    265252859812191058636308480000000
+
+    It must also not be ridiculously large:
+    >>> factorial(1e100)
+    Traceback (most recent call last):
+        ...
+    OverflowError: n too large
+    """
+
+    import math
+    if not n >= 0:
+        raise ValueError("n must be >= 0")
+    if math.floor(n) != n:
+        raise ValueError("n must be exact integer")
+    if n+1 == n:  # catch a value like 1e300
+        raise OverflowError("n too large")
+    result = 1
+    factor = 2
+    while factor <= n:
+        result *= factor
+        factor += 1
+    return result
+
+
+if __name__ == "__main__":
+    import doctest
+    doctest.testmod()
+
+

flaga "-v" przy uruchamianiu takiego skryptu sprawia, że wyświetlają się także raporty z poprawnych testów.

+

Pytest

+

Jeden z najpopularniejszych sposobów testowania link. +Pytest odpala wszystkie pliki test_*.py i *_test.py z naszego folderu. I uruchamia wszystkie funkcje zwawierające test_ w nazwie (także metody zdefiniowanych klas).

+

Pozwala na łtew testowanie klas, wyjątków etc

+
import pytest
+
+def f():
+    raise SystemExit(1)
+
+# sprawdzanie wyjątku
+def test_mytest():
+    with pytest.raises(SystemExit):
+        f()
+
+class TestClass:
+    def test_one(self):
+        x = "this"
+        assert "h" in x
+
+    def test_two(self):
+        x = "hello"
+        assert hasattr(x, "check")
+
+

Pokrycie testami

+

Przy testach można sobie wygenerować raport pokrycia kodu

+
pytest --cov=./nazwa_paczki/ 
+coverage xml #konwertuje plik .coverage do raportu w xml-u
+
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Python\360\237\220\215/Hands-on_Python_Tutorial.pdf" "b/Python\360\237\220\215/Hands-on_Python_Tutorial.pdf" new file mode 100644 index 00000000..f8757fdb Binary files /dev/null and "b/Python\360\237\220\215/Hands-on_Python_Tutorial.pdf" differ diff --git "a/Web\303\263wka\360\237\214\215/1_javascript_syntax/index.html" "b/Web\303\263wka\360\237\214\215/1_javascript_syntax/index.html" new file mode 100644 index 00000000..1050ff48 --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/1_javascript_syntax/index.html" @@ -0,0 +1,2375 @@ + + + + + + + + + + + + + + + + Javascript Syntax - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + +
+
+ + + + + + + + +

Javascript Syntax

+

Inne tutoriale: Java essentials

+

Osadzanie skryptu w HTML-u

+

W HTML-u skrypty umieszczane są wwenątrz tagów script.
+W praktyce skrypty można tak pisać, ale nie jest to wygodne, dlatego używa się osadzania skryptów.

+
<script src="plik_ze_sryptem.js"></script>
+
+<script>
+  ////Tutaj skrypty
+</script>
+
+

Zmienne

+
+

Warning

+
+

Zmienne nie mogą zaczynać się od liczb, ani nazywać się jak słowa kluczowe w JS (new function class etc)

+
/* let 3liczba = 43; */
+/* let function = 3; */
+let $function = 43; // ale za to $ jest dozwolony jako znak
+
+

Typy zmiennych

+

Warto pamiętać, że JS ma dynamiczne typowanie, czyli nie musimy definiować typów zmiennych, ponieważ to jest sprawdzane dynamicznie w trakcie pracy.
+Poza tym możemy nadpisywać zmienne innymi typami.

+
let mojaZmienna = 43;
+mojaZmienna = "teraz slowo";
+
+

Zalecane formatowanie dla zmiennych to camelCase.

+

Podstawowe

+
//Number - zawsze zmiennoprzecinkowa (także dla całkowitych)
+let wiek = 22;
+
+//String - wartpamiętać, że można je definiować na 3 sposoby "", '' i ``
+let imie = "Marian";
+
+// Boolean
+let isTrue = true;
+
+//Undefined
+let jeszczeNieOkreslone;
+
+// Null
+let nic = null;
+
+// Symbol (ES2015) - unikatowa wartość, której nie można zmienić
+
+

Dla sprawdzania typów ożywamy operatora typeof

+
let zmienna = 54;
+console.log(typeof zmienna);
+//>number
+typeof "Slowo";
+//>"string"
+let nieWiadomo;
+console.log(typeof nieWiadomo);
+//>undefined
+
+

Warto zwrócić uwagę na to co daje tutaj null. (Jest to wyjątek z którym trzeba się pogodzić)

+
console.log(typeof null);
+//>object
+
+

Tablice (arrays)

+

Są to kontenery w których trzymamy zmienne i obiekty

+
const liczby = [22, 33, 45];
+const slowa = new Array("slowo1", "slowo2");
+
+console.log(liczby[0]);
+// 22
+
+// mamy tu zbliżone odliczanie do pythonowego
+console.log(liczby[-1]);
+// 45
+
+// co ciekawe mimo inicjalizacji jako const możemy zmieniać wartości w tablicy
+liczby[1] = 32;
+//Ale nie możemy usunąć samej tablicy
+
+

Tablice mogą zawierać różne wartości w kolejnych komórkach

+
let osoba = ["Marian", "Kowalski", 22, ["Burek", "Kulka"]];
+
+

Operacje na tablicach

+
let tablica = [];
+
+// rozmiar tablicy
+tablica.length;
+// 0
+
+tablica.push(10); //teraz tablica zawiera 10
+// 1 - zwraca ona nową długośż naszej tablicy
+
+tablica.unshift(0); //tobi to samo co push, tylko dodaje na początek
+
+tablica.pop(); //a po tej operacji jest znowu pusta
+// 10 - zwraca wartość z końca tablicy
+
+tablica.shift(); // zwraca pierwszy element rablicy
+
+const inna = ["pierwszy", "drugi", "trzeci"];
+inna.indexOf("pierwszy");
+// 0
+
+inna.includes("trzeci");
+// true
+
+

Iterowanie po tablicach

+
const lista = ["a", "b", "c"];
+for (const [num, elem] of lista.entries()) {
+  console.log(`Indeks: ${num} Zawartosc: ${elem}`);
+}
+
+

Rozmontowywanie tablic

+
// tworzymy trzy zmienne (x, y, z), które bęzą zawierać poszczególne elementy
+const [x, y, z] = [1, 2, 3];
+const [, dwa, , cztery] = [1, 2, 3, 4, 5]; //nie musimy brać wszystkich elementów z danej tablicy
+
+

Możemy też w ten sposób definiować zmienne domyślne (jeśli w tablicy nie ma danego elementu do domyślnie jest Undefined)

+
const [x = 1, , z = 3] = [0, 1];
+
+

Ten mechanizm pozwala na łatwe zwracanie wielu elementów z funkcji, podobnie do krotek z pythona.

+

Sposoby definiowania

+

Jest kilka sposobów na definiowanie zmiennych. Służą do tego słowa kluczowe let, var i const.

+

let - definiowanie zwykłej zmienej wartości, za jego pomocą można też definiować puste zmienne.

+
let num = 30;
+num = 32;
+
+let undef;
+
+

var - podobne do let lecz jest już przestarzałe i nie zaleca się jego używania. Var jest dużo bardziej bugogenne

+
function f() {
+  for (var let_i = 0; let_i < 5; let_i++) {
+    console.log("let_i: " + let_i);
+  }
+
+  for (var var_i = 0; var_i < 5; var_i++) {
+    console.log("let_i: " + let_i); // to będzie działać dobrze
+  }
+}
+
+

Na dodatek pozwala ono używać zmiennej przed jej zadeklarowaniem.

+

const - po prostu stałe zmienne

+
const PI = 3.14;
+// PI = 1; - spowoduje TypeError
+
+// const unknown; - to też nie zadziała (SyntaxError)
+
+

Teoretycznie można pracować nawet bez definiowania zmiennych wg wymienionych wyżej sposobów.

+
imie = "Jan";
+console.log(imie);
+// Jan
+
+

Tylko, że ta zmienna będzie wtedy odpowiednikiem zmiennej globalnej.

+

Operatory

+

Typy operatorów:

+
    +
  • Matematyczne: + - * / ** (potęgowanie)
  • +
  • Przypisywania: = += *= -= ++ -- etc
  • +
  • Boolowskie
  • +
  • porównania: > >= < <= == != ===
  • +
  • logiczne && || !
  • +
  • trójargumentowy ? :
  • +
+

Kolejność operatorów jest taka jak w matematyce.

+
Operator == i ===
+

Istnieją dwa operatory równości:

+
    +
  • === - ścisły - zwraca prawdę tylko i wyłącznie wtedy, gdy obie strony są takie same, nie bawi się w żadne konwersje etc.
  • +
  • == - jest nieco luźniejszy, pozwala sobie na konwersje pomiędzy typami jeśli wartości są różnych typów, poza tym ma inne "pomagające" mechanizmy, które w dłuższej prespektywie mogą powodować więcej błędów. (jeśli się da używaj ===)
  • +
+
19 === "19";
+// false
+
+19 == "19";
+// true
+
+

Podobnie do === działa !==

+

Konwersja

+

Aby dokonać konwersji trzeba po prostu użyć konstruktora danego typu.

+
const rokStr = "2001";
+Number(rokStr);
+//>2001
+
+String(55);
+//>"55"
+
+

Tutaj w wypadku podania niewłaściwej wartości zamiast wyjątku dla liczby możemy dostać NaN (Not a Number)

+
let a = Number("ff2");
+a;
+//>NaN
+
+typeof a; // Co ciekawe ten typ jest wciąż numerem
+("number");
+
+

Poza tym warto uważać na sprytną konwersję typów np przy printowaniu.
+Na ogół działa to fajnie, ale operator + może trochę napsuć i być źródłem wielu błędów.

+
"22" + 10;
+// 2210
+
+"22" - 10;
+// 12
+
+"22" - "10";
+// 12
+
+"22" - "10" + 55;
+// 67
+
+"22" - "10" + "55";
+// 1255
+
+

Konwersja na Boola - wartości, które przy konewrsji na boola dają false:

+
    +
  • 0 - wartość liczbowa równa zero
  • +
  • ""
  • +
  • undefined
  • +
  • null
  • +
  • NaN
  • +
+

Pozostałe konwertują się na wartość true

+

Praca ze stringami

+

Mamy tutaj standardowe metody do pracy z ciągami znaków, podobne nieco do tych pythonowych.

+

Mamy:

+
    +
  • split(separator=" ")
  • +
  • replace(co,na_co), replaceAll(co,na_co)
  • +
+
let slowo = "";
+
+

Printowanie

+
console.log("Wiadomosc1", 323);
+//> Wiadomosc1 323
+
+// aby wypisać wiadomośc można klasycznie połączyć stringi
+const wiek = 10;
+const wiadomosc = "Hej, mam " + wiek + "lat";
+console.log(wiadomosc);
+
+// Ale można to zrobić wygodniej warto pamiętać, że robimy to w ``, a nie w ''
+const wiadomosc2 = `Hej, mam ${wiek} lat`;
+console.log(wiadomosc2);
+
+

Ogólnie to obecnie ten drugi sposób definiowania jest wygodniejszy

+
console.log(
+  "Wiele\n\
+linii w kodzie"
+);
+
+//VS
+
+console.log(`Wiele
+linii w kodzie`);
+
+

IF-y i warunki

+

Syntax warunków jest zbliżony do C++

+
const wiek = prompt("podaj wiek"); //pojawi się okno z pytaniem
+
+if (wiek >= 18) {
+  console.log("Pełnoletni");
+} else {
+  console.log("Niepełnoletni");
+}
+
+if (true) console.log("Nie");
+else console.log("Tak");
+
+if (true) console.log("True to prawda");
+
+

Mamy też tu switcha

+
switch (key) {
+  case value:
+    fun1();
+    fun2();
+    break;
+
+  case value2:
+  case value3: // dla tych dwóch wartości będzie się dziać to samo
+    fun3();
+    break;
+
+  default:
+    break;
+}
+
+

Jest też operator trójargumentowy ? :

+
wiek >= 18 ? console.log("Dorosły") : log.console("Nie Dorosły");
+// Albo
+console.log(wiek >= 18 ? "Dorosły" : "Nie Dorosły");
+
+

Pętle

+

Nic ciekawego mamy 2 zwykłe typy pętli, for i while.

+
for (let num = 0; num < 10; num++) {
+  if (num === 5) continue; //ale skipujemy dla 5
+  console.log(`Printujemy po raz ${num + 1}`);
+}
+
+while (true) {
+  //nigdy nie kończąca się pętla
+  break; //no chyba, że użyję break
+}
+
+

Poza tym mamy jeszcze forEach w dwóch wariantach.

+
const tablica = [0, 11, 22, 33, 44];
+
+for (const i of tablica) {
+  console.log(i);
+}
+
+// Metoda forEach
+tablica.forEach(function (i) {
+  console.log(i);
+});
+
+

Funkcje

+

Definiujemy je używając słowa kluczowego function.
+Także są na ogół formatowane jako camelCase.

+
+

Warning

+
+

Niestety JS nie wspiera przeciążania funkcji.

+

Poniżej zwykłe deklaracje funkcji (function declaration).

+
function printHello() {
+  console.log("Hello");
+}
+
+printHello();
+// Hello
+
+function isApple(fruit) {
+  if (fruit == "apple") return true;
+  else return false;
+}
+
+

Argumenty funkcji

+

Funckcję mającą n argumentów możemy wywołać używając:

+
    +
  • n argumentów
  • +
+
printHello(23);
+// Hello
+
+
    +
  • więcej niż n argumentów - nieoczekiwane argumenty są ignorowane
  • +
+
isApple("apple", 43); //drugi argument jest ignorowany
+// true
+
+
    +
  • mniej niż n argumentów - brakujące mają wartość undefined
  • +
+
isApple(); //pierwszy argument ma wartość "undefined"
+// false
+
+
    +
  • Możemy także przekazać do funkcji listę argumentów, które będą zmapowane na kolejne argumenty
  • +
+
let vector = ["apple", 2, 3, 4];
+isApple(...vector);
+
+

Do argumentów możemy odwołać się poprzez:

+
    +
  • nazwę
  • +
  • pseudo-listę arguments
  • +
+
function greetings() {
+  for (let i = 0; i < arguments.length; i++) {
+    console.log("Hi, " + arguments[i]);
+  }
+
+  //Hi, Tom
+}
+
+

W razie potrzeby możemy wymusić liczbę argumentów

+
function f(x,y) {if (arguments.length != 2)...
+
+

Właśnie przez ten śmietnik nie mamy przeciążania funkcji.

+

Funkcje anonimowe

+

Tym określeniem określamy funkcje, które są przechowywane w zmiennych. Określane także jako function expression.

+
let myFun = function () {
+  lonsole.log("HelloFun");
+};
+
+myFun();
+// HelloFun
+
+

Funkcje strzałkowe

+

Funkcje strzałkowe (arrow functions) to po prostu inny format funkcji przypominający wyrażenia lambda z innych języków.
+Pozwala na krótszy zapis funkcji.

+
const arrowFun = (value) => value + 12;
+
+arrowFun(10);
+// 22
+
+const arrowFunMultiline = (imie) => {
+  console.log(`imie to ${imie}`);
+  return imie;
+};
+
+arrowFunMultiline("Jan");
+// imie to Jan
+// "Jan"
+
+const linkNames = (imie, nazwisko) => imie + " " + nazwisko;
+
+

Mają one dość elastyczny zapis, w wypadku jednego argumentu nie musimy używać nawiasów początkowych, podobnie wygląda sytuacja z klamerkami w któ©ych zawieramy nasze funkcje.

+

Różnią się też nieco implementacją, nie jest dla nich tworzony this, ani obiekt arguments.

+
const fun1 = function () {
+  console.log(this); // undefined
+};
+
+const fun2 = () => {
+  console.log(this); // zwróci globalny obiekt window
+};
+
+

Kolejność (hoisting)

+

Przy deklarowaniu funkcji nie musimy się martwić kolejnością ich deklaracji, ponieważ ich deklaracje są doczytywane wcześniej (ale na ich użycie musimy poczekać).

+
const fun1 = function () {
+  fun2();
+};
+
+const fun2 = function () {
+  console.log("ok");
+};
+
+fun1(); //ale ta już musi być po deklaracji
+
+

Dostęp do zmiennych w funkcji zagnieżdżonej

+

Funkcjie zdefiniowane we wnętrzu innuch funkcji mają dostęp do wszystkich zmiennych które są dostępne w wybranym zakresie.

+
var global = "this is global";
+function scopeFunction() {
+  alsoGlobal = "This is also global!";
+  var notGlobal = "This is private to scopeFunction!";
+  function subFunction() {
+    alert(notGlobal); // We can still access notGlobal in this child function.
+    stillGlobal = "No var keyword so this is global!";
+    var isPrivate = "This is private to subFunction!";
+  }
+  alert(stillGlobal); // This is an error since we haven't executed subfunction
+  subFunction(); // execute subfunction
+  alert(stillGlobal); // This will output 'No var keyword so this is global!'
+  alert(isPrivate); // This generate an error since isPrivate is private to
+  // subfunction().
+  alert(global); // outputs: 'this is global'
+}
+
+alert(global); // outputs: 'this is global'
+alert(alsoGlobal); // generates an error since we haven't run scopeFunction yet.
+scopeFunction();
+alert(alsoGlobal); // outputs: 'This is also global!';
+alert(notGlobal); // generates an error.
+
+

Zmienne proste vs złożone (kopia vs referencja)

+

Przy pracy ze zmiennymi warto pamiętać o tym, że jedynie proste typy zmiennych są kopiowane przy przekazywaniu dalej (Number, String, Boolean, Undefined, Null, Symbol, BigInt), w pozostałych przypadkach przekazywana jest referencja.

+
let x = 1;
+let y = x;
+y = 2;
+console.log(x);
+// 1
+console.log(y);
+// 2
+
+let d1 = { x: 1 };
+let d2 = d1;
+
+d2.x = 2; //niechcący nadpisaliśmy wartość x obiektu d1
+console.log(d1);
+//{ x: 2 }
+console.log(d2);
+//{ x: 2 }
+
+

Aby temu zapobiec można użyć operatora Object.assign() - łączy on ze sobą 2 obiekty, wystarczy połączyć nasz z jakimś pustym.
+Tworzy on jednak tylko płytką kopię.

+
let kopia = Object.assign({}, d1);
+
+

Obiekty

+

Obiekty mogą być tworzone na dwa sposoby.

+

Tworzenie

+

Jako wyrażenie (expression) - sposób nieco zbliżony do opisu słownika. Otrzymujemy od razu gotową instancję naszej klasy.

+
const osoba = {
+  imie: "Marian",
+  nazwisko: "Nowak",
+  ur: 1999,
+
+  getAge: function () {
+    return 2021 - this.ur;
+  },
+};
+
+

Poszczególne elementy powinny być oddzielone przecinkami.

+

Deklaracja - tworzymy deklarację klasy i potem możemy (używając operatora new tworzyć jej instancje)

+
class Rectangle {
+  constructor(height, width) {
+    this.height = height;
+    this.width = width;
+  }
+}
+
+let instancja = new Rectangle(0, 0);
+
+

Dostęp do elementów danej klasy uzyskujemy za pomocą słowa this.

+
// Dane można pozyskiwać na 2 sposoby
+osoba.imie;
+//Marian
+
+//Ten sposób jest nieco bardziej elastyczny i pozwala na nieco łatwiejsze zarządzanie polami
+osoba["imie"];
+//Marian
+
+// Możemy tutaj też łątwo edytować pola w klasie
+osoba.drugie_imie = "Zbigniew";
+
+osoba;
+// Object { imie: "Marian", nazwisko: "Nowak", wiek: 25, drugie_imie: "Zbigniew" }
+
+osoba.getAge();
+// 22
+
+

Prototypy

+

Prototyp jest deklaracją zawierającą definicje, które są współdzielone między instancjami. Każda instancja ma dostęp do pól i metod prototypu.

+

Jest to przydatne, gdy chcemy coś zmienić we wszystkich instancjach danego obiektu bez ingerowania w niego.

+
class Rectangle {
+  constructor(height, width) {
+    this.height = height;
+    this.width = width;
+  }
+}
+
+let rect = new Rectangle(10, 10);
+
+// dla obiektu prototype dla instancji __proto__
+Rectangle.prototype.field = function () {
+  return this.height * this.width;
+};
+
+rect.field(); // to nam zwróci 100
+
+Rectangle.__proto__; //zwróci nam prototyp bazowego obiektu
+
+

Gettery i settery

+

Pozwalają na używanie niektórych metod tak, jakby były polami.
+Settery są bardzo przydatne podczas walidacji danych.

+
const account = {
+  owner: "Jonas",
+  movements: [200, 530, 120, 300],
+
+  get latest() {
+    return this.movements.slice(-1).pop();
+  },
+
+  set latest(mov) {
+    this.movements.push(mov);
+  },
+};
+
+account.latest = 23;
+account.latest;
+
+

Dziedziczenie

+

Używając słowa kluczowego extends możemy także tworzeyć hiererchie klas

+
class Animal {
+  //    nazwa;
+  constructor(nazwa) {
+    this.nazwa = nazwa;
+  }
+  habla() {}
+  nazwaAnimal() {
+    return this.nazwa;
+  }
+}
+
+class Pies extends Animal {
+  constructor() {
+    super("Pies");
+  }
+  habla() {
+    return "hau";
+  }
+}
+
+let perro = new Perro();
+console.log(perro.nazwaAnimal() + " dice " + perro.habla());
+
+

Komunikacja zewnętrzna i funkcje asynchroniczne

+

Aby zapobiec marnowaniu czasu niektóre funkcje w JS-ie zostały zaimplementowane asynchronicznie.

+
const img = document.querySelector(".dog");
+img.src = "dog.jpg"; // I właśnie to wczytywanie będzie asynchroniczne
+
+//Jak już się wczyta to odpalony zostanie ten event
+img.addEventListener("load", function () {
+  console.log("Wczytano");
+});
+
+

Warto pamiętać, że eventy z pętli zdarzeń mają miejsce tylko wtedy, gdy w głównym wątku nic nie jest przetwarzane.
+Po dokładniejsze wyjaśnienia zajrzyj do Javascript - Inne informacje

+

AJAX

+

AJAX - Async JavaScript And XML. Pozwala asynchronicznie komunikować się z zewnętrznymi serwerami (wysyłać żądania etc). Kiedyś opierało się to na użyciu XML-a, ale od iluś lat używa się jednak JSONa (teraz to podstawa REST-a).

+

Na potrzeby przykładów korzystamy z darmowych API stąd.

+

Wcześniej używało się do tego XMLHttpRequest.

+
const request = new XMLHttpRequest();
+request.open("GET", "https://restcountries.eu/rest/v2/name/poland");
+wynik = request.send();
+
+var polska;
+request.addEventListener("load", () => {
+  console.log(this.responseText);
+  //po otrzymaniu wyświetli nam się cały surowy tekst JSONa,
+  //który trzeba przekształcić w jakiś sensowny obiekt
+  [polska] = JSON.parse(this.responseText);
+  //json parse zwraca listę obiektów, więc bierzemy tylko pierwszy
+});
+
+

Jednak obecnie ta metoda jest przestarzała i zamiast tego używa się fetch, które zwraca nam Obietnicę (promise). Jest to tymczasowy obiekt w którym znajdziemy wynik operacji asynchronicznej jak już się wykona.
+Dzięki takiemu podejściu nie musimy polegać na callbackach, które mogą być problematyczne.

+
const promise = fetch("https://restcountries.eu/rest/v2/name/poland");
+
+

Taka obietnica po zakończeniu zadania może zmienić swój stan na spełnioną, lub odrzuconą.
+Jak już została wykonana to możemy ją skonsumować.
+Do tego warto używać metody then do której przekazujemy co ma zostać zrobione z otrzymanymi danymi.

+
then(onFulfilled);
+then(onFulfilled, onRejected);
+
+then(
+  (value) => {
+    /* fulfillment handler */
+  },
+  (reason) => {
+    /* rejection handler */
+  }
+);
+
+

W wypadku błędu, lud odrzucenia rządania możemy też wykorzystać catch() na końcu łańcuszka.

+
fetch("https://restcountries.eu/rest/v2/name/poland").then(function (response) {
+  console.log(response); //wypisze nam całą klasę odpowiedzi z kodem statusu etc
+  const new_promise = response.json(); //zwraca sparsowany obiekt, ale jest też kolejną obietnicą
+});
+
+

Używając tych mechanizmów można łatwo łączyć wiele żądań w ciągi.

+
const getCountryData = function (country) {
+  fetch(`https://restcountries.eu/rest/v2/name/${country}`)
+    .then((response) => {
+      response.json();
+    }) //po otrzymaniu odpowiedzi parsujemy ją asynchronicznie
+    .then((data) => {
+      console.log(data);
+    }); //po sparsowaniu w końcu możemy ją wyświetlić
+};
+
+

Mamy tu jedno żądanie, które po wykonaniu ma zwrócić kolejną obietnicę, która po spełnieniu ma nam wyświetlić sparsowany wynik.

+

Wysyłanie żądań z zawartością

+

Wysyłanie żądania zawierającego JSONa

+

Stary sposób:

+
let xhr = new XMLHttpRequest();
+let url = "https://httpbin.org/post";
+
+xhr.open("POST", url, true); //true mówi, że ma być asynchronicznie
+xhr.setRequestHeader("Content-Type", "application/json"); //kiedy jsona trzeba określić jaki to typ zawartości
+xhr.onreadystatechange = function () {
+  console.log("Jest git");
+  console.log(this.responseText);
+};
+var data = JSON.stringify({ imie: "Jan", wiek: 12 });
+xhr.send(data);
+
+

Nowy sposób:

+
fetch("https://httpbin.org/post", {
+  method: "post",
+  headers: {
+    Accept: "application/json, text/plain",
+    "Content-Type": "application/json",
+  },
+  body: JSON.stringify({ imie: "Jan", wiek: 12 }),
+})
+  .then((res) => res.json())
+  .then((res) => console.log(res));
+
+

Tutaj drugim argumentam fetcha jest odpowiednik obiektu Request.

+

Warto zwrócić tu uwagę na pola:

+
    +
  • method - określa typ żądania
  • +
  • headers - mamy tutaj typowe nagłówki http lista, za ich pomocą ustalamy np jaki typ danych wysyłamy (Content-Type), czy też jakie dane jesteśmy w stanie przyjąć (Accept).
  • +
  • body - już samo ciało żądania, tutaj warto pamiętać, że najczęściej wysyłamy je w postaci stringa
  • +
+

Runkcje asynchroniczne

+

Do zdefiniowania funkcji asynchronicznej (zwracającej obietnicę) wykorzystujemy słowo kluczowe async.

+
// Variation of program in slide 38...
+const fs = require("fs");
+function readFilePromise(filename) {
+  return new Promise((resolve, reject) => {
+    fs.readFile(filename, (err, data) => {
+      if (err) reject(err + "");
+      else resolve(data + "");
+    });
+  });
+}
+async function readTwoFiles() {
+  try {
+    console.log(await readFilePromise("readfile.js"));
+    console.log(await readFilePromise("doesntExist.js"));
+  } catch (err) {
+    console.error(err + "");
+  }
+}
+readTwoFiles();
+
+

Włączanie zewnętrznych bibliotek

+

TODO

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/2_javascript_interakcje_z_dom/index.html" "b/Web\303\263wka\360\237\214\215/2_javascript_interakcje_z_dom/index.html" new file mode 100644 index 00000000..71b54d59 --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/2_javascript_interakcje_z_dom/index.html" @@ -0,0 +1,1466 @@ + + + + + + + + + + + + + + + + Javascript DOM - Interakcje i właściwości - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + +
+
+ + + + + + + + +

Javascript DOM - Interakcje i właściwości

+

DOM (Document Object Model) -ustrukturyzowana reprezentacja dokumentów HTML.
+Pozwala Javascriptowi na dostęp do jego elementów i manipulowanie nimi (zmiana stylu, tekstu, czy też stylu CSS).

+

Jest to drzewiasta struktura łącząca elementy rodziców z ich dziećmi.

+

Drzewo DOM

+

Korzeniem tej struktury jest document. Jest to klasa dostępna w JS-ie do której się odwołujemy, gdy chcemy wejść w interakcję z naszym dokumentem.

+

Do manipulacji elementami zawartymi w dokumencie HTML wystarczy użyć metody document.querySelector, która zwróci nam obiekt reprezentujący dany element.

+

Manipulacja elementami strony

+

W praktyce

+
document.querySelector(".message");
+//W nawiasie podajemy jego identyfikator, analogicznie jak w CSS-ie .klasa lub #id
+
+document.querySelector(".message").textContent;
+//"Wiadomość"
+document.querySelector(".message").textContent = "Nowa wiadomość"; // w tym momencie zmieni się tekst zawarty w tym elemencie
+
+

Znajdowanie elementów

+
document.querySelector(".message"); //szuka po nazwie i zwraca pierwszy pasujący
+document.querySelectorAll(".message"); //jak wyżej, tylko zwraca listę wszystkich elementów
+
+document.documentElement; //zwraca nam całe drzewo dokumentu
+document.body; //analogicznie
+document.head;
+
+document.getElementById("element1"); // zwraca nam element po ID (bez potrzeby używania krokek, czy haszów przy nazwach)
+document.getElementsByTagName("button"); //Elements - czyli zwróci nam listę elementów typu button
+document.getElementsByClassName("moja_klasa");
+
+

Dodawanie i tworzenie elementów

+

Do dodawanie elementów w HTML-u używa się metody Element.insertAdjacentHTML() albo insertAdjacentElement().
+Pozwala ona nam wstawić dowolny tekst (element) względem wybranego elementu.

+
element.insertAdjacentHTML(position, text);
+
+

position może przyjmować wartości:

+
    +
  • 'beforebegin': przed element -em.
  • +
  • 'afterbegin': W środku element-u przed jego pierwszym dzieckiem.
  • +
  • 'beforeend': W środku elementu po jego ostatnim dziecku.
  • +
  • 'afterend': Po element-cie
  • +
+

Odpowiadają one takim wstawienion:

+
<!-- beforebegin -->
+<p>
+  <!-- afterbegin -->
+  foo
+  <!-- beforeend -->
+</p>
+<!-- afterend -->
+
+

Stworzenie elementu (którego jeszcze nie dodajemy do naszego DOM-a)

+
const my_element = document.createElement("div"); //to co dostaliśmy zachowuje się jak każdy element zdobyty za pomocą np query selectora
+
+document.body.prepend(my_element); //po wstawieniu naszego elementu do dokumentu nasz obiekt może być nadal używany
+//możemy np zmienić położenie naszego elementu
+document.body.append(my_element); // przeniesie to nasz element bo może istnieć tylko jedna instancja obiektu w DOM-ie
+// jesli chcemy kopiować to trzeba użyć .cloneNode(true)
+
+my_element.remove(); // usuwa ten element
+
+

W niektórych przypadkach zamiast createElement() trzeba użyć createElementNS() (np w wypadku elementów wewnątrz svg).

+

Edycja elementu oraz atrybutów

+
my_element.classList.add("my-created-class");
+my_element.textContent = "Trochę tekstu";
+
+// Ten jest chyba najbardziej uniwersalny przy prostych zastosowaniach
+my_element.innerHTML = "<h1>Trochę tekstu tylko inaczej</h1>";
+
+// zmiana atrybutów elementów
+my_element.color = "green"; // dla standardowych możemy się do nich dostać przez pole w klasie
+my_element.setAttribute("creator", "Marian"); //to się za to sprawdzi dla niestandardowych
+
+// jedynym wyjątkiem dla niestandardowych atrybutów są atrybuty data-.....
+// <button data-version-number=0/>
+mybtn.dataset.versionNum = 32;
+
+

CSS

+

Aby dostać się do stylu w CSS należy dostać się do parametru style.

+
body {
+  font-family: sans-serif;
+  color: #eee;
+  background-color: rgb(36, 33, 33);
+}
+
+

Trzeba tylko pamiętać, że wszystkie zmienne wewnątrz stylów (także liczby) muszą być podawane jako stringi.

+
document.querySelector("body").style.backgroundColor = "#60b347";
+
+

Należy pamiętać o tym, że pobierając style w sposób pokazany powyżej pobieramy tylko style określonych elementów.

+
const bt = document.querySelector("#my-btn");
+bt.style.width; //to zwróci nam wartość tylko i wyłącznie wtedy, gdy dany przycisk miał to zapisane bezpośrednio
+// (nie np gdy ta wartość jest dziedziczona po klasie, typie, albo jest zapisana w pliku CSS)
+
+getComputedStyle(bt).color; // to nam zawsze zwróci jakąś wartość
+
+

Podobnie możemy manipulować zmiennymi CSSowymi

+
document.documentElement.style.setProperty("--background-color", "red");
+
+

Odbieranie zdarzeń

+

Aby odbierać zdarzenia z elementów wystarczy dodać funkcję będącą callbackiem dla danego wydarzenia powiązanego z tym elementem.

+
document.querySelector(".myButton").addEventListener("click", function () {
+  console.log("pressed button");
+});
+
+

Warto pamiętać, że możemy odbierać zdarzenia nie tylko z elementów, lecz także z dokumentu jako całości. Np poprzez odbieranie wciśnięć.

+
document.addEventListener("keydown", function (e) {
+  console.log(e);
+});
+//keydown { target: body, key: "Escape", charCode: 0, keyCode: 27 }
+
+

Warto wiedzieć, żę w wypadku funkcji wołanych przez zdarzenia mamy w nich dostęp do słowa kluczowego this - reprezentuje ono wskaźnik na obiekt, który uruchomił dane wydarzenie.

+

//TODO przykład

+

Co można znaleźć w DOM-ie

+

Właściwości globalne

+

Window jest globalnym obiektem Window.
+W pewnym sensie to z jego wnętrza operujemy, bo window.window.pageYOffset zwraca to samo co pageYOffset. +Z jego pomocą można łatwo ustalić jego wymiary, obecne położenie na stronie i tym podobne.

+

Przykładowe właściwości i metody obiektu window:

+
    +
  • pageYOffset pageXOffset - obecne położenie (tylko odczyt), czyli o ile pikseli przewinęliśmy
  • +
+

Warto także pamiętać o takich obiektach jak document oraz screen (zawiera informacje na temat wymiarów ekranu itp).

+

Metody dla elementów

+

Przydatne metody dla klasy bazowej Element

+ +

Przydatne właściwości elementów

+

Wymiary i położenie

+
element.getBoundingClientRect();
+
+

zwróci

+
DOMRect { x: 30, y: -1054.9000244140625, width: 115.69999694824219, height: 28.79998779296875, top: -1054.9000244140625, right: 145.6999969482422, bottom: -1026.1000366210938, left: 30 }
+
+

wartości x oraz y pokazują położenie względem lewej i góry okna (viewport-u, nie strony), to znaczy, że mogą się zmieniać wraz z przewijaniem.

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/3_html_i_css/index.html" "b/Web\303\263wka\360\237\214\215/3_html_i_css/index.html" new file mode 100644 index 00000000..e0f708c3 --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/3_html_i_css/index.html" @@ -0,0 +1,1824 @@ + + + + + + + + + + + + + + + + HTML i CSS - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

HTML i CSS

+

Źródło tej notatki https://developer.mozilla.org/pl/docs/Learn/Getting_started_with_the_web/HTML_basics

+

HTML jest językiem znaczników (ang. markup language).
+Składa się z serii znaczników (tagów), których używa się do zamknięcia, opakowania różnych części treści, tak aby wyglądały i/lub działały w określony sposób. Z pomocą tagów możesz ze słów czy obrazów zrobić linki do innych stron, etc.

+

Podstawowa struktra

+

Element

+

Podstawową strukturą jest element.

+

+Mamy tutaj:

+
    +
  • Tag otwierający
  • +
  • Tag zamykający
  • +
  • Zawartość
    + Razem tworzą one nasz element
  • +
+

Elementy mogą zawierać także atrybuty

+

+

Atrybut zawsze powinien mieć:

+
    +
  • Spację między nazwą tagu a nazwą atrybutu (lub innego atrybutu, jeśli dany element ma więcej atrybutów).
  • +
  • Nazwę atrybutu oraz znak równości.
  • +
  • Wartość podaną w "cudzysłowie"
  • +
+

Atrybuty class i id są uniwersalnymi atrybutami dla wszystkich tagów. Pozwalają one na łatwe zarządzanie elementami strony poprzez przypisywane im identyfikatorów i określanie ich przynależności do różnych klas. (ID musi być unikalne, klasa już nie) +Potem można używać tego do zmiany stylów w CSS, czy też w skryptacj w JS.

+

Warto pamiętać, że elementy mogą mieć wiele klas jednocześnie

+
<button class="btn again">Again!</button>
+
+

Elementy mogą się w sobie zagnieżdżać

+
<p>My cat is <strong>very</strong> grumpy.</p>
+
+

Elementy mogą być też puste - gdy nie zawierają żadnej treści.
+Nie muszą wtedy mieć tagu zamykającego.

+
<img src="images/firefox-icon.png" alt="My test image" />
+
+

Struktura plików

+

Całość zawsze jest zawarta w tagach HTML.

+
<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8" />
+    <title>My test page</title>
+  </head>
+  <body>
+    <img src="images/firefox-icon.png" alt="My test image" />
+  </body>
+</html>
+
+

Opisy elementów:

+
    +
  • <!DOCTYPE html> - typ dokumentu (opcjonalny)
  • +
  • <html> - element html zawiera całą treść strony i czasem nazwany jest elementem bazowym (ang. root element). Wskazuje, gdzie zaczyna i kończy się kod HTML.
  • +
  • <head> -element head to tzw. nagłówek strony. Ten element działa jak kontener dla wszystkich elementów, które chcesz umieścić na stronie HTML, ale nie w treści, które wyświetlasz przeglądającym twoją stronę. Ma on w sobie na ogół konfigurację.
  • +
  • <body> - element body. Zawiera onczęść właściwą strony, czyli jej zawartość.
  • +
  • <meta charset="utf-8"> - reprezentuje metadane, które nie mogą być reprezentowane przez inne elementy związane z metadanymi w HTML. Tutaj ustawia zestaw znaków.
  • +
  • <title> - Ustawia tytuł strony, który jest tytułem wyświetlanym na karcie przeglądarki
  • +
+

Przykładowe elementy i tagi

+

Komentarze

+
<!-- tekst komentarza -->
+
+

Tekst

+
Nagłówek <h1>
+

Nagłówki opisujemy jako h1 (najgłówniejszy), h2,h3...

+
<h1>My main title</h1>
+<h2>My top level heading</h2>
+<h3>My subheading</h3>
+<h4>My sub-subheading</h4>
+
+
Podstawy
+

Paragrafy (<p>) służą do dzielenia tekstu na paragrafy

+
<p>This is a single paragraph</p>
+
+<b>Tekst pogrubiony</b>
+<!-- Jest to markup fizyczny alternatywą logiczną jest znacznik <strong> -->
+
+<i>tekst kursywą</i>
+<code>Tekst czcionką programistyczną</code>
+
+<br />
+<!-- Znak nowej linii -->
+
+
Lista <ul> <ol>
+

unordered list <ul> - lista nieuporządkowana

+
<ul>
+  <li>technologists</li>
+  <li>thinkers</li>
+  <li>builders</li>
+</ul>
+
+

ordered list <ol> - lista uporządkowana.

+

Jest dla niej kilka typów np: A -oznaczanie kolejnych punktów jako abc i - osnaczanie rzymskimi cyframi

+
<ol>
+  <li>pierwszy</li>
+  <li>drugi</li>
+  <li>trzeci</li>
+</ol>
+
+
Linki <a>
+

Aby utworzyć odnośnik musimy użyć prostego elementu — a — "a" jest skrótem od angielskiego "anchor".

+
<a href="https://www.mozilla.org/en-US/about/manifesto/">Mozilla Manifesto</a>
+
+
    +
  • href (hypertext reference) - link (może to być link nie tylko do innej strony, lecz także do elementu tej samej strony)
  • +
+
<a href="#section--1">Sekcja 1</a>
+<!-- .... -->
+
+<section class="section" id="section--1">
+  <!-- Tu nas przeniesie kliknięcie -->
+</section>
+
+

Jeśli nasz link będzie prowadził do # to zostaniemy przeniesieni na początek strony.

+

Możemy też łatwo tworzyć własne kotwice

+
<a name="moja_sekcja">Moja sekcja</a>
+
+

Obraz <img>

+

Używamy do tego tagu img

+
<img src="images/firefox-icon.png" alt="My test image" />
+
+
    +
  • src - źródło obrazu
  • +
  • alt - tekst alternatywny - pokazuje się w razie problemów z wyświetleniem.
  • +
+

Organizacja rzeczy na stronie

+
DIV <div>
+

div - jest to element który nie robi nic. Służy on jako kontener, dzięki któremu można łatwo podzielić i pogrupować elementy.

+

Wejścia

+

pole tekstowe i przycisk (bez JS-a bezuzyteczne)

+
<input type="text" placeholder="Domyślny tekst" /> <button>GIT!</button>
+
+

+

+
SPAN <span>
+

Tak jak <div> nie robi nic, po prostu pozwala łatwo zapanować nad elementami tekstu.

+
<h1>
+  słowo
+  <span class="highlight">ważne słowo</span>
+  Kolejne słowo<br />
+</h1>
+
+

Możemy w ten sposób łatwo zarządzać jakimiś fragmentami tekstu przypisując je np do klas.

+

Przekierowywanie strony TODO

+

CSS

+

CSS służy do ustalania stylu naszej strony. Analogicznie do JS-a może być umieszczony w pliku html, lub w oddzielnym pliku.

+
<html>
+  <head>
+    <title>Learning CSS</title>
+    <style>
+      body {
+        background-color: green;
+      }
+    </style>
+  </head>
+
+  <body></body>
+</html>
+
+

Osadzamy to za pomocą linku (ale nie tagiem a - anchor, tylko link)

+
 <title>Learning CSS</title>
+<link href="style.css" rel="stylesheet">
+</head>
+
+

Możemy też przypisać dany styl do poszczególnych elementów

+
<div style="display: flex; flex-direction: column"></div>
+
+

Składnia CSS

+

Poniżej widać, że przypisujemy dane parametry dla wszystkich elementów należących do tagu body tzn do wszystkich elementów dziedziczących po nim.

+
body {
+  background-color: yellow;
+  font-family: sans-serif;
+}
+
+

Pliki CSS zawierają listy elementów, które mają mieć zmienione wartości, mogą one opisywać zarówno to jak mamy zmienić niektóre tagi, jak i plasy, czy też edytować poszczególne ID.

+

Klasa - do zmian właściwości klasy używamy nazwy klasy poprzedzonej kropką .
+Klasa może być też łączona z typem np p.moja_klasa - czyli wszystkie paragrafy należące to tej klasy.

+
<p class="mojaklasa">Przykładowa klasa</p>
+
+
.mojaklasa {
+  color: red;
+}
+
+

ID - tutaj zamiast kropki używamy #

+
<p id="moj_paragraf">Przykładowa klasa</p>
+
+
#moj_paragraf {
+  color: green;
+  border: 5px solid black;
+}
+
+

Co ciekawe widać tutaj właściwość border - może ona mieć więcej niż jedną właściwość - tutaj są to grubość, styl i kolor.

+

Kilka elementów wystarczy je wymienić po przecinku

+
input,
+button {
+  padding: 10px;
+  font-size: 16px;
+}
+
+

Elementy umieszczone względem innych - jeśli chcemy oznaczyć wszystkie elementy znajdujące się wewnątrz innych to wypisujemy obok siebie, tylko bez przecinków

+
#moj-element h2 {
+  color: black;
+} /* będzie dotyczyć tylko nagłówków h2 wewnątrz elementu z id moj-element */
+
+

Wszystko

+

Za pomocą * można łatwo "złapać" wszystkie elementy.
+Można to użyć, aby łątwo dostosować np. marginesy wszystkich elementów.

+
* {
+  margin: 0;
+  padding: 0;
+  box-sizing: border-box; /* ta właściwość zmiania liczenie rozmiaru, od teraz ustalony rozmiar dotyczy zawartości wraz z paddingiem, a nie tylko zawartości */
+}
+
+

Warto pamiętać, że nie wszystkie właściwości są dziedziczone, np padding dotyczy tylko wskazanego elementu, elementy wewnątrz nie będą zmieniane.

+

Wartości wymiarów

+

Wszelkie wymiary mogą być opisywane z użyciem dwóch typów jednostek:

+
    +
  • Bezwzględnych - px cm mm in pt (piksele, centymetry, milimetry, cale, punkty etc) - wszystkie te (za wyjątkiem pikseli) skalują się do wymiarów urządzenia
  • +
  • Względnych - te już są nieco bardziej skomplikowane:
  • +
  • % - procent wymiarów rodzica
  • +
  • vw vh - 1% wysokości lub szerokości okna przeglądarki
  • +
  • em - liczone względem rozmiaru fontu elementu (2em to rozmiar 2 razy większy niż obecny font)
  • +
  • inne...
  • +
+

Zmienne CSS

+

Zmienne CSS mogą zawierać różne wartości dostępne w całym dokumencie.

+
/* najprościej jest zadeklarować je w roocie, wtedy są dostępne wszędzie */
+:root {
+  --glowny-kolor-tla: brown;
+}
+
+.blok {
+  --glowny-kolor-tla: green;
+}
+
+.jeden {
+  color: white;
+  background-color: var(
+    --glowny-kolor-tla
+  ); /* przy użyciu musi być to umieszczone w var()*/
+}
+/*Jeśli element .jeden znajdzie się wewnątrz elementu .blok, wtedy wartość zmiennej z
+roota zostanie przesłonięta przez wartość zadaną w bloku*/
+
+

Użyteczne wartości

+
    +
  • opacity - przezroczystość określana od 0 do 1 (przydatna do chowania i pokazywania elementów)
  • +
  • display - sposób w jaki sposób powinny być ułożone elementy w danym pojemniku. Przykładowe wartości:
  • +
  • none - elementy nie będą renderowane
  • +
  • inline - elementy będą ułożone w linii
  • +
  • flex
  • +
+

//TODO opisz dokładniej display

+

Box Model

+

Jest to koncepcja mówiąca, że każdy element strony powinniśmy postrzegać jako prostokąt z zawartością charakteryzujący się takimi właściwościami jak szerokość wysokość etc.

+

Właściwości te to:

+ +

box model

+

Dodatkowo jest jeszcze fill area czyli cała przestrzeń znajdująca się w obrębie granicy (border).

+

I właśnie te parametry możemy z łatwością dostosowywać za pomocą CSS-ów.

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/4_javascript_inne/index.html" "b/Web\303\263wka\360\237\214\215/4_javascript_inne/index.html" new file mode 100644 index 00000000..f4f48595 --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/4_javascript_inne/index.html" @@ -0,0 +1,1426 @@ + + + + + + + + + + + + + + + + Javascript - Inne informacje - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + +
+
+ + + + + + + + +

Javascript - Inne informacje

+

Koncepty webowe

+

W sieci mamy 3 główne technologie:

+
    +
  • html - odpowiada za zawartość strony, ułożenie elementów etc
  • +
  • CSS - Styl w którym jest nasza strona
  • +
  • Javascript - język programowania, który odpowaida za wszystkie "ruchome" rzeczy
  • +
+

Wersje JSa

+
    +
  • ES5 (ECMAScript 5) wersja wydana w 2009
  • +
  • ES6 (2015) - największa aktualizacja ever - od tego wydania
  • +
  • ES6+ - Od tego momentu kolejne wydania wychodzą co roku i określa się je jako ES6+ (ES2019, ES2020)
  • +
+

JS ma podobne założenia jak java jeśli chodzi o zmiany, czyli NIGDY nie usuwamy starych rzeczy z języka, tylko dodajemy nowe.
+Dzięki temu jest świetna kompatybilność wsteczna .Rzeczy napisane w roku 2009 będą działać dobrz na najnowszych przeglądarkach, ale za to nowe mechanizmy mogą nie być obecne na starszych.
+Do tego używa się narzędzia Babel (transpiluje twój kod do ES5).

+

Właściwości języka jako takiego

+

Cechy opisujące JS-a

+
    +
  • wysokopoziomowy
  • +
  • posiada garbage collectora
  • +
  • interpretowany lub just in time compiled
  • +
  • wieloparadygmatowy (Obiektowy, Funkcyjny)
  • +
  • Wszystko jest klasą (za wyjątkiem prymitywów)
  • +
  • Jednowątkowy
  • +
+

Asynchroniczność, Wydarzenia(eventy) etc

+

Ze względu na naturę języka (obsługa GUI oparta na zdarzeniach) oraz braku wsparcia dla wielowątkowości bardzo ważną rolę odgrywa tutaj asynchroniczność.

+

Kolejka JS

+

W pewnym uproszenieniu można powiedzieć, że w JS-ie mamy stos na którym wykonywane są funkcje z głównego pliku oraz kolejkę na której znajdują się wydarzenia do obsłużenia.
+W momencie, gdy wszystko co znajdowało się na stosie zostanie wykonane to wtedy na stos "wrzucona" zostanie funkcja z kolejki do wykonania. Z tego powodu czasami może dojść do przyblokowania, eventów, co może mieć nieoczekiwane konsekwencje (np. funkcja z setTimeout może się wykonað później niż planowaliśmy)

+
+ Przykład + +
function fibo(n) {
+  return n < 2 ? 1 : fibo(n - 2) + fibo(n - 1);
+}
+
+function showMessage(m, u) {
+  console.log(m + ": The result is: " + u);
+}
+
+console.log("Starting the process...");
+// Wait for 10 ms in order to show the message...
+setTimeout(function () {
+  console.log("M1: My first message...");
+}, 10);
+// Several seconds are needed in order to
+// complete this call: fibo(40)
+let j = fibo(40);
+// M2 is written before M1 is shown. Why?
+showMessage("M2", j);
+// M3 is written after M1. Why?
+setTimeout(function () {
+  showMessage("M3", j);
+}, 1);
+
+ +Powyższy kod drukuje: + +
C:\> node turnQueue.js
+Starting the process...
+M2: The result is: 165580141
+M1: My first message...
+M3: The result is: 165580141
+
+ + +
+ +

Zalecane formatowanie

+

TODO

+

Strict mode

+

Jest to specjalny tryb pomagający przy developmencie.
+Zapobiega głównie robieniu niektórych operacji oraz wyrzuca więcej errorów.

+

Aby go aktywować wystarczy dodać linię 'use strict'; na samym początku skryptu.

+

Przykładowe mechanizmy:

+
    +
  • Łapanie użycia nieistniejących zmiennych. (częste przy literówkach)
  • +
  • Pilnowanie próby użycia zastrzeżonych słów w złych miejscach (np jako nazwy zmiennych)
  • +
+

Więcej przykładów tutaj

+

Wczytywanie i wykonywanie skryptu

+

TODO async, defer +https://www.udemy.com/course/the-complete-javascript-course/learn/lecture/22649011#overview

+

Pomniejsze libki i obiekty wbudowane

+

Math

+
Math.random(); //zwraza liczbę z zakresu 0-1
+Math.trunc(num); //przycina liczbę co całkowitej
+
+

Czas

+

//TODO

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/5_nodejs/index.html" "b/Web\303\263wka\360\237\214\215/5_nodejs/index.html" new file mode 100644 index 00000000..7fce1f8c --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/5_nodejs/index.html" @@ -0,0 +1,1570 @@ + + + + + + + + + + + + + + + + NodeJS - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

NodeJS

+

Jest to narzędzie wykorzystywane do rozwijania komponentów systemów rozproszonych.
+Dostarcza serię modułów, które pomagają w rozwijaniu takich apek.
+Jest zaprojektowany do zwinnego rozwijania skalowalnych aplikacji.

+

Definiuje:

+
    +
  • Interfejsy
  • +
  • Interpreter - operty na silniku V8 (z google chrome'a)
  • +
  • zarządzanie modułami
  • +
  • ...
  • +
+

Inne cechy:

+
    +
  • I/O model oparty o zdarzenia
  • +
  • pętla zdarzeń działa w jednym wątku
  • +
  • aktywność nigdy nie jest bolkowana
  • +
  • równoległość oparta o callbacki oraz wydarzenia
  • +
+

Zastosowania:

+
    +
  • Komponenty serwerowe
  • +
  • Niekrytyczne aplikacje
  • +
  • Aplikacje z lekkimi interfejsami REST/JSON
  • +
  • Aproste aplikacje (takie, które korzystają z AJAX-a, do interakcji z serwerami)
  • +
+

Przyjmowanie argumentów programu argv

+

Argumenty znajdują się w zmiennej process.argv.

+

Poszczególne moduły

+

Zarządzanie modułami

+

Są 2 sposoby na importowanie modułów

+
    +
  • ESM - (imo lepszy)
  • +
+
import React from 'react';
+
+import {foo, bar} from './myLib';
+
+...
+import * as fs from 'node:fs/promises';
+...
+
+export default function() {
+  // your Function
+};
+export const function1() {...};
+export const function2() {...};
+
+
    +
  • CJS (CommonJS)
  • +
+

Korzystając z funkcji require() możemy włączać inne moduły do naszego programu

+
const HTTP = require(http);
+
+const st = require(./Circle.js);
+console.log( Area of a circle with radius 5:  + st.area(5) );
+
+

Aby coś dało się zaimportować musimy użyć exports

+
// Module Circle.js
+exports.area = function (r) {
+  return Math.PI * r * r;
+};
+
+

Moduł Events

+

Dokumentacja
+Jest on wykorzystywany do implementacji generatorów wydarzeń.

+

Generatory są instancjami EventEmitter

+

Proste użycie

+
const emitter = new ev.EventEmitter();
+emitter.on(eventName, functionHandler); //Rejestrowanie callbacka
+emitter.emit(eventName, arg1, arg2, ....); //Wywołanie zdarzenia z argumentami
+
+

emit() powoduje wywołanie natychmiastowe wywołanie callbacku.
+Jeśli chcemy, aby wydarzyło się to potem możemy skorzystać z asynchrnoiczności.
+setTimeout(function() {emit(event,...);},0)

+

MOże być wiele callbacków dla danego wydarzenia.

+

Większy przykład

+
const ev = require("events");
+const emitter = new ev.EventEmitter(); // DON’T FORGET NEW OPERATOR!!
+const e1 = "print",
+  e2 = "read"; // Names of the events.
+
+function createListener(eventName) {
+  let num = 0;
+  return function () {
+    console.log(
+      "Event " + eventName + " has " + "happened " + ++num + " times."
+    );
+  };
+}
+// Listener functions are registered in the event emitter.
+emitter.on(e1, createListener(e1));
+emitter.on(e2, createListener(e2));
+// There might be more than one listener for the same event.
+emitter.on(e1, function () {
+  console.log("Something has been printed!!");
+});
+// Generate the events periodically...
+setInterval(function () {
+  emitter.emit(e1);
+}, 2000); // First event emitted every 2s
+setInterval(function () {
+  emitter.emit(e2);
+}, 3000); // Second event emitted every 3s
+
+

Stream module

+

Uzywane do pracy ze strumieniemi danych. Dokumentacja

+

Istnieją 4 warianty:

+
    +
  • Readable: odczyt
  • +
  • Writable
  • +
  • Duplex: odczyt i zapis dostępny
  • +
  • Transform: podobne do duplexu, ale wpisy na ogół zależą od odczytów
  • +
+

Wszystkie z nich są klasami typu EventEmitter, posiadają one zdarzenia:

+
    +
  • Readable:
  • +
  • readable
  • +
  • data - część informacji została odczytana (linia)
  • +
  • end - strumień zamknął obecne połączenie
  • +
  • close - strumień TCP został zamknięty całkowicie (nie będzie już przyjmował nowych połączeń)
  • +
  • error.
  • +
  • Writable: drain, finish, pipe, unpipe.
  • +
+

Przykłady:

+
    +
  • Readable: process.stdin, files, HTTP requests (server), HTTP responses (client), ...
  • +
  • Writable: process.stdout, process.stderr, files, HTTP requests (client), HTTP responses (server),...
  • +
  • Duplex: TCP sockets, files,...
  • +
+
const st = require('./Circle.js')
+const os = require('os')
+process.stdout.write("Radius of the circle: ")
+process.stdin.resume() // Needed for initiating the reads from stdin.
+process.stdin.setEncoding("utf8") // … for reading strings instead of “Buffers”.
+// Endless loop. Every time we read a radius its circumference is printed and a new
+radius is requested
+process.stdin.on("data", function(str) {
+  // The string that has been read is “str”. Remove its trailing endline.
+  let rd = str.slice(0, str.length - os.EOL.length)
+  console.log("Circumference for radius " + rd + " is " + st.circumference(rd))
+  console.log(" ")
+  process.stdout.write("Radius of the circle: ")
+})
+// The “end” event is generated when STDIN is closed. [Ctrl]+[D] in UNIX.
+process.stdin.on("end", function() {console.log("Terminating...")})
+
+

Moduł sieciowy - net

+

Służy do zarządzania gniazdami TCP. Dokumentacja

+
    +
  • net.Server: TCP server.
  • +
  • Generated using net.createServer([options,][connectionlistener]).
      +
    • “connectionListener”, when used, has a single parameter: a TCP socket already connected.
    • +
    +
  • +
  • Events that may manage: listening, connection, close, error.
  • +
  • net.Socket: Socket TCP.
  • +
  • Generated using new net.Socket() or net.connect(options [,listener]) or net.connect(port [,host][,listener])
  • +
  • Implements a Duplex Stream.
  • +
  • Events that may manage: connect, data, end, timeout, drain, error, close.
  • +
  • Is child of EventEmitter
  • +
+

Przykład (serwer)

+
const net = require("net");
+let server = net.createServer(function (socket) {
+  //'connection' listener
+  console.log("server connected");
+  socket.on("end", function () {
+    console.log("server disconnected");
+  });
+  // Send "Hello" to the client.
+  socket.write("Hello\r\n");
+  // With pipe() we write to Socket 'c'
+  // what is read from 'c'.
+  socket.pipe(socket);
+}); // End of net.createServer()
+server.listen(9000, function () {
+  //'listening' listener
+  console.log("server bound");
+});
+
+

Klient

+
const net = require("net");
+// The server is in our same machine.
+let client = net.connect({ port: 9000 }, function () {
+  //'connect' listener
+  console.log("client connected");
+  // This will be echoed by the server.
+  client.write("world!\r\n");
+});
+client.on("data", function (data) {
+  // Write the received data to stdout.
+  console.log(data.toString());
+  // This says that no more data will be
+  // written to the Socket.
+  client.end();
+});
+client.on("end", function () {
+  console.log("client disconnected");
+});
+
+

Moduł HTTP

+

Pomaga przy implementacji serwerów webowych (oraz klientów) Dokumentacja

+

Klasy:

+
    +
  • http.Server - modeluje web serwer
  • +
  • http.ClientRequest - zapytanie
  • +
  • Jest to strumień oraz EventEmitter
  • +
  • Wydarzenia: response, socket, connect, upgrade, continue
  • +
  • http.ServerResponse
  • +
  • http.IncomingMessage
  • +
+
const http = require("http");
+const hostname = "127.0.0.1";
+const port = 3000;
+const server = http.createServer((req, res) => {
+  // res is a ServerResponse.
+  // Its setHeader() method sets the response header.
+  res.statusCode = 200;
+  res.setHeader("Content-Type", "text/plain");
+  // The end() method is needed to communicate that both the header
+  // and body of the response have already been sent. As a result, the response can
+  // be considered complete. Its optional argument may be used for including the
+  // last part of the body section.
+  res.end("Hello World\n");
+});
+// listen() is used in an http.Server in order to start listening for
+// new connections. It sets the port and (optionally) the IP address.
+server.listen(port, hostname, () => {
+  console.log("Server running at http://" + hostname + ":" + port + "/");
+});
+
+

Cluster - skalowanie

+

Jako, że JS jest jednowątkowy to nie możemy w prosty sposób stworzyć nawych wątków do przetwarzania większej ilości zapytań. Musimy uruchamiać kolejne procesy. Do ułatwienia tego zadania mozemy wykorzystać moduł cluster. Pozwala na:

+
    +
  • łatwe tworzenie nowych procesów wykonujących ten sam kod
  • +
  • umożliwia zarządzanie nimi i dzielenie obciążenia (klasa Worker)
  • +
  • procesy mogą dzielić ten sam port przypisany danemu serwisowi
  • +
  • dostarcza wiele dodatkowych eventów: (fork,online,listening,disconnect,exit…)
  • +
+

Przykładowy klaster

+
var cluster = require("cluster");
+var numCPUs = require("os").cpus().length;
+var server = ...; // the server which runs the workers
+var port = ...;// the port where the server binds
+
+if (cluster.isMaster) {// code of the master one
+// fork: create workers
+  for (var i = 0; i < numCPUs; i++) cluster.fork();
+  // listening death of workers
+  cluster.on("exit", function (worker, code, signal) {
+    console.log("worker", worker.process.pid, "died");
+  });
+} else {
+  // code of any worker
+  server.listen(port); // each worker runs the server
+}
+
+

Klaster serwerów HTTP

+
var cluster = require("cluster");
+var http = require("http");
+var numCPUs = require("os").cpus().length;
+if (cluster.isMaster) {
+  // code of the master one
+  for (var i = 0; i < numCPUs; i++) cluster.fork();
+  cluster.on("exit", function (worker, code, signal) {
+    console.log("worker", worker.process.pid, "died");
+  });
+} else {
+  // code of any worker
+  http
+    .createServer(function (req, res) {
+      res.writeHead(200);
+      res.end("hello world\n");
+    })
+    .listen(8000);
+}
+
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/7_nginx/index.html" "b/Web\303\263wka\360\237\214\215/7_nginx/index.html" new file mode 100644 index 00000000..35465f14 --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/7_nginx/index.html" @@ -0,0 +1,1216 @@ + + + + + + + + + + + + + + + + Nginx - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Nginx

+

Służy do routowania i zarządzania połączeniami przychodzącymi na dany serwer.

+

Jeśli nie chcesz robić niczego skomplikowanego to polecam po prostu użyć apki Nginx proxy manager. Zrobisz większość rzeczy z pomocą prostego GUI.

+

Instalacja i odpalenie

+
sudo apt install nginx
+
+

Po instalacji jest duża szansa, że nginx wystartuje jako serwis z domyślną konfiguracją w /etc/nginx/nginx.conf.

+

Do zarządzania przydaje się komenda service. Przydatna zwłąszcza, gdy chcemy zrestartować serwis, aby wczytał zaktualizowaną konfigurację.

+
sudo service nginx reload #restartuje go
+sudo service nginx start
+sudo service nginx stop
+
+

Jeśli chcesz na szybko coś pozmieniać to wystarczy, że wyedytujesz plik nginx.conf i zrestartujesz usługę.
+Jednak przed restartem warto sprawdzić, czy ta konfiguracja ma sens nginx -t.

+

Konfiguracja

+
http{ # Tutaj opisujemy zasady dla protokołu http
+
+}
+
+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/8-REST-HTTP/index.html" "b/Web\303\263wka\360\237\214\215/8-REST-HTTP/index.html" new file mode 100644 index 00000000..4c9ab151 --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/8-REST-HTTP/index.html" @@ -0,0 +1,1402 @@ + + + + + + + + + + + + + + + + REST i HTTP - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

REST i HTTP

+

HTTP i HTTPS

+

HTTP (Hypertext Transfer Protocol) to protokół sieciowy stosowany do przesyłania danych w sieci.
+Protokół HTTP pozwala na wymianę danych za pomocą zapytań (ang. requests) i odpowiedzi (ang. responses). Zapytania są wysyłane przez przeglądarkę internetową do serwera, a odpowiedzi są wysyłane przez serwer z powrotem do przeglądarki. Zapytania i odpowiedzi są wysyłane w postaci ciągów tekstowych, które są następnie parsowane i interpretowane przez klienta i serwer.

+

Protokół HTTP składa się z kilku elementów, takich jak:

+
    +
  • Metoda zapytania: określa, co ma zostać zrobione z danymi. Najczęściej używane metody to GET, POST, PUT i DELETE.
  • +
  • Adres URL: określa lokalizację danych, do których zostanie wysłane zapytanie.
  • +
  • Nagłówki: są to informacje dodatkowe, które są wysyłane razem z zapytaniem lub odpowiedzią. Nagłówki mogą zawierać informacje o typie zawartości, autoryzacji lub innych szczegółach zapytania lub odpowiedzi.
  • +
  • Treść zapytania lub odpowiedzi: zawiera dane, które są przesyłane pomiędzy klientem a serwerem.
  • +
+

Metody HTTP wykorzystywane przy transferze

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NazwaOpis
GETPobierz dane
PUT
POSTUtwórz lub zaktualizuj jakąś daną
DELETEUsuń jakąś daną
+

Kody odpowiedzi

+

Po wykonaniu każdego zapytania otrzymujemy kod odpowiedzi opisujący wynik naszej operacji.

+

Pierwsza cyfra kodu opisuje typ błędu

+
    +
  • 1xx - kody informacyjne
  • +
  • 2xx - sukces
  • +
  • 3xx - przekierowanie
  • +
  • 4xx - błąd klienta
  • +
  • 5xx - błąd serwera
  • +
+

Popularne kody

+
    +
  • 200 OK: Żądanie zostało pomyślnie zrealizowane i serwer zwrócił odpowiednią treść.
  • +
  • 301 Moved Permanently: Zasób, który został zażądany, został przeniesiony na stałe na nowy adres URL. Przeglądarka powinna automatycznie przekierować użytkownika na nowy adres.
  • +
  • 401 Unauthorized: Serwer wymaga uwierzytelnienia użytkownika, aby zaakceptować żądanie.
  • +
  • 404 Not Found: Zasób, który został zażądany, nie został znaleziony na serwerze.
  • +
  • 500 Internal Server Error: Serwer napotkał błąd wewnętrzny podczas próby zrealizowania żądania.
  • +
+

URL

+

URL (Uniform Resource Locator) to ciąg tekstowy, który służy do identyfikowania i lokalizowania zasobów w sieci. Zasoby te mogą być plikami, obrazami, stronami internetowymi lub innymi danymi.

+

Składnia URL składa się z kilku elementów, które są oddzielone znakiem "/":

+
    +
  • Protokół określa, jaki protokół sieciowy jest używany do połączenia z zasobem. Najczęściej używanymi protokołami są HTTP i HTTPS.
  • +
  • Nazwa hosta określa, na którym serwerze znajduje się zasób. Nazwa hosta może być nazwą domeny, np. "example.com", lub adresem IP serwera.
  • +
  • Ścieżka określa lokalizację zasobu na serwerze. Ścieżka składa się z katalogów i nazw plików, które są oddzielone znakami "/".
  • +
  • Parametryzapytania: są to dodatkowe informacje przekazywane do serwera podczas żądania zasobu. Parametry zapytania są zazwyczaj w postaci pól klucz-wartość, które są oddzielone znakiem & i są dodawane do URL po znaku ?.
  • +
+
https://example.com/path/to/file.html?key1=value1&key2=value2
+
+

REST

+

Representational state transfer - sposób komunikacji aplikacji siecowymi oparty na zapytaniach HTTP i przesyłaniu JSONów (lub innych zbliżonych plików) z odpowiedziami.

+

W takim systemie każdemu API odpowiada unikalny url.

+

JSON

+

JSON (JavaScript Object Notation) to lekki format wymiany danych, który jest często stosowany do przesyłania danych między aplikacjami i systemami w sieci. Jest to format tekstowy, który jest łatwy do odczytu i zapisu dla ludzi, a także łatwy do analizowania i generowania przez komputery.

+

Format JSON opiera się na składni języka JavaScript i składa się z par klucz-wartość. Klucze są ciągami tekstowymi zawierającymi nazwy pól, a wartości mogą być różnymi typami danych, takimi jak liczby, ciągi znaków, tablica lub obiekt.

+
{
+  "name": "John Smith",
+  "age": 30,
+  "city": "New York",
+  "skills": ["JavaScript", "HTML", "CSS"]
+}
+
+

Opiera się ona na słownikach {"nazwa":wartość} oraz na listach [].

+

Przesyłanie danych nie tekstowych

+

Jako, że JSON wspiera przede wszystkim dane tekstowe to aby zapakować inne dane do zapytania/odpowiedzi należy skorzystać z algorytmu takiego jak base64

+

Base64 to sposób kodowania danych binarnych w postaci ciągu znaków ASCII. Dzięki kodowaniu base64 dane binarne są konwertowane na ciąg znaków, które mogą być przesłane przez sieć jako zwykły tekst.
+Algorytm base64 używa 64 znaków do kodowania danych. Są to litery alfabetu łacińskiego (wielkimi i małymi literami), cyfry oraz kilka znaków specjalnych. Każde 3 bajty danych są kodowane jako 4 znaki base64. Jeśli liczba bajtów danych nie jest podzielna przez 3, to są one uzupełniane dodatkowymi znakami "=", aby zapewnić pełne grupy po 3 bajty.

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/9_django/index.html" "b/Web\303\263wka\360\237\214\215/9_django/index.html" new file mode 100644 index 00000000..ba0a2bd9 --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/9_django/index.html" @@ -0,0 +1,1751 @@ + + + + + + + + + + + + + + + + Django - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Django

+

Warto zajrzeć tutaj: https://docs.djangoproject.com/en/3.2/intro/tutorial01/

+

https://bulldogjob.pl/readme/architektura-django

+

Struktura projektu

+

Projekt w django tuż po stworzeniu (django-admin startproject mysite) wygląda mniej więcej tak:

+
mysite/
+    manage.py
+    mysite/
+        __init__.py
+        settings.py
+        urls.py
+        asgi.py
+        wsgi.py
+
+

mamy tu folder projektu w którym mamy poszczególne aplikacje. Na ten moment mamy tylko folder mysite zawierający ogólną konfigurację projektu,a w nim pliki takie jak:

+
    +
  • settings.py - konfiguracja projektu, jakie bazy danych mają byc używane, język projektu, moduły wykorzystywane w projekcie etc. link
  • +
  • urls.py - deklaracje url opisujące co ma być dostepne pod jakimi ścieżkami link
  • +
+

Komendą manage.py startapp polls możemy dodać nową apkę o nazwie polls.

+

Struktura aplikcaji:

+
polls/
+    __init__.py
+    admin.py
+    apps.py
+    migrations/
+        __init__.py
+    models.py
+    tests.py
+    views.py
+
+

Pliki:

+
    +
  • admin.py - to jak ma wyglądać panel administracyjny dla danej apki
  • +
  • urls.py - analogiczny do pliku urls.py w folderze opisującym projekt
  • +
  • models.py - modele, które będą znajdować się naszych bazach danych
  • +
  • views.py - poszczególne widoki znajdujące się w naszej aplikacji, możemy tutaj wystawić poszczególne API RESTowe, lub stronki w HTMLu
  • +
  • tests.py
  • +
+

Django mvt

+

Dodatkowe pliki mogące się tu znajdować:

+
    +
  • serializers.py - link klasy wykorzystywane do serializacji modeli na inne formaty (np. json, lub xml)
  • +
+

Przy większych projektach warto rozsądne rozszerzenie powyższego schematu przykład

+

Zarządzanie i praca z projektem

+

Do tego wykorzystywany jest skrypcik manage.py znajdujący się w głównym folderze projektu.

+

Może byc on wykorzystywany chociażby do tworzenia (lub aktualizacji) tablic w bazie danych odpowiadających strukturom danych opisanych w modelach.

+
manage.py makemigrations # przygotowuje instrukcje potrzebne do zaktualizowania struktur w bazie
+manage.py migrate #wykonanie migracji
+
+

Do wygodnej "zabawy" z danymi oraz klasami w bazie można użyć manage.py shell.

+

Modele danych

+

W django możemy w prosty sposób stworzyć własne struktury, które potem w automatyczny sposób będą mogły być mapowane na struktury znajdujące się w naszych klasycznych bazach danych. dokumnetacja

+

Wszystkie modele bazują na klasie django.db.models.Model.

+
from django.db import models
+
+class Person(models.Model):
+    first_name = models.CharField(max_length=30)
+    last_name = models.CharField(max_length=30)
+
+

Definiowanie

+

Nowe modele powstają poprzez stworzenie klasy dziedziczącej po bazowej klasie W klasie tej zdefiniowane przez nas pola są rekordami.
+Mamy tutaj typowe rodzaje pól takie jak:

+
    +
  • CharField
  • +
  • IntegerField
  • +
  • ForeignKey - klucz obcy link
  • +
  • ManyToManyField - relacja typu wiele do wielu, pozwala na bezpośrednie i pośrednie łączenie z wieloma rekordami
  • +
  • etc.
  • +
+

Dla każdego pola możemy określić też dodatkowe parametry takie jak nullowalność, maksymalną sługość (dla stringów), możliwe dozwolone wartości itp. Możemy też samodzielnie wybierać pole będące kluczem (chociaż na ogół te automatycznie dodawane wystarcza).

+

Na podstawie tych klas możemy potem wygenerować tabele w baszej bazie (lub zaktualizować obecne, aby dopasowac) wykonując migrację (z użyciek spryptu manage.py).

+

W każdej klasie możemy dodatkowo określić klasę Meta pozwalającą określić dodatkowe informacje o naszym modelu, takie jak wymagania co do unikalności pól, tworzenie indeksów ze złączenia dwóch pól etc, nazwę okiektu, lub stworzyć klasę abstrakcyjną. pełna lista opcji

+
from django.db import models
+
+class Ox(models.Model):
+    horn_length = models.IntegerField()
+
+    class Meta:
+        ordering = ["horn_length"]
+        verbose_name_plural = "oxen"
+
+

Metody

+

Dodatkowo dla modelu mozęmy zdefiniować własne metody. Warto zaimplementować chociażby __str__(), która jest używana do wypisywania obiektóe w panelu administratora, podobnie jak get_absolute_url(). Przydatny może być też dekorator @property.

+

W niektórych wypadkach możemy też chcieć nadpisać domyślne metody takie jak save(), czy też delete(), gdy chcemy np zablokować usuwanie jakichś elementów.

+
from django.db import models
+
+class Blog(models.Model):
+    name = models.CharField(max_length=100)
+    tagline = models.TextField()
+
+    def save(self, *args, **kwargs):
+        if self.name == "Yoko Ono's blog":
+            return # Yoko shall never have her own blog!
+        else:
+            super().save(*args, **kwargs)  # Call the "real" save() method.
+
+

Praca z modelami

+

Każda klasa ma artybut objects, jest obiekt klasy Manager. Służy on do wykonywania zapytań do bazy.

+

Przydatne metody do wykonywania zapytań:

+
People.objects.all()
+People.objects.filter(name="Jan")
+People.objects.exclude(surname="Kowalski)
+
+# gdy chcemy uzyskać jeden wynik oraz wiemy, że taki wynik istnieje
+# jeśli nie istnieje to dostaniemy wyjątek Entry.DoesNotExist
+People.objects.get(pesel=12345678)
+
+p1 = Poeple.objects.create(name="Marian",surname="Nowak") #stworzenie instancji modelu
+p1.save() #zapisanie do bazy
+
+

Filtrowanie

+

Sposoby filtrowania nie ogarniczają się do podawania wartości oczekiwanych. Możemy też używać różnych prefixów. link

+
People.objects.filter(surname__startswith="Kowalski)
+
+

Filtry można też łatwo ze sobą łączyć zanim przejdziemy do wykonania zapytania wykorzystując klasę Q.

+

Do łączenia możemy wykorzystać operatory: |= (lub) oraz &= (i).

+
from django.db.models import Q
+
+q = Q()
+if param_1 != 'all':
+    q &= Q(param_1__name=param_1)
+if param_2 != 'all':
+    q &= Q(param_2__name=param_2)
+class_var = ClassName.objects.filter(q)
+
+#LUB
+
+q = {}
+if param_1 != 'all':
+    q.update({'param_1__name': param_1})
+if param_2 != 'all':
+    q.update({'param_2__name': param_2})
+class_var = ClassName.objects.filter(**q)
+
+

Przy odpowiednim wykorzystaniu kluczy obcych można także wykonywać proste filtry na łączeniach. link. Przydaje się tu argument related_name.

+
class Sessions(models.Model):
+    sessionId = models.AutoField(primary_key=True)
+
+class Ip(models.Model):
+    ipId = models.AutoField(primary_key=True)
+
+class Affiliation(models.Model):
+    affiliationId = models.AutoField(primary_key=True)
+    ip = models.ForeignKey("Ip", null=False, db_column="ipId")
+    session = models.ForeignKey(
+        "Sessions",
+        related_name="affiliation_session"
+    )
+
+
+#potem można wołać
+Sessions.objects.filter(affiliation_session__ip_id=X)
+
+

TODO więcej przykładów by się przydało

+

Widoki

+

link - Writing your first Django app, part 3

+

The Django template language

+

Widok jest typem strony internetowej generowany przez django.
+Widoki mogą być zwykłymi stronkami w HTMLu, mogą to być też widoki na jakieś dane. W wielu wypadkach pozwalają na swoiste zautomatyzowanie danej strony

+

Widok może być klasą lub funkcją zwracającą JSON-a, lub stronę w HTMLu.

+
class UserLogin(LoginView):
+    template_name = 'sjopinie_app/login.html'
+
+
from django.shortcuts import render
+
+from .models import Question
+
+
+def index(request):
+    latest_question_list = Question.objects.order_by('-pub_date')[:5]
+    #kontekst pozwala na późniejsze wykorzystywanie wartości w kodzie templatki
+    context = {'latest_question_list': latest_question_list}
+    return render(request, 'polls/index.html', context)
+
+

Przykładowy schemat strony dla powyższego przykładu

+
{% if latest_question_list %}
+<ul>
+  {% for question in latest_question_list %}
+  <li><a href="/polls/{{ question.id }}/">{{ question.question_text }}</a></li>
+  {% endfor %}
+</ul>
+{% else %}
+<p>No polls are available.</p>
+{% endif %}
+
+

Dzięki przekazaniu wartości w kontekście templatka może korzystać z podanych wartości.

+

Panel Administratora

+

https://docs.djangoproject.com/en/3.2/intro/tutorial02/#introducing-the-django-admin

+

REST API

+

Do pracy z API RESTowym zaleca się użycie specjalnego frameworka https://www.django-rest-framework.org/tutorial/quickstart/

+

Serializacja

+

link

+

Widoki dla RESTa

+

Używanie widoków pozwala łatwo zautomatyzować wyświetlanie danych. Za jednym zamachem możemy wystawić API reagujące na wszystkie typy zapytań (GET, PUT, POST, DELETE)

+

Można do tego wykorzystać na przykład własną klasę dziedziczącą po viewsets.ModelViewSet. Dzięki temu dostaniemy nie tulko :gołe" API, lecz także django wygeneruje interfejs sieciowy do korzystania z tego API, w razie zgdybyśmy otowrzyli go w przeglądarce.

+
from rest_framework import viewsets
+
+#prosty widok na listę przedmiotów posortowanych alfabetycznie
+class SubjectViewSet(viewsets.ModelViewSet):
+    queryset = Subject.objects.all().order_by('name')
+    serializer_class = SubjectSerializer
+
+# tu już nieco bardziej skomplikowany widok, reagujący na podawane parametry
+# Przykładowa ścieżka: lecturers/?name=Marian
+class LecturerViewSet(viewsets.ModelViewSet):
+    serializer_class = LecturerSerializer
+
+    def get_queryset(self):
+        lecturer_name = self.request.query_params.get('name')
+        queryset = Lecturer.objects.filter(name=lecturer_name)
+        return queryset
+
+

Inne

+

Praca z użytkownikami

+

Django pozwala włatwy sposób dodać uzytkowników do naszej aplikacji. link

+

Możemy tutaj uzyć gotowego modelu django.contrib.auth.models.User. Jeśli ten obiekt nam nie pasuje, zawsze możemy go przystosować do swoich potrzeb.

+

Do zalogowania uzytkownika z pomocą włanego formularza możemy wykorzystać metodę authenticate.

+
from django.contrib.auth import authenticate
+user = authenticate(username='john', password='secret')
+if user is not None:
+    # A backend authenticated the credentials
+else:
+    # No backend authenticated the credentials
+
+

Potem będziemy mogli sprawdzać przychodzące żądania pod kątem tego, czy pochodzą od jakiegoś użytkownika.

+
if request.user.is_authenticated:
+    # Do something for authenticated users.
+    ...
+else:
+    # Do something for anonymous users.
+    ...
+
+

Dla prostego zastrzegania treści tylko dla użytkowników możemy używać dekoratorów.

+
# dla funkcji
+from django.contrib.auth.decorators import login_required
+
+@login_required
+def my_view(request):
+    ...
+
+
+#dla klas widoków
+from django.contrib.auth.mixins import LoginRequiredMixin
+
+class MyView(LoginRequiredMixin, View):
+    login_url = '/login/'
+    redirect_field_name = 'redirect_to'
+
+# dla innych wypadków np w serializerze
+self.context['request'].user
+
+

Możemy także wprowadzać zmiany bezpośrednio na poziomie szablonów.

+
{% if user.is_authenticated %}
+<h1>Witaj {{user.get_username}}</h1>
+{% else %}
+<h1>Witaj nieznajomy</h1>
+{% endif %}
+
+

Używając tych mechanizmów możemy także tworzyć grupy użytkowników z różnymi uprawnieniami.

+

Formularze

+

Formularze są jednym z najpopularniejszych sposobów na zbieranie danych od użytkowników. Django jest wyposażone w kilka mechanizmów wspomagających pracę z nimi. (omówienie formularzy w django, dokumentacja mozilli)

+

Formularze możemy tworzyć ręcznie umieszczasjąc je bezpośrednio w schemacie strony

+
<form action="/your-name/" method="post">
+  <label for="your_name">Your name: </label>
+  <input
+    id="your_name"
+    type="text"
+    name="your_name"
+    value="{{ current_name }}"
+  />
+  <input type="submit" value="OK" />
+</form>
+
+

Możemy też do tego wykorzystać klasę Form, która sama wygeneruje nam formularz.

+
from django import forms
+
+class NameForm(forms.Form):
+    your_name = forms.CharField(label='Your name', max_length=100)
+
+

Następnie łączymy ten formularz z widokiem, który go obsługuje.(W przykładzie poniżej żądanie jest obsługiwane przez ten sam widok, który udostępnia formularz)

+
from django.http import HttpResponseRedirect
+from django.shortcuts import render
+
+from .forms import NameForm
+
+def get_name(request):
+    # if this is a POST request we need to process the form data
+    if request.method == 'POST':
+        # create a form instance and populate it with data from the request:
+        form = NameForm(request.POST)
+        # check whether it's valid:
+        if form.is_valid():
+            # process the data in form.cleaned_data as required
+            # ...
+            # redirect to a new URL:
+            return HttpResponseRedirect('/thanks/')
+
+    # if a GET (or any other method) we'll create a blank form
+    else:
+        form = NameForm()
+
+    return render(request, 'name.html', {'form': form})
+
+

Wykorzystany schemat name.html:

+
<form action="/your-name/" method="post">
+  {% csrf_token %} {{ form }}
+  <input type="submit" value="Submit" />
+</form>
+
+

csrf_token jest sposobem na użycie ochrony przeciwko CSRF

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/9_fastapi/index.html" "b/Web\303\263wka\360\237\214\215/9_fastapi/index.html" new file mode 100644 index 00000000..315c898a --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/9_fastapi/index.html" @@ -0,0 +1,1295 @@ + + + + + + + + + + + + + + + + FastAPI - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

FastAPI

+

Jest to jeden z mikroframeworków pythonowych wykorzystywanych przy apkach webowych.
+Jego zaletą na tle podobnych bibliotek typu flask jest automatyczne generowanie dokumentacji oraz automatyczne sprawdzanie i walidacja danych.

+

link

+

Podstawy

+
from typing import Optional
+
+from fastapi import FastAPI
+
+app = FastAPI()
+
+
+@app.get("/")
+def read_root():
+    return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+def read_item(item_id: int, slowo: Optional[str] = None):
+    """
+    przyjmujemy zapytanie i zwracamy je jako json
+    np /items/8?q=zbyszek
+    """
+    return {"item_id": item_id, "slowo": slowo}
+
+

Aby uruchomić powuższy kod (plik main.py) należy użyć komendy:

+
uvicorn main:app --reload
+# main - nazwa pliku
+# app - obiekt typu FastAPI
+# --reload - restartuje serwer po zmianach w kodzie
+
+

Dodatkowo pod ścieżką /docs dostępna jest dokumentacja użytych API.

+

Definiowanie modeli

+

Modele można definiować z wykorzystaniem biblioteki pytandic (tutorial od bulldogjobs).

+
from typing import Optional
+
+from fastapi import FastAPI
+from pydantic import BaseModel
+
+app = FastAPI()
+
+
+class Item(BaseModel):
+    name: str
+    price: float
+    is_offer: Optional[bool] = None
+
+
+@app.put("/items/{item_id}")
+def update_item(item_id: int, item: Item):
+    return {"item_name": item.name, "item_id": item_id}
+
+

Serwowanie plików HTML

+

FastAPI może być łączone z każdym silnikiem do generowania plików HTML ze schematów. Najpopularniejszym wyborem jest tutaj Jinja2 (przykład użycia).

+

Jeśli nie potrzebujemy niczego tak skomplikowanego i wystarczą nam proste, ręcznie napisane pliki HTML to wystarczy wystawić je jako pliki statyczne lub jako pojedyncze pliki.

+
from fastapi import FastAPI
+from fastapi.staticfiles import StaticFiles
+
+app = FastAPI()
+
+app.mount("/static", StaticFiles(directory="static"), name="static")
+
+#lub
+@app.get("/")
+async def read_index():
+    return FileResponse('index.html')
+
+

Bazy danych

+

FastAPI nie jest związane z żadną biblioteką do baz danych.
+Mamy tutaj dużą dowolność. Dla przykładu w oficjalnej dokumentacji pokazano przykład użycia sla SQLAlchemy. Można też użyć Peewee.

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/9_hugo/index.html" "b/Web\303\263wka\360\237\214\215/9_hugo/index.html" new file mode 100644 index 00000000..17bc820a --- /dev/null +++ "b/Web\303\263wka\360\237\214\215/9_hugo/index.html" @@ -0,0 +1,1296 @@ + + + + + + + + + + + + + + + + Hugo - Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + +
+
+ + + + + + + + +

Hugo

+

Hugo is a static site generator written in Go. It is designed to be fast and easy to use, and it can generate a static website from source files written in Markdown, HTML, and other formats.

+

The structure of a Hugo project typically includes the following elements:

+
    +
  • Configuration file: The configuration file (usually named config.toml, config.yaml, or config.json) contains settings for the site, such as the title, author, and base URL.
  • +
  • Content: The content for the site is stored in the content directory. It is organized into subdirectories by content type, such as post for blog posts and page for standalone pages. Each content file contains front matter at the top, which is a block of metadata in YAML format that specifies the title, date, and other attributes of the content. The content body follows the front matter, and it can be written in Markdown, HTML, or another format.
  • +
  • Layout: The layout for the site is stored in the layouts directory. It is organized into subdirectories by content type, and it includes templates for rendering the content. The templates use the Go programming language's template syntax to specify the layout of the content and to insert dynamic elements such as the title and body of the content.
  • +
  • Static assets: The static assets for the site, such as images, CSS files, and JavaScript files, are stored in the static directory.
  • +
  • Public: The generated static website is output to the public directory.
  • +
+

In addition to these core elements, a Hugo project may also include custom templates, shortcodes, and other customizations that allow you to tailor the site to your specific needs.

+

Dodawanie nowego typu contentu

+

To define a new type of content called "product" in a Hugo project, you will need to follow these steps:

+
    +
  1. Create a new directory in the content directory to store the product content. For example, you can create a product directory:
  2. +
+
content
+└── product
+
+
    +
  1. In the configuration file, add a new section called product to define the product content type. For example:
  2. +
+
[product]
+title = "Product"
+singular = "product"
+plural = "products"
+
+
    +
  1. Create a template for rendering product content in the layouts directory. For example, you can create a product directory and a single.html file in it:
  2. +
+
layouts
+└── product
+    └── single.html
+
+
    +
  1. In the single.html file, use the Go programming language's template syntax to specify the layout for a single product page. You can use placeholders to insert dynamic elements such as the title and body of the product. For example:
  2. +
+
<h1>{{ .Title }}</h1>
+
+<div>{{ .Content }}</div>
+
+
    +
  1. Create a new content file for each product you want to add to the site. The content file should be saved in the product directory you created in step 1, and it should include front matter at the top to specify the title, date, and other attributes of the product. For example:
  2. +
+
content
+└── product
+    └── my-product.md
+
+
---
+title: "My Product"
+date: 2021-01-01
+article_thumbnail: "/static/image1.png"
+---
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+
+

That's it! You have now created a new content type called "product" and added a product to your Hugo site. You can repeat these steps to add more products to the site.

+

Hugo templates

+

Hugo uses basic Go's templating libraries Source.

+

All og Go template variables and functions are available within {{}}

+

Access variable

+

All of variables are available starting with dot. Like {{.Title}}. +There are a lot of basic variables available on most of the pages: list

+

In case of non-standard variables (like the ones defined in target files) we use parameter .Params

+

For file projekt.md:

+
---
+title: "My Product"
+article_thumbnail: "/static/image1.png"
+---
+
+

We can access variable article_thumbnail using {{ .Params.article_thumbnail }}.

+

Functions

+

We can also write some basic code using functions {{ FUNCTION ARG1 ARG2 .. }}.

+

.....

+ + +
+ +
+
+ +
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git "a/Web\303\263wka\360\237\214\215/assets/atrybut.png" "b/Web\303\263wka\360\237\214\215/assets/atrybut.png" new file mode 100644 index 00000000..e75e441b Binary files /dev/null and "b/Web\303\263wka\360\237\214\215/assets/atrybut.png" differ diff --git "a/Web\303\263wka\360\237\214\215/assets/budowa_paragrafu.png" "b/Web\303\263wka\360\237\214\215/assets/budowa_paragrafu.png" new file mode 100644 index 00000000..cdb49d28 Binary files /dev/null and "b/Web\303\263wka\360\237\214\215/assets/budowa_paragrafu.png" differ diff --git "a/Web\303\263wka\360\237\214\215/assets/css-box-model.jpg" "b/Web\303\263wka\360\237\214\215/assets/css-box-model.jpg" new file mode 100644 index 00000000..7018bfb2 Binary files /dev/null and "b/Web\303\263wka\360\237\214\215/assets/css-box-model.jpg" differ diff --git "a/Web\303\263wka\360\237\214\215/assets/django_mvt.png" "b/Web\303\263wka\360\237\214\215/assets/django_mvt.png" new file mode 100644 index 00000000..5bb831cc Binary files /dev/null and "b/Web\303\263wka\360\237\214\215/assets/django_mvt.png" differ diff --git "a/Web\303\263wka\360\237\214\215/assets/js_queue.gif" "b/Web\303\263wka\360\237\214\215/assets/js_queue.gif" new file mode 100644 index 00000000..921edac5 Binary files /dev/null and "b/Web\303\263wka\360\237\214\215/assets/js_queue.gif" differ diff --git a/assets/images/favicon.png b/assets/images/favicon.png new file mode 100644 index 00000000..1cf13b9f Binary files /dev/null and b/assets/images/favicon.png differ diff --git a/assets/javascripts/bundle.0238f547.min.js b/assets/javascripts/bundle.0238f547.min.js new file mode 100644 index 00000000..c95c932e --- /dev/null +++ b/assets/javascripts/bundle.0238f547.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var ra=Object.create;var xr=Object.defineProperty;var na=Object.getOwnPropertyDescriptor;var oa=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,ia=Object.getPrototypeOf,Sr=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable;var an=(e,t,r)=>t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,U=(e,t)=>{for(var r in t||(t={}))Sr.call(t,r)&&an(e,r,t[r]);if(kt)for(var r of kt(t))sn.call(t,r)&&an(e,r,t[r]);return e};var cn=(e,t)=>{var r={};for(var n in e)Sr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kt)for(var n of kt(e))t.indexOf(n)<0&&sn.call(e,n)&&(r[n]=e[n]);return r};var gt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var aa=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of oa(t))!Sr.call(e,o)&&o!==r&&xr(e,o,{get:()=>t[o],enumerable:!(n=na(t,o))||n.enumerable});return e};var Ye=(e,t,r)=>(r=e!=null?ra(ia(e)):{},aa(t||!e||!e.__esModule?xr(r,"default",{value:e,enumerable:!0}):r,e));var un=gt((wr,fn)=>{(function(e,t){typeof wr=="object"&&typeof fn!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(wr,function(){"use strict";function e(r){var n=!0,o=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(w){return!!(w&&w!==document&&w.nodeName!=="HTML"&&w.nodeName!=="BODY"&&"classList"in w&&"contains"in w.classList)}function c(w){var Ue=w.type,He=w.tagName;return!!(He==="INPUT"&&a[Ue]&&!w.readOnly||He==="TEXTAREA"&&!w.readOnly||w.isContentEditable)}function f(w){w.classList.contains("focus-visible")||(w.classList.add("focus-visible"),w.setAttribute("data-focus-visible-added",""))}function u(w){!w.hasAttribute("data-focus-visible-added")||(w.classList.remove("focus-visible"),w.removeAttribute("data-focus-visible-added"))}function p(w){w.metaKey||w.altKey||w.ctrlKey||(s(r.activeElement)&&f(r.activeElement),n=!0)}function l(w){n=!1}function d(w){!s(w.target)||(n||c(w.target))&&f(w.target)}function h(w){!s(w.target)||(w.target.classList.contains("focus-visible")||w.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(i),i=window.setTimeout(function(){o=!1},100),u(w.target))}function b(w){document.visibilityState==="hidden"&&(o&&(n=!0),F())}function F(){document.addEventListener("mousemove",W),document.addEventListener("mousedown",W),document.addEventListener("mouseup",W),document.addEventListener("pointermove",W),document.addEventListener("pointerdown",W),document.addEventListener("pointerup",W),document.addEventListener("touchmove",W),document.addEventListener("touchstart",W),document.addEventListener("touchend",W)}function G(){document.removeEventListener("mousemove",W),document.removeEventListener("mousedown",W),document.removeEventListener("mouseup",W),document.removeEventListener("pointermove",W),document.removeEventListener("pointerdown",W),document.removeEventListener("pointerup",W),document.removeEventListener("touchmove",W),document.removeEventListener("touchstart",W),document.removeEventListener("touchend",W)}function W(w){w.target.nodeName&&w.target.nodeName.toLowerCase()==="html"||(n=!1,G())}document.addEventListener("keydown",p,!0),document.addEventListener("mousedown",l,!0),document.addEventListener("pointerdown",l,!0),document.addEventListener("touchstart",l,!0),document.addEventListener("visibilitychange",b,!0),F(),r.addEventListener("focus",d,!0),r.addEventListener("blur",h,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var pn=gt(Er=>{(function(e){var t=function(){try{return!!Symbol.iterator}catch(f){return!1}},r=t(),n=function(f){var u={next:function(){var p=f.shift();return{done:p===void 0,value:p}}};return r&&(u[Symbol.iterator]=function(){return u}),u},o=function(f){return encodeURIComponent(f).replace(/%20/g,"+")},i=function(f){return decodeURIComponent(String(f).replace(/\+/g," "))},a=function(){var f=function(p){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var l=typeof p;if(l!=="undefined")if(l==="string")p!==""&&this._fromString(p);else if(p instanceof f){var d=this;p.forEach(function(G,W){d.append(W,G)})}else if(p!==null&&l==="object")if(Object.prototype.toString.call(p)==="[object Array]")for(var h=0;hd[0]?1:0}),f._entries&&(f._entries={});for(var p=0;p1?i(d[1]):"")}})})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Er);(function(e){var t=function(){try{var o=new e.URL("b","http://a");return o.pathname="c d",o.href==="http://a/c%20d"&&o.searchParams}catch(i){return!1}},r=function(){var o=e.URL,i=function(c,f){typeof c!="string"&&(c=String(c)),f&&typeof f!="string"&&(f=String(f));var u=document,p;if(f&&(e.location===void 0||f!==e.location.href)){f=f.toLowerCase(),u=document.implementation.createHTMLDocument(""),p=u.createElement("base"),p.href=f,u.head.appendChild(p);try{if(p.href.indexOf(f)!==0)throw new Error(p.href)}catch(w){throw new Error("URL unable to set base "+f+" due to "+w)}}var l=u.createElement("a");l.href=c,p&&(u.body.appendChild(l),l.href=l.href);var d=u.createElement("input");if(d.type="url",d.value=c,l.protocol===":"||!/:/.test(l.href)||!d.checkValidity()&&!f)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:l});var h=new e.URLSearchParams(this.search),b=!0,F=!0,G=this;["append","delete","set"].forEach(function(w){var Ue=h[w];h[w]=function(){Ue.apply(h,arguments),b&&(F=!1,G.search=h.toString(),F=!0)}}),Object.defineProperty(this,"searchParams",{value:h,enumerable:!0});var W=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==W&&(W=this.search,F&&(b=!1,this.searchParams._fromString(this.search),b=!0))}})},a=i.prototype,s=function(c){Object.defineProperty(a,c,{get:function(){return this._anchorElement[c]},set:function(f){this._anchorElement[c]=f},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(c){s(c)}),Object.defineProperty(a,"search",{get:function(){return this._anchorElement.search},set:function(c){this._anchorElement.search=c,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(a,{toString:{get:function(){var c=this;return function(){return c.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(c){this._anchorElement.href=c,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(c){this._anchorElement.pathname=c},enumerable:!0},origin:{get:function(){var c={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],f=this._anchorElement.port!=c&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(f?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(c){},enumerable:!0},username:{get:function(){return""},set:function(c){},enumerable:!0}}),i.createObjectURL=function(c){return o.createObjectURL.apply(o,arguments)},i.revokeObjectURL=function(c){return o.revokeObjectURL.apply(o,arguments)},e.URL=i};if(t()||r(),e.location!==void 0&&!("origin"in e.location)){var n=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:n,enumerable:!0})}catch(o){setInterval(function(){e.location.origin=n()},100)}}})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Er)});var kn=gt((Ds,It)=>{/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var ln,mn,dn,hn,bn,vn,gn,yn,xn,Ht,Or,Sn,wn,En,tt,On,_n,Tn,Mn,Ln,An,Cn,Rn,Pt;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof It=="object"&&typeof It.exports=="object"?e(r(t,r(It.exports))):e(r(t));function r(n,o){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,a){return n[i]=o?o(i,a):a}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])};ln=function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(n,o);function i(){this.constructor=n}n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)},mn=Object.assign||function(n){for(var o,i=1,a=arguments.length;i=0;u--)(f=n[u])&&(c=(s<3?f(c):s>3?f(o,i,c):f(o,i))||c);return s>3&&c&&Object.defineProperty(o,i,c),c},bn=function(n,o){return function(i,a){o(i,a,n)}},vn=function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)},gn=function(n,o,i,a){function s(c){return c instanceof i?c:new i(function(f){f(c)})}return new(i||(i=Promise))(function(c,f){function u(d){try{l(a.next(d))}catch(h){f(h)}}function p(d){try{l(a.throw(d))}catch(h){f(h)}}function l(d){d.done?c(d.value):s(d.value).then(u,p)}l((a=a.apply(n,o||[])).next())})},yn=function(n,o){var i={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},a,s,c,f;return f={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(l){return function(d){return p([l,d])}}function p(l){if(a)throw new TypeError("Generator is already executing.");for(;i;)try{if(a=1,s&&(c=l[0]&2?s.return:l[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,l[1])).done)return c;switch(s=0,c&&(l=[l[0]&2,c.value]),l[0]){case 0:case 1:c=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,s=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(c=i.trys,!(c=c.length>0&&c[c.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!c||l[1]>c[0]&&l[1]=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},Or=function(n,o){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var a=i.call(n),s,c=[],f;try{for(;(o===void 0||o-- >0)&&!(s=a.next()).done;)c.push(s.value)}catch(u){f={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(f)throw f.error}}return c},Sn=function(){for(var n=[],o=0;o1||u(b,F)})})}function u(b,F){try{p(a[b](F))}catch(G){h(c[0][3],G)}}function p(b){b.value instanceof tt?Promise.resolve(b.value.v).then(l,d):h(c[0][2],b)}function l(b){u("next",b)}function d(b){u("throw",b)}function h(b,F){b(F),c.shift(),c.length&&u(c[0][0],c[0][1])}},_n=function(n){var o,i;return o={},a("next"),a("throw",function(s){throw s}),a("return"),o[Symbol.iterator]=function(){return this},o;function a(s,c){o[s]=n[s]?function(f){return(i=!i)?{value:tt(n[s](f)),done:s==="return"}:c?c(f):f}:c}},Tn=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n[Symbol.asyncIterator],i;return o?o.call(n):(n=typeof Ht=="function"?Ht(n):n[Symbol.iterator](),i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i);function a(c){i[c]=n[c]&&function(f){return new Promise(function(u,p){f=n[c](f),s(u,p,f.done,f.value)})}}function s(c,f,u,p){Promise.resolve(p).then(function(l){c({value:l,done:u})},f)}},Mn=function(n,o){return Object.defineProperty?Object.defineProperty(n,"raw",{value:o}):n.raw=o,n};var r=Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o};Ln=function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&Pt(o,n,i);return r(o,n),o},An=function(n){return n&&n.__esModule?n:{default:n}},Cn=function(n,o,i,a){if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?n!==o||!a:!o.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(n):a?a.value:o.get(n)},Rn=function(n,o,i,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?n!==o||!s:!o.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(n,i):s?s.value=i:o.set(n,i),i},e("__extends",ln),e("__assign",mn),e("__rest",dn),e("__decorate",hn),e("__param",bn),e("__metadata",vn),e("__awaiter",gn),e("__generator",yn),e("__exportStar",xn),e("__createBinding",Pt),e("__values",Ht),e("__read",Or),e("__spread",Sn),e("__spreadArrays",wn),e("__spreadArray",En),e("__await",tt),e("__asyncGenerator",On),e("__asyncDelegator",_n),e("__asyncValues",Tn),e("__makeTemplateObject",Mn),e("__importStar",Ln),e("__importDefault",An),e("__classPrivateFieldGet",Cn),e("__classPrivateFieldSet",Rn)})});var Kr=gt((Lt,Yr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */(function(t,r){typeof Lt=="object"&&typeof Yr=="object"?Yr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Lt=="object"?Lt.ClipboardJS=r():t.ClipboardJS=r()})(Lt,function(){return function(){var e={686:function(n,o,i){"use strict";i.d(o,{default:function(){return ta}});var a=i(279),s=i.n(a),c=i(370),f=i.n(c),u=i(817),p=i.n(u);function l(I){try{return document.execCommand(I)}catch(E){return!1}}var d=function(E){var S=p()(E);return l("cut"),S},h=d;function b(I){var E=document.documentElement.getAttribute("dir")==="rtl",S=document.createElement("textarea");S.style.fontSize="12pt",S.style.border="0",S.style.padding="0",S.style.margin="0",S.style.position="absolute",S.style[E?"right":"left"]="-9999px";var R=window.pageYOffset||document.documentElement.scrollTop;return S.style.top="".concat(R,"px"),S.setAttribute("readonly",""),S.value=I,S}var F=function(E,S){var R=b(E);S.container.appendChild(R);var H=p()(R);return l("copy"),R.remove(),H},G=function(E){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},R="";return typeof E=="string"?R=F(E,S):E instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(E==null?void 0:E.type)?R=F(E.value,S):(R=p()(E),l("copy")),R},W=G;function w(I){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?w=function(S){return typeof S}:w=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},w(I)}var Ue=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=E.action,R=S===void 0?"copy":S,H=E.container,z=E.target,Oe=E.text;if(R!=="copy"&&R!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(z!==void 0)if(z&&w(z)==="object"&&z.nodeType===1){if(R==="copy"&&z.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(R==="cut"&&(z.hasAttribute("readonly")||z.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Oe)return W(Oe,{container:H});if(z)return R==="cut"?h(z):W(z,{container:H})},He=Ue;function Ce(I){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ce=function(S){return typeof S}:Ce=function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},Ce(I)}function Yi(I,E){if(!(I instanceof E))throw new TypeError("Cannot call a class as a function")}function on(I,E){for(var S=0;S0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof H.action=="function"?H.action:this.defaultAction,this.target=typeof H.target=="function"?H.target:this.defaultTarget,this.text=typeof H.text=="function"?H.text:this.defaultText,this.container=Ce(H.container)==="object"?H.container:document.body}},{key:"listenClick",value:function(H){var z=this;this.listener=f()(H,"click",function(Oe){return z.onClick(Oe)})}},{key:"onClick",value:function(H){var z=H.delegateTarget||H.currentTarget,Oe=this.action(z)||"copy",Rt=He({action:Oe,container:this.container,target:this.target(z),text:this.text(z)});this.emit(Rt?"success":"error",{action:Oe,text:Rt,trigger:z,clearSelection:function(){z&&z.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(H){return yr("action",H)}},{key:"defaultTarget",value:function(H){var z=yr("target",H);if(z)return document.querySelector(z)}},{key:"defaultText",value:function(H){return yr("text",H)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(H){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return W(H,z)}},{key:"cut",value:function(H){return h(H)}},{key:"isSupported",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],z=typeof H=="string"?[H]:H,Oe=!!document.queryCommandSupported;return z.forEach(function(Rt){Oe=Oe&&!!document.queryCommandSupported(Rt)}),Oe}}]),S}(s()),ta=ea},828:function(n){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,c){for(;s&&s.nodeType!==o;){if(typeof s.matches=="function"&&s.matches(c))return s;s=s.parentNode}}n.exports=a},438:function(n,o,i){var a=i(828);function s(u,p,l,d,h){var b=f.apply(this,arguments);return u.addEventListener(l,b,h),{destroy:function(){u.removeEventListener(l,b,h)}}}function c(u,p,l,d,h){return typeof u.addEventListener=="function"?s.apply(null,arguments):typeof l=="function"?s.bind(null,document).apply(null,arguments):(typeof u=="string"&&(u=document.querySelectorAll(u)),Array.prototype.map.call(u,function(b){return s(b,p,l,d,h)}))}function f(u,p,l,d){return function(h){h.delegateTarget=a(h.target,p),h.delegateTarget&&d.call(u,h)}}n.exports=c},879:function(n,o){o.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},o.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||o.node(i[0]))},o.string=function(i){return typeof i=="string"||i instanceof String},o.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(n,o,i){var a=i(879),s=i(438);function c(l,d,h){if(!l&&!d&&!h)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(h))throw new TypeError("Third argument must be a Function");if(a.node(l))return f(l,d,h);if(a.nodeList(l))return u(l,d,h);if(a.string(l))return p(l,d,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function f(l,d,h){return l.addEventListener(d,h),{destroy:function(){l.removeEventListener(d,h)}}}function u(l,d,h){return Array.prototype.forEach.call(l,function(b){b.addEventListener(d,h)}),{destroy:function(){Array.prototype.forEach.call(l,function(b){b.removeEventListener(d,h)})}}}function p(l,d,h){return s(document.body,l,d,h)}n.exports=c},817:function(n){function o(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var c=window.getSelection(),f=document.createRange();f.selectNodeContents(i),c.removeAllRanges(),c.addRange(f),a=c.toString()}return a}n.exports=o},279:function(n){function o(){}o.prototype={on:function(i,a,s){var c=this.e||(this.e={});return(c[i]||(c[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var c=this;function f(){c.off(i,f),a.apply(s,arguments)}return f._=a,this.on(i,f,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),c=0,f=s.length;for(c;c{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var Ss=/["'&<>]/;yi.exports=ws;function ws(e){var t=""+e,r=Ss.exec(t);if(!r)return t;var n,o="",i=0,a=0;for(i=r.index;i0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?_r:(this.currentObservers=null,s.push(r),new Re(function(){n.currentObservers=null,Pe(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new $;return r.source=this,r},t.create=function(r,n){return new qn(r,n)},t}($);var qn=function(e){te(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:_r},t}(_);var xt={now:function(){return(xt.delegate||Date).now()},delegate:void 0};var St=function(e){te(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=xt);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,c=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+c)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),c=0;c0?e.prototype.requestAsyncId.call(this,r,n,o):(r.actions.push(this),r._scheduled||(r._scheduled=at.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,n,o){if(o===void 0&&(o=0),o!=null&&o>0||o==null&&this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,o);r.actions.some(function(i){return i.id===n})||(at.cancelAnimationFrame(n),r._scheduled=void 0)},t}(Nt);var Kn=function(e){te(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var o=this.actions,i;r=r||o.shift();do if(i=r.execute(r.state,r.delay))break;while((r=o[0])&&r.id===n&&o.shift());if(this._active=!1,i){for(;(r=o[0])&&r.id===n&&o.shift();)r.unsubscribe();throw i}},t}(zt);var Te=new Kn(Yn);var k=new $(function(e){return e.complete()});function qt(e){return e&&T(e.schedule)}function kr(e){return e[e.length-1]}function De(e){return T(kr(e))?e.pop():void 0}function ye(e){return qt(kr(e))?e.pop():void 0}function Qt(e,t){return typeof kr(e)=="number"?e.pop():t}var st=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Yt(e){return T(e==null?void 0:e.then)}function Kt(e){return T(e[it])}function Bt(e){return Symbol.asyncIterator&&T(e==null?void 0:e[Symbol.asyncIterator])}function Gt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ha(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Jt=ha();function Xt(e){return T(e==null?void 0:e[Jt])}function Zt(e){return In(this,arguments,function(){var r,n,o,i;return $t(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,jt(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,jt(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,jt(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function er(e){return T(e==null?void 0:e.getReader)}function N(e){if(e instanceof $)return e;if(e!=null){if(Kt(e))return ba(e);if(st(e))return va(e);if(Yt(e))return ga(e);if(Bt(e))return Bn(e);if(Xt(e))return ya(e);if(er(e))return xa(e)}throw Gt(e)}function ba(e){return new $(function(t){var r=e[it]();if(T(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function va(e){return new $(function(t){for(var r=0;r=2,!0))}function ne(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new _}:t,n=e.resetOnError,o=n===void 0?!0:n,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(f){var u=null,p=null,l=null,d=0,h=!1,b=!1,F=function(){p==null||p.unsubscribe(),p=null},G=function(){F(),u=l=null,h=b=!1},W=function(){var w=u;G(),w==null||w.unsubscribe()};return v(function(w,Ue){d++,!b&&!h&&F();var He=l=l!=null?l:r();Ue.add(function(){d--,d===0&&!b&&!h&&(p=Ur(W,c))}),He.subscribe(Ue),u||(u=new ot({next:function(Ce){return He.next(Ce)},error:function(Ce){b=!0,F(),p=Ur(G,o,Ce),He.error(Ce)},complete:function(){h=!0,F(),p=Ur(G,a),He.complete()}}),ie(w).subscribe(u))})(f)}}function Ur(e,t){for(var r=[],n=2;ne.next(document)),e}function B(e,t=document){return Array.from(t.querySelectorAll(e))}function Q(e,t=document){let r=pe(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function pe(e,t=document){return t.querySelector(e)||void 0}function Ne(){return document.activeElement instanceof HTMLElement&&document.activeElement||void 0}function nr(e){return A(g(document.body,"focusin"),g(document.body,"focusout")).pipe(Xe(1),m(()=>{let t=Ne();return typeof t!="undefined"?e.contains(t):!1}),q(e===Ne()),K())}function ze(e){return{x:e.offsetLeft,y:e.offsetTop}}function vo(e){return A(g(window,"load"),g(window,"resize")).pipe($e(0,Te),m(()=>ze(e)),q(ze(e)))}function or(e){return{x:e.scrollLeft,y:e.scrollTop}}function pt(e){return A(g(e,"scroll"),g(window,"resize")).pipe($e(0,Te),m(()=>or(e)),q(or(e)))}var yo=function(){if(typeof Map!="undefined")return Map;function e(t,r){var n=-1;return t.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(r,n){var o=e(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,o=e(n,r);~o&&n.splice(o,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!zr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Va?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!zr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,o=Wa.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),xo=function(e,t){for(var r=0,n=Object.keys(t);r0},e}(),wo=typeof WeakMap!="undefined"?new WeakMap:new yo,Eo=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Na.getInstance(),n=new Za(t,r,this);wo.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Eo.prototype[e]=function(){var t;return(t=wo.get(this))[e].apply(t,arguments)}});var es=function(){return typeof ir.ResizeObserver!="undefined"?ir.ResizeObserver:Eo}(),Oo=es;var _o=new _,ts=j(()=>P(new Oo(e=>{for(let t of e)_o.next(t)}))).pipe(x(e=>A(xe,P(e)).pipe(C(()=>e.disconnect()))),X(1));function Ae(e){return{width:e.offsetWidth,height:e.offsetHeight}}function de(e){return ts.pipe(O(t=>t.observe(e)),x(t=>_o.pipe(M(({target:r})=>r===e),C(()=>t.unobserve(e)),m(()=>Ae(e)))),q(Ae(e)))}function mt(e){return{width:e.scrollWidth,height:e.scrollHeight}}var To=new _,rs=j(()=>P(new IntersectionObserver(e=>{for(let t of e)To.next(t)},{threshold:0}))).pipe(x(e=>A(xe,P(e)).pipe(C(()=>e.disconnect()))),X(1));function cr(e){return rs.pipe(O(t=>t.observe(e)),x(t=>To.pipe(M(({target:r})=>r===e),C(()=>t.unobserve(e)),m(({isIntersecting:r})=>r))))}function Mo(e,t=16){return pt(e).pipe(m(({y:r})=>{let n=Ae(e),o=mt(e);return r>=o.height-n.height-t}),K())}var fr={drawer:Q("[data-md-toggle=drawer]"),search:Q("[data-md-toggle=search]")};function Lo(e){return fr[e].checked}function qe(e,t){fr[e].checked!==t&&fr[e].click()}function dt(e){let t=fr[e];return g(t,"change").pipe(m(()=>t.checked),q(t.checked))}function ns(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ao(){return g(window,"keydown").pipe(M(e=>!(e.metaKey||e.ctrlKey)),m(e=>({mode:Lo("search")?"search":"global",type:e.key,claim(){e.preventDefault(),e.stopPropagation()}})),M(({mode:e,type:t})=>{if(e==="global"){let r=Ne();if(typeof r!="undefined")return!ns(r,t)}return!0}),ne())}function Se(){return new URL(location.href)}function ur(e){location.href=e.href}function Co(){return new _}function Ro(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)Ro(e,r)}function L(e,t,...r){let n=document.createElement(e);if(t)for(let o of Object.keys(t))typeof t[o]!="undefined"&&(typeof t[o]!="boolean"?n.setAttribute(o,t[o]):n.setAttribute(o,""));for(let o of r)Ro(n,o);return n}function ko(e,t){let r=t;if(e.length>r){for(;e[r]!==" "&&--r>0;);return`${e.substring(0,r)}...`}return e}function pr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function Ho(){return location.hash.substring(1)}function Po(e){let t=L("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function os(){return g(window,"hashchange").pipe(m(Ho),q(Ho()),M(e=>e.length>0),X(1))}function Io(){return os().pipe(m(e=>pe(`[id="${e}"]`)),M(e=>typeof e!="undefined"))}function qr(e){let t=matchMedia(e);return rr(r=>t.addListener(()=>r(t.matches))).pipe(q(t.matches))}function $o(){let e=matchMedia("print");return A(g(window,"beforeprint").pipe(m(()=>!0)),g(window,"afterprint").pipe(m(()=>!1))).pipe(q(e.matches))}function Qr(e,t){return e.pipe(x(r=>r?t():k))}function lr(e,t={credentials:"same-origin"}){return ie(fetch(`${e}`,t)).pipe(ce(()=>k),x(r=>r.status!==200?Et(()=>new Error(r.statusText)):P(r)))}function ke(e,t){return lr(e,t).pipe(x(r=>r.json()),X(1))}function jo(e,t){let r=new DOMParser;return lr(e,t).pipe(x(n=>n.text()),m(n=>r.parseFromString(n,"text/xml")),X(1))}function Fo(e){let t=L("script",{src:e});return j(()=>(document.head.appendChild(t),A(g(t,"load"),g(t,"error").pipe(x(()=>Et(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(m(()=>{}),C(()=>document.head.removeChild(t)),re(1))))}function Uo(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function Do(){return A(g(window,"scroll",{passive:!0}),g(window,"resize",{passive:!0})).pipe(m(Uo),q(Uo()))}function Wo(){return{width:innerWidth,height:innerHeight}}function Vo(){return g(window,"resize",{passive:!0}).pipe(m(Wo),q(Wo()))}function No(){return Y([Do(),Vo()]).pipe(m(([e,t])=>({offset:e,size:t})),X(1))}function mr(e,{viewport$:t,header$:r}){let n=t.pipe(J("size")),o=Y([n,r]).pipe(m(()=>ze(e)));return Y([r,t,o]).pipe(m(([{height:i},{offset:a,size:s},{x:c,y:f}])=>({offset:{x:a.x-c,y:a.y-f+i},size:s})))}function zo(e,{tx$:t}){let r=g(e,"message").pipe(m(({data:n})=>n));return t.pipe(Mt(()=>r,{leading:!0,trailing:!0}),O(n=>e.postMessage(n)),x(()=>r),ne())}var is=Q("#__config"),ht=JSON.parse(is.textContent);ht.base=`${new URL(ht.base,Se())}`;function he(){return ht}function oe(e){return ht.features.includes(e)}function ee(e,t){return typeof t!="undefined"?ht.translations[e].replace("#",t.toString()):ht.translations[e]}function we(e,t=document){return Q(`[data-md-component=${e}]`,t)}function ae(e,t=document){return B(`[data-md-component=${e}]`,t)}var ti=Ye(Kr());function qo(e){return L("aside",{class:"md-annotation",tabIndex:0},L("div",{class:"md-annotation__inner md-tooltip"},L("div",{class:"md-tooltip__inner md-typeset"})),L("span",{class:"md-annotation__index"},L("span",{"data-md-annotation-id":e})))}function Qo(e){return L("button",{class:"md-clipboard md-icon",title:ee("clipboard.copy"),"data-clipboard-target":`#${e} > code`})}function Br(e,t){let r=t&2,n=t&1,o=Object.keys(e.terms).filter(a=>!e.terms[a]).reduce((a,s)=>[...a,L("del",null,s)," "],[]).slice(0,-1),i=new URL(e.location);return oe("search.highlight")&&i.searchParams.set("h",Object.entries(e.terms).filter(([,a])=>a).reduce((a,[s])=>`${a} ${s}`.trim(),"")),L("a",{href:`${i}`,class:"md-search-result__link",tabIndex:-1},L("article",{class:["md-search-result__article",...r?["md-search-result__article--document"]:[]].join(" "),"data-md-score":e.score.toFixed(2)},r>0&&L("div",{class:"md-search-result__icon md-icon"}),L("h1",{class:"md-search-result__title"},e.title),n>0&&e.text.length>0&&L("p",{class:"md-search-result__teaser"},ko(e.text,320)),e.tags&&e.tags.map(a=>L("span",{class:"md-tag"},a)),n>0&&o.length>0&&L("p",{class:"md-search-result__terms"},ee("search.result.term.missing"),": ",...o)))}function Yo(e){let t=e[0].score,r=[...e],n=r.findIndex(f=>!f.location.includes("#")),[o]=r.splice(n,1),i=r.findIndex(f=>f.scoreBr(f,1)),...s.length?[L("details",{class:"md-search-result__more"},L("summary",{tabIndex:-1},s.length>0&&s.length===1?ee("search.result.more.one"):ee("search.result.more.other",s.length)),...s.map(f=>Br(f,1)))]:[]];return L("li",{class:"md-search-result__item"},c)}function Ko(e){return L("ul",{class:"md-source__facts"},Object.entries(e).map(([t,r])=>L("li",{class:`md-source__fact md-source__fact--${t}`},typeof r=="number"?pr(r):r)))}function Gr(e){let t=`tabbed-control tabbed-control--${e}`;return L("div",{class:t,hidden:!0},L("button",{class:"tabbed-button",tabIndex:-1}))}function Bo(e){return L("div",{class:"md-typeset__scrollwrap"},L("div",{class:"md-typeset__table"},e))}function as(e){let t=he(),r=new URL(`../${e.version}/`,t.base);return L("li",{class:"md-version__item"},L("a",{href:`${r}`,class:"md-version__link"},e.title))}function Go(e,t){return L("div",{class:"md-version"},L("button",{class:"md-version__current","aria-label":ee("select.version.title")},t.title),L("ul",{class:"md-version__list"},e.map(as)))}function ss(e,t){let r=j(()=>Y([vo(e),pt(t)])).pipe(m(([{x:n,y:o},i])=>{let{width:a}=Ae(e);return{x:n-i.x+a/2,y:o-i.y}}));return nr(e).pipe(x(n=>r.pipe(m(o=>({active:n,offset:o})),re(+!n||1/0))))}function Jo(e,t){return j(()=>{let r=new _;r.subscribe({next({offset:a}){e.style.setProperty("--md-tooltip-x",`${a.x}px`),e.style.setProperty("--md-tooltip-y",`${a.y}px`)},complete(){e.style.removeProperty("--md-tooltip-x"),e.style.removeProperty("--md-tooltip-y")}});let n=r.pipe(fe(1));cr(e).pipe(Z(n)).subscribe(a=>{e.toggleAttribute("data-md-visible",a)}),r.pipe(Vr(500,Te),m(()=>t.getBoundingClientRect()),m(({x:a})=>a)).subscribe({next(a){a?e.style.setProperty("--md-tooltip-0",`${-a}px`):e.style.removeProperty("--md-tooltip-0")},complete(){e.style.removeProperty("--md-tooltip-0")}});let o=Q(":scope > :last-child",e),i=g(o,"mousedown",{once:!0});return r.pipe(x(({active:a})=>a?i:k),O(a=>a.preventDefault())).subscribe(()=>e.blur()),ss(e,t).pipe(O(a=>r.next(a)),C(()=>r.complete()),m(a=>U({ref:e},a)))})}function cs(e){let t=[];for(let r of B(".c, .c1, .cm",e)){let n,o=r.firstChild;if(o instanceof Text)for(;n=/\((\d+)\)/.exec(o.textContent);){let i=o.splitText(n.index);o=i.splitText(n[0].length),t.push(i)}}return t}function Xo(e,t){t.append(...Array.from(e.childNodes))}function Zo(e,t,{print$:r}){let n=new Map;for(let o of cs(t)){let[,i]=o.textContent.match(/\((\d+)\)/);pe(`li:nth-child(${i})`,e)&&(n.set(+i,qo(+i)),o.replaceWith(n.get(+i)))}return n.size===0?k:j(()=>{let o=new _;return r.pipe(Z(o.pipe(fe(1)))).subscribe(i=>{e.hidden=!i;for(let[a,s]of n){let c=Q(".md-typeset",s),f=Q(`li:nth-child(${a})`,e);i?Xo(c,f):Xo(f,c)}}),A(...[...n].map(([,i])=>Jo(i,t))).pipe(C(()=>o.complete()),ne())})}var fs=0;function ri(e){if(e.nextElementSibling){let t=e.nextElementSibling;if(t.tagName==="OL")return t;if(t.tagName==="P"&&!t.children.length)return ri(t)}}function ei(e){return de(e).pipe(m(({width:t})=>({scrollable:mt(e).width>t})),J("scrollable"))}function ni(e,t){let{matches:r}=matchMedia("(hover)"),n=j(()=>{let o=new _;if(o.subscribe(({scrollable:a})=>{a&&r?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}),ti.default.isSupported()){let a=e.closest("pre");a.id=`__code_${++fs}`,a.insertBefore(Qo(a.id),e)}let i=e.closest(".highlight");if(i instanceof HTMLElement){let a=ri(i);if(typeof a!="undefined"&&(i.classList.contains("annotate")||oe("content.code.annotate"))){let s=Zo(a,e,t);return ei(e).pipe(O(c=>o.next(c)),C(()=>o.complete()),m(c=>U({ref:e},c)),Ze(de(i).pipe(Z(o.pipe(fe(1))),m(({width:c,height:f})=>c&&f),K(),x(c=>c?s:k))))}}return ei(e).pipe(O(a=>o.next(a)),C(()=>o.complete()),m(a=>U({ref:e},a)))});return cr(e).pipe(M(o=>o),re(1),x(()=>n))}var oi=".node circle,.node ellipse,.node path,.node polygon,.node rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}marker{fill:var(--md-mermaid-edge-color)!important}.edgeLabel .label rect{fill:transparent}.label{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.label foreignObject{line-height:normal;overflow:visible}.label div .edgeLabel{color:var(--md-mermaid-label-fg-color)}.edgeLabel,.edgeLabel rect,.label div .edgeLabel{background-color:var(--md-mermaid-label-bg-color)}.edgeLabel,.edgeLabel rect{fill:var(--md-mermaid-label-bg-color);color:var(--md-mermaid-edge-color)}.edgePath .path,.flowchart-link{stroke:var(--md-mermaid-edge-color)}.edgePath .arrowheadPath{fill:var(--md-mermaid-edge-color);stroke:none}.cluster rect{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}.cluster span{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}defs #flowchart-circleEnd,defs #flowchart-circleStart,defs #flowchart-crossEnd,defs #flowchart-crossStart,defs #flowchart-pointEnd,defs #flowchart-pointStart{stroke:none}g.classGroup line,g.classGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.classGroup text{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.classLabel .box{fill:var(--md-mermaid-label-bg-color);background-color:var(--md-mermaid-label-bg-color);opacity:1}.classLabel .label{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node .divider{stroke:var(--md-mermaid-node-fg-color)}.relation{stroke:var(--md-mermaid-edge-color)}.cardinality{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.cardinality text{fill:inherit!important}defs #classDiagram-compositionEnd,defs #classDiagram-compositionStart,defs #classDiagram-dependencyEnd,defs #classDiagram-dependencyStart,defs #classDiagram-extensionEnd,defs #classDiagram-extensionStart{fill:var(--md-mermaid-edge-color)!important;stroke:var(--md-mermaid-edge-color)!important}defs #classDiagram-aggregationEnd,defs #classDiagram-aggregationStart{fill:var(--md-mermaid-label-bg-color)!important;stroke:var(--md-mermaid-edge-color)!important}g.stateGroup rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}g.stateGroup .state-title{fill:var(--md-mermaid-label-fg-color)!important;font-family:var(--md-mermaid-font-family)}g.stateGroup .composit{fill:var(--md-mermaid-label-bg-color)}.nodeLabel{color:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.node circle.state-end,.node circle.state-start,.start-state{fill:var(--md-mermaid-edge-color);stroke:none}.end-state-inner,.end-state-outer{fill:var(--md-mermaid-edge-color)}.end-state-inner,.node circle.state-end{stroke:var(--md-mermaid-label-bg-color)}.transition{stroke:var(--md-mermaid-edge-color)}[id^=state-fork] rect,[id^=state-join] rect{fill:var(--md-mermaid-edge-color)!important;stroke:none!important}.statediagram-cluster.statediagram-cluster .inner{fill:var(--md-default-bg-color)}.statediagram-cluster rect{fill:var(--md-mermaid-node-bg-color);stroke:var(--md-mermaid-node-fg-color)}.statediagram-state rect.divider{fill:var(--md-default-fg-color--lightest);stroke:var(--md-default-fg-color--lighter)}defs #statediagram-barbEnd{stroke:var(--md-mermaid-edge-color)}.entityBox{fill:var(--md-mermaid-label-bg-color);stroke:var(--md-mermaid-node-fg-color)}.entityLabel{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}.relationshipLabelBox{fill:var(--md-mermaid-label-bg-color);fill-opacity:1;background-color:var(--md-mermaid-label-bg-color);opacity:1}.relationshipLabel{fill:var(--md-mermaid-label-fg-color)}.relationshipLine{stroke:var(--md-mermaid-edge-color)}defs #ONE_OR_MORE_END *,defs #ONE_OR_MORE_START *,defs #ONLY_ONE_END *,defs #ONLY_ONE_START *,defs #ZERO_OR_MORE_END *,defs #ZERO_OR_MORE_START *,defs #ZERO_OR_ONE_END *,defs #ZERO_OR_ONE_START *{stroke:var(--md-mermaid-edge-color)!important}.actor,defs #ZERO_OR_MORE_END circle,defs #ZERO_OR_MORE_START circle{fill:var(--md-mermaid-label-bg-color)}.actor{stroke:var(--md-mermaid-node-fg-color)}text.actor>tspan{fill:var(--md-mermaid-label-fg-color);font-family:var(--md-mermaid-font-family)}line{stroke:var(--md-default-fg-color--lighter)}.messageLine0,.messageLine1{stroke:var(--md-mermaid-edge-color)}.loopText>tspan,.messageText{font-family:var(--md-mermaid-font-family)!important}#arrowhead path,.loopText>tspan,.messageText{fill:var(--md-mermaid-edge-color);stroke:none}.loopLine{stroke:var(--md-mermaid-node-fg-color)}.labelBox,.loopLine{fill:var(--md-mermaid-node-bg-color)}.labelBox{stroke:none}.labelText,.labelText>span{fill:var(--md-mermaid-node-fg-color);font-family:var(--md-mermaid-font-family)}";var Jr,ps=0;function ls(){return typeof mermaid=="undefined"||mermaid instanceof Element?Fo("https://unpkg.com/mermaid@9.0.1/dist/mermaid.min.js"):P(void 0)}function ii(e){return e.classList.remove("mermaid"),Jr||(Jr=ls().pipe(O(()=>mermaid.initialize({startOnLoad:!1,themeCSS:oi})),m(()=>{}),X(1))),Jr.subscribe(()=>{e.classList.add("mermaid");let t=`__mermaid_${ps++}`,r=L("div",{class:"mermaid"});mermaid.mermaidAPI.render(t,e.textContent,n=>{let o=r.attachShadow({mode:"closed"});o.innerHTML=n,e.replaceWith(r)})}),Jr.pipe(m(()=>({ref:e})))}function ms(e,{target$:t,print$:r}){let n=!0;return A(t.pipe(m(o=>o.closest("details:not([open])")),M(o=>e===o),m(()=>({action:"open",reveal:!0}))),r.pipe(M(o=>o||!n),O(()=>n=e.open),m(o=>({action:o?"open":"close"}))))}function ai(e,t){return j(()=>{let r=new _;return r.subscribe(({action:n,reveal:o})=>{n==="open"?e.setAttribute("open",""):e.removeAttribute("open"),o&&e.scrollIntoView()}),ms(e,t).pipe(O(n=>r.next(n)),C(()=>r.complete()),m(n=>U({ref:e},n)))})}var si=L("table");function ci(e){return e.replaceWith(si),si.replaceWith(Bo(e)),P({ref:e})}function ds(e){let t=B(":scope > input",e),r=t.find(n=>n.checked)||t[0];return A(...t.map(n=>g(n,"change").pipe(m(()=>Q(`label[for=${n.id}]`))))).pipe(q(Q(`label[for=${r.id}]`)),m(n=>({active:n})))}function fi(e){let t=Gr("prev");e.append(t);let r=Gr("next");e.append(r);let n=Q(".tabbed-labels",e);return j(()=>{let o=new _,i=o.pipe(fe(1));return Y([o,de(e)]).pipe($e(1,Te),Z(i)).subscribe({next([{active:a},s]){let c=ze(a),{width:f}=Ae(a);e.style.setProperty("--md-indicator-x",`${c.x}px`),e.style.setProperty("--md-indicator-width",`${f}px`);let u=or(n);(c.xu.x+s.width)&&n.scrollTo({left:Math.max(0,c.x-16),behavior:"smooth"})},complete(){e.style.removeProperty("--md-indicator-x"),e.style.removeProperty("--md-indicator-width")}}),Y([pt(n),de(n)]).pipe(Z(i)).subscribe(([a,s])=>{let c=mt(n);t.hidden=a.x<16,r.hidden=a.x>c.width-s.width-16}),A(g(t,"click").pipe(m(()=>-1)),g(r,"click").pipe(m(()=>1))).pipe(Z(i)).subscribe(a=>{let{width:s}=Ae(n);n.scrollBy({left:s*a,behavior:"smooth"})}),oe("content.tabs.link")&&o.pipe(Le(1)).subscribe(({active:a})=>{let s=a.innerText.trim();for(let f of B("[data-tabs]"))for(let u of B(":scope > input",f))if(Q(`label[for=${u.id}]`).innerText.trim()===s){u.click();break}let c=__md_get("__tabs")||[];__md_set("__tabs",[...new Set([s,...c])])}),ds(e).pipe(O(a=>o.next(a)),C(()=>o.complete()),m(a=>U({ref:e},a)))}).pipe(Be(ue))}function ui(e,{target$:t,print$:r}){return A(...B("pre:not(.mermaid) > code",e).map(n=>ni(n,{print$:r})),...B("pre.mermaid",e).map(n=>ii(n)),...B("table:not([class])",e).map(n=>ci(n)),...B("details",e).map(n=>ai(n,{target$:t,print$:r})),...B("[data-tabs]",e).map(n=>fi(n)))}function hs(e,{alert$:t}){return t.pipe(x(r=>A(P(!0),P(!1).pipe(Fe(2e3))).pipe(m(n=>({message:r,active:n})))))}function pi(e,t){let r=Q(".md-typeset",e);return j(()=>{let n=new _;return n.subscribe(({message:o,active:i})=>{e.classList.toggle("md-dialog--active",i),r.textContent=o}),hs(e,t).pipe(O(o=>n.next(o)),C(()=>n.complete()),m(o=>U({ref:e},o)))})}function bs({viewport$:e}){if(!oe("header.autohide"))return P(!1);let t=e.pipe(m(({offset:{y:o}})=>o),Me(2,1),m(([o,i])=>[oMath.abs(i-o.y)>100),m(([,[o]])=>o),K()),n=dt("search");return Y([e,n]).pipe(m(([{offset:o},i])=>o.y>400&&!i),K(),x(o=>o?r:P(!1)),q(!1))}function li(e,t){return j(()=>Y([de(e),bs(t)])).pipe(m(([{height:r},n])=>({height:r,hidden:n})),K((r,n)=>r.height===n.height&&r.hidden===n.hidden),X(1))}function mi(e,{header$:t,main$:r}){return j(()=>{let n=new _,o=n.pipe(fe(1));return n.pipe(J("active"),Je(t)).subscribe(([{active:i},{hidden:a}])=>{e.classList.toggle("md-header--shadow",i&&!a),e.hidden=a}),r.subscribe(n),t.pipe(Z(o),m(i=>U({ref:e},i)))})}function vs(e,{viewport$:t,header$:r}){return mr(e,{viewport$:t,header$:r}).pipe(m(({offset:{y:n}})=>{let{height:o}=Ae(e);return{active:n>=o}}),J("active"))}function di(e,t){return j(()=>{let r=new _;r.subscribe(({active:o})=>{e.classList.toggle("md-header__title--active",o)});let n=pe("article h1");return typeof n=="undefined"?k:vs(n,t).pipe(O(o=>r.next(o)),C(()=>r.complete()),m(o=>U({ref:e},o)))})}function hi(e,{viewport$:t,header$:r}){let n=r.pipe(m(({height:i})=>i),K()),o=n.pipe(x(()=>de(e).pipe(m(({height:i})=>({top:e.offsetTop,bottom:e.offsetTop+i})),J("bottom"))));return Y([n,o,t]).pipe(m(([i,{top:a,bottom:s},{offset:{y:c},size:{height:f}}])=>(f=Math.max(0,f-Math.max(0,a-c,i)-Math.max(0,f+c-s)),{offset:a-i,height:f,active:a-i<=c})),K((i,a)=>i.offset===a.offset&&i.height===a.height&&i.active===a.active))}function gs(e){let t=__md_get("__palette")||{index:e.findIndex(r=>matchMedia(r.getAttribute("data-md-color-media")).matches)};return P(...e).pipe(se(r=>g(r,"change").pipe(m(()=>r))),q(e[Math.max(0,t.index)]),m(r=>({index:e.indexOf(r),color:{scheme:r.getAttribute("data-md-color-scheme"),primary:r.getAttribute("data-md-color-primary"),accent:r.getAttribute("data-md-color-accent")}})),X(1))}function bi(e){return j(()=>{let t=new _;t.subscribe(n=>{document.body.setAttribute("data-md-color-switching","");for(let[o,i]of Object.entries(n.color))document.body.setAttribute(`data-md-color-${o}`,i);for(let o=0;o{document.body.removeAttribute("data-md-color-switching")});let r=B("input",e);return gs(r).pipe(O(n=>t.next(n)),C(()=>t.complete()),m(n=>U({ref:e},n)))})}var Xr=Ye(Kr());function ys(e){e.setAttribute("data-md-copying","");let t=e.innerText;return e.removeAttribute("data-md-copying"),t}function vi({alert$:e}){Xr.default.isSupported()&&new $(t=>{new Xr.default("[data-clipboard-target], [data-clipboard-text]",{text:r=>r.getAttribute("data-clipboard-text")||ys(Q(r.getAttribute("data-clipboard-target")))}).on("success",r=>t.next(r))}).pipe(O(t=>{t.trigger.focus()}),m(()=>ee("clipboard.copied"))).subscribe(e)}function xs(e){if(e.length<2)return[""];let[t,r]=[...e].sort((o,i)=>o.length-i.length).map(o=>o.replace(/[^/]+$/,"")),n=0;if(t===r)n=t.length;else for(;t.charCodeAt(n)===r.charCodeAt(n);)n++;return e.map(o=>o.replace(t.slice(0,n),""))}function dr(e){let t=__md_get("__sitemap",sessionStorage,e);if(t)return P(t);{let r=he();return jo(new URL("sitemap.xml",e||r.base)).pipe(m(n=>xs(B("loc",n).map(o=>o.textContent))),ce(()=>k),je([]),O(n=>__md_set("__sitemap",n,sessionStorage,e)))}}function gi({document$:e,location$:t,viewport$:r}){let n=he();if(location.protocol==="file:")return;"scrollRestoration"in history&&(history.scrollRestoration="manual",g(window,"beforeunload").subscribe(()=>{history.scrollRestoration="auto"}));let o=pe("link[rel=icon]");typeof o!="undefined"&&(o.href=o.href);let i=dr().pipe(m(f=>f.map(u=>`${new URL(u,n.base)}`)),x(f=>g(document.body,"click").pipe(M(u=>!u.metaKey&&!u.ctrlKey),x(u=>{if(u.target instanceof Element){let p=u.target.closest("a");if(p&&!p.target){let l=new URL(p.href);if(l.search="",l.hash="",l.pathname!==location.pathname&&f.includes(l.toString()))return u.preventDefault(),P({url:new URL(p.href)})}}return xe}))),ne()),a=g(window,"popstate").pipe(M(f=>f.state!==null),m(f=>({url:new URL(location.href),offset:f.state})),ne());A(i,a).pipe(K((f,u)=>f.url.href===u.url.href),m(({url:f})=>f)).subscribe(t);let s=t.pipe(J("pathname"),x(f=>lr(f.href).pipe(ce(()=>(ur(f),xe)))),ne());i.pipe(ut(s)).subscribe(({url:f})=>{history.pushState({},"",`${f}`)});let c=new DOMParser;s.pipe(x(f=>f.text()),m(f=>c.parseFromString(f,"text/html"))).subscribe(e),e.pipe(Le(1)).subscribe(f=>{for(let u of["title","link[rel=canonical]","meta[name=author]","meta[name=description]","[data-md-component=announce]","[data-md-component=container]","[data-md-component=header-topic]","[data-md-component=outdated]","[data-md-component=logo]","[data-md-component=skip]",...oe("navigation.tabs.sticky")?["[data-md-component=tabs]"]:[]]){let p=pe(u),l=pe(u,f);typeof p!="undefined"&&typeof l!="undefined"&&p.replaceWith(l)}}),e.pipe(Le(1),m(()=>we("container")),x(f=>B("script",f)),Ir(f=>{let u=L("script");if(f.src){for(let p of f.getAttributeNames())u.setAttribute(p,f.getAttribute(p));return f.replaceWith(u),new $(p=>{u.onload=()=>p.complete()})}else return u.textContent=f.textContent,f.replaceWith(u),k})).subscribe(),A(i,a).pipe(ut(e)).subscribe(({url:f,offset:u})=>{f.hash&&!u?Po(f.hash):window.scrollTo(0,(u==null?void 0:u.y)||0)}),r.pipe(Tt(i),Xe(250),J("offset")).subscribe(({offset:f})=>{history.replaceState(f,"")}),A(i,a).pipe(Me(2,1),M(([f,u])=>f.url.pathname===u.url.pathname),m(([,f])=>f)).subscribe(({offset:f})=>{window.scrollTo(0,(f==null?void 0:f.y)||0)})}var Es=Ye(Zr());var xi=Ye(Zr());function en(e,t){let r=new RegExp(e.separator,"img"),n=(o,i,a)=>`${i}${a}`;return o=>{o=o.replace(/[\s*+\-:~^]+/g," ").trim();let i=new RegExp(`(^|${e.separator})(${o.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return a=>(t?(0,xi.default)(a):a).replace(i,n).replace(/<\/mark>(\s+)]*>/img,"$1")}}function Si(e){return e.split(/"([^"]+)"/g).map((t,r)=>r&1?t.replace(/^\b|^(?![^\x00-\x7F]|$)|\s+/g," +"):t).join("").replace(/"|(?:^|\s+)[*+\-:^~]+(?=\s+|$)/g,"").trim()}function bt(e){return e.type===1}function wi(e){return e.type===2}function vt(e){return e.type===3}function _s({config:e,docs:t}){e.lang.length===1&&e.lang[0]==="en"&&(e.lang=[ee("search.config.lang")]),e.separator==="[\\s\\-]+"&&(e.separator=ee("search.config.separator"));let n={pipeline:ee("search.config.pipeline").split(/\s*,\s*/).filter(Boolean),suggestions:oe("search.suggest")};return{config:e,docs:t,options:n}}function Ei(e,t){let r=he(),n=new Worker(e),o=new _,i=zo(n,{tx$:o}).pipe(m(a=>{if(vt(a))for(let s of a.data.items)for(let c of s)c.location=`${new URL(c.location,r.base)}`;return a}),ne());return ie(t).pipe(m(a=>({type:0,data:_s(a)}))).subscribe(o.next.bind(o)),{tx$:o,rx$:i}}function Oi({document$:e}){let t=he(),r=ke(new URL("../versions.json",t.base)).pipe(ce(()=>k)),n=r.pipe(m(o=>{let[,i]=t.base.match(/([^/]+)\/?$/);return o.find(({version:a,aliases:s})=>a===i||s.includes(i))||o[0]}));r.pipe(m(o=>new Map(o.map(i=>[`${new URL(`../${i.version}/`,t.base)}`,i]))),x(o=>g(document.body,"click").pipe(M(i=>!i.metaKey&&!i.ctrlKey),ge(n),x(([i,a])=>{if(i.target instanceof Element){let s=i.target.closest("a");if(s&&!s.target&&o.has(s.href)){i.preventDefault();let c=s.href;return!i.target.closest(".md-version")&&o.get(c)===a?k:P(c)}}return k}),x(i=>{let{version:a}=o.get(i);return dr(new URL(i)).pipe(m(s=>{let f=Se().href.replace(t.base,"");return s.includes(f)?new URL(`../${a}/${f}`,t.base):new URL(i)}))})))).subscribe(o=>ur(o)),Y([r,n]).subscribe(([o,i])=>{Q(".md-header__topic").appendChild(Go(o,i))}),e.pipe(x(()=>n)).subscribe(o=>{var a;let i=__md_get("__outdated",sessionStorage);if(i===null){let s=((a=t.version)==null?void 0:a.default)||"latest";i=!o.aliases.includes(s),__md_set("__outdated",i,sessionStorage)}if(i)for(let s of ae("outdated"))s.hidden=!1})}function Ts(e,{rx$:t}){let r=(__search==null?void 0:__search.transform)||Si,{searchParams:n}=Se();n.has("q")&&qe("search",!0);let o=t.pipe(M(bt),re(1),m(()=>n.get("q")||""));dt("search").pipe(M(s=>!s),re(1)).subscribe(()=>{let s=new URL(location.href);s.searchParams.delete("q"),history.replaceState({},"",`${s}`)}),o.subscribe(s=>{s&&(e.value=s,e.focus())});let i=nr(e),a=A(g(e,"keyup"),g(e,"focus").pipe(Fe(1)),o).pipe(m(()=>r(e.value)),q(""),K());return Y([a,i]).pipe(m(([s,c])=>({value:s,focus:c})),X(1))}function _i(e,{tx$:t,rx$:r}){let n=new _,o=n.pipe(fe(1));return n.pipe(J("value"),m(({value:i})=>({type:2,data:i}))).subscribe(t.next.bind(t)),n.pipe(J("focus")).subscribe(({focus:i})=>{i?(qe("search",i),e.placeholder=""):e.placeholder=ee("search.placeholder")}),g(e.form,"reset").pipe(Z(o)).subscribe(()=>e.focus()),Ts(e,{tx$:t,rx$:r}).pipe(O(i=>n.next(i)),C(()=>n.complete()),m(i=>U({ref:e},i)),ne())}function Ti(e,{rx$:t},{query$:r}){let n=new _,o=Mo(e.parentElement).pipe(M(Boolean)),i=Q(":scope > :first-child",e),a=Q(":scope > :last-child",e),s=t.pipe(M(bt),re(1));return n.pipe(ge(r),Tt(s)).subscribe(([{items:f},{value:u}])=>{if(u)switch(f.length){case 0:i.textContent=ee("search.result.none");break;case 1:i.textContent=ee("search.result.one");break;default:i.textContent=ee("search.result.other",pr(f.length))}else i.textContent=ee("search.result.placeholder")}),n.pipe(O(()=>a.innerHTML=""),x(({items:f})=>A(P(...f.slice(0,10)),P(...f.slice(10)).pipe(Me(4),Nr(o),x(([u])=>u))))).subscribe(f=>a.appendChild(Yo(f))),t.pipe(M(vt),m(({data:f})=>f)).pipe(O(f=>n.next(f)),C(()=>n.complete()),m(f=>U({ref:e},f)))}function Ms(e,{query$:t}){return t.pipe(m(({value:r})=>{let n=Se();return n.hash="",n.searchParams.delete("h"),n.searchParams.set("q",r),{url:n}}))}function Mi(e,t){let r=new _;return r.subscribe(({url:n})=>{e.setAttribute("data-clipboard-text",e.href),e.href=`${n}`}),g(e,"click").subscribe(n=>n.preventDefault()),Ms(e,t).pipe(O(n=>r.next(n)),C(()=>r.complete()),m(n=>U({ref:e},n)))}function Li(e,{rx$:t},{keyboard$:r}){let n=new _,o=we("search-query"),i=A(g(o,"keydown"),g(o,"focus")).pipe(Ie(ue),m(()=>o.value),K());return n.pipe(Je(i),m(([{suggestions:s},c])=>{let f=c.split(/([\s-]+)/);if((s==null?void 0:s.length)&&f[f.length-1]){let u=s[s.length-1];u.startsWith(f[f.length-1])&&(f[f.length-1]=u)}else f.length=0;return f})).subscribe(s=>e.innerHTML=s.join("").replace(/\s/g," ")),r.pipe(M(({mode:s})=>s==="search")).subscribe(s=>{switch(s.type){case"ArrowRight":e.innerText.length&&o.selectionStart===o.value.length&&(o.value=e.innerText);break}}),t.pipe(M(vt),m(({data:s})=>s)).pipe(O(s=>n.next(s)),C(()=>n.complete()),m(()=>({ref:e})))}function Ai(e,{index$:t,keyboard$:r}){let n=he();try{let o=(__search==null?void 0:__search.worker)||n.search,i=Ei(o,t),a=we("search-query",e),s=we("search-result",e),{tx$:c,rx$:f}=i;c.pipe(M(wi),ut(f.pipe(M(bt))),re(1)).subscribe(c.next.bind(c)),r.pipe(M(({mode:l})=>l==="search")).subscribe(l=>{let d=Ne();switch(l.type){case"Enter":if(d===a){let h=new Map;for(let b of B(":first-child [href]",s)){let F=b.firstElementChild;h.set(b,parseFloat(F.getAttribute("data-md-score")))}if(h.size){let[[b]]=[...h].sort(([,F],[,G])=>G-F);b.click()}l.claim()}break;case"Escape":case"Tab":qe("search",!1),a.blur();break;case"ArrowUp":case"ArrowDown":if(typeof d=="undefined")a.focus();else{let h=[a,...B(":not(details) > [href], summary, details[open] [href]",s)],b=Math.max(0,(Math.max(0,h.indexOf(d))+h.length+(l.type==="ArrowUp"?-1:1))%h.length);h[b].focus()}l.claim();break;default:a!==Ne()&&a.focus()}}),r.pipe(M(({mode:l})=>l==="global")).subscribe(l=>{switch(l.type){case"f":case"s":case"/":a.focus(),a.select(),l.claim();break}});let u=_i(a,i),p=Ti(s,i,{query$:u});return A(u,p).pipe(Ze(...ae("search-share",e).map(l=>Mi(l,{query$:u})),...ae("search-suggest",e).map(l=>Li(l,i,{keyboard$:r}))))}catch(o){return e.hidden=!0,xe}}function Ci(e,{index$:t,location$:r}){return Y([t,r.pipe(q(Se()),M(n=>!!n.searchParams.get("h")))]).pipe(m(([n,o])=>en(n.config,!0)(o.searchParams.get("h"))),m(n=>{var a;let o=new Map,i=document.createNodeIterator(e,NodeFilter.SHOW_TEXT);for(let s=i.nextNode();s;s=i.nextNode())if((a=s.parentElement)!=null&&a.offsetHeight){let c=s.textContent,f=n(c);f.length>c.length&&o.set(s,f)}for(let[s,c]of o){let{childNodes:f}=L("span",null,c);s.replaceWith(...Array.from(f))}return{ref:e,nodes:o}}))}function Ls(e,{viewport$:t,main$:r}){let n=e.parentElement,o=n.offsetTop-n.parentElement.offsetTop;return Y([r,t]).pipe(m(([{offset:i,height:a},{offset:{y:s}}])=>(a=a+Math.min(o,Math.max(0,s-i))-o,{height:a,locked:s>=i+o})),K((i,a)=>i.height===a.height&&i.locked===a.locked))}function tn(e,n){var o=n,{header$:t}=o,r=cn(o,["header$"]);let i=Q(".md-sidebar__scrollwrap",e),{y:a}=ze(i);return j(()=>{let s=new _;return s.pipe($e(0,Te),ge(t)).subscribe({next([{height:c},{height:f}]){i.style.height=`${c-2*a}px`,e.style.top=`${f}px`},complete(){i.style.height="",e.style.top=""}}),Ls(e,r).pipe(O(c=>s.next(c)),C(()=>s.complete()),m(c=>U({ref:e},c)))})}function Ri(e,t){if(typeof t!="undefined"){let r=`https://api.github.com/repos/${e}/${t}`;return Ot(ke(`${r}/releases/latest`).pipe(ce(()=>k),m(n=>({version:n.tag_name})),je({})),ke(r).pipe(ce(()=>k),m(n=>({stars:n.stargazers_count,forks:n.forks_count})),je({}))).pipe(m(([n,o])=>U(U({},n),o)))}else{let r=`https://api.github.com/users/${e}`;return ke(r).pipe(m(n=>({repositories:n.public_repos})),je({}))}}function ki(e,t){let r=`https://${e}/api/v4/projects/${encodeURIComponent(t)}`;return ke(r).pipe(ce(()=>k),m(({star_count:n,forks_count:o})=>({stars:n,forks:o})),je({}))}function Hi(e){let[t]=e.match(/(git(?:hub|lab))/i)||[];switch(t.toLowerCase()){case"github":let[,r,n]=e.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i);return Ri(r,n);case"gitlab":let[,o,i]=e.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i);return ki(o,i);default:return k}}var As;function Cs(e){return As||(As=j(()=>{let t=__md_get("__source",sessionStorage);return t?P(t):Hi(e.href).pipe(O(r=>__md_set("__source",r,sessionStorage)))}).pipe(ce(()=>k),M(t=>Object.keys(t).length>0),m(t=>({facts:t})),X(1)))}function Pi(e){let t=Q(":scope > :last-child",e);return j(()=>{let r=new _;return r.subscribe(({facts:n})=>{t.appendChild(Ko(n)),t.classList.add("md-source__repository--active")}),Cs(e).pipe(O(n=>r.next(n)),C(()=>r.complete()),m(n=>U({ref:e},n)))})}function Rs(e,{viewport$:t,header$:r}){return de(document.body).pipe(x(()=>mr(e,{header$:r,viewport$:t})),m(({offset:{y:n}})=>({hidden:n>=10})),J("hidden"))}function Ii(e,t){return j(()=>{let r=new _;return r.subscribe({next({hidden:n}){e.hidden=n},complete(){e.hidden=!1}}),(oe("navigation.tabs.sticky")?P({hidden:!1}):Rs(e,t)).pipe(O(n=>r.next(n)),C(()=>r.complete()),m(n=>U({ref:e},n)))})}function ks(e,{viewport$:t,header$:r}){let n=new Map,o=B("[href^=\\#]",e);for(let s of o){let c=decodeURIComponent(s.hash.substring(1)),f=pe(`[id="${c}"]`);typeof f!="undefined"&&n.set(s,f)}let i=r.pipe(J("height"),m(({height:s})=>{let c=we("main"),f=Q(":scope > :first-child",c);return s+.8*(f.offsetTop-c.offsetTop)}),ne());return de(document.body).pipe(J("height"),x(s=>j(()=>{let c=[];return P([...n].reduce((f,[u,p])=>{for(;c.length&&n.get(c[c.length-1]).tagName>=p.tagName;)c.pop();let l=p.offsetTop;for(;!l&&p.parentElement;)p=p.parentElement,l=p.offsetTop;return f.set([...c=[...c,u]].reverse(),l)},new Map))}).pipe(m(c=>new Map([...c].sort(([,f],[,u])=>f-u))),Je(i),x(([c,f])=>t.pipe(Fr(([u,p],{offset:{y:l},size:d})=>{let h=l+d.height>=Math.floor(s.height);for(;p.length;){let[,b]=p[0];if(b-f=l&&!h)p=[u.pop(),...p];else break}return[u,p]},[[],[...c]]),K((u,p)=>u[0]===p[0]&&u[1]===p[1])))))).pipe(m(([s,c])=>({prev:s.map(([f])=>f),next:c.map(([f])=>f)})),q({prev:[],next:[]}),Me(2,1),m(([s,c])=>s.prev.length{let o=new _,i=o.pipe(fe(1));return o.subscribe(({prev:a,next:s})=>{for(let[c]of s)c.classList.remove("md-nav__link--passed"),c.classList.remove("md-nav__link--active");for(let[c,[f]]of a.entries())f.classList.add("md-nav__link--passed"),f.classList.toggle("md-nav__link--active",c===a.length-1)}),oe("navigation.tracking")&&t.pipe(Z(i),J("offset"),Xe(250),Le(1),Z(n.pipe(Le(1))),_t({delay:250}),ge(o)).subscribe(([,{prev:a}])=>{let s=Se(),c=a[a.length-1];if(c&&c.length){let[f]=c,{hash:u}=new URL(f.href);s.hash!==u&&(s.hash=u,history.replaceState({},"",`${s}`))}else s.hash="",history.replaceState({},"",`${s}`)}),ks(e,{viewport$:t,header$:r}).pipe(O(a=>o.next(a)),C(()=>o.complete()),m(a=>U({ref:e},a)))})}function Hs(e,{viewport$:t,main$:r,target$:n}){let o=t.pipe(m(({offset:{y:a}})=>a),Me(2,1),m(([a,s])=>a>s&&s>0),K()),i=r.pipe(m(({active:a})=>a));return Y([i,o]).pipe(m(([a,s])=>!(a&&s)),K(),Z(n.pipe(Le(1))),jr(!0),_t({delay:250}),m(a=>({hidden:a})))}function ji(e,{viewport$:t,header$:r,main$:n,target$:o}){let i=new _,a=i.pipe(fe(1));return i.subscribe({next({hidden:s}){e.hidden=s,s?(e.setAttribute("tabindex","-1"),e.blur()):e.removeAttribute("tabindex")},complete(){e.style.top="",e.hidden=!0,e.removeAttribute("tabindex")}}),r.pipe(Z(a),J("height")).subscribe(({height:s})=>{e.style.top=`${s+16}px`}),Hs(e,{viewport$:t,main$:n,target$:o}).pipe(O(s=>i.next(s)),C(()=>i.complete()),m(s=>U({ref:e},s)))}function Fi({document$:e,tablet$:t}){e.pipe(x(()=>B(".md-toggle--indeterminate, [data-md-state=indeterminate]")),O(r=>{r.indeterminate=!0,r.checked=!1}),se(r=>g(r,"change").pipe(Dr(()=>r.classList.contains("md-toggle--indeterminate")),m(()=>r))),ge(t)).subscribe(([r,n])=>{r.classList.remove("md-toggle--indeterminate"),n&&(r.checked=!1)})}function Ps(){return/(iPad|iPhone|iPod)/.test(navigator.userAgent)}function Ui({document$:e}){e.pipe(x(()=>B("[data-md-scrollfix]")),O(t=>t.removeAttribute("data-md-scrollfix")),M(Ps),se(t=>g(t,"touchstart").pipe(m(()=>t)))).subscribe(t=>{let r=t.scrollTop;r===0?t.scrollTop=1:r+t.offsetHeight===t.scrollHeight&&(t.scrollTop=r-1)})}function Di({viewport$:e,tablet$:t}){Y([dt("search"),t]).pipe(m(([r,n])=>r&&!n),x(r=>P(r).pipe(Fe(r?400:100))),ge(e)).subscribe(([r,{offset:{y:n}}])=>{if(r)document.body.setAttribute("data-md-scrolllock",""),document.body.style.top=`-${n}px`;else{let o=-1*parseInt(document.body.style.top,10);document.body.removeAttribute("data-md-scrolllock"),document.body.style.top="",o&&window.scrollTo(0,o)}})}Object.entries||(Object.entries=function(e){let t=[];for(let r of Object.keys(e))t.push([r,e[r]]);return t});Object.values||(Object.values=function(e){let t=[];for(let r of Object.keys(e))t.push(e[r]);return t});typeof Element!="undefined"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(e,t){typeof e=="object"?(this.scrollLeft=e.left,this.scrollTop=e.top):(this.scrollLeft=e,this.scrollTop=t)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...e){let t=this.parentNode;if(t){e.length===0&&t.removeChild(this);for(let r=e.length-1;r>=0;r--){let n=e[r];typeof n!="object"?n=document.createTextNode(n):n.parentNode&&n.parentNode.removeChild(n),r?t.insertBefore(this.previousSibling,n):t.replaceChild(n,this)}}}));document.documentElement.classList.remove("no-js");document.documentElement.classList.add("js");var et=bo(),br=Co(),At=Io(),rn=Ao(),Ee=No(),vr=qr("(min-width: 960px)"),Vi=qr("(min-width: 1220px)"),Ni=$o(),zi=he(),qi=document.forms.namedItem("search")?(__search==null?void 0:__search.index)||ke(new URL("search/search_index.json",zi.base)):xe,nn=new _;vi({alert$:nn});oe("navigation.instant")&&gi({document$:et,location$:br,viewport$:Ee});var Wi;((Wi=zi.version)==null?void 0:Wi.provider)==="mike"&&Oi({document$:et});A(br,At).pipe(Fe(125)).subscribe(()=>{qe("drawer",!1),qe("search",!1)});rn.pipe(M(({mode:e})=>e==="global")).subscribe(e=>{switch(e.type){case"p":case",":let t=pe("[href][rel=prev]");typeof t!="undefined"&&t.click();break;case"n":case".":let r=pe("[href][rel=next]");typeof r!="undefined"&&r.click();break}});Fi({document$:et,tablet$:vr});Ui({document$:et});Di({viewport$:Ee,tablet$:vr});var Qe=li(we("header"),{viewport$:Ee}),hr=et.pipe(m(()=>we("main")),x(e=>hi(e,{viewport$:Ee,header$:Qe})),X(1)),Is=A(...ae("dialog").map(e=>pi(e,{alert$:nn})),...ae("header").map(e=>mi(e,{viewport$:Ee,header$:Qe,main$:hr})),...ae("palette").map(e=>bi(e)),...ae("search").map(e=>Ai(e,{index$:qi,keyboard$:rn})),...ae("source").map(e=>Pi(e))),$s=j(()=>A(...ae("content").map(e=>ui(e,{target$:At,print$:Ni})),...ae("content").map(e=>oe("search.highlight")?Ci(e,{index$:qi,location$:br}):k),...ae("header-title").map(e=>di(e,{viewport$:Ee,header$:Qe})),...ae("sidebar").map(e=>e.getAttribute("data-md-type")==="navigation"?Qr(Vi,()=>tn(e,{viewport$:Ee,header$:Qe,main$:hr})):Qr(vr,()=>tn(e,{viewport$:Ee,header$:Qe,main$:hr}))),...ae("tabs").map(e=>Ii(e,{viewport$:Ee,header$:Qe})),...ae("toc").map(e=>$i(e,{viewport$:Ee,header$:Qe,target$:At})),...ae("top").map(e=>ji(e,{viewport$:Ee,header$:Qe,main$:hr,target$:At})))),Qi=et.pipe(x(()=>$s),Ze(Is),X(1));Qi.subscribe();window.document$=et;window.location$=br;window.target$=At;window.keyboard$=rn;window.viewport$=Ee;window.tablet$=vr;window.screen$=Vi;window.print$=Ni;window.alert$=nn;window.component$=Qi;})(); +//# sourceMappingURL=bundle.0238f547.min.js.map + diff --git a/assets/javascripts/bundle.0238f547.min.js.map b/assets/javascripts/bundle.0238f547.min.js.map new file mode 100644 index 00000000..a97c7780 --- /dev/null +++ b/assets/javascripts/bundle.0238f547.min.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "sources": ["node_modules/focus-visible/dist/focus-visible.js", "node_modules/url-polyfill/url-polyfill.js", "node_modules/rxjs/node_modules/tslib/tslib.js", "node_modules/clipboard/dist/clipboard.js", "node_modules/escape-html/index.js", "node_modules/array-flat-polyfill/index.mjs", "src/assets/javascripts/bundle.ts", "node_modules/unfetch/polyfill/index.js", "node_modules/rxjs/node_modules/tslib/modules/index.js", "node_modules/rxjs/src/internal/util/isFunction.ts", "node_modules/rxjs/src/internal/util/createErrorClass.ts", "node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "node_modules/rxjs/src/internal/util/arrRemove.ts", "node_modules/rxjs/src/internal/Subscription.ts", "node_modules/rxjs/src/internal/config.ts", "node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "node_modules/rxjs/src/internal/util/noop.ts", "node_modules/rxjs/src/internal/NotificationFactories.ts", "node_modules/rxjs/src/internal/util/errorContext.ts", "node_modules/rxjs/src/internal/Subscriber.ts", "node_modules/rxjs/src/internal/symbol/observable.ts", "node_modules/rxjs/src/internal/util/identity.ts", "node_modules/rxjs/src/internal/util/pipe.ts", "node_modules/rxjs/src/internal/Observable.ts", "node_modules/rxjs/src/internal/util/lift.ts", "node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts", "node_modules/rxjs/src/internal/scheduler/animationFrameProvider.ts", "node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "node_modules/rxjs/src/internal/Subject.ts", "node_modules/rxjs/src/internal/scheduler/dateTimestampProvider.ts", "node_modules/rxjs/src/internal/ReplaySubject.ts", "node_modules/rxjs/src/internal/scheduler/Action.ts", "node_modules/rxjs/src/internal/scheduler/intervalProvider.ts", "node_modules/rxjs/src/internal/scheduler/AsyncAction.ts", "node_modules/rxjs/src/internal/Scheduler.ts", "node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts", "node_modules/rxjs/src/internal/scheduler/async.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameAction.ts", "node_modules/rxjs/src/internal/scheduler/AnimationFrameScheduler.ts", "node_modules/rxjs/src/internal/scheduler/animationFrame.ts", "node_modules/rxjs/src/internal/observable/empty.ts", "node_modules/rxjs/src/internal/util/isScheduler.ts", "node_modules/rxjs/src/internal/util/args.ts", "node_modules/rxjs/src/internal/util/isArrayLike.ts", "node_modules/rxjs/src/internal/util/isPromise.ts", "node_modules/rxjs/src/internal/util/isInteropObservable.ts", "node_modules/rxjs/src/internal/util/isAsyncIterable.ts", "node_modules/rxjs/src/internal/util/throwUnobservableError.ts", "node_modules/rxjs/src/internal/symbol/iterator.ts", "node_modules/rxjs/src/internal/util/isIterable.ts", "node_modules/rxjs/src/internal/util/isReadableStreamLike.ts", "node_modules/rxjs/src/internal/observable/innerFrom.ts", "node_modules/rxjs/src/internal/util/executeSchedule.ts", "node_modules/rxjs/src/internal/operators/observeOn.ts", "node_modules/rxjs/src/internal/operators/subscribeOn.ts", "node_modules/rxjs/src/internal/scheduled/scheduleObservable.ts", "node_modules/rxjs/src/internal/scheduled/schedulePromise.ts", "node_modules/rxjs/src/internal/scheduled/scheduleArray.ts", "node_modules/rxjs/src/internal/scheduled/scheduleIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleAsyncIterable.ts", "node_modules/rxjs/src/internal/scheduled/scheduleReadableStreamLike.ts", "node_modules/rxjs/src/internal/scheduled/scheduled.ts", "node_modules/rxjs/src/internal/observable/from.ts", "node_modules/rxjs/src/internal/observable/of.ts", "node_modules/rxjs/src/internal/observable/throwError.ts", "node_modules/rxjs/src/internal/util/isDate.ts", "node_modules/rxjs/src/internal/operators/map.ts", "node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts", "node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts", "node_modules/rxjs/src/internal/util/createObject.ts", "node_modules/rxjs/src/internal/observable/combineLatest.ts", "node_modules/rxjs/src/internal/operators/mergeInternals.ts", "node_modules/rxjs/src/internal/operators/mergeMap.ts", "node_modules/rxjs/src/internal/operators/mergeAll.ts", "node_modules/rxjs/src/internal/operators/concatAll.ts", "node_modules/rxjs/src/internal/observable/concat.ts", "node_modules/rxjs/src/internal/observable/defer.ts", "node_modules/rxjs/src/internal/observable/fromEvent.ts", "node_modules/rxjs/src/internal/observable/fromEventPattern.ts", "node_modules/rxjs/src/internal/observable/timer.ts", "node_modules/rxjs/src/internal/observable/merge.ts", "node_modules/rxjs/src/internal/observable/never.ts", "node_modules/rxjs/src/internal/util/argsOrArgArray.ts", "node_modules/rxjs/src/internal/operators/filter.ts", "node_modules/rxjs/src/internal/observable/zip.ts", "node_modules/rxjs/src/internal/operators/audit.ts", "node_modules/rxjs/src/internal/operators/auditTime.ts", "node_modules/rxjs/src/internal/operators/bufferCount.ts", "node_modules/rxjs/src/internal/operators/catchError.ts", "node_modules/rxjs/src/internal/operators/scanInternals.ts", "node_modules/rxjs/src/internal/operators/combineLatest.ts", "node_modules/rxjs/src/internal/operators/combineLatestWith.ts", "node_modules/rxjs/src/internal/operators/concatMap.ts", "node_modules/rxjs/src/internal/operators/debounceTime.ts", "node_modules/rxjs/src/internal/operators/defaultIfEmpty.ts", "node_modules/rxjs/src/internal/operators/take.ts", "node_modules/rxjs/src/internal/operators/ignoreElements.ts", "node_modules/rxjs/src/internal/operators/mapTo.ts", "node_modules/rxjs/src/internal/operators/delayWhen.ts", "node_modules/rxjs/src/internal/operators/delay.ts", "node_modules/rxjs/src/internal/operators/distinctUntilChanged.ts", "node_modules/rxjs/src/internal/operators/distinctUntilKeyChanged.ts", "node_modules/rxjs/src/internal/operators/endWith.ts", "node_modules/rxjs/src/internal/operators/finalize.ts", "node_modules/rxjs/src/internal/operators/takeLast.ts", "node_modules/rxjs/src/internal/operators/merge.ts", "node_modules/rxjs/src/internal/operators/mergeWith.ts", "node_modules/rxjs/src/internal/operators/repeat.ts", "node_modules/rxjs/src/internal/operators/sample.ts", "node_modules/rxjs/src/internal/operators/scan.ts", "node_modules/rxjs/src/internal/operators/share.ts", "node_modules/rxjs/src/internal/operators/shareReplay.ts", "node_modules/rxjs/src/internal/operators/skip.ts", "node_modules/rxjs/src/internal/operators/skipUntil.ts", "node_modules/rxjs/src/internal/operators/startWith.ts", "node_modules/rxjs/src/internal/operators/switchMap.ts", "node_modules/rxjs/src/internal/operators/takeUntil.ts", "node_modules/rxjs/src/internal/operators/takeWhile.ts", "node_modules/rxjs/src/internal/operators/tap.ts", "node_modules/rxjs/src/internal/operators/throttle.ts", "node_modules/rxjs/src/internal/operators/throttleTime.ts", "node_modules/rxjs/src/internal/operators/withLatestFrom.ts", "node_modules/rxjs/src/internal/operators/zip.ts", "node_modules/rxjs/src/internal/operators/zipWith.ts", "src/assets/javascripts/browser/document/index.ts", "src/assets/javascripts/browser/element/_/index.ts", "src/assets/javascripts/browser/element/focus/index.ts", "src/assets/javascripts/browser/element/offset/_/index.ts", "src/assets/javascripts/browser/element/offset/content/index.ts", "node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js", "src/assets/javascripts/browser/element/size/_/index.ts", "src/assets/javascripts/browser/element/size/content/index.ts", "src/assets/javascripts/browser/element/visibility/index.ts", "src/assets/javascripts/browser/toggle/index.ts", "src/assets/javascripts/browser/keyboard/index.ts", "src/assets/javascripts/browser/location/_/index.ts", "src/assets/javascripts/utilities/h/index.ts", "src/assets/javascripts/utilities/string/index.ts", "src/assets/javascripts/browser/location/hash/index.ts", "src/assets/javascripts/browser/media/index.ts", "src/assets/javascripts/browser/request/index.ts", "src/assets/javascripts/browser/script/index.ts", "src/assets/javascripts/browser/viewport/offset/index.ts", "src/assets/javascripts/browser/viewport/size/index.ts", "src/assets/javascripts/browser/viewport/_/index.ts", "src/assets/javascripts/browser/viewport/at/index.ts", "src/assets/javascripts/browser/worker/index.ts", "src/assets/javascripts/_/index.ts", "src/assets/javascripts/components/_/index.ts", "src/assets/javascripts/components/content/code/_/index.ts", "src/assets/javascripts/templates/annotation/index.tsx", "src/assets/javascripts/templates/clipboard/index.tsx", "src/assets/javascripts/templates/search/index.tsx", "src/assets/javascripts/templates/source/index.tsx", "src/assets/javascripts/templates/tabbed/index.tsx", "src/assets/javascripts/templates/table/index.tsx", "src/assets/javascripts/templates/version/index.tsx", "src/assets/javascripts/components/content/annotation/_/index.ts", "src/assets/javascripts/components/content/annotation/list/index.ts", "src/assets/javascripts/components/content/code/mermaid/index.ts", "src/assets/javascripts/components/content/details/index.ts", "src/assets/javascripts/components/content/table/index.ts", "src/assets/javascripts/components/content/tabs/index.ts", "src/assets/javascripts/components/content/_/index.ts", "src/assets/javascripts/components/dialog/index.ts", "src/assets/javascripts/components/header/_/index.ts", "src/assets/javascripts/components/header/title/index.ts", "src/assets/javascripts/components/main/index.ts", "src/assets/javascripts/components/palette/index.ts", "src/assets/javascripts/integrations/clipboard/index.ts", "src/assets/javascripts/integrations/sitemap/index.ts", "src/assets/javascripts/integrations/instant/index.ts", "src/assets/javascripts/integrations/search/document/index.ts", "src/assets/javascripts/integrations/search/highlighter/index.ts", "src/assets/javascripts/integrations/search/query/transform/index.ts", "src/assets/javascripts/integrations/search/worker/message/index.ts", "src/assets/javascripts/integrations/search/worker/_/index.ts", "src/assets/javascripts/integrations/version/index.ts", "src/assets/javascripts/components/search/query/index.ts", "src/assets/javascripts/components/search/result/index.ts", "src/assets/javascripts/components/search/share/index.ts", "src/assets/javascripts/components/search/suggest/index.ts", "src/assets/javascripts/components/search/_/index.ts", "src/assets/javascripts/components/search/highlight/index.ts", "src/assets/javascripts/components/sidebar/index.ts", "src/assets/javascripts/components/source/facts/github/index.ts", "src/assets/javascripts/components/source/facts/gitlab/index.ts", "src/assets/javascripts/components/source/facts/_/index.ts", "src/assets/javascripts/components/source/_/index.ts", "src/assets/javascripts/components/tabs/index.ts", "src/assets/javascripts/components/toc/index.ts", "src/assets/javascripts/components/top/index.ts", "src/assets/javascripts/patches/indeterminate/index.ts", "src/assets/javascripts/patches/scrollfix/index.ts", "src/assets/javascripts/patches/scrolllock/index.ts", "src/assets/javascripts/polyfills/index.ts"], + "sourceRoot": "../../../..", + "sourcesContent": ["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (factory());\n}(this, (function () { 'use strict';\n\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\n function applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n\n var inputTypesAllowlist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (\n e.target.classList.contains('focus-visible') ||\n e.target.hasAttribute('data-focus-visible-added')\n ) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n addInitialPointerMoveListeners();\n }\n }\n\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on whenever the\n // window blurs, even if you're tabbing out of the page. \u00AF\\_(\u30C4)_/\u00AF\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }\n\n // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n addInitialPointerMoveListeners();\n\n // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true);\n\n // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n }\n\n // It is important to wrap all references to global window and document in\n // these checks to support server-side rendering use cases\n // @see https://github.com/WICG/focus-visible/issues/199\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n }\n\n if (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n }\n\n})));\n", "(function(global) {\r\n /**\r\n * Polyfill URLSearchParams\r\n *\r\n * Inspired from : https://github.com/WebReflection/url-search-params/blob/master/src/url-search-params.js\r\n */\r\n\r\n var checkIfIteratorIsSupported = function() {\r\n try {\r\n return !!Symbol.iterator;\r\n } catch (error) {\r\n return false;\r\n }\r\n };\r\n\r\n\r\n var iteratorSupported = checkIfIteratorIsSupported();\r\n\r\n var createIterator = function(items) {\r\n var iterator = {\r\n next: function() {\r\n var value = items.shift();\r\n return { done: value === void 0, value: value };\r\n }\r\n };\r\n\r\n if (iteratorSupported) {\r\n iterator[Symbol.iterator] = function() {\r\n return iterator;\r\n };\r\n }\r\n\r\n return iterator;\r\n };\r\n\r\n /**\r\n * Search param name and values should be encoded according to https://url.spec.whatwg.org/#urlencoded-serializing\r\n * encodeURIComponent() produces the same result except encoding spaces as `%20` instead of `+`.\r\n */\r\n var serializeParam = function(value) {\r\n return encodeURIComponent(value).replace(/%20/g, '+');\r\n };\r\n\r\n var deserializeParam = function(value) {\r\n return decodeURIComponent(String(value).replace(/\\+/g, ' '));\r\n };\r\n\r\n var polyfillURLSearchParams = function() {\r\n\r\n var URLSearchParams = function(searchString) {\r\n Object.defineProperty(this, '_entries', { writable: true, value: {} });\r\n var typeofSearchString = typeof searchString;\r\n\r\n if (typeofSearchString === 'undefined') {\r\n // do nothing\r\n } else if (typeofSearchString === 'string') {\r\n if (searchString !== '') {\r\n this._fromString(searchString);\r\n }\r\n } else if (searchString instanceof URLSearchParams) {\r\n var _this = this;\r\n searchString.forEach(function(value, name) {\r\n _this.append(name, value);\r\n });\r\n } else if ((searchString !== null) && (typeofSearchString === 'object')) {\r\n if (Object.prototype.toString.call(searchString) === '[object Array]') {\r\n for (var i = 0; i < searchString.length; i++) {\r\n var entry = searchString[i];\r\n if ((Object.prototype.toString.call(entry) === '[object Array]') || (entry.length !== 2)) {\r\n this.append(entry[0], entry[1]);\r\n } else {\r\n throw new TypeError('Expected [string, any] as entry at index ' + i + ' of URLSearchParams\\'s input');\r\n }\r\n }\r\n } else {\r\n for (var key in searchString) {\r\n if (searchString.hasOwnProperty(key)) {\r\n this.append(key, searchString[key]);\r\n }\r\n }\r\n }\r\n } else {\r\n throw new TypeError('Unsupported input\\'s type for URLSearchParams');\r\n }\r\n };\r\n\r\n var proto = URLSearchParams.prototype;\r\n\r\n proto.append = function(name, value) {\r\n if (name in this._entries) {\r\n this._entries[name].push(String(value));\r\n } else {\r\n this._entries[name] = [String(value)];\r\n }\r\n };\r\n\r\n proto.delete = function(name) {\r\n delete this._entries[name];\r\n };\r\n\r\n proto.get = function(name) {\r\n return (name in this._entries) ? this._entries[name][0] : null;\r\n };\r\n\r\n proto.getAll = function(name) {\r\n return (name in this._entries) ? this._entries[name].slice(0) : [];\r\n };\r\n\r\n proto.has = function(name) {\r\n return (name in this._entries);\r\n };\r\n\r\n proto.set = function(name, value) {\r\n this._entries[name] = [String(value)];\r\n };\r\n\r\n proto.forEach = function(callback, thisArg) {\r\n var entries;\r\n for (var name in this._entries) {\r\n if (this._entries.hasOwnProperty(name)) {\r\n entries = this._entries[name];\r\n for (var i = 0; i < entries.length; i++) {\r\n callback.call(thisArg, entries[i], name, this);\r\n }\r\n }\r\n }\r\n };\r\n\r\n proto.keys = function() {\r\n var items = [];\r\n this.forEach(function(value, name) {\r\n items.push(name);\r\n });\r\n return createIterator(items);\r\n };\r\n\r\n proto.values = function() {\r\n var items = [];\r\n this.forEach(function(value) {\r\n items.push(value);\r\n });\r\n return createIterator(items);\r\n };\r\n\r\n proto.entries = function() {\r\n var items = [];\r\n this.forEach(function(value, name) {\r\n items.push([name, value]);\r\n });\r\n return createIterator(items);\r\n };\r\n\r\n if (iteratorSupported) {\r\n proto[Symbol.iterator] = proto.entries;\r\n }\r\n\r\n proto.toString = function() {\r\n var searchArray = [];\r\n this.forEach(function(value, name) {\r\n searchArray.push(serializeParam(name) + '=' + serializeParam(value));\r\n });\r\n return searchArray.join('&');\r\n };\r\n\r\n\r\n global.URLSearchParams = URLSearchParams;\r\n };\r\n\r\n var checkIfURLSearchParamsSupported = function() {\r\n try {\r\n var URLSearchParams = global.URLSearchParams;\r\n\r\n return (\r\n (new URLSearchParams('?a=1').toString() === 'a=1') &&\r\n (typeof URLSearchParams.prototype.set === 'function') &&\r\n (typeof URLSearchParams.prototype.entries === 'function')\r\n );\r\n } catch (e) {\r\n return false;\r\n }\r\n };\r\n\r\n if (!checkIfURLSearchParamsSupported()) {\r\n polyfillURLSearchParams();\r\n }\r\n\r\n var proto = global.URLSearchParams.prototype;\r\n\r\n if (typeof proto.sort !== 'function') {\r\n proto.sort = function() {\r\n var _this = this;\r\n var items = [];\r\n this.forEach(function(value, name) {\r\n items.push([name, value]);\r\n if (!_this._entries) {\r\n _this.delete(name);\r\n }\r\n });\r\n items.sort(function(a, b) {\r\n if (a[0] < b[0]) {\r\n return -1;\r\n } else if (a[0] > b[0]) {\r\n return +1;\r\n } else {\r\n return 0;\r\n }\r\n });\r\n if (_this._entries) { // force reset because IE keeps keys index\r\n _this._entries = {};\r\n }\r\n for (var i = 0; i < items.length; i++) {\r\n this.append(items[i][0], items[i][1]);\r\n }\r\n };\r\n }\r\n\r\n if (typeof proto._fromString !== 'function') {\r\n Object.defineProperty(proto, '_fromString', {\r\n enumerable: false,\r\n configurable: false,\r\n writable: false,\r\n value: function(searchString) {\r\n if (this._entries) {\r\n this._entries = {};\r\n } else {\r\n var keys = [];\r\n this.forEach(function(value, name) {\r\n keys.push(name);\r\n });\r\n for (var i = 0; i < keys.length; i++) {\r\n this.delete(keys[i]);\r\n }\r\n }\r\n\r\n searchString = searchString.replace(/^\\?/, '');\r\n var attributes = searchString.split('&');\r\n var attribute;\r\n for (var i = 0; i < attributes.length; i++) {\r\n attribute = attributes[i].split('=');\r\n this.append(\r\n deserializeParam(attribute[0]),\r\n (attribute.length > 1) ? deserializeParam(attribute[1]) : ''\r\n );\r\n }\r\n }\r\n });\r\n }\r\n\r\n // HTMLAnchorElement\r\n\r\n})(\r\n (typeof global !== 'undefined') ? global\r\n : ((typeof window !== 'undefined') ? window\r\n : ((typeof self !== 'undefined') ? self : this))\r\n);\r\n\r\n(function(global) {\r\n /**\r\n * Polyfill URL\r\n *\r\n * Inspired from : https://github.com/arv/DOM-URL-Polyfill/blob/master/src/url.js\r\n */\r\n\r\n var checkIfURLIsSupported = function() {\r\n try {\r\n var u = new global.URL('b', 'http://a');\r\n u.pathname = 'c d';\r\n return (u.href === 'http://a/c%20d') && u.searchParams;\r\n } catch (e) {\r\n return false;\r\n }\r\n };\r\n\r\n\r\n var polyfillURL = function() {\r\n var _URL = global.URL;\r\n\r\n var URL = function(url, base) {\r\n if (typeof url !== 'string') url = String(url);\r\n if (base && typeof base !== 'string') base = String(base);\r\n\r\n // Only create another document if the base is different from current location.\r\n var doc = document, baseElement;\r\n if (base && (global.location === void 0 || base !== global.location.href)) {\r\n base = base.toLowerCase();\r\n doc = document.implementation.createHTMLDocument('');\r\n baseElement = doc.createElement('base');\r\n baseElement.href = base;\r\n doc.head.appendChild(baseElement);\r\n try {\r\n if (baseElement.href.indexOf(base) !== 0) throw new Error(baseElement.href);\r\n } catch (err) {\r\n throw new Error('URL unable to set base ' + base + ' due to ' + err);\r\n }\r\n }\r\n\r\n var anchorElement = doc.createElement('a');\r\n anchorElement.href = url;\r\n if (baseElement) {\r\n doc.body.appendChild(anchorElement);\r\n anchorElement.href = anchorElement.href; // force href to refresh\r\n }\r\n\r\n var inputElement = doc.createElement('input');\r\n inputElement.type = 'url';\r\n inputElement.value = url;\r\n\r\n if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href) || (!inputElement.checkValidity() && !base)) {\r\n throw new TypeError('Invalid URL');\r\n }\r\n\r\n Object.defineProperty(this, '_anchorElement', {\r\n value: anchorElement\r\n });\r\n\r\n\r\n // create a linked searchParams which reflect its changes on URL\r\n var searchParams = new global.URLSearchParams(this.search);\r\n var enableSearchUpdate = true;\r\n var enableSearchParamsUpdate = true;\r\n var _this = this;\r\n ['append', 'delete', 'set'].forEach(function(methodName) {\r\n var method = searchParams[methodName];\r\n searchParams[methodName] = function() {\r\n method.apply(searchParams, arguments);\r\n if (enableSearchUpdate) {\r\n enableSearchParamsUpdate = false;\r\n _this.search = searchParams.toString();\r\n enableSearchParamsUpdate = true;\r\n }\r\n };\r\n });\r\n\r\n Object.defineProperty(this, 'searchParams', {\r\n value: searchParams,\r\n enumerable: true\r\n });\r\n\r\n var search = void 0;\r\n Object.defineProperty(this, '_updateSearchParams', {\r\n enumerable: false,\r\n configurable: false,\r\n writable: false,\r\n value: function() {\r\n if (this.search !== search) {\r\n search = this.search;\r\n if (enableSearchParamsUpdate) {\r\n enableSearchUpdate = false;\r\n this.searchParams._fromString(this.search);\r\n enableSearchUpdate = true;\r\n }\r\n }\r\n }\r\n });\r\n };\r\n\r\n var proto = URL.prototype;\r\n\r\n var linkURLWithAnchorAttribute = function(attributeName) {\r\n Object.defineProperty(proto, attributeName, {\r\n get: function() {\r\n return this._anchorElement[attributeName];\r\n },\r\n set: function(value) {\r\n this._anchorElement[attributeName] = value;\r\n },\r\n enumerable: true\r\n });\r\n };\r\n\r\n ['hash', 'host', 'hostname', 'port', 'protocol']\r\n .forEach(function(attributeName) {\r\n linkURLWithAnchorAttribute(attributeName);\r\n });\r\n\r\n Object.defineProperty(proto, 'search', {\r\n get: function() {\r\n return this._anchorElement['search'];\r\n },\r\n set: function(value) {\r\n this._anchorElement['search'] = value;\r\n this._updateSearchParams();\r\n },\r\n enumerable: true\r\n });\r\n\r\n Object.defineProperties(proto, {\r\n\r\n 'toString': {\r\n get: function() {\r\n var _this = this;\r\n return function() {\r\n return _this.href;\r\n };\r\n }\r\n },\r\n\r\n 'href': {\r\n get: function() {\r\n return this._anchorElement.href.replace(/\\?$/, '');\r\n },\r\n set: function(value) {\r\n this._anchorElement.href = value;\r\n this._updateSearchParams();\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'pathname': {\r\n get: function() {\r\n return this._anchorElement.pathname.replace(/(^\\/?)/, '/');\r\n },\r\n set: function(value) {\r\n this._anchorElement.pathname = value;\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'origin': {\r\n get: function() {\r\n // get expected port from protocol\r\n var expectedPort = { 'http:': 80, 'https:': 443, 'ftp:': 21 }[this._anchorElement.protocol];\r\n // add port to origin if, expected port is different than actual port\r\n // and it is not empty f.e http://foo:8080\r\n // 8080 != 80 && 8080 != ''\r\n var addPortToOrigin = this._anchorElement.port != expectedPort &&\r\n this._anchorElement.port !== '';\r\n\r\n return this._anchorElement.protocol +\r\n '//' +\r\n this._anchorElement.hostname +\r\n (addPortToOrigin ? (':' + this._anchorElement.port) : '');\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'password': { // TODO\r\n get: function() {\r\n return '';\r\n },\r\n set: function(value) {\r\n },\r\n enumerable: true\r\n },\r\n\r\n 'username': { // TODO\r\n get: function() {\r\n return '';\r\n },\r\n set: function(value) {\r\n },\r\n enumerable: true\r\n },\r\n });\r\n\r\n URL.createObjectURL = function(blob) {\r\n return _URL.createObjectURL.apply(_URL, arguments);\r\n };\r\n\r\n URL.revokeObjectURL = function(url) {\r\n return _URL.revokeObjectURL.apply(_URL, arguments);\r\n };\r\n\r\n global.URL = URL;\r\n\r\n };\r\n\r\n if (!checkIfURLIsSupported()) {\r\n polyfillURL();\r\n }\r\n\r\n if ((global.location !== void 0) && !('origin' in global.location)) {\r\n var getOrigin = function() {\r\n return global.location.protocol + '//' + global.location.hostname + (global.location.port ? (':' + global.location.port) : '');\r\n };\r\n\r\n try {\r\n Object.defineProperty(global.location, 'origin', {\r\n get: getOrigin,\r\n enumerable: true\r\n });\r\n } catch (e) {\r\n setInterval(function() {\r\n global.location.origin = getOrigin();\r\n }, 100);\r\n }\r\n }\r\n\r\n})(\r\n (typeof global !== 'undefined') ? global\r\n : ((typeof window !== 'undefined') ? window\r\n : ((typeof self !== 'undefined') ? self : this))\r\n);\r\n", "/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __createBinding;\r\n(function (factory) {\r\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n if (typeof define === \"function\" && define.amd) {\r\n define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n }\r\n else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n factory(createExporter(root, createExporter(module.exports)));\r\n }\r\n else {\r\n factory(createExporter(root));\r\n }\r\n function createExporter(exports, previous) {\r\n if (exports !== root) {\r\n if (typeof Object.create === \"function\") {\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n }\r\n else {\r\n exports.__esModule = true;\r\n }\r\n }\r\n return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n }\r\n})\r\n(function (exporter) {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n __extends = function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n\r\n __rest = function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n };\r\n\r\n __decorate = function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __exportStar = function(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n };\r\n\r\n __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n }) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n });\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __spreadArray = function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n var __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n }) : function(o, v) {\r\n o[\"default\"] = v;\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__spreadArray\", __spreadArray);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n});\r\n", "/*!\n * clipboard.js v2.0.11\n * https://clipboardjs.com/\n *\n * Licensed MIT \u00A9 Zeno Rocha\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClipboardJS\"] = factory();\n\telse\n\t\troot[\"ClipboardJS\"] = factory();\n})(this, function() {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 686:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"default\": function() { return /* binding */ clipboard; }\n});\n\n// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js\nvar tiny_emitter = __webpack_require__(279);\nvar tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);\n// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js\nvar listen = __webpack_require__(370);\nvar listen_default = /*#__PURE__*/__webpack_require__.n(listen);\n// EXTERNAL MODULE: ./node_modules/select/src/select.js\nvar src_select = __webpack_require__(817);\nvar select_default = /*#__PURE__*/__webpack_require__.n(src_select);\n;// CONCATENATED MODULE: ./src/common/command.js\n/**\n * Executes a given operation type.\n * @param {String} type\n * @return {Boolean}\n */\nfunction command(type) {\n try {\n return document.execCommand(type);\n } catch (err) {\n return false;\n }\n}\n;// CONCATENATED MODULE: ./src/actions/cut.js\n\n\n/**\n * Cut action wrapper.\n * @param {String|HTMLElement} target\n * @return {String}\n */\n\nvar ClipboardActionCut = function ClipboardActionCut(target) {\n var selectedText = select_default()(target);\n command('cut');\n return selectedText;\n};\n\n/* harmony default export */ var actions_cut = (ClipboardActionCut);\n;// CONCATENATED MODULE: ./src/common/create-fake-element.js\n/**\n * Creates a fake textarea element with a value.\n * @param {String} value\n * @return {HTMLElement}\n */\nfunction createFakeElement(value) {\n var isRTL = document.documentElement.getAttribute('dir') === 'rtl';\n var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS\n\n fakeElement.style.fontSize = '12pt'; // Reset box model\n\n fakeElement.style.border = '0';\n fakeElement.style.padding = '0';\n fakeElement.style.margin = '0'; // Move element out of screen horizontally\n\n fakeElement.style.position = 'absolute';\n fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically\n\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n fakeElement.style.top = \"\".concat(yPosition, \"px\");\n fakeElement.setAttribute('readonly', '');\n fakeElement.value = value;\n return fakeElement;\n}\n;// CONCATENATED MODULE: ./src/actions/copy.js\n\n\n\n/**\n * Create fake copy action wrapper using a fake element.\n * @param {String} target\n * @param {Object} options\n * @return {String}\n */\n\nvar fakeCopyAction = function fakeCopyAction(value, options) {\n var fakeElement = createFakeElement(value);\n options.container.appendChild(fakeElement);\n var selectedText = select_default()(fakeElement);\n command('copy');\n fakeElement.remove();\n return selectedText;\n};\n/**\n * Copy action wrapper.\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @return {String}\n */\n\n\nvar ClipboardActionCopy = function ClipboardActionCopy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n var selectedText = '';\n\n if (typeof target === 'string') {\n selectedText = fakeCopyAction(target, options);\n } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {\n // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n selectedText = fakeCopyAction(target.value, options);\n } else {\n selectedText = select_default()(target);\n command('copy');\n }\n\n return selectedText;\n};\n\n/* harmony default export */ var actions_copy = (ClipboardActionCopy);\n;// CONCATENATED MODULE: ./src/actions/default.js\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/**\n * Inner function which performs selection from either `text` or `target`\n * properties and then executes copy or cut operations.\n * @param {Object} options\n */\n\nvar ClipboardActionDefault = function ClipboardActionDefault() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Defines base properties passed from constructor.\n var _options$action = options.action,\n action = _options$action === void 0 ? 'copy' : _options$action,\n container = options.container,\n target = options.target,\n text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.\n\n if (action !== 'copy' && action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n } // Sets the `target` property using an element that will be have its content copied.\n\n\n if (target !== undefined) {\n if (target && _typeof(target) === 'object' && target.nodeType === 1) {\n if (action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n } // Define selection strategy based on `text` property.\n\n\n if (text) {\n return actions_copy(text, {\n container: container\n });\n } // Defines which selection strategy based on `target` property.\n\n\n if (target) {\n return action === 'cut' ? actions_cut(target) : actions_copy(target, {\n container: container\n });\n }\n};\n\n/* harmony default export */ var actions_default = (ClipboardActionDefault);\n;// CONCATENATED MODULE: ./src/clipboard.js\nfunction clipboard_typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return clipboard_typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n/**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n\nfunction getAttributeValue(suffix, element) {\n var attribute = \"data-clipboard-\".concat(suffix);\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n}\n/**\n * Base class which takes one or more elements, adds event listeners to them,\n * and instantiates a new `ClipboardAction` on each click.\n */\n\n\nvar Clipboard = /*#__PURE__*/function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n var _super = _createSuper(Clipboard);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n var _this;\n\n _classCallCheck(this, Clipboard);\n\n _this = _super.call(this);\n\n _this.resolveOptions(options);\n\n _this.listenClick(trigger);\n\n return _this;\n }\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: \"resolveOptions\",\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;\n }\n /**\n * Adds a click event listener to the passed trigger.\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n */\n\n }, {\n key: \"listenClick\",\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = listen_default()(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n /**\n * Defines a new `ClipboardAction` on each click event.\n * @param {Event} e\n */\n\n }, {\n key: \"onClick\",\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n var action = this.action(trigger) || 'copy';\n var text = actions_default({\n action: action,\n container: this.container,\n target: this.target(trigger),\n text: this.text(trigger)\n }); // Fires an event based on the copy operation result.\n\n this.emit(text ? 'success' : 'error', {\n action: action,\n text: text,\n trigger: trigger,\n clearSelection: function clearSelection() {\n if (trigger) {\n trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n });\n }\n /**\n * Default `action` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultAction\",\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n /**\n * Default `target` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultTarget\",\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n /**\n * Allow fire programmatically a copy action\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @returns Text copied.\n */\n\n }, {\n key: \"defaultText\",\n\n /**\n * Default `text` lookup function.\n * @param {Element} trigger\n */\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n /**\n * Destroy lifecycle.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.listener.destroy();\n }\n }], [{\n key: \"copy\",\n value: function copy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n return actions_copy(target, options);\n }\n /**\n * Allow fire programmatically a cut action\n * @param {String|HTMLElement} target\n * @returns Text cutted.\n */\n\n }, {\n key: \"cut\",\n value: function cut(target) {\n return actions_cut(target);\n }\n /**\n * Returns the support of the given action, or all actions if no action is\n * given.\n * @param {String} [action]\n */\n\n }, {\n key: \"isSupported\",\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n return support;\n }\n }]);\n\n return Clipboard;\n}((tiny_emitter_default()));\n\n/* harmony default export */ var clipboard = (Clipboard);\n\n/***/ }),\n\n/***/ 828:\n/***/ (function(module) {\n\nvar DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n var proto = Element.prototype;\n\n proto.matches = proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n if (typeof element.matches === 'function' &&\n element.matches(selector)) {\n return element;\n }\n element = element.parentNode;\n }\n}\n\nmodule.exports = closest;\n\n\n/***/ }),\n\n/***/ 438:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar closest = __webpack_require__(828);\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n // Handle the regular Element usage\n if (typeof elements.addEventListener === 'function') {\n return _delegate.apply(null, arguments);\n }\n\n // Handle Element-less usage, it defaults to global delegation\n if (typeof type === 'function') {\n // Use `document` as the first parameter, then apply arguments\n // This is a short way to .unshift `arguments` without running into deoptimizations\n return _delegate.bind(null, document).apply(null, arguments);\n }\n\n // Handle Selector-based usage\n if (typeof elements === 'string') {\n elements = document.querySelectorAll(elements);\n }\n\n // Handle Array-like based usage\n return Array.prototype.map.call(elements, function (element) {\n return _delegate(element, selector, type, callback, useCapture);\n });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n\n\n/***/ }),\n\n/***/ 879:\n/***/ (function(__unused_webpack_module, exports) {\n\n/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n return value !== undefined\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return value !== undefined\n && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n && ('length' in value)\n && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n return typeof value === 'string'\n || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return type === '[object Function]';\n};\n\n\n/***/ }),\n\n/***/ 370:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar is = __webpack_require__(879);\nvar delegate = __webpack_require__(438);\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n if (!target && !type && !callback) {\n throw new Error('Missing required arguments');\n }\n\n if (!is.string(type)) {\n throw new TypeError('Second argument must be a String');\n }\n\n if (!is.fn(callback)) {\n throw new TypeError('Third argument must be a Function');\n }\n\n if (is.node(target)) {\n return listenNode(target, type, callback);\n }\n else if (is.nodeList(target)) {\n return listenNodeList(target, type, callback);\n }\n else if (is.string(target)) {\n return listenSelector(target, type, callback);\n }\n else {\n throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n node.addEventListener(type, callback);\n\n return {\n destroy: function() {\n node.removeEventListener(type, callback);\n }\n }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.addEventListener(type, callback);\n });\n\n return {\n destroy: function() {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.removeEventListener(type, callback);\n });\n }\n }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n\n\n/***/ }),\n\n/***/ 817:\n/***/ (function(module) {\n\nfunction select(element) {\n var selectedText;\n\n if (element.nodeName === 'SELECT') {\n element.focus();\n\n selectedText = element.value;\n }\n else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n var isReadOnly = element.hasAttribute('readonly');\n\n if (!isReadOnly) {\n element.setAttribute('readonly', '');\n }\n\n element.select();\n element.setSelectionRange(0, element.value.length);\n\n if (!isReadOnly) {\n element.removeAttribute('readonly');\n }\n\n selectedText = element.value;\n }\n else {\n if (element.hasAttribute('contenteditable')) {\n element.focus();\n }\n\n var selection = window.getSelection();\n var range = document.createRange();\n\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n\n selectedText = selection.toString();\n }\n\n return selectedText;\n}\n\nmodule.exports = select;\n\n\n/***/ }),\n\n/***/ 279:\n/***/ (function(module) {\n\nfunction E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(__webpack_module_cache__[moduleId]) {\n/******/ \t\t\treturn __webpack_module_cache__[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t!function() {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = function(module) {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\tfunction() { return module['default']; } :\n/******/ \t\t\t\tfunction() { return module; };\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t!function() {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = function(exports, definition) {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t!function() {\n/******/ \t\t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ \t}();\n/******/ \t\n/************************************************************************/\n/******/ \t// module exports must be returned from runtime so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(686);\n/******/ })()\n.default;\n});", "/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n", "Array.prototype.flat||Object.defineProperty(Array.prototype,\"flat\",{configurable:!0,value:function r(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(a,e){return Array.isArray(e)?a.push.apply(a,r.call(e,t-1)):a.push(e),a},[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,\"flatMap\",{configurable:!0,value:function(r){return Array.prototype.map.apply(this,arguments).flat()},writable:!0})\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport \"array-flat-polyfill\"\nimport \"focus-visible\"\nimport \"unfetch/polyfill\"\nimport \"url-polyfill\"\n\nimport {\n EMPTY,\n NEVER,\n Subject,\n defer,\n delay,\n filter,\n map,\n merge,\n mergeWith,\n shareReplay,\n switchMap\n} from \"rxjs\"\n\nimport { configuration, feature } from \"./_\"\nimport {\n at,\n getOptionalElement,\n requestJSON,\n setToggle,\n watchDocument,\n watchKeyboard,\n watchLocation,\n watchLocationTarget,\n watchMedia,\n watchPrint,\n watchViewport\n} from \"./browser\"\nimport {\n getComponentElement,\n getComponentElements,\n mountBackToTop,\n mountContent,\n mountDialog,\n mountHeader,\n mountHeaderTitle,\n mountPalette,\n mountSearch,\n mountSearchHiglight,\n mountSidebar,\n mountSource,\n mountTableOfContents,\n mountTabs,\n watchHeader,\n watchMain\n} from \"./components\"\nimport {\n SearchIndex,\n setupClipboardJS,\n setupInstantLoading,\n setupVersionSelector\n} from \"./integrations\"\nimport {\n patchIndeterminate,\n patchScrollfix,\n patchScrolllock\n} from \"./patches\"\nimport \"./polyfills\"\n\n/* ----------------------------------------------------------------------------\n * Application\n * ------------------------------------------------------------------------- */\n\n/* Yay, JavaScript is available */\ndocument.documentElement.classList.remove(\"no-js\")\ndocument.documentElement.classList.add(\"js\")\n\n/* Set up navigation observables and subjects */\nconst document$ = watchDocument()\nconst location$ = watchLocation()\nconst target$ = watchLocationTarget()\nconst keyboard$ = watchKeyboard()\n\n/* Set up media observables */\nconst viewport$ = watchViewport()\nconst tablet$ = watchMedia(\"(min-width: 960px)\")\nconst screen$ = watchMedia(\"(min-width: 1220px)\")\nconst print$ = watchPrint()\n\n/* Retrieve search index, if search is enabled */\nconst config = configuration()\nconst index$ = document.forms.namedItem(\"search\")\n ? __search?.index || requestJSON(\n new URL(\"search/search_index.json\", config.base)\n )\n : NEVER\n\n/* Set up Clipboard.js integration */\nconst alert$ = new Subject()\nsetupClipboardJS({ alert$ })\n\n/* Set up instant loading, if enabled */\nif (feature(\"navigation.instant\"))\n setupInstantLoading({ document$, location$, viewport$ })\n\n/* Set up version selector */\nif (config.version?.provider === \"mike\")\n setupVersionSelector({ document$ })\n\n/* Always close drawer and search on navigation */\nmerge(location$, target$)\n .pipe(\n delay(125)\n )\n .subscribe(() => {\n setToggle(\"drawer\", false)\n setToggle(\"search\", false)\n })\n\n/* Set up global keyboard handlers */\nkeyboard$\n .pipe(\n filter(({ mode }) => mode === \"global\")\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Go to previous page */\n case \"p\":\n case \",\":\n const prev = getOptionalElement(\"[href][rel=prev]\")\n if (typeof prev !== \"undefined\")\n prev.click()\n break\n\n /* Go to next page */\n case \"n\":\n case \".\":\n const next = getOptionalElement(\"[href][rel=next]\")\n if (typeof next !== \"undefined\")\n next.click()\n break\n }\n })\n\n/* Set up patches */\npatchIndeterminate({ document$, tablet$ })\npatchScrollfix({ document$ })\npatchScrolllock({ viewport$, tablet$ })\n\n/* Set up header and main area observable */\nconst header$ = watchHeader(getComponentElement(\"header\"), { viewport$ })\nconst main$ = document$\n .pipe(\n map(() => getComponentElement(\"main\")),\n switchMap(el => watchMain(el, { viewport$, header$ })),\n shareReplay(1)\n )\n\n/* Set up control component observables */\nconst control$ = merge(\n\n /* Dialog */\n ...getComponentElements(\"dialog\")\n .map(el => mountDialog(el, { alert$ })),\n\n /* Header */\n ...getComponentElements(\"header\")\n .map(el => mountHeader(el, { viewport$, header$, main$ })),\n\n /* Color palette */\n ...getComponentElements(\"palette\")\n .map(el => mountPalette(el)),\n\n /* Search */\n ...getComponentElements(\"search\")\n .map(el => mountSearch(el, { index$, keyboard$ })),\n\n /* Repository information */\n ...getComponentElements(\"source\")\n .map(el => mountSource(el))\n)\n\n/* Set up content component observables */\nconst content$ = defer(() => merge(\n\n /* Content */\n ...getComponentElements(\"content\")\n .map(el => mountContent(el, { target$, print$ })),\n\n /* Search highlighting */\n ...getComponentElements(\"content\")\n .map(el => feature(\"search.highlight\")\n ? mountSearchHiglight(el, { index$, location$ })\n : EMPTY\n ),\n\n /* Header title */\n ...getComponentElements(\"header-title\")\n .map(el => mountHeaderTitle(el, { viewport$, header$ })),\n\n /* Sidebar */\n ...getComponentElements(\"sidebar\")\n .map(el => el.getAttribute(\"data-md-type\") === \"navigation\"\n ? at(screen$, () => mountSidebar(el, { viewport$, header$, main$ }))\n : at(tablet$, () => mountSidebar(el, { viewport$, header$, main$ }))\n ),\n\n /* Navigation tabs */\n ...getComponentElements(\"tabs\")\n .map(el => mountTabs(el, { viewport$, header$ })),\n\n /* Table of contents */\n ...getComponentElements(\"toc\")\n .map(el => mountTableOfContents(el, { viewport$, header$, target$ })),\n\n /* Back-to-top button */\n ...getComponentElements(\"top\")\n .map(el => mountBackToTop(el, { viewport$, header$, main$, target$ }))\n))\n\n/* Set up component observables */\nconst component$ = document$\n .pipe(\n switchMap(() => content$),\n mergeWith(control$),\n shareReplay(1)\n )\n\n/* Subscribe to all components */\ncomponent$.subscribe()\n\n/* ----------------------------------------------------------------------------\n * Exports\n * ------------------------------------------------------------------------- */\n\nwindow.document$ = document$ /* Document observable */\nwindow.location$ = location$ /* Location subject */\nwindow.target$ = target$ /* Location target observable */\nwindow.keyboard$ = keyboard$ /* Keyboard observable */\nwindow.viewport$ = viewport$ /* Viewport observable */\nwindow.tablet$ = tablet$ /* Media tablet observable */\nwindow.screen$ = screen$ /* Media screen observable */\nwindow.print$ = print$ /* Media print observable */\nwindow.alert$ = alert$ /* Alert subject */\nwindow.component$ = component$ /* Component observable */\n", "self.fetch||(self.fetch=function(e,n){return n=n||{},new Promise(function(t,s){var r=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(r.status/100|0),statusText:r.statusText,status:r.status,url:r.responseURL,text:function(){return Promise.resolve(r.responseText)},json:function(){return Promise.resolve(r.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([r.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var c in r.open(n.method||\"get\",e,!0),r.onload=function(){r.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+\",\"+t:t}),t(a())},r.onerror=s,r.withCredentials=\"include\"==n.credentials,n.headers)r.setRequestHeader(c,n.headers[c]);r.send(n.body||null)})});\n", "import tslib from '../tslib.js';\r\nconst {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n} = tslib;\r\nexport {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n};\r\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n ReplaySubject,\n Subject,\n fromEvent\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch document\n *\n * Documents are implemented as subjects, so all downstream observables are\n * automatically updated when a new document is emitted.\n *\n * @returns Document subject\n */\nexport function watchDocument(): Subject {\n const document$ = new ReplaySubject(1)\n fromEvent(document, \"DOMContentLoaded\", { once: true })\n .subscribe(() => document$.next(document))\n\n /* Return document */\n return document$\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve all elements matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Elements\n */\nexport function getElements(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T][]\n\nexport function getElements(\n selector: string, node?: ParentNode\n): T[]\n\nexport function getElements(\n selector: string, node: ParentNode = document\n): T[] {\n return Array.from(node.querySelectorAll(selector))\n}\n\n/**\n * Retrieve an element matching a query selector or throw a reference error\n *\n * Note that this function assumes that the element is present. If unsure if an\n * element is existent, use the `getOptionalElement` function instead.\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Element\n */\nexport function getElement(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T]\n\nexport function getElement(\n selector: string, node?: ParentNode\n): T\n\nexport function getElement(\n selector: string, node: ParentNode = document\n): T {\n const el = getOptionalElement(selector, node)\n if (typeof el === \"undefined\")\n throw new ReferenceError(\n `Missing element: expected \"${selector}\" to be present`\n )\n\n /* Return element */\n return el\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Retrieve an optional element matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Element or nothing\n */\nexport function getOptionalElement(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T] | undefined\n\nexport function getOptionalElement(\n selector: string, node?: ParentNode\n): T | undefined\n\nexport function getOptionalElement(\n selector: string, node: ParentNode = document\n): T | undefined {\n return node.querySelector(selector) || undefined\n}\n\n/**\n * Retrieve the currently active element\n *\n * @returns Element or nothing\n */\nexport function getActiveElement(): HTMLElement | undefined {\n return document.activeElement instanceof HTMLElement\n ? document.activeElement || undefined\n : undefined\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n debounceTime,\n distinctUntilChanged,\n fromEvent,\n map,\n merge,\n startWith\n} from \"rxjs\"\n\nimport { getActiveElement } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch element focus\n *\n * Previously, this function used `focus` and `blur` events to determine whether\n * an element is focused, but this doesn't work if there are focusable elements\n * within the elements itself. A better solutions are `focusin` and `focusout`\n * events, which bubble up the tree and allow for more fine-grained control.\n *\n * `debounceTime` is necessary, because when a focus change happens inside an\n * element, the observable would first emit `false` and then `true` again.\n *\n * @param el - Element\n *\n * @returns Element focus observable\n */\nexport function watchElementFocus(\n el: HTMLElement\n): Observable {\n return merge(\n fromEvent(document.body, \"focusin\"),\n fromEvent(document.body, \"focusout\")\n )\n .pipe(\n debounceTime(1),\n map(() => {\n const active = getActiveElement()\n return typeof active !== \"undefined\"\n ? el.contains(active)\n : false\n }),\n startWith(el === getActiveElement()),\n distinctUntilChanged()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n animationFrameScheduler,\n auditTime,\n fromEvent,\n map,\n merge,\n startWith\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementOffset {\n x: number /* Horizontal offset */\n y: number /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element offset\n *\n * @param el - Element\n *\n * @returns Element offset\n */\nexport function getElementOffset(\n el: HTMLElement\n): ElementOffset {\n return {\n x: el.offsetLeft,\n y: el.offsetTop\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element offset\n *\n * @param el - Element\n *\n * @returns Element offset observable\n */\nexport function watchElementOffset(\n el: HTMLElement\n): Observable {\n return merge(\n fromEvent(window, \"load\"),\n fromEvent(window, \"resize\")\n )\n .pipe(\n auditTime(0, animationFrameScheduler),\n map(() => getElementOffset(el)),\n startWith(getElementOffset(el))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n animationFrameScheduler,\n auditTime,\n fromEvent,\n map,\n merge,\n startWith\n} from \"rxjs\"\n\nimport { ElementOffset } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element content offset (= scroll offset)\n *\n * @param el - Element\n *\n * @returns Element content offset\n */\nexport function getElementContentOffset(\n el: HTMLElement\n): ElementOffset {\n return {\n x: el.scrollLeft,\n y: el.scrollTop\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element content offset\n *\n * @param el - Element\n *\n * @returns Element content offset observable\n */\nexport function watchElementContentOffset(\n el: HTMLElement\n): Observable {\n return merge(\n fromEvent(el, \"scroll\"),\n fromEvent(window, \"resize\")\n )\n .pipe(\n auditTime(0, animationFrameScheduler),\n map(() => getElementContentOffset(el)),\n startWith(getElementContentOffset(el))\n )\n}\n", "/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport ResizeObserver from \"resize-observer-polyfill\"\nimport {\n NEVER,\n Observable,\n Subject,\n defer,\n filter,\n finalize,\n map,\n merge,\n of,\n shareReplay,\n startWith,\n switchMap,\n tap\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Element offset\n */\nexport interface ElementSize {\n width: number /* Element width */\n height: number /* Element height */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Resize observer entry subject\n */\nconst entry$ = new Subject()\n\n/**\n * Resize observer observable\n *\n * This observable will create a `ResizeObserver` on the first subscription\n * and will automatically terminate it when there are no more subscribers.\n * It's quite important to centralize observation in a single `ResizeObserver`,\n * as the performance difference can be quite dramatic, as the link shows.\n *\n * @see https://bit.ly/3iIYfEm - Google Groups on performance\n */\nconst observer$ = defer(() => of(\n new ResizeObserver(entries => {\n for (const entry of entries)\n entry$.next(entry)\n })\n))\n .pipe(\n switchMap(observer => merge(NEVER, of(observer))\n .pipe(\n finalize(() => observer.disconnect())\n )\n ),\n shareReplay(1)\n )\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element size\n *\n * @param el - Element\n *\n * @returns Element size\n */\nexport function getElementSize(\n el: HTMLElement\n): ElementSize {\n return {\n width: el.offsetWidth,\n height: el.offsetHeight\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch element size\n *\n * This function returns an observable that subscribes to a single internal\n * instance of `ResizeObserver` upon subscription, and emit resize events until\n * termination. Note that this function should not be called with the same\n * element twice, as the first unsubscription will terminate observation.\n *\n * Sadly, we can't use the `DOMRect` objects returned by the observer, because\n * we need the emitted values to be consistent with `getElementSize`, which will\n * return the used values (rounded) and not actual values (unrounded). Thus, we\n * use the `offset*` properties. See the linked GitHub issue.\n *\n * @see https://bit.ly/3m0k3he - GitHub issue\n *\n * @param el - Element\n *\n * @returns Element size observable\n */\nexport function watchElementSize(\n el: HTMLElement\n): Observable {\n return observer$\n .pipe(\n tap(observer => observer.observe(el)),\n switchMap(observer => entry$\n .pipe(\n filter(({ target }) => target === el),\n finalize(() => observer.unobserve(el)),\n map(() => getElementSize(el))\n )\n ),\n startWith(getElementSize(el))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ElementSize } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve element content size (= scroll width and height)\n *\n * @param el - Element\n *\n * @returns Element content size\n */\nexport function getElementContentSize(\n el: HTMLElement\n): ElementSize {\n return {\n width: el.scrollWidth,\n height: el.scrollHeight\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n NEVER,\n Observable,\n Subject,\n defer,\n distinctUntilChanged,\n filter,\n finalize,\n map,\n merge,\n of,\n shareReplay,\n switchMap,\n tap\n} from \"rxjs\"\n\nimport {\n getElementContentSize,\n getElementSize,\n watchElementContentOffset\n} from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Intersection observer entry subject\n */\nconst entry$ = new Subject()\n\n/**\n * Intersection observer observable\n *\n * This observable will create an `IntersectionObserver` on first subscription\n * and will automatically terminate it when there are no more subscribers.\n *\n * @see https://bit.ly/3iIYfEm - Google Groups on performance\n */\nconst observer$ = defer(() => of(\n new IntersectionObserver(entries => {\n for (const entry of entries)\n entry$.next(entry)\n }, {\n threshold: 0\n })\n))\n .pipe(\n switchMap(observer => merge(NEVER, of(observer))\n .pipe(\n finalize(() => observer.disconnect())\n )\n ),\n shareReplay(1)\n )\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch element visibility\n *\n * @param el - Element\n *\n * @returns Element visibility observable\n */\nexport function watchElementVisibility(\n el: HTMLElement\n): Observable {\n return observer$\n .pipe(\n tap(observer => observer.observe(el)),\n switchMap(observer => entry$\n .pipe(\n filter(({ target }) => target === el),\n finalize(() => observer.unobserve(el)),\n map(({ isIntersecting }) => isIntersecting)\n )\n )\n )\n}\n\n/**\n * Watch element boundary\n *\n * This function returns an observable which emits whether the bottom content\n * boundary (= scroll offset) of an element is within a certain threshold.\n *\n * @param el - Element\n * @param threshold - Threshold\n *\n * @returns Element boundary observable\n */\nexport function watchElementBoundary(\n el: HTMLElement, threshold = 16\n): Observable {\n return watchElementContentOffset(el)\n .pipe(\n map(({ y }) => {\n const visible = getElementSize(el)\n const content = getElementContentSize(el)\n return y >= (\n content.height - visible.height - threshold\n )\n }),\n distinctUntilChanged()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n fromEvent,\n map,\n startWith\n} from \"rxjs\"\n\nimport { getElement } from \"../element\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle\n */\nexport type Toggle =\n | \"drawer\" /* Toggle for drawer */\n | \"search\" /* Toggle for search */\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Toggle map\n */\nconst toggles: Record = {\n drawer: getElement(\"[data-md-toggle=drawer]\"),\n search: getElement(\"[data-md-toggle=search]\")\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve the value of a toggle\n *\n * @param name - Toggle\n *\n * @returns Toggle value\n */\nexport function getToggle(name: Toggle): boolean {\n return toggles[name].checked\n}\n\n/**\n * Set toggle\n *\n * Simulating a click event seems to be the most cross-browser compatible way\n * of changing the value while also emitting a `change` event. Before, Material\n * used `CustomEvent` to programmatically change the value of a toggle, but this\n * is a much simpler and cleaner solution which doesn't require a polyfill.\n *\n * @param name - Toggle\n * @param value - Toggle value\n */\nexport function setToggle(name: Toggle, value: boolean): void {\n if (toggles[name].checked !== value)\n toggles[name].click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch toggle\n *\n * @param name - Toggle\n *\n * @returns Toggle value observable\n */\nexport function watchToggle(name: Toggle): Observable {\n const el = toggles[name]\n return fromEvent(el, \"change\")\n .pipe(\n map(() => el.checked),\n startWith(el.checked)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n filter,\n fromEvent,\n map,\n share\n} from \"rxjs\"\n\nimport { getActiveElement } from \"../element\"\nimport { getToggle } from \"../toggle\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Keyboard mode\n */\nexport type KeyboardMode =\n | \"global\" /* Global */\n | \"search\" /* Search is open */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Keyboard\n */\nexport interface Keyboard {\n mode: KeyboardMode /* Keyboard mode */\n type: string /* Key type */\n claim(): void /* Key claim */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Check whether an element may receive keyboard input\n *\n * @param el - Element\n * @param type - Key type\n *\n * @returns Test result\n */\nfunction isSusceptibleToKeyboard(\n el: HTMLElement, type: string\n): boolean {\n switch (el.constructor) {\n\n /* Input elements */\n case HTMLInputElement:\n /* @ts-expect-error - omit unnecessary type cast */\n if (el.type === \"radio\")\n return /^Arrow/.test(type)\n else\n return true\n\n /* Select element and textarea */\n case HTMLSelectElement:\n case HTMLTextAreaElement:\n return true\n\n /* Everything else */\n default:\n return el.isContentEditable\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch keyboard\n *\n * @returns Keyboard observable\n */\nexport function watchKeyboard(): Observable {\n return fromEvent(window, \"keydown\")\n .pipe(\n filter(ev => !(ev.metaKey || ev.ctrlKey)),\n map(ev => ({\n mode: getToggle(\"search\") ? \"search\" : \"global\",\n type: ev.key,\n claim() {\n ev.preventDefault()\n ev.stopPropagation()\n }\n } as Keyboard)),\n filter(({ mode, type }) => {\n if (mode === \"global\") {\n const active = getActiveElement()\n if (typeof active !== \"undefined\")\n return !isSusceptibleToKeyboard(active, type)\n }\n return true\n }),\n share()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Subject } from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve location\n *\n * This function returns a `URL` object (and not `Location`) to normalize the\n * typings across the application. Furthermore, locations need to be tracked\n * without setting them and `Location` is a singleton which represents the\n * current location.\n *\n * @returns URL\n */\nexport function getLocation(): URL {\n return new URL(location.href)\n}\n\n/**\n * Set location\n *\n * @param url - URL to change to\n */\nexport function setLocation(url: URL): void {\n location.href = url.href\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location\n *\n * @returns Location subject\n */\nexport function watchLocation(): Subject {\n return new Subject()\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { JSX as JSXInternal } from \"preact\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * HTML attributes\n */\ntype Attributes =\n & JSXInternal.HTMLAttributes\n & JSXInternal.SVGAttributes\n & Record\n\n/**\n * Child element\n */\ntype Child =\n | HTMLElement\n | Text\n | string\n | number\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Append a child node to an element\n *\n * @param el - Element\n * @param child - Child node(s)\n */\nfunction appendChild(el: HTMLElement, child: Child | Child[]): void {\n\n /* Handle primitive types (including raw HTML) */\n if (typeof child === \"string\" || typeof child === \"number\") {\n el.innerHTML += child.toString()\n\n /* Handle nodes */\n } else if (child instanceof Node) {\n el.appendChild(child)\n\n /* Handle nested children */\n } else if (Array.isArray(child)) {\n for (const node of child)\n appendChild(el, node)\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * JSX factory\n *\n * @template T - Element type\n *\n * @param tag - HTML tag\n * @param attributes - HTML attributes\n * @param children - Child elements\n *\n * @returns Element\n */\nexport function h(\n tag: T, attributes?: Attributes | null, ...children: Child[]\n): HTMLElementTagNameMap[T]\n\nexport function h(\n tag: string, attributes?: Attributes | null, ...children: Child[]\n): T\n\nexport function h(\n tag: string, attributes?: Attributes | null, ...children: Child[]\n): T {\n const el = document.createElement(tag)\n\n /* Set attributes, if any */\n if (attributes)\n for (const attr of Object.keys(attributes)) {\n if (typeof attributes[attr] === \"undefined\")\n continue\n\n /* Set default attribute or boolean */\n if (typeof attributes[attr] !== \"boolean\")\n el.setAttribute(attr, attributes[attr])\n else\n el.setAttribute(attr, \"\")\n }\n\n /* Append child nodes */\n for (const child of children)\n appendChild(el, child)\n\n /* Return element */\n return el as T\n}\n\n/* ----------------------------------------------------------------------------\n * Namespace\n * ------------------------------------------------------------------------- */\n\nexport declare namespace h {\n namespace JSX {\n type Element = HTMLElement\n type IntrinsicElements = JSXInternal.IntrinsicElements\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Truncate a string after the given number of characters\n *\n * This is not a very reasonable approach, since the summaries kind of suck.\n * It would be better to create something more intelligent, highlighting the\n * search occurrences and making a better summary out of it, but this note was\n * written three years ago, so who knows if we'll ever fix it.\n *\n * @param value - Value to be truncated\n * @param n - Number of characters\n *\n * @returns Truncated value\n */\nexport function truncate(value: string, n: number): string {\n let i = n\n if (value.length > i) {\n while (value[i] !== \" \" && --i > 0) { /* keep eating */ }\n return `${value.substring(0, i)}...`\n }\n return value\n}\n\n/**\n * Round a number for display with repository facts\n *\n * This is a reverse-engineered version of GitHub's weird rounding algorithm\n * for stars, forks and all other numbers. While all numbers below `1,000` are\n * returned as-is, bigger numbers are converted to fixed numbers:\n *\n * - `1,049` => `1k`\n * - `1,050` => `1.1k`\n * - `1,949` => `1.9k`\n * - `1,950` => `2k`\n *\n * @param value - Original value\n *\n * @returns Rounded value\n */\nexport function round(value: number): string {\n if (value > 999) {\n const digits = +((value - 950) % 1000 > 99)\n return `${((value + 0.000001) / 1000).toFixed(digits)}k`\n } else {\n return value.toString()\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n filter,\n fromEvent,\n map,\n shareReplay,\n startWith\n} from \"rxjs\"\n\nimport { getOptionalElement } from \"~/browser\"\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve location hash\n *\n * @returns Location hash\n */\nexport function getLocationHash(): string {\n return location.hash.substring(1)\n}\n\n/**\n * Set location hash\n *\n * Setting a new fragment identifier via `location.hash` will have no effect\n * if the value doesn't change. When a new fragment identifier is set, we want\n * the browser to target the respective element at all times, which is why we\n * use this dirty little trick.\n *\n * @param hash - Location hash\n */\nexport function setLocationHash(hash: string): void {\n const el = h(\"a\", { href: hash })\n el.addEventListener(\"click\", ev => ev.stopPropagation())\n el.click()\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch location hash\n *\n * @returns Location hash observable\n */\nexport function watchLocationHash(): Observable {\n return fromEvent(window, \"hashchange\")\n .pipe(\n map(getLocationHash),\n startWith(getLocationHash()),\n filter(hash => hash.length > 0),\n shareReplay(1)\n )\n}\n\n/**\n * Watch location target\n *\n * @returns Location target observable\n */\nexport function watchLocationTarget(): Observable {\n return watchLocationHash()\n .pipe(\n map(id => getOptionalElement(`[id=\"${id}\"]`)!),\n filter(el => typeof el !== \"undefined\")\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n fromEvent,\n fromEventPattern,\n map,\n merge,\n startWith,\n switchMap\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch media query\n *\n * Note that although `MediaQueryList.addListener` is deprecated we have to\n * use it, because it's the only way to ensure proper downward compatibility.\n *\n * @see https://bit.ly/3dUBH2m - GitHub issue\n *\n * @param query - Media query\n *\n * @returns Media observable\n */\nexport function watchMedia(query: string): Observable {\n const media = matchMedia(query)\n return fromEventPattern(next => (\n media.addListener(() => next(media.matches))\n ))\n .pipe(\n startWith(media.matches)\n )\n}\n\n/**\n * Watch print mode\n *\n * @returns Print observable\n */\nexport function watchPrint(): Observable {\n const media = matchMedia(\"print\")\n return merge(\n fromEvent(window, \"beforeprint\").pipe(map(() => true)),\n fromEvent(window, \"afterprint\").pipe(map(() => false))\n )\n .pipe(\n startWith(media.matches)\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Toggle an observable with a media observable\n *\n * @template T - Data type\n *\n * @param query$ - Media observable\n * @param factory - Observable factory\n *\n * @returns Toggled observable\n */\nexport function at(\n query$: Observable, factory: () => Observable\n): Observable {\n return query$\n .pipe(\n switchMap(active => active ? factory() : EMPTY)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n catchError,\n from,\n map,\n of,\n shareReplay,\n switchMap,\n throwError\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch the given URL\n *\n * If the request fails (e.g. when dispatched from `file://` locations), the\n * observable will complete without emitting a value.\n *\n * @param url - Request URL\n * @param options - Options\n *\n * @returns Response observable\n */\nexport function request(\n url: URL | string, options: RequestInit = { credentials: \"same-origin\" }\n): Observable {\n return from(fetch(`${url}`, options))\n .pipe(\n catchError(() => EMPTY),\n switchMap(res => res.status !== 200\n ? throwError(() => new Error(res.statusText))\n : of(res)\n )\n )\n}\n\n/**\n * Fetch JSON from the given URL\n *\n * @template T - Data type\n *\n * @param url - Request URL\n * @param options - Options\n *\n * @returns Data observable\n */\nexport function requestJSON(\n url: URL | string, options?: RequestInit\n): Observable {\n return request(url, options)\n .pipe(\n switchMap(res => res.json()),\n shareReplay(1)\n )\n}\n\n/**\n * Fetch XML from the given URL\n *\n * @param url - Request URL\n * @param options - Options\n *\n * @returns Data observable\n */\nexport function requestXML(\n url: URL | string, options?: RequestInit\n): Observable {\n const dom = new DOMParser()\n return request(url, options)\n .pipe(\n switchMap(res => res.text()),\n map(res => dom.parseFromString(res, \"text/xml\")),\n shareReplay(1)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n defer,\n finalize,\n fromEvent,\n map,\n merge,\n switchMap,\n take,\n throwError\n} from \"rxjs\"\n\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create and load a `script` element\n *\n * This function returns an observable that will emit when the script was\n * successfully loaded, or throw an error if it didn't.\n *\n * @param src - Script URL\n *\n * @returns Script observable\n */\nexport function watchScript(src: string): Observable {\n const script = h(\"script\", { src })\n return defer(() => {\n document.head.appendChild(script)\n return merge(\n fromEvent(script, \"load\"),\n fromEvent(script, \"error\")\n .pipe(\n switchMap(() => (\n throwError(() => new ReferenceError(`Invalid script: ${src}`))\n ))\n )\n )\n .pipe(\n map(() => undefined),\n finalize(() => document.head.removeChild(script)),\n take(1)\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n fromEvent,\n map,\n merge,\n startWith\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport offset\n */\nexport interface ViewportOffset {\n x: number /* Horizontal offset */\n y: number /* Vertical offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport offset\n *\n * On iOS Safari, viewport offset can be negative due to overflow scrolling.\n * As this may induce strange behaviors downstream, we'll just limit it to 0.\n *\n * @returns Viewport offset\n */\nexport function getViewportOffset(): ViewportOffset {\n return {\n x: Math.max(0, scrollX),\n y: Math.max(0, scrollY)\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport offset\n *\n * @returns Viewport offset observable\n */\nexport function watchViewportOffset(): Observable {\n return merge(\n fromEvent(window, \"scroll\", { passive: true }),\n fromEvent(window, \"resize\", { passive: true })\n )\n .pipe(\n map(getViewportOffset),\n startWith(getViewportOffset())\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n fromEvent,\n map,\n startWith\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport size\n */\nexport interface ViewportSize {\n width: number /* Viewport width */\n height: number /* Viewport height */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve viewport size\n *\n * @returns Viewport size\n */\nexport function getViewportSize(): ViewportSize {\n return {\n width: innerWidth,\n height: innerHeight\n }\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport size\n *\n * @returns Viewport size observable\n */\nexport function watchViewportSize(): Observable {\n return fromEvent(window, \"resize\", { passive: true })\n .pipe(\n map(getViewportSize),\n startWith(getViewportSize())\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n combineLatest,\n map,\n shareReplay\n} from \"rxjs\"\n\nimport {\n ViewportOffset,\n watchViewportOffset\n} from \"../offset\"\nimport {\n ViewportSize,\n watchViewportSize\n} from \"../size\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Viewport\n */\nexport interface Viewport {\n offset: ViewportOffset /* Viewport offset */\n size: ViewportSize /* Viewport size */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport\n *\n * @returns Viewport observable\n */\nexport function watchViewport(): Observable {\n return combineLatest([\n watchViewportOffset(),\n watchViewportSize()\n ])\n .pipe(\n map(([offset, size]) => ({ offset, size })),\n shareReplay(1)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n combineLatest,\n distinctUntilKeyChanged,\n map\n} from \"rxjs\"\n\nimport { Header } from \"~/components\"\n\nimport { getElementOffset } from \"../../element\"\nimport { Viewport } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
/* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch viewport relative to element\n *\n * @param el - Element\n * @param options - Options\n *\n * @returns Viewport observable\n */\nexport function watchViewportAt(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable {\n const size$ = viewport$\n .pipe(\n distinctUntilKeyChanged(\"size\")\n )\n\n /* Compute element offset */\n const offset$ = combineLatest([size$, header$])\n .pipe(\n map(() => getElementOffset(el))\n )\n\n /* Compute relative viewport, return hot observable */\n return combineLatest([header$, viewport$, offset$])\n .pipe(\n map(([{ height }, { offset, size }, { x, y }]) => ({\n offset: {\n x: offset.x - x,\n y: offset.y - y + height\n },\n size\n }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n fromEvent,\n map,\n share,\n switchMap,\n tap,\n throttle\n} from \"rxjs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Worker message\n */\nexport interface WorkerMessage {\n type: unknown /* Message type */\n data?: unknown /* Message data */\n}\n\n/**\n * Worker handler\n *\n * @template T - Message type\n */\nexport interface WorkerHandler<\n T extends WorkerMessage\n> {\n tx$: Subject /* Message transmission subject */\n rx$: Observable /* Message receive observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n *\n * @template T - Worker message type\n */\ninterface WatchOptions {\n tx$: Observable /* Message transmission observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch a web worker\n *\n * This function returns an observable that sends all values emitted by the\n * message observable to the web worker. Web worker communication is expected\n * to be bidirectional (request-response) and synchronous. Messages that are\n * emitted during a pending request are throttled, the last one is emitted.\n *\n * @param worker - Web worker\n * @param options - Options\n *\n * @returns Worker message observable\n */\nexport function watchWorker(\n worker: Worker, { tx$ }: WatchOptions\n): Observable {\n\n /* Intercept messages from worker-like objects */\n const rx$ = fromEvent(worker, \"message\")\n .pipe(\n map(({ data }) => data as T)\n )\n\n /* Send and receive messages, return hot observable */\n return tx$\n .pipe(\n throttle(() => rx$, { leading: true, trailing: true }),\n tap(message => worker.postMessage(message)),\n switchMap(() => rx$),\n share()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getElement, getLocation } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Feature flag\n */\nexport type Flag =\n | \"content.code.annotate\" /* Code annotations */\n | \"content.tabs.link\" /* Link content tabs */\n | \"header.autohide\" /* Hide header */\n | \"navigation.expand\" /* Automatic expansion */\n | \"navigation.indexes\" /* Section pages */\n | \"navigation.instant\" /* Instant loading */\n | \"navigation.sections\" /* Section navigation */\n | \"navigation.tabs\" /* Tabs navigation */\n | \"navigation.tabs.sticky\" /* Tabs navigation (sticky) */\n | \"navigation.top\" /* Back-to-top button */\n | \"navigation.tracking\" /* Anchor tracking */\n | \"search.highlight\" /* Search highlighting */\n | \"search.share\" /* Search sharing */\n | \"search.suggest\" /* Search suggestions */\n | \"toc.integrate\" /* Integrated table of contents */\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Translation\n */\nexport type Translation =\n | \"clipboard.copy\" /* Copy to clipboard */\n | \"clipboard.copied\" /* Copied to clipboard */\n | \"search.config.lang\" /* Search language */\n | \"search.config.pipeline\" /* Search pipeline */\n | \"search.config.separator\" /* Search separator */\n | \"search.placeholder\" /* Search */\n | \"search.result.placeholder\" /* Type to start searching */\n | \"search.result.none\" /* No matching documents */\n | \"search.result.one\" /* 1 matching document */\n | \"search.result.other\" /* # matching documents */\n | \"search.result.more.one\" /* 1 more on this page */\n | \"search.result.more.other\" /* # more on this page */\n | \"search.result.term.missing\" /* Missing */\n | \"select.version.title\" /* Version selector */\n\n/**\n * Translations\n */\nexport type Translations = Record\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Versioning\n */\nexport interface Versioning {\n provider: \"mike\" /* Version provider */\n default?: string /* Default version */\n}\n\n/**\n * Configuration\n */\nexport interface Config {\n base: string /* Base URL */\n features: Flag[] /* Feature flags */\n translations: Translations /* Translations */\n search: string /* Search worker URL */\n version?: Versioning /* Versioning */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve global configuration and make base URL absolute\n */\nconst script = getElement(\"#__config\")\nconst config: Config = JSON.parse(script.textContent!)\nconfig.base = `${new URL(config.base, getLocation())}`\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve global configuration\n *\n * @returns Global configuration\n */\nexport function configuration(): Config {\n return config\n}\n\n/**\n * Check whether a feature flag is enabled\n *\n * @param flag - Feature flag\n *\n * @returns Test result\n */\nexport function feature(flag: Flag): boolean {\n return config.features.includes(flag)\n}\n\n/**\n * Retrieve the translation for the given key\n *\n * @param key - Key to be translated\n * @param value - Positional value, if any\n *\n * @returns Translation\n */\nexport function translation(\n key: Translation, value?: string | number\n): string {\n return typeof value !== \"undefined\"\n ? config.translations[key].replace(\"#\", value.toString())\n : config.translations[key]\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { getElement, getElements } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Component type\n */\nexport type ComponentType =\n | \"announce\" /* Announcement bar */\n | \"container\" /* Container */\n | \"content\" /* Content */\n | \"dialog\" /* Dialog */\n | \"header\" /* Header */\n | \"header-title\" /* Header title */\n | \"header-topic\" /* Header topic */\n | \"main\" /* Main area */\n | \"outdated\" /* Version warning */\n | \"palette\" /* Color palette */\n | \"search\" /* Search */\n | \"search-query\" /* Search input */\n | \"search-result\" /* Search results */\n | \"search-share\" /* Search sharing */\n | \"search-suggest\" /* Search suggestions */\n | \"sidebar\" /* Sidebar */\n | \"skip\" /* Skip link */\n | \"source\" /* Repository information */\n | \"tabs\" /* Navigation tabs */\n | \"toc\" /* Table of contents */\n | \"top\" /* Back-to-top button */\n\n/**\n * Component\n *\n * @template T - Component type\n * @template U - Reference type\n */\nexport type Component<\n T extends {} = {},\n U extends HTMLElement = HTMLElement\n> =\n T & {\n ref: U /* Component reference */\n }\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Component type map\n */\ninterface ComponentTypeMap {\n \"announce\": HTMLElement /* Announcement bar */\n \"container\": HTMLElement /* Container */\n \"content\": HTMLElement /* Content */\n \"dialog\": HTMLElement /* Dialog */\n \"header\": HTMLElement /* Header */\n \"header-title\": HTMLElement /* Header title */\n \"header-topic\": HTMLElement /* Header topic */\n \"main\": HTMLElement /* Main area */\n \"outdated\": HTMLElement /* Version warning */\n \"palette\": HTMLElement /* Color palette */\n \"search\": HTMLElement /* Search */\n \"search-query\": HTMLInputElement /* Search input */\n \"search-result\": HTMLElement /* Search results */\n \"search-share\": HTMLAnchorElement /* Search sharing */\n \"search-suggest\": HTMLElement /* Search suggestions */\n \"sidebar\": HTMLElement /* Sidebar */\n \"skip\": HTMLAnchorElement /* Skip link */\n \"source\": HTMLAnchorElement /* Repository information */\n \"tabs\": HTMLElement /* Navigation tabs */\n \"toc\": HTMLElement /* Table of contents */\n \"top\": HTMLAnchorElement /* Back-to-top button */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve the element for a given component or throw a reference error\n *\n * @template T - Component type\n *\n * @param type - Component type\n * @param node - Node of reference\n *\n * @returns Element\n */\nexport function getComponentElement(\n type: T, node: ParentNode = document\n): ComponentTypeMap[T] {\n return getElement(`[data-md-component=${type}]`, node)\n}\n\n/**\n * Retrieve all elements for a given component\n *\n * @template T - Component type\n *\n * @param type - Component type\n * @param node - Node of reference\n *\n * @returns Elements\n */\nexport function getComponentElements(\n type: T, node: ParentNode = document\n): ComponentTypeMap[T][] {\n return getElements(`[data-md-component=${type}]`, node)\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport ClipboardJS from \"clipboard\"\nimport {\n EMPTY,\n Observable,\n Subject,\n defer,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n filter,\n finalize,\n map,\n mergeWith,\n switchMap,\n take,\n takeLast,\n takeUntil,\n tap\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n getElementContentSize,\n watchElementSize,\n watchElementVisibility\n} from \"~/browser\"\nimport { renderClipboardButton } from \"~/templates\"\n\nimport { Component } from \"../../../_\"\nimport {\n Annotation,\n mountAnnotationList\n} from \"../../annotation\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Code block\n */\nexport interface CodeBlock {\n scrollable: boolean /* Code block overflows */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n print$: Observable /* Media print observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Global sequence number for Clipboard.js integration\n */\nlet sequence = 0\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Find candidate list element directly following a code block\n *\n * @param el - Code block element\n *\n * @returns List element or nothing\n */\nfunction findCandidateList(el: HTMLElement): HTMLElement | undefined {\n if (el.nextElementSibling) {\n const sibling = el.nextElementSibling as HTMLElement\n if (sibling.tagName === \"OL\")\n return sibling\n\n /* Skip empty paragraphs - see https://bit.ly/3r4ZJ2O */\n else if (sibling.tagName === \"P\" && !sibling.children.length)\n return findCandidateList(sibling)\n }\n\n /* Everything else */\n return undefined\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch code block\n *\n * This function monitors size changes of the viewport, as well as switches of\n * content tabs with embedded code blocks, as both may trigger overflow.\n *\n * @param el - Code block element\n *\n * @returns Code block observable\n */\nexport function watchCodeBlock(\n el: HTMLElement\n): Observable {\n return watchElementSize(el)\n .pipe(\n map(({ width }) => {\n const content = getElementContentSize(el)\n return {\n scrollable: content.width > width\n }\n }),\n distinctUntilKeyChanged(\"scrollable\")\n )\n}\n\n/**\n * Mount code block\n *\n * This function ensures that an overflowing code block is focusable through\n * keyboard, so it can be scrolled without a mouse to improve on accessibility.\n * Furthermore, if code annotations are enabled, they are mounted if and only\n * if the code block is currently visible, e.g., not in a hidden content tab.\n *\n * @param el - Code block element\n * @param options - Options\n *\n * @returns Code block and annotation component observable\n */\nexport function mountCodeBlock(\n el: HTMLElement, options: MountOptions\n): Observable> {\n const { matches: hover } = matchMedia(\"(hover)\")\n\n /* Defer mounting of code block - see https://bit.ly/3vHVoVD */\n const factory$ = defer(() => {\n const push$ = new Subject()\n push$.subscribe(({ scrollable }) => {\n if (scrollable && hover)\n el.setAttribute(\"tabindex\", \"0\")\n else\n el.removeAttribute(\"tabindex\")\n })\n\n /* Render button for Clipboard.js integration */\n if (ClipboardJS.isSupported()) {\n const parent = el.closest(\"pre\")!\n parent.id = `__code_${++sequence}`\n parent.insertBefore(\n renderClipboardButton(parent.id),\n el\n )\n }\n\n /* Handle code annotations */\n const container = el.closest(\".highlight\")\n if (container instanceof HTMLElement) {\n const list = findCandidateList(container)\n\n /* Mount code annotations, if enabled */\n if (typeof list !== \"undefined\" && (\n container.classList.contains(\"annotate\") ||\n feature(\"content.code.annotate\")\n )) {\n const annotations$ = mountAnnotationList(list, el, options)\n\n /* Create and return component */\n return watchCodeBlock(el)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state })),\n mergeWith(\n watchElementSize(container)\n .pipe(\n takeUntil(push$.pipe(takeLast(1))),\n map(({ width, height }) => width && height),\n distinctUntilChanged(),\n switchMap(active => active ? annotations$ : EMPTY)\n )\n )\n )\n }\n }\n\n /* Create and return component */\n return watchCodeBlock(el)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n\n /* Mount code block on first sight */\n return watchElementVisibility(el)\n .pipe(\n filter(visible => visible),\n take(1),\n switchMap(() => factory$)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render an empty annotation\n *\n * @param id - Annotation identifier\n *\n * @returns Element\n */\nexport function renderAnnotation(id: number): HTMLElement {\n return (\n \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { translation } from \"~/_\"\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a 'copy-to-clipboard' button\n *\n * @param id - Unique identifier\n *\n * @returns Element\n */\nexport function renderClipboardButton(id: string): HTMLElement {\n return (\n code`}\n >\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ComponentChild } from \"preact\"\n\nimport { feature, translation } from \"~/_\"\nimport {\n SearchDocument,\n SearchMetadata,\n SearchResultItem\n} from \"~/integrations/search\"\nimport { h, truncate } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Render flag\n */\nconst enum Flag {\n TEASER = 1, /* Render teaser */\n PARENT = 2 /* Render as parent */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper function\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a search document\n *\n * @param document - Search document\n * @param flag - Render flags\n *\n * @returns Element\n */\nfunction renderSearchDocument(\n document: SearchDocument & SearchMetadata, flag: Flag\n): HTMLElement {\n const parent = flag & Flag.PARENT\n const teaser = flag & Flag.TEASER\n\n /* Render missing query terms */\n const missing = Object.keys(document.terms)\n .filter(key => !document.terms[key])\n .reduce((list, key) => [\n ...list, {key}, \" \"\n ], [])\n .slice(0, -1)\n\n /* Assemble query string for highlighting */\n const url = new URL(document.location)\n if (feature(\"search.highlight\"))\n url.searchParams.set(\"h\", Object.entries(document.terms)\n .filter(([, match]) => match)\n .reduce((highlight, [value]) => `${highlight} ${value}`.trim(), \"\")\n )\n\n /* Render article or section, depending on flags */\n return (\n \n \n {parent > 0 &&
}\n

{document.title}

\n {teaser > 0 && document.text.length > 0 &&\n

\n {truncate(document.text, 320)}\n

\n }\n {document.tags && document.tags.map(tag => (\n {tag}\n ))}\n {teaser > 0 && missing.length > 0 &&\n

\n {translation(\"search.result.term.missing\")}: {...missing}\n

\n }\n \n
\n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a search result\n *\n * @param result - Search result\n *\n * @returns Element\n */\nexport function renderSearchResultItem(\n result: SearchResultItem\n): HTMLElement {\n const threshold = result[0].score\n const docs = [...result]\n\n /* Find and extract parent article */\n const parent = docs.findIndex(doc => !doc.location.includes(\"#\"))\n const [article] = docs.splice(parent, 1)\n\n /* Determine last index above threshold */\n let index = docs.findIndex(doc => doc.score < threshold)\n if (index === -1)\n index = docs.length\n\n /* Partition sections */\n const best = docs.slice(0, index)\n const more = docs.slice(index)\n\n /* Render children */\n const children = [\n renderSearchDocument(article, Flag.PARENT | +(!parent && index === 0)),\n ...best.map(section => renderSearchDocument(section, Flag.TEASER)),\n ...more.length ? [\n
\n \n {more.length > 0 && more.length === 1\n ? translation(\"search.result.more.one\")\n : translation(\"search.result.more.other\", more.length)\n }\n \n {...more.map(section => renderSearchDocument(section, Flag.TEASER))}\n
\n ] : []\n ]\n\n /* Render search result */\n return (\n
  • \n {children}\n
  • \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SourceFacts } from \"~/components\"\nimport { h, round } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render repository facts\n *\n * @param facts - Repository facts\n *\n * @returns Element\n */\nexport function renderSourceFacts(facts: SourceFacts): HTMLElement {\n return (\n
      \n {Object.entries(facts).map(([key, value]) => (\n
    • \n {typeof value === \"number\" ? round(value) : value}\n
    • \n ))}\n
    \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Tabbed control type\n */\ntype TabbedControlType =\n | \"prev\"\n | \"next\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render control for content tabs\n *\n * @param type - Control type\n *\n * @returns Element\n */\nexport function renderTabbedControl(\n type: TabbedControlType\n): HTMLElement {\n const classes = `tabbed-control tabbed-control--${type}`\n return (\n \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a table inside a wrapper to improve scrolling on mobile\n *\n * @param table - Table element\n *\n * @returns Element\n */\nexport function renderTable(table: HTMLElement): HTMLElement {\n return (\n
    \n
    \n {table}\n
    \n
    \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { configuration, translation } from \"~/_\"\nimport { h } from \"~/utilities\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Version\n */\nexport interface Version {\n version: string /* Version identifier */\n title: string /* Version title */\n aliases: string[] /* Version aliases */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a version\n *\n * @param version - Version\n *\n * @returns Element\n */\nfunction renderVersion(version: Version): HTMLElement {\n const config = configuration()\n\n /* Ensure trailing slash, see https://bit.ly/3rL5u3f */\n const url = new URL(`../${version.version}/`, config.base)\n return (\n
  • \n \n {version.title}\n \n
  • \n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Render a version selector\n *\n * @param versions - Versions\n * @param active - Active version\n *\n * @returns Element\n */\nexport function renderVersionSelector(\n versions: Version[], active: Version\n): HTMLElement {\n return (\n
    \n \n {active.title}\n \n
      \n {versions.map(renderVersion)}\n
    \n
    \n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n Subject,\n animationFrameScheduler,\n combineLatest,\n defer,\n finalize,\n fromEvent,\n map,\n switchMap,\n take,\n takeLast,\n takeUntil,\n tap,\n throttleTime\n} from \"rxjs\"\n\nimport {\n ElementOffset,\n getElement,\n getElementSize,\n watchElementContentOffset,\n watchElementFocus,\n watchElementOffset,\n watchElementVisibility\n} from \"~/browser\"\n\nimport { Component } from \"../../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Annotation\n */\nexport interface Annotation {\n active: boolean /* Annotation is active */\n offset: ElementOffset /* Annotation offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch annotation\n *\n * @param el - Annotation element\n * @param container - Containing element\n *\n * @returns Annotation observable\n */\nexport function watchAnnotation(\n el: HTMLElement, container: HTMLElement\n): Observable {\n const offset$ = defer(() => combineLatest([\n watchElementOffset(el),\n watchElementContentOffset(container)\n ]))\n .pipe(\n map(([{ x, y }, scroll]) => {\n const { width } = getElementSize(el)\n return ({\n x: x - scroll.x + width / 2,\n y: y - scroll.y\n })\n })\n )\n\n /* Actively watch annotation on focus */\n return watchElementFocus(el)\n .pipe(\n switchMap(active => offset$\n .pipe(\n map(offset => ({ active, offset })),\n take(+!active || Infinity)\n )\n )\n )\n}\n\n/**\n * Mount annotation\n *\n * @param el - Annotation element\n * @param container - Containing element\n *\n * @returns Annotation component observable\n */\nexport function mountAnnotation(\n el: HTMLElement, container: HTMLElement\n): Observable> {\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe({\n\n /* Handle emission */\n next({ offset }) {\n el.style.setProperty(\"--md-tooltip-x\", `${offset.x}px`)\n el.style.setProperty(\"--md-tooltip-y\", `${offset.y}px`)\n },\n\n /* Handle complete */\n complete() {\n el.style.removeProperty(\"--md-tooltip-x\")\n el.style.removeProperty(\"--md-tooltip-y\")\n }\n })\n\n /* Start animation only when annotation is visible */\n const done$ = push$.pipe(takeLast(1))\n watchElementVisibility(el)\n .pipe(\n takeUntil(done$)\n )\n .subscribe(visible => {\n el.toggleAttribute(\"data-md-visible\", visible)\n })\n\n /* Track relative origin of tooltip */\n push$\n .pipe(\n throttleTime(500, animationFrameScheduler),\n map(() => container.getBoundingClientRect()),\n map(({ x }) => x)\n )\n .subscribe({\n\n /* Handle emission */\n next(origin) {\n if (origin)\n el.style.setProperty(\"--md-tooltip-0\", `${-origin}px`)\n else\n el.style.removeProperty(\"--md-tooltip-0\")\n },\n\n /* Handle complete */\n complete() {\n el.style.removeProperty(\"--md-tooltip-0\")\n }\n })\n\n /* Close open annotation on click */\n const index = getElement(\":scope > :last-child\", el)\n const blur$ = fromEvent(index, \"mousedown\", { once: true })\n push$\n .pipe(\n switchMap(({ active }) => active ? blur$ : EMPTY),\n tap(ev => ev.preventDefault())\n )\n .subscribe(() => el.blur())\n\n /* Create and return component */\n return watchAnnotation(el, container)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n Subject,\n defer,\n finalize,\n merge,\n share,\n takeLast,\n takeUntil\n} from \"rxjs\"\n\nimport {\n getElement,\n getElements,\n getOptionalElement\n} from \"~/browser\"\nimport { renderAnnotation } from \"~/templates\"\n\nimport { Component } from \"../../../_\"\nimport {\n Annotation,\n mountAnnotation\n} from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n print$: Observable /* Media print observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Find all annotation markers in the given code block\n *\n * @param container - Containing element\n *\n * @returns Annotation markers\n */\nfunction findAnnotationMarkers(container: HTMLElement): Text[] {\n const markers: Text[] = []\n for (const comment of getElements(\".c, .c1, .cm\", container)) {\n let match: RegExpExecArray | null\n\n /* Split text at marker and add to list */\n let text = comment.firstChild as Text\n if (text instanceof Text)\n while ((match = /\\((\\d+)\\)/.exec(text.textContent!))) {\n const marker = text.splitText(match.index)\n text = marker.splitText(match[0].length)\n markers.push(marker)\n }\n }\n return markers\n}\n\n/**\n * Swap the child nodes of two elements\n *\n * @param source - Source element\n * @param target - Target element\n */\nfunction swap(source: HTMLElement, target: HTMLElement): void {\n target.append(...Array.from(source.childNodes))\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount annotation list\n *\n * This function analyzes the containing code block and checks for markers\n * referring to elements in the given annotation list. If no markers are found,\n * the list is left untouched. Otherwise, list elements are rendered as\n * annotations inside the code block.\n *\n * @param el - Annotation list element\n * @param container - Containing element\n * @param options - Options\n *\n * @returns Annotation component observable\n */\nexport function mountAnnotationList(\n el: HTMLElement, container: HTMLElement, { print$ }: MountOptions\n): Observable> {\n\n /* Find and replace all markers with empty annotations */\n const annotations = new Map()\n for (const marker of findAnnotationMarkers(container)) {\n const [, id] = marker.textContent!.match(/\\((\\d+)\\)/)!\n if (getOptionalElement(`li:nth-child(${id})`, el)) {\n annotations.set(+id, renderAnnotation(+id))\n marker.replaceWith(annotations.get(+id)!)\n }\n }\n\n /* Keep list if there are no annotations to render */\n if (annotations.size === 0)\n return EMPTY\n\n /* Create and return component */\n return defer(() => {\n const done$ = new Subject()\n\n /* Handle print mode - see https://bit.ly/3rgPdpt */\n print$\n .pipe(\n takeUntil(done$.pipe(takeLast(1)))\n )\n .subscribe(active => {\n el.hidden = !active\n\n /* Show annotations in code block or list (print) */\n for (const [id, annotation] of annotations) {\n const inner = getElement(\".md-typeset\", annotation)\n const child = getElement(`li:nth-child(${id})`, el)\n if (!active)\n swap(child, inner)\n else\n swap(inner, child)\n }\n })\n\n /* Create and return component */\n return merge(...[...annotations]\n .map(([, annotation]) => (\n mountAnnotation(annotation, container)\n ))\n )\n .pipe(\n finalize(() => done$.complete()),\n share()\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n map,\n of,\n shareReplay,\n tap\n} from \"rxjs\"\n\nimport { watchScript } from \"~/browser\"\nimport { h } from \"~/utilities\"\n\nimport { Component } from \"../../../_\"\n\nimport themeCSS from \"./index.css\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mermaid diagram\n */\nexport interface Mermaid {}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Mermaid instance observable\n */\nlet mermaid$: Observable\n\n/**\n * Global sequence number for diagrams\n */\nlet sequence = 0\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch Mermaid script\n *\n * @returns Mermaid scripts observable\n */\nfunction fetchScripts(): Observable {\n return typeof mermaid === \"undefined\" || mermaid instanceof Element\n ? watchScript(\"https://unpkg.com/mermaid@9.0.1/dist/mermaid.min.js\")\n : of(undefined)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount Mermaid diagram\n *\n * @param el - Code block element\n *\n * @returns Mermaid diagram component observable\n */\nexport function mountMermaid(\n el: HTMLElement\n): Observable> {\n el.classList.remove(\"mermaid\") // Hack: mitigate https://bit.ly/3CiN6Du\n mermaid$ ||= fetchScripts()\n .pipe(\n tap(() => mermaid.initialize({\n startOnLoad: false,\n themeCSS\n })),\n map(() => undefined),\n shareReplay(1)\n )\n\n /* Render diagram */\n mermaid$.subscribe(() => {\n el.classList.add(\"mermaid\") // Hack: mitigate https://bit.ly/3CiN6Du\n const id = `__mermaid_${sequence++}`\n const host = h(\"div\", { class: \"mermaid\" })\n mermaid.mermaidAPI.render(id, el.textContent, (svg: string) => {\n\n /* Create a shadow root and inject diagram */\n const shadow = host.attachShadow({ mode: \"closed\" })\n shadow.innerHTML = svg\n\n /* Replace code block with diagram */\n el.replaceWith(host)\n })\n })\n\n /* Create and return component */\n return mermaid$\n .pipe(\n map(() => ({ ref: el }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n defer,\n filter,\n finalize,\n map,\n merge,\n tap\n} from \"rxjs\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Details\n */\nexport interface Details {\n action: \"open\" | \"close\" /* Details state */\n reveal?: boolean /* Details is revealed */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n target$: Observable /* Location target observable */\n print$: Observable /* Media print observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n target$: Observable /* Location target observable */\n print$: Observable /* Media print observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch details\n *\n * @param el - Details element\n * @param options - Options\n *\n * @returns Details observable\n */\nexport function watchDetails(\n el: HTMLDetailsElement, { target$, print$ }: WatchOptions\n): Observable
    {\n let open = true\n return merge(\n\n /* Open and focus details on location target */\n target$\n .pipe(\n map(target => target.closest(\"details:not([open])\")!),\n filter(details => el === details),\n map(() => ({\n action: \"open\", reveal: true\n }) as Details)\n ),\n\n /* Open details on print and close afterwards */\n print$\n .pipe(\n filter(active => active || !open),\n tap(() => open = el.open),\n map(active => ({\n action: active ? \"open\" : \"close\"\n }) as Details)\n )\n )\n}\n\n/**\n * Mount details\n *\n * This function ensures that `details` tags are opened on anchor jumps and\n * prior to printing, so the whole content of the page is visible.\n *\n * @param el - Details element\n * @param options - Options\n *\n * @returns Details component observable\n */\nexport function mountDetails(\n el: HTMLDetailsElement, options: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject
    ()\n push$.subscribe(({ action, reveal }) => {\n if (action === \"open\")\n el.setAttribute(\"open\", \"\")\n else\n el.removeAttribute(\"open\")\n if (reveal)\n el.scrollIntoView()\n })\n\n /* Create and return component */\n return watchDetails(el, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, of } from \"rxjs\"\n\nimport { renderTable } from \"~/templates\"\nimport { h } from \"~/utilities\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Data table\n */\nexport interface DataTable {}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Sentinel for replacement\n */\nconst sentinel = h(\"table\")\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount data table\n *\n * This function wraps a data table in another scrollable container, so it can\n * be smoothly scrolled on smaller screen sizes and won't break the layout.\n *\n * @param el - Data table element\n *\n * @returns Data table component observable\n */\nexport function mountDataTable(\n el: HTMLElement\n): Observable> {\n el.replaceWith(sentinel)\n sentinel.replaceWith(renderTable(el))\n\n /* Create and return component */\n return of({ ref: el })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n animationFrameScheduler,\n asyncScheduler,\n auditTime,\n combineLatest,\n defer,\n finalize,\n fromEvent,\n map,\n merge,\n skip,\n startWith,\n subscribeOn,\n takeLast,\n takeUntil,\n tap\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n getElement,\n getElementContentOffset,\n getElementContentSize,\n getElementOffset,\n getElementSize,\n getElements,\n watchElementContentOffset,\n watchElementSize\n} from \"~/browser\"\nimport { renderTabbedControl } from \"~/templates\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Content tabs\n */\nexport interface ContentTabs {\n active: HTMLLabelElement /* Active tab label */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch content tabs\n *\n * @param el - Content tabs element\n *\n * @returns Content tabs observable\n */\nexport function watchContentTabs(\n el: HTMLElement\n): Observable {\n const inputs = getElements(\":scope > input\", el)\n const initial = inputs.find(input => input.checked) || inputs[0]\n return merge(...inputs.map(input => fromEvent(input, \"change\")\n .pipe(\n map(() => getElement(`label[for=${input.id}]`))\n )\n ))\n .pipe(\n startWith(getElement(`label[for=${initial.id}]`)),\n map(active => ({ active }))\n )\n}\n\n/**\n * Mount content tabs\n *\n * This function scrolls the active tab into view. While this functionality is\n * provided by browsers as part of `scrollInfoView`, browsers will always also\n * scroll the vertical axis, which we do not want. Thus, we decided to provide\n * this functionality ourselves.\n *\n * @param el - Content tabs element\n *\n * @returns Content tabs component observable\n */\nexport function mountContentTabs(\n el: HTMLElement\n): Observable> {\n\n /* Render content tab previous button for pagination */\n const prev = renderTabbedControl(\"prev\")\n el.append(prev)\n\n /* Render content tab next button for pagination */\n const next = renderTabbedControl(\"next\")\n el.append(next)\n\n /* Mount component on subscription */\n const container = getElement(\".tabbed-labels\", el)\n return defer(() => {\n const push$ = new Subject()\n const done$ = push$.pipe(takeLast(1))\n combineLatest([push$, watchElementSize(el)])\n .pipe(\n auditTime(1, animationFrameScheduler),\n takeUntil(done$)\n )\n .subscribe({\n\n /* Handle emission */\n next([{ active }, size]) {\n const offset = getElementOffset(active)\n const { width } = getElementSize(active)\n\n /* Set tab indicator offset and width */\n el.style.setProperty(\"--md-indicator-x\", `${offset.x}px`)\n el.style.setProperty(\"--md-indicator-width\", `${width}px`)\n\n /* Scroll container to active content tab */\n const content = getElementContentOffset(container)\n if (\n offset.x < content.x ||\n offset.x + width > content.x + size.width\n )\n container.scrollTo({\n left: Math.max(0, offset.x - 16),\n behavior: \"smooth\"\n })\n },\n\n /* Handle complete */\n complete() {\n el.style.removeProperty(\"--md-indicator-x\")\n el.style.removeProperty(\"--md-indicator-width\")\n }\n })\n\n /* Hide content tab buttons on borders */\n combineLatest([\n watchElementContentOffset(container),\n watchElementSize(container)\n ])\n .pipe(\n takeUntil(done$)\n )\n .subscribe(([offset, size]) => {\n const content = getElementContentSize(container)\n prev.hidden = offset.x < 16\n next.hidden = offset.x > content.width - size.width - 16\n })\n\n /* Paginate content tab container on click */\n merge(\n fromEvent(prev, \"click\").pipe(map(() => -1)),\n fromEvent(next, \"click\").pipe(map(() => +1))\n )\n .pipe(\n takeUntil(done$)\n )\n .subscribe(direction => {\n const { width } = getElementSize(container)\n container.scrollBy({\n left: width * direction,\n behavior: \"smooth\"\n })\n })\n\n /* Set up linking of content tabs, if enabled */\n if (feature(\"content.tabs.link\"))\n push$.pipe(skip(1))\n .subscribe(({ active }) => {\n const tab = active.innerText.trim()\n for (const set of getElements(\"[data-tabs]\"))\n for (const input of getElements(\n \":scope > input\", set\n )) {\n const label = getElement(`label[for=${input.id}]`)\n if (label.innerText.trim() === tab) {\n input.click()\n break\n }\n }\n\n /* Persist active tabs in local storage */\n const tabs = __md_get(\"__tabs\") || []\n __md_set(\"__tabs\", [...new Set([tab, ...tabs])])\n })\n\n /* Create and return component */\n return watchContentTabs(el)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n .pipe(\n subscribeOn(asyncScheduler)\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Observable, merge } from \"rxjs\"\n\nimport { getElements } from \"~/browser\"\n\nimport { Component } from \"../../_\"\nimport { Annotation } from \"../annotation\"\nimport {\n CodeBlock,\n Mermaid,\n mountCodeBlock,\n mountMermaid\n} from \"../code\"\nimport {\n Details,\n mountDetails\n} from \"../details\"\nimport {\n DataTable,\n mountDataTable\n} from \"../table\"\nimport {\n ContentTabs,\n mountContentTabs\n} from \"../tabs\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Content\n */\nexport type Content =\n | Annotation\n | ContentTabs\n | CodeBlock\n | Mermaid\n | DataTable\n | Details\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n target$: Observable /* Location target observable */\n print$: Observable /* Media print observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount content\n *\n * This function mounts all components that are found in the content of the\n * actual article, including code blocks, data tables and details.\n *\n * @param el - Content element\n * @param options - Options\n *\n * @returns Content component observable\n */\nexport function mountContent(\n el: HTMLElement, { target$, print$ }: MountOptions\n): Observable> {\n return merge(\n\n /* Code blocks */\n ...getElements(\"pre:not(.mermaid) > code\", el)\n .map(child => mountCodeBlock(child, { print$ })),\n\n /* Mermaid diagrams */\n ...getElements(\"pre.mermaid\", el)\n .map(child => mountMermaid(child)),\n\n /* Data tables */\n ...getElements(\"table:not([class])\", el)\n .map(child => mountDataTable(child)),\n\n /* Details */\n ...getElements(\"details\", el)\n .map(child => mountDetails(child, { target$, print$ })),\n\n /* Content tabs */\n ...getElements(\"[data-tabs]\", el)\n .map(child => mountContentTabs(child))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n defer,\n delay,\n finalize,\n map,\n merge,\n of,\n switchMap,\n tap\n} from \"rxjs\"\n\nimport { getElement } from \"~/browser\"\n\nimport { Component } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Dialog\n */\nexport interface Dialog {\n message: string /* Dialog message */\n active: boolean /* Dialog is active */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n alert$: Subject /* Alert subject */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n alert$: Subject /* Alert subject */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch dialog\n *\n * @param _el - Dialog element\n * @param options - Options\n *\n * @returns Dialog observable\n */\nexport function watchDialog(\n _el: HTMLElement, { alert$ }: WatchOptions\n): Observable {\n return alert$\n .pipe(\n switchMap(message => merge(\n of(true),\n of(false).pipe(delay(2000))\n )\n .pipe(\n map(active => ({ message, active }))\n )\n )\n )\n}\n\n/**\n * Mount dialog\n *\n * This function reveals the dialog in the right corner when a new alert is\n * emitted through the subject that is passed as part of the options.\n *\n * @param el - Dialog element\n * @param options - Options\n *\n * @returns Dialog component observable\n */\nexport function mountDialog(\n el: HTMLElement, options: MountOptions\n): Observable> {\n const inner = getElement(\".md-typeset\", el)\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe(({ message, active }) => {\n el.classList.toggle(\"md-dialog--active\", active)\n inner.textContent = message\n })\n\n /* Create and return component */\n return watchDialog(el, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n bufferCount,\n combineLatest,\n combineLatestWith,\n defer,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n filter,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n takeLast,\n takeUntil\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n Viewport,\n watchElementSize,\n watchToggle\n} from \"~/browser\"\n\nimport { Component } from \"../../_\"\nimport { Main } from \"../../main\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Header\n */\nexport interface Header {\n height: number /* Header visible height */\n hidden: boolean /* Header is hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n main$: Observable
    /* Main area observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Compute whether the header is hidden\n *\n * If the user scrolls past a certain threshold, the header can be hidden when\n * scrolling down, and shown when scrolling up.\n *\n * @param options - Options\n *\n * @returns Toggle observable\n */\nfunction isHidden({ viewport$ }: WatchOptions): Observable {\n if (!feature(\"header.autohide\"))\n return of(false)\n\n /* Compute direction and turning point */\n const direction$ = viewport$\n .pipe(\n map(({ offset: { y } }) => y),\n bufferCount(2, 1),\n map(([a, b]) => [a < b, b] as const),\n distinctUntilKeyChanged(0)\n )\n\n /* Compute whether header should be hidden */\n const hidden$ = combineLatest([viewport$, direction$])\n .pipe(\n filter(([{ offset }, [, y]]) => Math.abs(y - offset.y) > 100),\n map(([, [direction]]) => direction),\n distinctUntilChanged()\n )\n\n /* Compute threshold for hiding */\n const search$ = watchToggle(\"search\")\n return combineLatest([viewport$, search$])\n .pipe(\n map(([{ offset }, search]) => offset.y > 400 && !search),\n distinctUntilChanged(),\n switchMap(active => active ? hidden$ : of(false)),\n startWith(false)\n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch header\n *\n * @param el - Header element\n * @param options - Options\n *\n * @returns Header observable\n */\nexport function watchHeader(\n el: HTMLElement, options: WatchOptions\n): Observable
    {\n return defer(() => combineLatest([\n watchElementSize(el),\n isHidden(options)\n ]))\n .pipe(\n map(([{ height }, hidden]) => ({\n height,\n hidden\n })),\n distinctUntilChanged((a, b) => (\n a.height === b.height &&\n a.hidden === b.hidden\n )),\n shareReplay(1)\n )\n}\n\n/**\n * Mount header\n *\n * This function manages the different states of the header, i.e. whether it's\n * hidden or rendered with a shadow. This depends heavily on the main area.\n *\n * @param el - Header element\n * @param options - Options\n *\n * @returns Header component observable\n */\nexport function mountHeader(\n el: HTMLElement, { header$, main$ }: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject
    ()\n const done$ = push$.pipe(takeLast(1))\n push$\n .pipe(\n distinctUntilKeyChanged(\"active\"),\n combineLatestWith(header$)\n )\n .subscribe(([{ active }, { hidden }]) => {\n el.classList.toggle(\"md-header--shadow\", active && !hidden)\n el.hidden = hidden\n })\n\n /* Link to main area */\n main$.subscribe(push$)\n\n /* Create and return component */\n return header$\n .pipe(\n takeUntil(done$),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n Subject,\n defer,\n distinctUntilKeyChanged,\n finalize,\n map,\n tap\n} from \"rxjs\"\n\nimport {\n Viewport,\n getElementSize,\n getOptionalElement,\n watchViewportAt\n} from \"~/browser\"\n\nimport { Component } from \"../../_\"\nimport { Header } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Header\n */\nexport interface HeaderTitle {\n active: boolean /* Header title is active */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch header title\n *\n * @param el - Heading element\n * @param options - Options\n *\n * @returns Header title observable\n */\nexport function watchHeaderTitle(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable {\n return watchViewportAt(el, { viewport$, header$ })\n .pipe(\n map(({ offset: { y } }) => {\n const { height } = getElementSize(el)\n return {\n active: y >= height\n }\n }),\n distinctUntilKeyChanged(\"active\")\n )\n}\n\n/**\n * Mount header title\n *\n * This function swaps the header title from the site title to the title of the\n * current page when the user scrolls past the first headline.\n *\n * @param el - Header title element\n * @param options - Options\n *\n * @returns Header title component observable\n */\nexport function mountHeaderTitle(\n el: HTMLElement, options: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe(({ active }) => {\n el.classList.toggle(\"md-header__title--active\", active)\n })\n\n /* Obtain headline, if any */\n const heading = getOptionalElement(\"article h1\")\n if (typeof heading === \"undefined\")\n return EMPTY\n\n /* Create and return component */\n return watchHeaderTitle(heading, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n combineLatest,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n map,\n switchMap\n} from \"rxjs\"\n\nimport {\n Viewport,\n watchElementSize\n} from \"~/browser\"\n\nimport { Header } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Main area\n */\nexport interface Main {\n offset: number /* Main area top offset */\n height: number /* Main area visible height */\n active: boolean /* Main area is active */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch main area\n *\n * This function returns an observable that computes the visual parameters of\n * the main area which depends on the viewport vertical offset and height, as\n * well as the height of the header element, if the header is fixed.\n *\n * @param el - Main area element\n * @param options - Options\n *\n * @returns Main area observable\n */\nexport function watchMain(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable
    {\n\n /* Compute necessary adjustment for header */\n const adjust$ = header$\n .pipe(\n map(({ height }) => height),\n distinctUntilChanged()\n )\n\n /* Compute the main area's top and bottom borders */\n const border$ = adjust$\n .pipe(\n switchMap(() => watchElementSize(el)\n .pipe(\n map(({ height }) => ({\n top: el.offsetTop,\n bottom: el.offsetTop + height\n })),\n distinctUntilKeyChanged(\"bottom\")\n )\n )\n )\n\n /* Compute the main area's offset, visible height and if we scrolled past */\n return combineLatest([adjust$, border$, viewport$])\n .pipe(\n map(([header, { top, bottom }, { offset: { y }, size: { height } }]) => {\n height = Math.max(0, height\n - Math.max(0, top - y, header)\n - Math.max(0, height + y - bottom)\n )\n return {\n offset: top - header,\n height,\n active: top - header <= y\n }\n }),\n distinctUntilChanged((a, b) => (\n a.offset === b.offset &&\n a.height === b.height &&\n a.active === b.active\n ))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n asyncScheduler,\n defer,\n finalize,\n fromEvent,\n map,\n mergeMap,\n observeOn,\n of,\n shareReplay,\n startWith,\n tap\n} from \"rxjs\"\n\nimport { getElements } from \"~/browser\"\n\nimport { Component } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Palette colors\n */\nexport interface PaletteColor {\n scheme?: string /* Color scheme */\n primary?: string /* Primary color */\n accent?: string /* Accent color */\n}\n\n/**\n * Palette\n */\nexport interface Palette {\n index: number /* Palette index */\n color: PaletteColor /* Palette colors */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch color palette\n *\n * @param inputs - Color palette element\n *\n * @returns Color palette observable\n */\nexport function watchPalette(\n inputs: HTMLInputElement[]\n): Observable {\n const current = __md_get(\"__palette\") || {\n index: inputs.findIndex(input => matchMedia(\n input.getAttribute(\"data-md-color-media\")!\n ).matches)\n }\n\n /* Emit changes in color palette */\n return of(...inputs)\n .pipe(\n mergeMap(input => fromEvent(input, \"change\")\n .pipe(\n map(() => input)\n )\n ),\n startWith(inputs[Math.max(0, current.index)]),\n map(input => ({\n index: inputs.indexOf(input),\n color: {\n scheme: input.getAttribute(\"data-md-color-scheme\"),\n primary: input.getAttribute(\"data-md-color-primary\"),\n accent: input.getAttribute(\"data-md-color-accent\")\n }\n } as Palette)),\n shareReplay(1)\n )\n}\n\n/**\n * Mount color palette\n *\n * @param el - Color palette element\n *\n * @returns Color palette component observable\n */\nexport function mountPalette(\n el: HTMLElement\n): Observable> {\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe(palette => {\n document.body.setAttribute(\"data-md-color-switching\", \"\")\n\n /* Set color palette */\n for (const [key, value] of Object.entries(palette.color))\n document.body.setAttribute(`data-md-color-${key}`, value)\n\n /* Toggle visibility */\n for (let index = 0; index < inputs.length; index++) {\n const label = inputs[index].nextElementSibling\n if (label instanceof HTMLElement)\n label.hidden = palette.index !== index\n }\n\n /* Persist preference in local storage */\n __md_set(\"__palette\", palette)\n })\n\n /* Revert transition durations after color switch */\n push$.pipe(observeOn(asyncScheduler))\n .subscribe(() => {\n document.body.removeAttribute(\"data-md-color-switching\")\n })\n\n /* Create and return component */\n const inputs = getElements(\"input\", el)\n return watchPalette(inputs)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport ClipboardJS from \"clipboard\"\nimport {\n Observable,\n Subject,\n map,\n tap\n} from \"rxjs\"\n\nimport { translation } from \"~/_\"\nimport { getElement } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n alert$: Subject /* Alert subject */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Extract text to copy\n *\n * @param el - HTML element\n *\n * @returns Extracted text\n */\nfunction extract(el: HTMLElement): string {\n el.setAttribute(\"data-md-copying\", \"\")\n const text = el.innerText\n el.removeAttribute(\"data-md-copying\")\n return text\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up Clipboard.js integration\n *\n * @param options - Options\n */\nexport function setupClipboardJS(\n { alert$ }: SetupOptions\n): void {\n if (ClipboardJS.isSupported()) {\n new Observable(subscriber => {\n new ClipboardJS(\"[data-clipboard-target], [data-clipboard-text]\", {\n text: el => (\n el.getAttribute(\"data-clipboard-text\")! ||\n extract(getElement(\n el.getAttribute(\"data-clipboard-target\")!\n ))\n )\n })\n .on(\"success\", ev => subscriber.next(ev))\n })\n .pipe(\n tap(ev => {\n const trigger = ev.trigger as HTMLElement\n trigger.focus()\n }),\n map(() => translation(\"clipboard.copied\"))\n )\n .subscribe(alert$)\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n catchError,\n defaultIfEmpty,\n map,\n of,\n tap\n} from \"rxjs\"\n\nimport { configuration } from \"~/_\"\nimport { getElements, requestXML } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Sitemap, i.e. a list of URLs\n */\nexport type Sitemap = string[]\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Preprocess a list of URLs\n *\n * This function replaces the `site_url` in the sitemap with the actual base\n * URL, to allow instant loading to work in occasions like Netlify previews.\n *\n * @param urls - URLs\n *\n * @returns URL path parts\n */\nfunction preprocess(urls: Sitemap): Sitemap {\n if (urls.length < 2)\n return [\"\"]\n\n /* Take the first two URLs and remove everything after the last slash */\n const [root, next] = [...urls]\n .sort((a, b) => a.length - b.length)\n .map(url => url.replace(/[^/]+$/, \"\"))\n\n /* Compute common prefix */\n let index = 0\n if (root === next)\n index = root.length\n else\n while (root.charCodeAt(index) === next.charCodeAt(index))\n index++\n\n /* Remove common prefix and return in original order */\n return urls.map(url => url.replace(root.slice(0, index), \"\"))\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch the sitemap for the given base URL\n *\n * @param base - Base URL\n *\n * @returns Sitemap observable\n */\nexport function fetchSitemap(base?: URL): Observable {\n const cached = __md_get(\"__sitemap\", sessionStorage, base)\n if (cached) {\n return of(cached)\n } else {\n const config = configuration()\n return requestXML(new URL(\"sitemap.xml\", base || config.base))\n .pipe(\n map(sitemap => preprocess(getElements(\"loc\", sitemap)\n .map(node => node.textContent!)\n )),\n catchError(() => EMPTY), // @todo refactor instant loading\n defaultIfEmpty([]),\n tap(sitemap => __md_set(\"__sitemap\", sitemap, sessionStorage, base))\n )\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n NEVER,\n Observable,\n Subject,\n bufferCount,\n catchError,\n concatMap,\n debounceTime,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n filter,\n fromEvent,\n map,\n merge,\n of,\n sample,\n share,\n skip,\n skipUntil,\n switchMap\n} from \"rxjs\"\n\nimport { configuration, feature } from \"~/_\"\nimport {\n Viewport,\n ViewportOffset,\n getElements,\n getOptionalElement,\n request,\n setLocation,\n setLocationHash\n} from \"~/browser\"\nimport { getComponentElement } from \"~/components\"\nimport { h } from \"~/utilities\"\n\nimport { fetchSitemap } from \"../sitemap\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * History state\n */\nexport interface HistoryState {\n url: URL /* State URL */\n offset?: ViewportOffset /* State viewport offset */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n document$: Subject /* Document subject */\n location$: Subject /* Location subject */\n viewport$: Observable /* Viewport observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up instant loading\n *\n * When fetching, theoretically, we could use `responseType: \"document\"`, but\n * since all MkDocs links are relative, we need to make sure that the current\n * location matches the document we just loaded. Otherwise any relative links\n * in the document could use the old location.\n *\n * This is the reason why we need to synchronize history events and the process\n * of fetching the document for navigation changes (except `popstate` events):\n *\n * 1. Fetch document via `XMLHTTPRequest`\n * 2. Set new location via `history.pushState`\n * 3. Parse and emit fetched document\n *\n * For `popstate` events, we must not use `history.pushState`, or the forward\n * history will be irreversibly overwritten. In case the request fails, the\n * location change is dispatched regularly.\n *\n * @param options - Options\n */\nexport function setupInstantLoading(\n { document$, location$, viewport$ }: SetupOptions\n): void {\n const config = configuration()\n if (location.protocol === \"file:\")\n return\n\n /* Disable automatic scroll restoration */\n if (\"scrollRestoration\" in history) {\n history.scrollRestoration = \"manual\"\n\n /* Hack: ensure that reloads restore viewport offset */\n fromEvent(window, \"beforeunload\")\n .subscribe(() => {\n history.scrollRestoration = \"auto\"\n })\n }\n\n /* Hack: ensure absolute favicon link to omit 404s when switching */\n const favicon = getOptionalElement(\"link[rel=icon]\")\n if (typeof favicon !== \"undefined\")\n favicon.href = favicon.href\n\n /* Intercept internal navigation */\n const push$ = fetchSitemap()\n .pipe(\n map(paths => paths.map(path => `${new URL(path, config.base)}`)),\n switchMap(urls => fromEvent(document.body, \"click\")\n .pipe(\n filter(ev => !ev.metaKey && !ev.ctrlKey),\n switchMap(ev => {\n if (ev.target instanceof Element) {\n const el = ev.target.closest(\"a\")\n if (el && !el.target) {\n const url = new URL(el.href)\n\n /* Canonicalize URL */\n url.search = \"\"\n url.hash = \"\"\n\n /* Check if URL should be intercepted */\n if (\n url.pathname !== location.pathname &&\n urls.includes(url.toString())\n ) {\n ev.preventDefault()\n return of({\n url: new URL(el.href)\n })\n }\n }\n }\n return NEVER\n })\n )\n ),\n share()\n )\n\n /* Intercept history back and forward */\n const pop$ = fromEvent(window, \"popstate\")\n .pipe(\n filter(ev => ev.state !== null),\n map(ev => ({\n url: new URL(location.href),\n offset: ev.state\n })),\n share()\n )\n\n /* Emit location change */\n merge(push$, pop$)\n .pipe(\n distinctUntilChanged((a, b) => a.url.href === b.url.href),\n map(({ url }) => url)\n )\n .subscribe(location$)\n\n /* Fetch document via `XMLHTTPRequest` */\n const response$ = location$\n .pipe(\n distinctUntilKeyChanged(\"pathname\"),\n switchMap(url => request(url.href)\n .pipe(\n catchError(() => {\n setLocation(url)\n return NEVER\n })\n )\n ),\n share()\n )\n\n /* Set new location via `history.pushState` */\n push$\n .pipe(\n sample(response$)\n )\n .subscribe(({ url }) => {\n history.pushState({}, \"\", `${url}`)\n })\n\n /* Parse and emit fetched document */\n const dom = new DOMParser()\n response$\n .pipe(\n switchMap(res => res.text()),\n map(res => dom.parseFromString(res, \"text/html\"))\n )\n .subscribe(document$)\n\n /* Replace meta tags and components */\n document$\n .pipe(\n skip(1)\n )\n .subscribe(replacement => {\n for (const selector of [\n\n /* Meta tags */\n \"title\",\n \"link[rel=canonical]\",\n \"meta[name=author]\",\n \"meta[name=description]\",\n\n /* Components */\n \"[data-md-component=announce]\",\n \"[data-md-component=container]\",\n \"[data-md-component=header-topic]\",\n \"[data-md-component=outdated]\",\n \"[data-md-component=logo]\",\n \"[data-md-component=skip]\",\n ...feature(\"navigation.tabs.sticky\")\n ? [\"[data-md-component=tabs]\"]\n : []\n ]) {\n const source = getOptionalElement(selector)\n const target = getOptionalElement(selector, replacement)\n if (\n typeof source !== \"undefined\" &&\n typeof target !== \"undefined\"\n ) {\n source.replaceWith(target)\n }\n }\n })\n\n /* Re-evaluate scripts */\n document$\n .pipe(\n skip(1),\n map(() => getComponentElement(\"container\")),\n switchMap(el => getElements(\"script\", el)),\n concatMap(el => {\n const script = h(\"script\")\n if (el.src) {\n for (const name of el.getAttributeNames())\n script.setAttribute(name, el.getAttribute(name)!)\n el.replaceWith(script)\n\n /* Complete when script is loaded */\n return new Observable(observer => {\n script.onload = () => observer.complete()\n })\n\n /* Complete immediately */\n } else {\n script.textContent = el.textContent\n el.replaceWith(script)\n return EMPTY\n }\n })\n )\n .subscribe()\n\n /* Emit history state change */\n merge(push$, pop$)\n .pipe(\n sample(document$)\n )\n .subscribe(({ url, offset }) => {\n if (url.hash && !offset) {\n setLocationHash(url.hash)\n } else {\n window.scrollTo(0, offset?.y || 0)\n }\n })\n\n /* Debounce update of viewport offset */\n viewport$\n .pipe(\n skipUntil(push$),\n debounceTime(250),\n distinctUntilKeyChanged(\"offset\")\n )\n .subscribe(({ offset }) => {\n history.replaceState(offset, \"\")\n })\n\n /* Set viewport offset from history */\n merge(push$, pop$)\n .pipe(\n bufferCount(2, 1),\n filter(([a, b]) => a.url.pathname === b.url.pathname),\n map(([, state]) => state)\n )\n .subscribe(({ offset }) => {\n window.scrollTo(0, offset?.y || 0)\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport escapeHTML from \"escape-html\"\n\nimport { SearchIndexDocument } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search document\n */\nexport interface SearchDocument extends SearchIndexDocument {\n parent?: SearchIndexDocument /* Parent article */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search document mapping\n */\nexport type SearchDocumentMap = Map\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search document mapping\n *\n * @param docs - Search index documents\n *\n * @returns Search document map\n */\nexport function setupSearchDocumentMap(\n docs: SearchIndexDocument[]\n): SearchDocumentMap {\n const documents = new Map()\n const parents = new Set()\n for (const doc of docs) {\n const [path, hash] = doc.location.split(\"#\")\n\n /* Extract location, title and tags */\n const location = doc.location\n const title = doc.title\n const tags = doc.tags\n\n /* Escape and cleanup text */\n const text = escapeHTML(doc.text)\n .replace(/\\s+(?=[,.:;!?])/g, \"\")\n .replace(/\\s+/g, \" \")\n\n /* Handle section */\n if (hash) {\n const parent = documents.get(path)!\n\n /* Ignore first section, override article */\n if (!parents.has(parent)) {\n parent.title = doc.title\n parent.text = text\n\n /* Remember that we processed the article */\n parents.add(parent)\n\n /* Add subsequent section */\n } else {\n documents.set(location, {\n location,\n title,\n text,\n parent\n })\n }\n\n /* Add article */\n } else {\n documents.set(location, {\n location,\n title,\n text,\n ...tags && { tags }\n })\n }\n }\n return documents\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport escapeHTML from \"escape-html\"\n\nimport { SearchIndexConfig } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search highlight function\n *\n * @param value - Value\n *\n * @returns Highlighted value\n */\nexport type SearchHighlightFn = (value: string) => string\n\n/**\n * Search highlight factory function\n *\n * @param query - Query value\n *\n * @returns Search highlight function\n */\nexport type SearchHighlightFactoryFn = (query: string) => SearchHighlightFn\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search highlighter\n *\n * @param config - Search index configuration\n * @param escape - Whether to escape HTML\n *\n * @returns Search highlight factory function\n */\nexport function setupSearchHighlighter(\n config: SearchIndexConfig, escape: boolean\n): SearchHighlightFactoryFn {\n const separator = new RegExp(config.separator, \"img\")\n const highlight = (_: unknown, data: string, term: string) => {\n return `${data}${term}`\n }\n\n /* Return factory function */\n return (query: string) => {\n query = query\n .replace(/[\\s*+\\-:~^]+/g, \" \")\n .trim()\n\n /* Create search term match expression */\n const match = new RegExp(`(^|${config.separator})(${\n query\n .replace(/[|\\\\{}()[\\]^$+*?.-]/g, \"\\\\$&\")\n .replace(separator, \"|\")\n })`, \"img\")\n\n /* Highlight string value */\n return value => (\n escape\n ? escapeHTML(value)\n : value\n )\n .replace(match, highlight)\n .replace(/<\\/mark>(\\s+)]*>/img, \"$1\")\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search transformation function\n *\n * @param value - Query value\n *\n * @returns Transformed query value\n */\nexport type SearchTransformFn = (value: string) => string\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Default transformation function\n *\n * 1. Search for terms in quotation marks and prepend a `+` modifier to denote\n * that the resulting document must contain all terms, converting the query\n * to an `AND` query (as opposed to the default `OR` behavior). While users\n * may expect terms enclosed in quotation marks to map to span queries, i.e.\n * for which order is important, Lunr.js doesn't support them, so the best\n * we can do is to convert the terms to an `AND` query.\n *\n * 2. Replace control characters which are not located at the beginning of the\n * query or preceded by white space, or are not followed by a non-whitespace\n * character or are at the end of the query string. Furthermore, filter\n * unmatched quotation marks.\n *\n * 3. Trim excess whitespace from left and right.\n *\n * @param query - Query value\n *\n * @returns Transformed query value\n */\nexport function defaultTransform(query: string): string {\n return query\n .split(/\"([^\"]+)\"/g) /* => 1 */\n .map((terms, index) => index & 1\n ? terms.replace(/^\\b|^(?![^\\x00-\\x7F]|$)|\\s+/g, \" +\")\n : terms\n )\n .join(\"\")\n .replace(/\"|(?:^|\\s+)[*+\\-:^~]+(?=\\s+|$)/g, \"\") /* => 2 */\n .trim() /* => 3 */\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SearchIndex, SearchResult } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search message type\n */\nexport const enum SearchMessageType {\n SETUP, /* Search index setup */\n READY, /* Search index ready */\n QUERY, /* Search query */\n RESULT /* Search results */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Message containing the data necessary to setup the search index\n */\nexport interface SearchSetupMessage {\n type: SearchMessageType.SETUP /* Message type */\n data: SearchIndex /* Message data */\n}\n\n/**\n * Message indicating the search index is ready\n */\nexport interface SearchReadyMessage {\n type: SearchMessageType.READY /* Message type */\n}\n\n/**\n * Message containing a search query\n */\nexport interface SearchQueryMessage {\n type: SearchMessageType.QUERY /* Message type */\n data: string /* Message data */\n}\n\n/**\n * Message containing results for a search query\n */\nexport interface SearchResultMessage {\n type: SearchMessageType.RESULT /* Message type */\n data: SearchResult /* Message data */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Message exchanged with the search worker\n */\nexport type SearchMessage =\n | SearchSetupMessage\n | SearchReadyMessage\n | SearchQueryMessage\n | SearchResultMessage\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Type guard for search setup messages\n *\n * @param message - Search worker message\n *\n * @returns Test result\n */\nexport function isSearchSetupMessage(\n message: SearchMessage\n): message is SearchSetupMessage {\n return message.type === SearchMessageType.SETUP\n}\n\n/**\n * Type guard for search ready messages\n *\n * @param message - Search worker message\n *\n * @returns Test result\n */\nexport function isSearchReadyMessage(\n message: SearchMessage\n): message is SearchReadyMessage {\n return message.type === SearchMessageType.READY\n}\n\n/**\n * Type guard for search query messages\n *\n * @param message - Search worker message\n *\n * @returns Test result\n */\nexport function isSearchQueryMessage(\n message: SearchMessage\n): message is SearchQueryMessage {\n return message.type === SearchMessageType.QUERY\n}\n\n/**\n * Type guard for search result messages\n *\n * @param message - Search worker message\n *\n * @returns Test result\n */\nexport function isSearchResultMessage(\n message: SearchMessage\n): message is SearchResultMessage {\n return message.type === SearchMessageType.RESULT\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n ObservableInput,\n Subject,\n from,\n map,\n share\n} from \"rxjs\"\n\nimport { configuration, feature, translation } from \"~/_\"\nimport { WorkerHandler, watchWorker } from \"~/browser\"\n\nimport { SearchIndex } from \"../../_\"\nimport {\n SearchOptions,\n SearchPipeline\n} from \"../../options\"\nimport {\n SearchMessage,\n SearchMessageType,\n SearchSetupMessage,\n isSearchResultMessage\n} from \"../message\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search worker\n */\nexport type SearchWorker = WorkerHandler\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up search index\n *\n * @param data - Search index\n *\n * @returns Search index\n */\nfunction setupSearchIndex({ config, docs }: SearchIndex): SearchIndex {\n\n /* Override default language with value from translation */\n if (config.lang.length === 1 && config.lang[0] === \"en\")\n config.lang = [\n translation(\"search.config.lang\")\n ]\n\n /* Override default separator with value from translation */\n if (config.separator === \"[\\\\s\\\\-]+\")\n config.separator = translation(\"search.config.separator\")\n\n /* Set pipeline from translation */\n const pipeline = translation(\"search.config.pipeline\")\n .split(/\\s*,\\s*/)\n .filter(Boolean) as SearchPipeline\n\n /* Determine search options */\n const options: SearchOptions = {\n pipeline,\n suggestions: feature(\"search.suggest\")\n }\n\n /* Return search index after defaulting */\n return { config, docs, options }\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up search worker\n *\n * This function creates a web worker to set up and query the search index,\n * which is done using Lunr.js. The index must be passed as an observable to\n * enable hacks like _localsearch_ via search index embedding as JSON.\n *\n * @param url - Worker URL\n * @param index - Search index observable input\n *\n * @returns Search worker\n */\nexport function setupSearchWorker(\n url: string, index: ObservableInput\n): SearchWorker {\n const config = configuration()\n const worker = new Worker(url)\n\n /* Create communication channels and resolve relative links */\n const tx$ = new Subject()\n const rx$ = watchWorker(worker, { tx$ })\n .pipe(\n map(message => {\n if (isSearchResultMessage(message)) {\n for (const result of message.data.items)\n for (const document of result)\n document.location = `${new URL(document.location, config.base)}`\n }\n return message\n }),\n share()\n )\n\n /* Set up search index */\n from(index)\n .pipe(\n map(data => ({\n type: SearchMessageType.SETUP,\n data: setupSearchIndex(data)\n } as SearchSetupMessage))\n )\n .subscribe(tx$.next.bind(tx$))\n\n /* Return search worker */\n return { tx$, rx$ }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Subject,\n catchError,\n combineLatest,\n filter,\n fromEvent,\n map,\n of,\n switchMap,\n withLatestFrom\n} from \"rxjs\"\n\nimport { configuration } from \"~/_\"\nimport {\n getElement,\n getLocation,\n requestJSON,\n setLocation\n} from \"~/browser\"\nimport { getComponentElements } from \"~/components\"\nimport {\n Version,\n renderVersionSelector\n} from \"~/templates\"\n\nimport { fetchSitemap } from \"../sitemap\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Setup options\n */\ninterface SetupOptions {\n document$: Subject /* Document subject */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Set up version selector\n *\n * @param options - Options\n */\nexport function setupVersionSelector(\n { document$ }: SetupOptions\n): void {\n const config = configuration()\n const versions$ = requestJSON(\n new URL(\"../versions.json\", config.base)\n )\n .pipe(\n catchError(() => EMPTY) // @todo refactor instant loading\n )\n\n /* Determine current version */\n const current$ = versions$\n .pipe(\n map(versions => {\n const [, current] = config.base.match(/([^/]+)\\/?$/)!\n return versions.find(({ version, aliases }) => (\n version === current || aliases.includes(current)\n )) || versions[0]\n })\n )\n\n /* Intercept inter-version navigation */\n versions$\n .pipe(\n map(versions => new Map(versions.map(version => [\n `${new URL(`../${version.version}/`, config.base)}`,\n version\n ]))),\n switchMap(urls => fromEvent(document.body, \"click\")\n .pipe(\n filter(ev => !ev.metaKey && !ev.ctrlKey),\n withLatestFrom(current$),\n switchMap(([ev, current]) => {\n if (ev.target instanceof Element) {\n const el = ev.target.closest(\"a\")\n if (el && !el.target && urls.has(el.href)) {\n ev.preventDefault()\n const url = el.href\n // This is a temporary hack to detect if a version inside the\n // version selector or on another part of the site was clicked.\n // If we're inside the version selector, we definitely want to\n // find the same page, as we might have different deployments\n // due to aliases. However, if we're outside the version\n // selector, we must abort here, because we might otherwise\n // interfere with instant loading. We need to refactor this\n // at some point together with instant loading.\n //\n // See https://github.com/squidfunk/mkdocs-material/issues/4012\n if (!ev.target.closest(\".md-version\")) {\n const version = urls.get(url)!\n if (version === current)\n return EMPTY\n }\n return of(url)\n }\n }\n return EMPTY\n }),\n switchMap(url => {\n const { version } = urls.get(url)!\n return fetchSitemap(new URL(url))\n .pipe(\n map(sitemap => {\n const location = getLocation()\n const path = location.href.replace(config.base, \"\")\n return sitemap.includes(path)\n ? new URL(`../${version}/${path}`, config.base)\n : new URL(url)\n })\n )\n })\n )\n )\n )\n .subscribe(url => setLocation(url))\n\n /* Render version selector and warning */\n combineLatest([versions$, current$])\n .subscribe(([versions, current]) => {\n const topic = getElement(\".md-header__topic\")\n topic.appendChild(renderVersionSelector(versions, current))\n })\n\n /* Integrate outdated version banner with instant loading */\n document$.pipe(switchMap(() => current$))\n .subscribe(current => {\n\n /* Check if version state was already determined */\n let outdated = __md_get(\"__outdated\", sessionStorage)\n if (outdated === null) {\n const latest = config.version?.default || \"latest\"\n outdated = !current.aliases.includes(latest)\n\n /* Persist version state in session storage */\n __md_set(\"__outdated\", outdated, sessionStorage)\n }\n\n /* Unhide outdated version banner */\n if (outdated)\n for (const warning of getComponentElements(\"outdated\"))\n warning.hidden = false\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n combineLatest,\n delay,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n filter,\n finalize,\n fromEvent,\n map,\n merge,\n share,\n shareReplay,\n startWith,\n take,\n takeLast,\n takeUntil,\n tap\n} from \"rxjs\"\n\nimport { translation } from \"~/_\"\nimport {\n getLocation,\n setToggle,\n watchElementFocus,\n watchToggle\n} from \"~/browser\"\nimport {\n SearchMessageType,\n SearchQueryMessage,\n SearchWorker,\n defaultTransform,\n isSearchReadyMessage\n} from \"~/integrations\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query\n */\nexport interface SearchQuery {\n value: string /* Query value */\n focus: boolean /* Query focus */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch search query\n *\n * Note that the focus event which triggers re-reading the current query value\n * is delayed by `1ms` so the input's empty state is allowed to propagate.\n *\n * @param el - Search query element\n * @param worker - Search worker\n *\n * @returns Search query observable\n */\nexport function watchSearchQuery(\n el: HTMLInputElement, { rx$ }: SearchWorker\n): Observable {\n const fn = __search?.transform || defaultTransform\n\n /* Immediately show search dialog */\n const { searchParams } = getLocation()\n if (searchParams.has(\"q\"))\n setToggle(\"search\", true)\n\n /* Intercept query parameter (deep link) */\n const param$ = rx$\n .pipe(\n filter(isSearchReadyMessage),\n take(1),\n map(() => searchParams.get(\"q\") || \"\")\n )\n\n /* Remove query parameter when search is closed */\n watchToggle(\"search\")\n .pipe(\n filter(active => !active),\n take(1)\n )\n .subscribe(() => {\n const url = new URL(location.href)\n url.searchParams.delete(\"q\")\n history.replaceState({}, \"\", `${url}`)\n })\n\n /* Set query from parameter */\n param$.subscribe(value => { // TODO: not ideal - find a better way\n if (value) {\n el.value = value\n el.focus()\n }\n })\n\n /* Intercept focus and input events */\n const focus$ = watchElementFocus(el)\n const value$ = merge(\n fromEvent(el, \"keyup\"),\n fromEvent(el, \"focus\").pipe(delay(1)),\n param$\n )\n .pipe(\n map(() => fn(el.value)),\n startWith(\"\"),\n distinctUntilChanged(),\n )\n\n /* Combine into single observable */\n return combineLatest([value$, focus$])\n .pipe(\n map(([value, focus]) => ({ value, focus })),\n shareReplay(1)\n )\n}\n\n/**\n * Mount search query\n *\n * @param el - Search query element\n * @param worker - Search worker\n *\n * @returns Search query component observable\n */\nexport function mountSearchQuery(\n el: HTMLInputElement, { tx$, rx$ }: SearchWorker\n): Observable> {\n const push$ = new Subject()\n const done$ = push$.pipe(takeLast(1))\n\n /* Handle value changes */\n push$\n .pipe(\n distinctUntilKeyChanged(\"value\"),\n map(({ value }): SearchQueryMessage => ({\n type: SearchMessageType.QUERY,\n data: value\n }))\n )\n .subscribe(tx$.next.bind(tx$))\n\n /* Handle focus changes */\n push$\n .pipe(\n distinctUntilKeyChanged(\"focus\")\n )\n .subscribe(({ focus }) => {\n if (focus) {\n setToggle(\"search\", focus)\n el.placeholder = \"\"\n } else {\n el.placeholder = translation(\"search.placeholder\")\n }\n })\n\n /* Handle reset */\n fromEvent(el.form!, \"reset\")\n .pipe(\n takeUntil(done$)\n )\n .subscribe(() => el.focus())\n\n /* Create and return component */\n return watchSearchQuery(el, { tx$, rx$ })\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state })),\n share()\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n bufferCount,\n filter,\n finalize,\n map,\n merge,\n of,\n skipUntil,\n switchMap,\n take,\n tap,\n withLatestFrom,\n zipWith\n} from \"rxjs\"\n\nimport { translation } from \"~/_\"\nimport {\n getElement,\n watchElementBoundary\n} from \"~/browser\"\nimport {\n SearchResult,\n SearchWorker,\n isSearchReadyMessage,\n isSearchResultMessage\n} from \"~/integrations\"\nimport { renderSearchResultItem } from \"~/templates\"\nimport { round } from \"~/utilities\"\n\nimport { Component } from \"../../_\"\nimport { SearchQuery } from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n query$: Observable /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search result list\n *\n * This function performs a lazy rendering of the search results, depending on\n * the vertical offset of the search result container.\n *\n * @param el - Search result list element\n * @param worker - Search worker\n * @param options - Options\n *\n * @returns Search result list component observable\n */\nexport function mountSearchResult(\n el: HTMLElement, { rx$ }: SearchWorker, { query$ }: MountOptions\n): Observable> {\n const push$ = new Subject()\n const boundary$ = watchElementBoundary(el.parentElement!)\n .pipe(\n filter(Boolean)\n )\n\n /* Retrieve nested components */\n const meta = getElement(\":scope > :first-child\", el)\n const list = getElement(\":scope > :last-child\", el)\n\n /* Wait until search is ready */\n const ready$ = rx$\n .pipe(\n filter(isSearchReadyMessage),\n take(1)\n )\n\n /* Update search result metadata */\n push$\n .pipe(\n withLatestFrom(query$),\n skipUntil(ready$)\n )\n .subscribe(([{ items }, { value }]) => {\n if (value) {\n switch (items.length) {\n\n /* No results */\n case 0:\n meta.textContent = translation(\"search.result.none\")\n break\n\n /* One result */\n case 1:\n meta.textContent = translation(\"search.result.one\")\n break\n\n /* Multiple result */\n default:\n meta.textContent = translation(\n \"search.result.other\",\n round(items.length)\n )\n }\n } else {\n meta.textContent = translation(\"search.result.placeholder\")\n }\n })\n\n /* Update search result list */\n push$\n .pipe(\n tap(() => list.innerHTML = \"\"),\n switchMap(({ items }) => merge(\n of(...items.slice(0, 10)),\n of(...items.slice(10))\n .pipe(\n bufferCount(4),\n zipWith(boundary$),\n switchMap(([chunk]) => chunk)\n )\n ))\n )\n .subscribe(result => list.appendChild(\n renderSearchResultItem(result)\n ))\n\n /* Filter search result message */\n const result$ = rx$\n .pipe(\n filter(isSearchResultMessage),\n map(({ data }) => data)\n )\n\n /* Create and return component */\n return result$\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n finalize,\n fromEvent,\n map,\n tap\n} from \"rxjs\"\n\nimport { getLocation } from \"~/browser\"\n\nimport { Component } from \"../../_\"\nimport { SearchQuery } from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search sharing\n */\nexport interface SearchShare {\n url: URL /* Deep link for sharing */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n query$: Observable /* Search query observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n query$: Observable /* Search query observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search sharing\n *\n * @param _el - Search sharing element\n * @param options - Options\n *\n * @returns Search sharing observable\n */\nexport function watchSearchShare(\n _el: HTMLElement, { query$ }: WatchOptions\n): Observable {\n return query$\n .pipe(\n map(({ value }) => {\n const url = getLocation()\n url.hash = \"\"\n url.searchParams.delete(\"h\")\n url.searchParams.set(\"q\", value)\n return { url }\n })\n )\n}\n\n/**\n * Mount search sharing\n *\n * @param el - Search sharing element\n * @param options - Options\n *\n * @returns Search sharing component observable\n */\nexport function mountSearchShare(\n el: HTMLAnchorElement, options: MountOptions\n): Observable> {\n const push$ = new Subject()\n push$.subscribe(({ url }) => {\n el.setAttribute(\"data-clipboard-text\", el.href)\n el.href = `${url}`\n })\n\n /* Prevent following of link */\n fromEvent(el, \"click\")\n .subscribe(ev => ev.preventDefault())\n\n /* Create and return component */\n return watchSearchShare(el, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n asyncScheduler,\n combineLatestWith,\n distinctUntilChanged,\n filter,\n finalize,\n fromEvent,\n map,\n merge,\n observeOn,\n tap\n} from \"rxjs\"\n\nimport { Keyboard } from \"~/browser\"\nimport {\n SearchResult,\n SearchWorker,\n isSearchResultMessage\n} from \"~/integrations\"\n\nimport { Component, getComponentElement } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search suggestions\n */\nexport interface SearchSuggest {}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n keyboard$: Observable /* Keyboard observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search suggestions\n *\n * This function will perform a lazy rendering of the search results, depending\n * on the vertical offset of the search result container.\n *\n * @param el - Search result list element\n * @param worker - Search worker\n * @param options - Options\n *\n * @returns Search result list component observable\n */\nexport function mountSearchSuggest(\n el: HTMLElement, { rx$ }: SearchWorker, { keyboard$ }: MountOptions\n): Observable> {\n const push$ = new Subject()\n\n /* Retrieve query component and track all changes */\n const query = getComponentElement(\"search-query\")\n const query$ = merge(\n fromEvent(query, \"keydown\"),\n fromEvent(query, \"focus\")\n )\n .pipe(\n observeOn(asyncScheduler),\n map(() => query.value),\n distinctUntilChanged(),\n )\n\n /* Update search suggestions */\n push$\n .pipe(\n combineLatestWith(query$),\n map(([{ suggestions }, value]) => {\n const words = value.split(/([\\s-]+)/)\n if (suggestions?.length && words[words.length - 1]) {\n const last = suggestions[suggestions.length - 1]\n if (last.startsWith(words[words.length - 1]))\n words[words.length - 1] = last\n } else {\n words.length = 0\n }\n return words\n })\n )\n .subscribe(words => el.innerHTML = words\n .join(\"\")\n .replace(/\\s/g, \" \")\n )\n\n /* Set up search keyboard handlers */\n keyboard$\n .pipe(\n filter(({ mode }) => mode === \"search\")\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Right arrow: accept current suggestion */\n case \"ArrowRight\":\n if (\n el.innerText.length &&\n query.selectionStart === query.value.length\n )\n query.value = el.innerText\n break\n }\n })\n\n /* Filter search result message */\n const result$ = rx$\n .pipe(\n filter(isSearchResultMessage),\n map(({ data }) => data)\n )\n\n /* Create and return component */\n return result$\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(() => ({ ref: el }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n NEVER,\n Observable,\n ObservableInput,\n filter,\n merge,\n mergeWith,\n sample,\n take\n} from \"rxjs\"\n\nimport { configuration } from \"~/_\"\nimport {\n Keyboard,\n getActiveElement,\n getElements,\n setToggle\n} from \"~/browser\"\nimport {\n SearchIndex,\n SearchResult,\n isSearchQueryMessage,\n isSearchReadyMessage,\n setupSearchWorker\n} from \"~/integrations\"\n\nimport {\n Component,\n getComponentElement,\n getComponentElements\n} from \"../../_\"\nimport {\n SearchQuery,\n mountSearchQuery\n} from \"../query\"\nimport { mountSearchResult } from \"../result\"\nimport {\n SearchShare,\n mountSearchShare\n} from \"../share\"\nimport {\n SearchSuggest,\n mountSearchSuggest\n} from \"../suggest\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search\n */\nexport type Search =\n | SearchQuery\n | SearchResult\n | SearchShare\n | SearchSuggest\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n index$: ObservableInput /* Search index observable */\n keyboard$: Observable /* Keyboard observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search\n *\n * This function sets up the search functionality, including the underlying\n * web worker and all keyboard bindings.\n *\n * @param el - Search element\n * @param options - Options\n *\n * @returns Search component observable\n */\nexport function mountSearch(\n el: HTMLElement, { index$, keyboard$ }: MountOptions\n): Observable> {\n const config = configuration()\n try {\n const url = __search?.worker || config.search\n const worker = setupSearchWorker(url, index$)\n\n /* Retrieve query and result components */\n const query = getComponentElement(\"search-query\", el)\n const result = getComponentElement(\"search-result\", el)\n\n /* Re-emit query when search is ready */\n const { tx$, rx$ } = worker\n tx$\n .pipe(\n filter(isSearchQueryMessage),\n sample(rx$.pipe(filter(isSearchReadyMessage))),\n take(1)\n )\n .subscribe(tx$.next.bind(tx$))\n\n /* Set up search keyboard handlers */\n keyboard$\n .pipe(\n filter(({ mode }) => mode === \"search\")\n )\n .subscribe(key => {\n const active = getActiveElement()\n switch (key.type) {\n\n /* Enter: go to first (best) result */\n case \"Enter\":\n if (active === query) {\n const anchors = new Map()\n for (const anchor of getElements(\n \":first-child [href]\", result\n )) {\n const article = anchor.firstElementChild!\n anchors.set(anchor, parseFloat(\n article.getAttribute(\"data-md-score\")!\n ))\n }\n\n /* Go to result with highest score, if any */\n if (anchors.size) {\n const [[best]] = [...anchors].sort(([, a], [, b]) => b - a)\n best.click()\n }\n\n /* Otherwise omit form submission */\n key.claim()\n }\n break\n\n /* Escape or Tab: close search */\n case \"Escape\":\n case \"Tab\":\n setToggle(\"search\", false)\n query.blur()\n break\n\n /* Vertical arrows: select previous or next search result */\n case \"ArrowUp\":\n case \"ArrowDown\":\n if (typeof active === \"undefined\") {\n query.focus()\n } else {\n const els = [query, ...getElements(\n \":not(details) > [href], summary, details[open] [href]\",\n result\n )]\n const i = Math.max(0, (\n Math.max(0, els.indexOf(active)) + els.length + (\n key.type === \"ArrowUp\" ? -1 : +1\n )\n ) % els.length)\n els[i].focus()\n }\n\n /* Prevent scrolling of page */\n key.claim()\n break\n\n /* All other keys: hand to search query */\n default:\n if (query !== getActiveElement())\n query.focus()\n }\n })\n\n /* Set up global keyboard handlers */\n keyboard$\n .pipe(\n filter(({ mode }) => mode === \"global\"),\n )\n .subscribe(key => {\n switch (key.type) {\n\n /* Open search and select query */\n case \"f\":\n case \"s\":\n case \"/\":\n query.focus()\n query.select()\n\n /* Prevent scrolling of page */\n key.claim()\n break\n }\n })\n\n /* Create and return component */\n const query$ = mountSearchQuery(query, worker)\n const result$ = mountSearchResult(result, worker, { query$ })\n return merge(query$, result$)\n .pipe(\n mergeWith(\n\n /* Search sharing */\n ...getComponentElements(\"search-share\", el)\n .map(child => mountSearchShare(child, { query$ })),\n\n /* Search suggestions */\n ...getComponentElements(\"search-suggest\", el)\n .map(child => mountSearchSuggest(child, worker, { keyboard$ }))\n )\n )\n\n /* Gracefully handle broken search */\n } catch (err) {\n el.hidden = true\n return NEVER\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n ObservableInput,\n combineLatest,\n filter,\n map,\n startWith\n} from \"rxjs\"\n\nimport { getLocation } from \"~/browser\"\nimport {\n SearchIndex,\n setupSearchHighlighter\n} from \"~/integrations\"\nimport { h } from \"~/utilities\"\n\nimport { Component } from \"../../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search highlighting\n */\nexport interface SearchHighlight {\n nodes: Map /* Map of replacements */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount options\n */\ninterface MountOptions {\n index$: ObservableInput /* Search index observable */\n location$: Observable /* Location observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Mount search highlighting\n *\n * @param el - Content element\n * @param options - Options\n *\n * @returns Search highlighting component observable\n */\nexport function mountSearchHiglight(\n el: HTMLElement, { index$, location$ }: MountOptions\n): Observable> {\n return combineLatest([\n index$,\n location$\n .pipe(\n startWith(getLocation()),\n filter(url => !!url.searchParams.get(\"h\"))\n )\n ])\n .pipe(\n map(([index, url]) => setupSearchHighlighter(index.config, true)(\n url.searchParams.get(\"h\")!\n )),\n map(fn => {\n const nodes = new Map()\n\n /* Traverse text nodes and collect matches */\n const it = document.createNodeIterator(el, NodeFilter.SHOW_TEXT)\n for (let node = it.nextNode(); node; node = it.nextNode()) {\n if (node.parentElement?.offsetHeight) {\n const original = node.textContent!\n const replaced = fn(original)\n if (replaced.length > original.length)\n nodes.set(node as ChildNode, replaced)\n }\n }\n\n /* Replace original nodes with matches */\n for (const [node, text] of nodes) {\n const { childNodes } = h(\"span\", null, text)\n node.replaceWith(...Array.from(childNodes))\n }\n\n /* Return component */\n return { ref: el, nodes }\n })\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n animationFrameScheduler,\n auditTime,\n combineLatest,\n defer,\n distinctUntilChanged,\n finalize,\n map,\n tap,\n withLatestFrom\n} from \"rxjs\"\n\nimport {\n Viewport,\n getElement,\n getElementOffset\n} from \"~/browser\"\n\nimport { Component } from \"../_\"\nimport { Header } from \"../header\"\nimport { Main } from \"../main\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Sidebar\n */\nexport interface Sidebar {\n height: number /* Sidebar height */\n locked: boolean /* Sidebar is locked */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n main$: Observable
    /* Main area observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n main$: Observable
    /* Main area observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch sidebar\n *\n * This function returns an observable that computes the visual parameters of\n * the sidebar which depends on the vertical viewport offset, as well as the\n * height of the main area. When the page is scrolled beyond the header, the\n * sidebar is locked and fills the remaining space.\n *\n * @param el - Sidebar element\n * @param options - Options\n *\n * @returns Sidebar observable\n */\nexport function watchSidebar(\n el: HTMLElement, { viewport$, main$ }: WatchOptions\n): Observable {\n const parent = el.parentElement!\n const adjust =\n parent.offsetTop -\n parent.parentElement!.offsetTop\n\n /* Compute the sidebar's available height and if it should be locked */\n return combineLatest([main$, viewport$])\n .pipe(\n map(([{ offset, height }, { offset: { y } }]) => {\n height = height\n + Math.min(adjust, Math.max(0, y - offset))\n - adjust\n return {\n height,\n locked: y >= offset + adjust\n }\n }),\n distinctUntilChanged((a, b) => (\n a.height === b.height &&\n a.locked === b.locked\n ))\n )\n}\n\n/**\n * Mount sidebar\n *\n * This function doesn't set the height of the actual sidebar, but of its first\n * child \u2013 the `.md-sidebar__scrollwrap` element in order to mitigiate jittery\n * sidebars when the footer is scrolled into view. At some point we switched\n * from `absolute` / `fixed` positioning to `sticky` positioning, significantly\n * reducing jitter in some browsers (respectively Firefox and Safari) when\n * scrolling from the top. However, top-aligned sticky positioning means that\n * the sidebar snaps to the bottom when the end of the container is reached.\n * This is what leads to the mentioned jitter, as the sidebar's height may be\n * updated too slowly.\n *\n * This behaviour can be mitigiated by setting the height of the sidebar to `0`\n * while preserving the padding, and the height on its first element.\n *\n * @param el - Sidebar element\n * @param options - Options\n *\n * @returns Sidebar component observable\n */\nexport function mountSidebar(\n el: HTMLElement, { header$, ...options }: MountOptions\n): Observable> {\n const inner = getElement(\".md-sidebar__scrollwrap\", el)\n const { y } = getElementOffset(inner)\n return defer(() => {\n const push$ = new Subject()\n push$\n .pipe(\n auditTime(0, animationFrameScheduler),\n withLatestFrom(header$)\n )\n .subscribe({\n\n /* Handle emission */\n next([{ height }, { height: offset }]) {\n inner.style.height = `${height - 2 * y}px`\n el.style.top = `${offset}px`\n },\n\n /* Handle complete */\n complete() {\n inner.style.height = \"\"\n el.style.top = \"\"\n }\n })\n\n /* Create and return component */\n return watchSidebar(el, options)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { Repo, User } from \"github-types\"\nimport {\n EMPTY,\n Observable,\n catchError,\n defaultIfEmpty,\n map,\n zip\n} from \"rxjs\"\n\nimport { requestJSON } from \"~/browser\"\n\nimport { SourceFacts } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * GitHub release (partial)\n */\ninterface Release {\n tag_name: string /* Tag name */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch GitHub repository facts\n *\n * @param user - GitHub user or organization\n * @param repo - GitHub repository\n *\n * @returns Repository facts observable\n */\nexport function fetchSourceFactsFromGitHub(\n user: string, repo?: string\n): Observable {\n if (typeof repo !== \"undefined\") {\n const url = `https://api.github.com/repos/${user}/${repo}`\n return zip(\n\n /* Fetch version */\n requestJSON(`${url}/releases/latest`)\n .pipe(\n catchError(() => EMPTY), // @todo refactor instant loading\n map(release => ({\n version: release.tag_name\n })),\n defaultIfEmpty({})\n ),\n\n /* Fetch stars and forks */\n requestJSON(url)\n .pipe(\n catchError(() => EMPTY), // @todo refactor instant loading\n map(info => ({\n stars: info.stargazers_count,\n forks: info.forks_count\n })),\n defaultIfEmpty({})\n )\n )\n .pipe(\n map(([release, info]) => ({ ...release, ...info }))\n )\n\n /* User or organization */\n } else {\n const url = `https://api.github.com/users/${user}`\n return requestJSON(url)\n .pipe(\n map(info => ({\n repositories: info.public_repos\n })),\n defaultIfEmpty({})\n )\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { ProjectSchema } from \"gitlab\"\nimport {\n EMPTY,\n Observable,\n catchError,\n defaultIfEmpty,\n map\n} from \"rxjs\"\n\nimport { requestJSON } from \"~/browser\"\n\nimport { SourceFacts } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch GitLab repository facts\n *\n * @param base - GitLab base\n * @param project - GitLab project\n *\n * @returns Repository facts observable\n */\nexport function fetchSourceFactsFromGitLab(\n base: string, project: string\n): Observable {\n const url = `https://${base}/api/v4/projects/${encodeURIComponent(project)}`\n return requestJSON(url)\n .pipe(\n catchError(() => EMPTY), // @todo refactor instant loading\n map(({ star_count, forks_count }) => ({\n stars: star_count,\n forks: forks_count\n })),\n defaultIfEmpty({})\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { EMPTY, Observable } from \"rxjs\"\n\nimport { fetchSourceFactsFromGitHub } from \"../github\"\nimport { fetchSourceFactsFromGitLab } from \"../gitlab\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Repository facts for repositories\n */\nexport interface RepositoryFacts {\n stars?: number /* Number of stars */\n forks?: number /* Number of forks */\n version?: string /* Latest version */\n}\n\n/**\n * Repository facts for organizations\n */\nexport interface OrganizationFacts {\n repositories?: number /* Number of repositories */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Repository facts\n */\nexport type SourceFacts =\n | RepositoryFacts\n | OrganizationFacts\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch repository facts\n *\n * @param url - Repository URL\n *\n * @returns Repository facts observable\n */\nexport function fetchSourceFacts(\n url: string\n): Observable {\n const [type] = url.match(/(git(?:hub|lab))/i) || []\n switch (type.toLowerCase()) {\n\n /* GitHub repository */\n case \"github\":\n const [, user, repo] = url.match(/^.+github\\.com\\/([^/]+)\\/?([^/]+)?/i)!\n return fetchSourceFactsFromGitHub(user, repo)\n\n /* GitLab repository */\n case \"gitlab\":\n const [, base, slug] = url.match(/^.+?([^/]*gitlab[^/]+)\\/(.+?)\\/?$/i)!\n return fetchSourceFactsFromGitLab(base, slug)\n\n /* Everything else */\n default:\n return EMPTY\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n EMPTY,\n Observable,\n Subject,\n catchError,\n defer,\n filter,\n finalize,\n map,\n of,\n shareReplay,\n tap\n} from \"rxjs\"\n\nimport { getElement } from \"~/browser\"\nimport { renderSourceFacts } from \"~/templates\"\n\nimport { Component } from \"../../_\"\nimport {\n SourceFacts,\n fetchSourceFacts\n} from \"../facts\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Repository information\n */\nexport interface Source {\n facts: SourceFacts /* Repository facts */\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Repository information observable\n */\nlet fetch$: Observable\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch repository information\n *\n * This function tries to read the repository facts from session storage, and\n * if unsuccessful, fetches them from the underlying provider.\n *\n * @param el - Repository information element\n *\n * @returns Repository information observable\n */\nexport function watchSource(\n el: HTMLAnchorElement\n): Observable {\n return fetch$ ||= defer(() => {\n const cached = __md_get(\"__source\", sessionStorage)\n if (cached)\n return of(cached)\n else\n return fetchSourceFacts(el.href)\n .pipe(\n tap(facts => __md_set(\"__source\", facts, sessionStorage))\n )\n })\n .pipe(\n catchError(() => EMPTY),\n filter(facts => Object.keys(facts).length > 0),\n map(facts => ({ facts })),\n shareReplay(1)\n )\n}\n\n/**\n * Mount repository information\n *\n * @param el - Repository information element\n *\n * @returns Repository information component observable\n */\nexport function mountSource(\n el: HTMLAnchorElement\n): Observable> {\n const inner = getElement(\":scope > :last-child\", el)\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe(({ facts }) => {\n inner.appendChild(renderSourceFacts(facts))\n inner.classList.add(\"md-source__repository--active\")\n })\n\n /* Create and return component */\n return watchSource(el)\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n defer,\n distinctUntilKeyChanged,\n finalize,\n map,\n of,\n switchMap,\n tap\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n Viewport,\n watchElementSize,\n watchViewportAt\n} from \"~/browser\"\n\nimport { Component } from \"../_\"\nimport { Header } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Navigation tabs\n */\nexport interface Tabs {\n hidden: boolean /* Navigation tabs are hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch navigation tabs\n *\n * @param el - Navigation tabs element\n * @param options - Options\n *\n * @returns Navigation tabs observable\n */\nexport function watchTabs(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable {\n return watchElementSize(document.body)\n .pipe(\n switchMap(() => watchViewportAt(el, { header$, viewport$ })),\n map(({ offset: { y } }) => {\n return {\n hidden: y >= 10\n }\n }),\n distinctUntilKeyChanged(\"hidden\")\n )\n}\n\n/**\n * Mount navigation tabs\n *\n * This function hides the navigation tabs when scrolling past the threshold\n * and makes them reappear in a nice CSS animation when scrolling back up.\n *\n * @param el - Navigation tabs element\n * @param options - Options\n *\n * @returns Navigation tabs component observable\n */\nexport function mountTabs(\n el: HTMLElement, options: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject()\n push$.subscribe({\n\n /* Handle emission */\n next({ hidden }) {\n el.hidden = hidden\n },\n\n /* Handle complete */\n complete() {\n el.hidden = false\n }\n })\n\n /* Create and return component */\n return (\n feature(\"navigation.tabs.sticky\")\n ? of({ hidden: false })\n : watchTabs(el, options)\n )\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n bufferCount,\n combineLatestWith,\n debounceTime,\n defer,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n finalize,\n map,\n of,\n repeat,\n scan,\n share,\n skip,\n startWith,\n switchMap,\n takeLast,\n takeUntil,\n tap,\n withLatestFrom\n} from \"rxjs\"\n\nimport { feature } from \"~/_\"\nimport {\n Viewport,\n getElement,\n getElements,\n getLocation,\n getOptionalElement,\n watchElementSize\n} from \"~/browser\"\n\nimport {\n Component,\n getComponentElement\n} from \"../_\"\nimport { Header } from \"../header\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Table of contents\n */\nexport interface TableOfContents {\n prev: HTMLAnchorElement[][] /* Anchors (previous) */\n next: HTMLAnchorElement[][] /* Anchors (next) */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n target$: Observable /* Location target observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch table of contents\n *\n * This is effectively a scroll spy implementation which will account for the\n * fixed header and automatically re-calculate anchor offsets when the viewport\n * is resized. The returned observable will only emit if the table of contents\n * needs to be repainted.\n *\n * This implementation tracks an anchor element's entire path starting from its\n * level up to the top-most anchor element, e.g. `[h3, h2, h1]`. Although the\n * Material theme currently doesn't make use of this information, it enables\n * the styling of the entire hierarchy through customization.\n *\n * Note that the current anchor is the last item of the `prev` anchor list.\n *\n * @param el - Table of contents element\n * @param options - Options\n *\n * @returns Table of contents observable\n */\nexport function watchTableOfContents(\n el: HTMLElement, { viewport$, header$ }: WatchOptions\n): Observable {\n const table = new Map()\n\n /* Compute anchor-to-target mapping */\n const anchors = getElements(\"[href^=\\\\#]\", el)\n for (const anchor of anchors) {\n const id = decodeURIComponent(anchor.hash.substring(1))\n const target = getOptionalElement(`[id=\"${id}\"]`)\n if (typeof target !== \"undefined\")\n table.set(anchor, target)\n }\n\n /* Compute necessary adjustment for header */\n const adjust$ = header$\n .pipe(\n distinctUntilKeyChanged(\"height\"),\n map(({ height }) => {\n const main = getComponentElement(\"main\")\n const grid = getElement(\":scope > :first-child\", main)\n return height + 0.8 * (\n grid.offsetTop -\n main.offsetTop\n )\n }),\n share()\n )\n\n /* Compute partition of previous and next anchors */\n const partition$ = watchElementSize(document.body)\n .pipe(\n distinctUntilKeyChanged(\"height\"),\n\n /* Build index to map anchor paths to vertical offsets */\n switchMap(body => defer(() => {\n let path: HTMLAnchorElement[] = []\n return of([...table].reduce((index, [anchor, target]) => {\n while (path.length) {\n const last = table.get(path[path.length - 1])!\n if (last.tagName >= target.tagName) {\n path.pop()\n } else {\n break\n }\n }\n\n /* If the current anchor is hidden, continue with its parent */\n let offset = target.offsetTop\n while (!offset && target.parentElement) {\n target = target.parentElement\n offset = target.offsetTop\n }\n\n /* Map reversed anchor path to vertical offset */\n return index.set(\n [...path = [...path, anchor]].reverse(),\n offset\n )\n }, new Map()))\n })\n .pipe(\n\n /* Sort index by vertical offset (see https://bit.ly/30z6QSO) */\n map(index => new Map([...index].sort(([, a], [, b]) => a - b))),\n combineLatestWith(adjust$),\n\n /* Re-compute partition when viewport offset changes */\n switchMap(([index, adjust]) => viewport$\n .pipe(\n scan(([prev, next], { offset: { y }, size }) => {\n const last = y + size.height >= Math.floor(body.height)\n\n /* Look forward */\n while (next.length) {\n const [, offset] = next[0]\n if (offset - adjust < y || last) {\n prev = [...prev, next.shift()!]\n } else {\n break\n }\n }\n\n /* Look backward */\n while (prev.length) {\n const [, offset] = prev[prev.length - 1]\n if (offset - adjust >= y && !last) {\n next = [prev.pop()!, ...next]\n } else {\n break\n }\n }\n\n /* Return partition */\n return [prev, next]\n }, [[], [...index]]),\n distinctUntilChanged((a, b) => (\n a[0] === b[0] &&\n a[1] === b[1]\n ))\n )\n )\n )\n )\n )\n\n /* Compute and return anchor list migrations */\n return partition$\n .pipe(\n map(([prev, next]) => ({\n prev: prev.map(([path]) => path),\n next: next.map(([path]) => path)\n })),\n\n /* Extract anchor list migrations */\n startWith({ prev: [], next: [] }),\n bufferCount(2, 1),\n map(([a, b]) => {\n\n /* Moving down */\n if (a.prev.length < b.prev.length) {\n return {\n prev: b.prev.slice(Math.max(0, a.prev.length - 1), b.prev.length),\n next: []\n }\n\n /* Moving up */\n } else {\n return {\n prev: b.prev.slice(-1),\n next: b.next.slice(0, b.next.length - a.next.length)\n }\n }\n })\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount table of contents\n *\n * @param el - Table of contents element\n * @param options - Options\n *\n * @returns Table of contents component observable\n */\nexport function mountTableOfContents(\n el: HTMLElement, { viewport$, header$, target$ }: MountOptions\n): Observable> {\n return defer(() => {\n const push$ = new Subject()\n const done$ = push$.pipe(takeLast(1))\n push$.subscribe(({ prev, next }) => {\n\n /* Look forward */\n for (const [anchor] of next) {\n anchor.classList.remove(\"md-nav__link--passed\")\n anchor.classList.remove(\"md-nav__link--active\")\n }\n\n /* Look backward */\n for (const [index, [anchor]] of prev.entries()) {\n anchor.classList.add(\"md-nav__link--passed\")\n anchor.classList.toggle(\n \"md-nav__link--active\",\n index === prev.length - 1\n )\n }\n })\n\n /* Set up anchor tracking, if enabled */\n if (feature(\"navigation.tracking\"))\n viewport$\n .pipe(\n takeUntil(done$),\n distinctUntilKeyChanged(\"offset\"),\n debounceTime(250),\n skip(1),\n takeUntil(target$.pipe(skip(1))),\n repeat({ delay: 250 }),\n withLatestFrom(push$)\n )\n .subscribe(([, { prev }]) => {\n const url = getLocation()\n\n /* Set hash fragment to active anchor */\n const anchor = prev[prev.length - 1]\n if (anchor && anchor.length) {\n const [active] = anchor\n const { hash } = new URL(active.href)\n if (url.hash !== hash) {\n url.hash = hash\n history.replaceState({}, \"\", `${url}`)\n }\n\n /* Reset anchor when at the top */\n } else {\n url.hash = \"\"\n history.replaceState({}, \"\", `${url}`)\n }\n })\n\n /* Create and return component */\n return watchTableOfContents(el, { viewport$, header$ })\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n Subject,\n bufferCount,\n combineLatest,\n distinctUntilChanged,\n distinctUntilKeyChanged,\n endWith,\n finalize,\n map,\n repeat,\n skip,\n takeLast,\n takeUntil,\n tap\n} from \"rxjs\"\n\nimport { Viewport } from \"~/browser\"\n\nimport { Component } from \"../_\"\nimport { Header } from \"../header\"\nimport { Main } from \"../main\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Back-to-top button\n */\nexport interface BackToTop {\n hidden: boolean /* Back-to-top button is hidden */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch options\n */\ninterface WatchOptions {\n viewport$: Observable /* Viewport observable */\n main$: Observable
    /* Main area observable */\n target$: Observable /* Location target observable */\n}\n\n/**\n * Mount options\n */\ninterface MountOptions {\n viewport$: Observable /* Viewport observable */\n header$: Observable
    /* Header observable */\n main$: Observable
    /* Main area observable */\n target$: Observable /* Location target observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Watch back-to-top\n *\n * @param _el - Back-to-top element\n * @param options - Options\n *\n * @returns Back-to-top observable\n */\nexport function watchBackToTop(\n _el: HTMLElement, { viewport$, main$, target$ }: WatchOptions\n): Observable {\n\n /* Compute direction */\n const direction$ = viewport$\n .pipe(\n map(({ offset: { y } }) => y),\n bufferCount(2, 1),\n map(([a, b]) => a > b && b > 0),\n distinctUntilChanged()\n )\n\n /* Compute whether main area is active */\n const active$ = main$\n .pipe(\n map(({ active }) => active)\n )\n\n /* Compute threshold for hiding */\n return combineLatest([active$, direction$])\n .pipe(\n map(([active, direction]) => !(active && direction)),\n distinctUntilChanged(),\n takeUntil(target$.pipe(skip(1))),\n endWith(true),\n repeat({ delay: 250 }),\n map(hidden => ({ hidden }))\n )\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Mount back-to-top\n *\n * @param el - Back-to-top element\n * @param options - Options\n *\n * @returns Back-to-top component observable\n */\nexport function mountBackToTop(\n el: HTMLElement, { viewport$, header$, main$, target$ }: MountOptions\n): Observable> {\n const push$ = new Subject()\n const done$ = push$.pipe(takeLast(1))\n push$.subscribe({\n\n /* Handle emission */\n next({ hidden }) {\n el.hidden = hidden\n if (hidden) {\n el.setAttribute(\"tabindex\", \"-1\")\n el.blur()\n } else {\n el.removeAttribute(\"tabindex\")\n }\n },\n\n /* Handle complete */\n complete() {\n el.style.top = \"\"\n el.hidden = true\n el.removeAttribute(\"tabindex\")\n }\n })\n\n /* Watch header height */\n header$\n .pipe(\n takeUntil(done$),\n distinctUntilKeyChanged(\"height\")\n )\n .subscribe(({ height }) => {\n el.style.top = `${height + 16}px`\n })\n\n /* Create and return component */\n return watchBackToTop(el, { viewport$, main$, target$ })\n .pipe(\n tap(state => push$.next(state)),\n finalize(() => push$.complete()),\n map(state => ({ ref: el, ...state }))\n )\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n fromEvent,\n map,\n mergeMap,\n switchMap,\n takeWhile,\n tap,\n withLatestFrom\n} from \"rxjs\"\n\nimport { getElements } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n document$: Observable /* Document observable */\n tablet$: Observable /* Media tablet observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch indeterminate checkboxes\n *\n * This function replaces the indeterminate \"pseudo state\" with the actual\n * indeterminate state, which is used to keep navigation always expanded.\n *\n * @param options - Options\n */\nexport function patchIndeterminate(\n { document$, tablet$ }: PatchOptions\n): void {\n document$\n .pipe(\n switchMap(() => getElements(\n // @todo `data-md-state` is deprecated and removed in v9\n \".md-toggle--indeterminate, [data-md-state=indeterminate]\"\n )),\n tap(el => {\n el.indeterminate = true\n el.checked = false\n }),\n mergeMap(el => fromEvent(el, \"change\")\n .pipe(\n takeWhile(() => el.classList.contains(\"md-toggle--indeterminate\")),\n map(() => el)\n )\n ),\n withLatestFrom(tablet$)\n )\n .subscribe(([el, tablet]) => {\n el.classList.remove(\"md-toggle--indeterminate\")\n if (tablet)\n el.checked = false\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n filter,\n fromEvent,\n map,\n mergeMap,\n switchMap,\n tap\n} from \"rxjs\"\n\nimport { getElements } from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n document$: Observable /* Document observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Check whether the given device is an Apple device\n *\n * @returns Test result\n */\nfunction isAppleDevice(): boolean {\n return /(iPad|iPhone|iPod)/.test(navigator.userAgent)\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch all elements with `data-md-scrollfix` attributes\n *\n * This is a year-old patch which ensures that overflow scrolling works at the\n * top and bottom of containers on iOS by ensuring a `1px` scroll offset upon\n * the start of a touch event.\n *\n * @see https://bit.ly/2SCtAOO - Original source\n *\n * @param options - Options\n */\nexport function patchScrollfix(\n { document$ }: PatchOptions\n): void {\n document$\n .pipe(\n switchMap(() => getElements(\"[data-md-scrollfix]\")),\n tap(el => el.removeAttribute(\"data-md-scrollfix\")),\n filter(isAppleDevice),\n mergeMap(el => fromEvent(el, \"touchstart\")\n .pipe(\n map(() => el)\n )\n )\n )\n .subscribe(el => {\n const top = el.scrollTop\n\n /* We're at the top of the container */\n if (top === 0) {\n el.scrollTop = 1\n\n /* We're at the bottom of the container */\n } else if (top + el.offsetHeight === el.scrollHeight) {\n el.scrollTop = top - 1\n }\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n Observable,\n combineLatest,\n delay,\n map,\n of,\n switchMap,\n withLatestFrom\n} from \"rxjs\"\n\nimport {\n Viewport,\n watchToggle\n} from \"~/browser\"\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch options\n */\ninterface PatchOptions {\n viewport$: Observable /* Viewport observable */\n tablet$: Observable /* Media tablet observable */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Patch the document body to lock when search is open\n *\n * For mobile and tablet viewports, the search is rendered full screen, which\n * leads to scroll leaking when at the top or bottom of the search result. This\n * function locks the body when the search is in full screen mode, and restores\n * the scroll position when leaving.\n *\n * @param options - Options\n */\nexport function patchScrolllock(\n { viewport$, tablet$ }: PatchOptions\n): void {\n combineLatest([watchToggle(\"search\"), tablet$])\n .pipe(\n map(([active, tablet]) => active && !tablet),\n switchMap(active => of(active)\n .pipe(\n delay(active ? 400 : 100)\n )\n ),\n withLatestFrom(viewport$)\n )\n .subscribe(([active, { offset: { y }}]) => {\n if (active) {\n document.body.setAttribute(\"data-md-scrolllock\", \"\")\n document.body.style.top = `-${y}px`\n } else {\n const value = -1 * parseInt(document.body.style.top, 10)\n document.body.removeAttribute(\"data-md-scrolllock\")\n document.body.style.top = \"\"\n if (value)\n window.scrollTo(0, value)\n }\n })\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Polyfills\n * ------------------------------------------------------------------------- */\n\n/* Polyfill `Object.entries` */\nif (!Object.entries)\n Object.entries = function (obj: object) {\n const data: [string, string][] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push([key, obj[key]])\n\n /* Return entries */\n return data\n }\n\n/* Polyfill `Object.values` */\nif (!Object.values)\n Object.values = function (obj: object) {\n const data: string[] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push(obj[key])\n\n /* Return values */\n return data\n }\n\n/* ------------------------------------------------------------------------- */\n\n/* Polyfills for `Element` */\nif (typeof Element !== \"undefined\") {\n\n /* Polyfill `Element.scrollTo` */\n if (!Element.prototype.scrollTo)\n Element.prototype.scrollTo = function (\n x?: ScrollToOptions | number, y?: number\n ): void {\n if (typeof x === \"object\") {\n this.scrollLeft = x.left!\n this.scrollTop = x.top!\n } else {\n this.scrollLeft = x!\n this.scrollTop = y!\n }\n }\n\n /* Polyfill `Element.replaceWith` */\n if (!Element.prototype.replaceWith)\n Element.prototype.replaceWith = function (\n ...nodes: Array\n ): void {\n const parent = this.parentNode\n if (parent) {\n if (nodes.length === 0)\n parent.removeChild(this)\n\n /* Replace children and create text nodes */\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i]\n if (typeof node !== \"object\")\n node = document.createTextNode(node)\n else if (node.parentNode)\n node.parentNode.removeChild(node)\n\n /* Replace child or insert before previous sibling */\n if (!i)\n parent.replaceChild(node, this)\n else\n parent.insertBefore(this.previousSibling!, node)\n }\n }\n }\n}\n"], + "mappings": "6+BAAA,oBAAC,UAAU,EAAQ,EAAS,CAC1B,MAAO,KAAY,UAAY,MAAO,KAAW,YAAc,EAAQ,EACvE,MAAO,SAAW,YAAc,OAAO,IAAM,OAAO,CAAO,EAC1D,EAAQ,CACX,GAAE,GAAO,UAAY,CAAE,aASrB,WAAmC,EAAO,CACxC,GAAI,GAAmB,GACnB,EAA0B,GAC1B,EAAiC,KAEjC,EAAsB,CACxB,KAAM,GACN,OAAQ,GACR,IAAK,GACL,IAAK,GACL,MAAO,GACP,SAAU,GACV,OAAQ,GACR,KAAM,GACN,MAAO,GACP,KAAM,GACN,KAAM,GACN,SAAU,GACV,iBAAkB,EACpB,EAOA,WAA4B,EAAI,CAC9B,MACE,MACA,IAAO,UACP,EAAG,WAAa,QAChB,EAAG,WAAa,QAChB,aAAe,IACf,YAAc,GAAG,UAKrB,CASA,WAAuC,EAAI,CACzC,GAAI,IAAO,EAAG,KACV,GAAU,EAAG,QAUjB,MARI,QAAY,SAAW,EAAoB,KAAS,CAAC,EAAG,UAIxD,KAAY,YAAc,CAAC,EAAG,UAI9B,EAAG,kBAKT,CAOA,WAA8B,EAAI,CAChC,AAAI,EAAG,UAAU,SAAS,eAAe,GAGzC,GAAG,UAAU,IAAI,eAAe,EAChC,EAAG,aAAa,2BAA4B,EAAE,EAChD,CAOA,WAAiC,EAAI,CACnC,AAAI,CAAC,EAAG,aAAa,0BAA0B,G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ACpB,OAAO,UAAa,GACpB,OAAO,QAAa,GACpB,OAAO,QAAa,GACpB,OAAO,OAAa,GACpB,OAAO,OAAa,GACpB,OAAO,WAAa", + "names": [] +} diff --git a/assets/javascripts/lunr/min/lunr.ar.min.js b/assets/javascripts/lunr/min/lunr.ar.min.js new file mode 100644 index 00000000..248ddc5d --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.ar.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ar=function(){this.pipeline.reset(),this.pipeline.add(e.ar.trimmer,e.ar.stopWordFilter,e.ar.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ar.stemmer))},e.ar.wordCharacters="ء-ٛٱـ",e.ar.trimmer=e.trimmerSupport.generateTrimmer(e.ar.wordCharacters),e.Pipeline.registerFunction(e.ar.trimmer,"trimmer-ar"),e.ar.stemmer=function(){var e=this;return e.result=!1,e.preRemoved=!1,e.sufRemoved=!1,e.pre={pre1:"ف ك ب و س ل ن ا ي ت",pre2:"ال لل",pre3:"بال وال فال تال كال ولل",pre4:"فبال كبال وبال وكال"},e.suf={suf1:"ه ك ت ن ا ي",suf2:"نك نه ها وك يا اه ون ين تن تم نا وا ان كم كن ني نن ما هم هن تك ته ات يه",suf3:"تين كهم نيه نهم ونه وها يهم ونا ونك وني وهم تكم تنا تها تني تهم كما كها ناه نكم هنا تان يها",suf4:"كموه ناها ونني ونهم تكما تموه تكاه كماه ناكم ناهم نيها وننا"},e.patterns=JSON.parse('{"pt43":[{"pt":[{"c":"ا","l":1}]},{"pt":[{"c":"ا,ت,ن,ي","l":0}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"و","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ي","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ا","l":2},{"c":"ل","l":3,"m":3}]},{"pt":[{"c":"م","l":0}]}],"pt53":[{"pt":[{"c":"ت","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":3},{"c":"ل","l":3,"m":4},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":3}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ن","l":4}]},{"pt":[{"c":"ت","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"م","l":0},{"c":"و","l":3}]},{"pt":[{"c":"ا","l":1},{"c":"و","l":3}]},{"pt":[{"c":"و","l":1},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"ا","l":2},{"c":"ن","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":1},{"c":"ا","l":3}]},{"pt":[{"c":"ي,ت,ا,ن","l":0},{"c":"ت","l":1}],"mPt":[{"c":"ف","l":0,"m":2},{"c":"ع","l":1,"m":3},{"c":"ا","l":2},{"c":"ل","l":3,"m":4}]},{"pt":[{"c":"ت,ي,ا,ن","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":2},{"c":"ي","l":3}]},{"pt":[{"c":"ا,ي,ت,ن","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ء","l":4}]}],"pt63":[{"pt":[{"c":"ا","l":0},{"c":"ت","l":2},{"c":"ا","l":4}]},{"pt":[{"c":"ا,ت,ن,ي","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"و","l":3}]},{"pt":[{"c":"م","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ي","l":1},{"c":"ي","l":3},{"c":"ا","l":4},{"c":"ء","l":5}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ا","l":4}]}],"pt54":[{"pt":[{"c":"ت","l":0}]},{"pt":[{"c":"ا,ي,ت,ن","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"م","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":2}]}],"pt64":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":1}]}],"pt73":[{"pt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ا","l":5}]}],"pt75":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":5}]}]}'),e.execArray=["cleanWord","removeDiacritics","cleanAlef","removeStopWords","normalizeHamzaAndAlef","removeStartWaw","removePre432","removeEndTaa","wordCheck"],e.stem=function(){var r=0;for(e.result=!1,e.preRemoved=!1,e.sufRemoved=!1;r=0)return!0},e.normalizeHamzaAndAlef=function(){return e.word=e.word.replace("ؤ","ء"),e.word=e.word.replace("ئ","ء"),e.word=e.word.replace(/([\u0627])\1+/gi,"ا"),!1},e.removeEndTaa=function(){return!(e.word.length>2)||(e.word=e.word.replace(/[\u0627]$/,""),e.word=e.word.replace("ة",""),!1)},e.removeStartWaw=function(){return e.word.length>3&&"و"==e.word[0]&&"و"==e.word[1]&&(e.word=e.word.slice(1)),!1},e.removePre432=function(){var r=e.word;if(e.word.length>=7){var t=new RegExp("^("+e.pre.pre4.split(" ").join("|")+")");e.word=e.word.replace(t,"")}if(e.word==r&&e.word.length>=6){var c=new RegExp("^("+e.pre.pre3.split(" ").join("|")+")");e.word=e.word.replace(c,"")}if(e.word==r&&e.word.length>=5){var l=new RegExp("^("+e.pre.pre2.split(" ").join("|")+")");e.word=e.word.replace(l,"")}return r!=e.word&&(e.preRemoved=!0),!1},e.patternCheck=function(r){for(var t=0;t3){var t=new RegExp("^("+e.pre.pre1.split(" ").join("|")+")");e.word=e.word.replace(t,"")}return r!=e.word&&(e.preRemoved=!0),!1},e.removeSuf1=function(){var r=e.word;if(0==e.sufRemoved&&e.word.length>3){var t=new RegExp("("+e.suf.suf1.split(" ").join("|")+")$");e.word=e.word.replace(t,"")}return r!=e.word&&(e.sufRemoved=!0),!1},e.removeSuf432=function(){var r=e.word;if(e.word.length>=6){var t=new RegExp("("+e.suf.suf4.split(" ").join("|")+")$");e.word=e.word.replace(t,"")}if(e.word==r&&e.word.length>=5){var c=new RegExp("("+e.suf.suf3.split(" ").join("|")+")$");e.word=e.word.replace(c,"")}if(e.word==r&&e.word.length>=4){var l=new RegExp("("+e.suf.suf2.split(" ").join("|")+")$");e.word=e.word.replace(l,"")}return r!=e.word&&(e.sufRemoved=!0),!1},e.wordCheck=function(){for(var r=(e.word,[e.removeSuf432,e.removeSuf1,e.removePre1]),t=0,c=!1;e.word.length>=7&&!e.result&&t=f.limit)return;f.cursor++}for(;!f.out_grouping(w,97,248);){if(f.cursor>=f.limit)return;f.cursor++}d=f.cursor,d=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(c,32),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del();break;case 2:f.in_grouping_b(p,97,229)&&f.slice_del()}}function t(){var e,r=f.limit-f.cursor;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.find_among_b(l,4)?(f.bra=f.cursor,f.limit_backward=e,f.cursor=f.limit-r,f.cursor>f.limit_backward&&(f.cursor--,f.bra=f.cursor,f.slice_del())):f.limit_backward=e)}function s(){var e,r,i,n=f.limit-f.cursor;if(f.ket=f.cursor,f.eq_s_b(2,"st")&&(f.bra=f.cursor,f.eq_s_b(2,"ig")&&f.slice_del()),f.cursor=f.limit-n,f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(m,5),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del(),i=f.limit-f.cursor,t(),f.cursor=f.limit-i;break;case 2:f.slice_from("løs")}}function o(){var e;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.out_grouping_b(w,97,248)?(f.bra=f.cursor,u=f.slice_to(u),f.limit_backward=e,f.eq_v_b(u)&&f.slice_del()):f.limit_backward=e)}var a,d,u,c=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],l=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],w=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],p=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],f=new i;this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var r=f.cursor;return e(),f.limit_backward=r,f.cursor=f.limit,n(),f.cursor=f.limit,t(),f.cursor=f.limit,s(),f.cursor=f.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.de.min.js b/assets/javascripts/lunr/min/lunr.de.min.js new file mode 100644 index 00000000..f3b5c108 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.de.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `German` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.de=function(){this.pipeline.reset(),this.pipeline.add(e.de.trimmer,e.de.stopWordFilter,e.de.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.de.stemmer))},e.de.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.de.trimmer=e.trimmerSupport.generateTrimmer(e.de.wordCharacters),e.Pipeline.registerFunction(e.de.trimmer,"trimmer-de"),e.de.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,n){return!(!v.eq_s(1,e)||(v.ket=v.cursor,!v.in_grouping(p,97,252)))&&(v.slice_from(r),v.cursor=n,!0)}function i(){for(var r,n,i,s,t=v.cursor;;)if(r=v.cursor,v.bra=r,v.eq_s(1,"ß"))v.ket=v.cursor,v.slice_from("ss");else{if(r>=v.limit)break;v.cursor=r+1}for(v.cursor=t;;)for(n=v.cursor;;){if(i=v.cursor,v.in_grouping(p,97,252)){if(s=v.cursor,v.bra=s,e("u","U",i))break;if(v.cursor=s,e("y","Y",i))break}if(i>=v.limit)return void(v.cursor=n);v.cursor=i+1}}function s(){for(;!v.in_grouping(p,97,252);){if(v.cursor>=v.limit)return!0;v.cursor++}for(;!v.out_grouping(p,97,252);){if(v.cursor>=v.limit)return!0;v.cursor++}return!1}function t(){m=v.limit,l=m;var e=v.cursor+3;0<=e&&e<=v.limit&&(d=e,s()||(m=v.cursor,m=v.limit)return;v.cursor++}}}function c(){return m<=v.cursor}function u(){return l<=v.cursor}function a(){var e,r,n,i,s=v.limit-v.cursor;if(v.ket=v.cursor,(e=v.find_among_b(w,7))&&(v.bra=v.cursor,c()))switch(e){case 1:v.slice_del();break;case 2:v.slice_del(),v.ket=v.cursor,v.eq_s_b(1,"s")&&(v.bra=v.cursor,v.eq_s_b(3,"nis")&&v.slice_del());break;case 3:v.in_grouping_b(g,98,116)&&v.slice_del()}if(v.cursor=v.limit-s,v.ket=v.cursor,(e=v.find_among_b(f,4))&&(v.bra=v.cursor,c()))switch(e){case 1:v.slice_del();break;case 2:if(v.in_grouping_b(k,98,116)){var t=v.cursor-3;v.limit_backward<=t&&t<=v.limit&&(v.cursor=t,v.slice_del())}}if(v.cursor=v.limit-s,v.ket=v.cursor,(e=v.find_among_b(_,8))&&(v.bra=v.cursor,u()))switch(e){case 1:v.slice_del(),v.ket=v.cursor,v.eq_s_b(2,"ig")&&(v.bra=v.cursor,r=v.limit-v.cursor,v.eq_s_b(1,"e")||(v.cursor=v.limit-r,u()&&v.slice_del()));break;case 2:n=v.limit-v.cursor,v.eq_s_b(1,"e")||(v.cursor=v.limit-n,v.slice_del());break;case 3:if(v.slice_del(),v.ket=v.cursor,i=v.limit-v.cursor,!v.eq_s_b(2,"er")&&(v.cursor=v.limit-i,!v.eq_s_b(2,"en")))break;v.bra=v.cursor,c()&&v.slice_del();break;case 4:v.slice_del(),v.ket=v.cursor,e=v.find_among_b(b,2),e&&(v.bra=v.cursor,u()&&1==e&&v.slice_del())}}var d,l,m,h=[new r("",-1,6),new r("U",0,2),new r("Y",0,1),new r("ä",0,3),new r("ö",0,4),new r("ü",0,5)],w=[new r("e",-1,2),new r("em",-1,1),new r("en",-1,2),new r("ern",-1,1),new r("er",-1,1),new r("s",-1,3),new r("es",5,2)],f=[new r("en",-1,1),new r("er",-1,1),new r("st",-1,2),new r("est",2,1)],b=[new r("ig",-1,1),new r("lich",-1,1)],_=[new r("end",-1,1),new r("ig",-1,2),new r("ung",-1,1),new r("lich",-1,3),new r("isch",-1,2),new r("ik",-1,2),new r("heit",-1,3),new r("keit",-1,4)],p=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32,8],g=[117,30,5],k=[117,30,4],v=new n;this.setCurrent=function(e){v.setCurrent(e)},this.getCurrent=function(){return v.getCurrent()},this.stem=function(){var e=v.cursor;return i(),v.cursor=e,t(),v.limit_backward=e,v.cursor=v.limit,a(),v.cursor=v.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.de.stemmer,"stemmer-de"),e.de.stopWordFilter=e.generateStopWordFilter("aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daß dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures für gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines können könnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte während würde würden zu zum zur zwar zwischen über".split(" ")),e.Pipeline.registerFunction(e.de.stopWordFilter,"stopWordFilter-de")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.du.min.js b/assets/javascripts/lunr/min/lunr.du.min.js new file mode 100644 index 00000000..49a0f3f0 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.du.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Dutch` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");console.warn('[Lunr Languages] Please use the "nl" instead of the "du". The "nl" code is the standard code for Dutch language, and "du" will be removed in the next major versions.'),e.du=function(){this.pipeline.reset(),this.pipeline.add(e.du.trimmer,e.du.stopWordFilter,e.du.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.du.stemmer))},e.du.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.du.trimmer=e.trimmerSupport.generateTrimmer(e.du.wordCharacters),e.Pipeline.registerFunction(e.du.trimmer,"trimmer-du"),e.du.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e,r,i,o=C.cursor;;){if(C.bra=C.cursor,e=C.find_among(b,11))switch(C.ket=C.cursor,e){case 1:C.slice_from("a");continue;case 2:C.slice_from("e");continue;case 3:C.slice_from("i");continue;case 4:C.slice_from("o");continue;case 5:C.slice_from("u");continue;case 6:if(C.cursor>=C.limit)break;C.cursor++;continue}break}for(C.cursor=o,C.bra=o,C.eq_s(1,"y")?(C.ket=C.cursor,C.slice_from("Y")):C.cursor=o;;)if(r=C.cursor,C.in_grouping(q,97,232)){if(i=C.cursor,C.bra=i,C.eq_s(1,"i"))C.ket=C.cursor,C.in_grouping(q,97,232)&&(C.slice_from("I"),C.cursor=r);else if(C.cursor=i,C.eq_s(1,"y"))C.ket=C.cursor,C.slice_from("Y"),C.cursor=r;else if(n(r))break}else if(n(r))break}function n(e){return C.cursor=e,e>=C.limit||(C.cursor++,!1)}function o(){_=C.limit,f=_,t()||(_=C.cursor,_<3&&(_=3),t()||(f=C.cursor))}function t(){for(;!C.in_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}for(;!C.out_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}return!1}function s(){for(var e;;)if(C.bra=C.cursor,e=C.find_among(p,3))switch(C.ket=C.cursor,e){case 1:C.slice_from("y");break;case 2:C.slice_from("i");break;case 3:if(C.cursor>=C.limit)return;C.cursor++}}function u(){return _<=C.cursor}function c(){return f<=C.cursor}function a(){var e=C.limit-C.cursor;C.find_among_b(g,3)&&(C.cursor=C.limit-e,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del()))}function l(){var e;w=!1,C.ket=C.cursor,C.eq_s_b(1,"e")&&(C.bra=C.cursor,u()&&(e=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-e,C.slice_del(),w=!0,a())))}function m(){var e;u()&&(e=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-e,C.eq_s_b(3,"gem")||(C.cursor=C.limit-e,C.slice_del(),a())))}function d(){var e,r,i,n,o,t,s=C.limit-C.cursor;if(C.ket=C.cursor,e=C.find_among_b(h,5))switch(C.bra=C.cursor,e){case 1:u()&&C.slice_from("heid");break;case 2:m();break;case 3:u()&&C.out_grouping_b(z,97,232)&&C.slice_del()}if(C.cursor=C.limit-s,l(),C.cursor=C.limit-s,C.ket=C.cursor,C.eq_s_b(4,"heid")&&(C.bra=C.cursor,c()&&(r=C.limit-C.cursor,C.eq_s_b(1,"c")||(C.cursor=C.limit-r,C.slice_del(),C.ket=C.cursor,C.eq_s_b(2,"en")&&(C.bra=C.cursor,m())))),C.cursor=C.limit-s,C.ket=C.cursor,e=C.find_among_b(k,6))switch(C.bra=C.cursor,e){case 1:if(c()){if(C.slice_del(),i=C.limit-C.cursor,C.ket=C.cursor,C.eq_s_b(2,"ig")&&(C.bra=C.cursor,c()&&(n=C.limit-C.cursor,!C.eq_s_b(1,"e")))){C.cursor=C.limit-n,C.slice_del();break}C.cursor=C.limit-i,a()}break;case 2:c()&&(o=C.limit-C.cursor,C.eq_s_b(1,"e")||(C.cursor=C.limit-o,C.slice_del()));break;case 3:c()&&(C.slice_del(),l());break;case 4:c()&&C.slice_del();break;case 5:c()&&w&&C.slice_del()}C.cursor=C.limit-s,C.out_grouping_b(j,73,232)&&(t=C.limit-C.cursor,C.find_among_b(v,4)&&C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-t,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del())))}var f,_,w,b=[new r("",-1,6),new r("á",0,1),new r("ä",0,1),new r("é",0,2),new r("ë",0,2),new r("í",0,3),new r("ï",0,3),new r("ó",0,4),new r("ö",0,4),new r("ú",0,5),new r("ü",0,5)],p=[new r("",-1,3),new r("I",0,2),new r("Y",0,1)],g=[new r("dd",-1,-1),new r("kk",-1,-1),new r("tt",-1,-1)],h=[new r("ene",-1,2),new r("se",-1,3),new r("en",-1,2),new r("heden",2,1),new r("s",-1,3)],k=[new r("end",-1,1),new r("ig",-1,2),new r("ing",-1,1),new r("lijk",-1,3),new r("baar",-1,4),new r("bar",-1,5)],v=[new r("aa",-1,-1),new r("ee",-1,-1),new r("oo",-1,-1),new r("uu",-1,-1)],q=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],j=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],z=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],C=new i;this.setCurrent=function(e){C.setCurrent(e)},this.getCurrent=function(){return C.getCurrent()},this.stem=function(){var r=C.cursor;return e(),C.cursor=r,o(),C.limit_backward=r,C.cursor=C.limit,d(),C.cursor=C.limit_backward,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.du.stemmer,"stemmer-du"),e.du.stopWordFilter=e.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),e.Pipeline.registerFunction(e.du.stopWordFilter,"stopWordFilter-du")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.es.min.js b/assets/javascripts/lunr/min/lunr.es.min.js new file mode 100644 index 00000000..2989d342 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.es.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Spanish` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,s){"function"==typeof define&&define.amd?define(s):"object"==typeof exports?module.exports=s():s()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.es=function(){this.pipeline.reset(),this.pipeline.add(e.es.trimmer,e.es.stopWordFilter,e.es.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.es.stemmer))},e.es.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.es.trimmer=e.trimmerSupport.generateTrimmer(e.es.wordCharacters),e.Pipeline.registerFunction(e.es.trimmer,"trimmer-es"),e.es.stemmer=function(){var s=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,n=new function(){function e(){if(A.out_grouping(x,97,252)){for(;!A.in_grouping(x,97,252);){if(A.cursor>=A.limit)return!0;A.cursor++}return!1}return!0}function n(){if(A.in_grouping(x,97,252)){var s=A.cursor;if(e()){if(A.cursor=s,!A.in_grouping(x,97,252))return!0;for(;!A.out_grouping(x,97,252);){if(A.cursor>=A.limit)return!0;A.cursor++}}return!1}return!0}function i(){var s,r=A.cursor;if(n()){if(A.cursor=r,!A.out_grouping(x,97,252))return;if(s=A.cursor,e()){if(A.cursor=s,!A.in_grouping(x,97,252)||A.cursor>=A.limit)return;A.cursor++}}g=A.cursor}function a(){for(;!A.in_grouping(x,97,252);){if(A.cursor>=A.limit)return!1;A.cursor++}for(;!A.out_grouping(x,97,252);){if(A.cursor>=A.limit)return!1;A.cursor++}return!0}function t(){var e=A.cursor;g=A.limit,p=g,v=g,i(),A.cursor=e,a()&&(p=A.cursor,a()&&(v=A.cursor))}function o(){for(var e;;){if(A.bra=A.cursor,e=A.find_among(k,6))switch(A.ket=A.cursor,e){case 1:A.slice_from("a");continue;case 2:A.slice_from("e");continue;case 3:A.slice_from("i");continue;case 4:A.slice_from("o");continue;case 5:A.slice_from("u");continue;case 6:if(A.cursor>=A.limit)break;A.cursor++;continue}break}}function u(){return g<=A.cursor}function w(){return p<=A.cursor}function c(){return v<=A.cursor}function m(){var e;if(A.ket=A.cursor,A.find_among_b(y,13)&&(A.bra=A.cursor,(e=A.find_among_b(q,11))&&u()))switch(e){case 1:A.bra=A.cursor,A.slice_from("iendo");break;case 2:A.bra=A.cursor,A.slice_from("ando");break;case 3:A.bra=A.cursor,A.slice_from("ar");break;case 4:A.bra=A.cursor,A.slice_from("er");break;case 5:A.bra=A.cursor,A.slice_from("ir");break;case 6:A.slice_del();break;case 7:A.eq_s_b(1,"u")&&A.slice_del()}}function l(e,s){if(!c())return!0;A.slice_del(),A.ket=A.cursor;var r=A.find_among_b(e,s);return r&&(A.bra=A.cursor,1==r&&c()&&A.slice_del()),!1}function d(e){return!c()||(A.slice_del(),A.ket=A.cursor,A.eq_s_b(2,e)&&(A.bra=A.cursor,c()&&A.slice_del()),!1)}function b(){var e;if(A.ket=A.cursor,e=A.find_among_b(S,46)){switch(A.bra=A.cursor,e){case 1:if(!c())return!1;A.slice_del();break;case 2:if(d("ic"))return!1;break;case 3:if(!c())return!1;A.slice_from("log");break;case 4:if(!c())return!1;A.slice_from("u");break;case 5:if(!c())return!1;A.slice_from("ente");break;case 6:if(!w())return!1;A.slice_del(),A.ket=A.cursor,e=A.find_among_b(C,4),e&&(A.bra=A.cursor,c()&&(A.slice_del(),1==e&&(A.ket=A.cursor,A.eq_s_b(2,"at")&&(A.bra=A.cursor,c()&&A.slice_del()))));break;case 7:if(l(P,3))return!1;break;case 8:if(l(F,3))return!1;break;case 9:if(d("at"))return!1}return!0}return!1}function f(){var e,s;if(A.cursor>=g&&(s=A.limit_backward,A.limit_backward=g,A.ket=A.cursor,e=A.find_among_b(W,12),A.limit_backward=s,e)){if(A.bra=A.cursor,1==e){if(!A.eq_s_b(1,"u"))return!1;A.slice_del()}return!0}return!1}function _(){var e,s,r,n;if(A.cursor>=g&&(s=A.limit_backward,A.limit_backward=g,A.ket=A.cursor,e=A.find_among_b(L,96),A.limit_backward=s,e))switch(A.bra=A.cursor,e){case 1:r=A.limit-A.cursor,A.eq_s_b(1,"u")?(n=A.limit-A.cursor,A.eq_s_b(1,"g")?A.cursor=A.limit-n:A.cursor=A.limit-r):A.cursor=A.limit-r,A.bra=A.cursor;case 2:A.slice_del()}}function h(){var e,s;if(A.ket=A.cursor,e=A.find_among_b(z,8))switch(A.bra=A.cursor,e){case 1:u()&&A.slice_del();break;case 2:u()&&(A.slice_del(),A.ket=A.cursor,A.eq_s_b(1,"u")&&(A.bra=A.cursor,s=A.limit-A.cursor,A.eq_s_b(1,"g")&&(A.cursor=A.limit-s,u()&&A.slice_del())))}}var v,p,g,k=[new s("",-1,6),new s("á",0,1),new s("é",0,2),new s("í",0,3),new s("ó",0,4),new s("ú",0,5)],y=[new s("la",-1,-1),new s("sela",0,-1),new s("le",-1,-1),new s("me",-1,-1),new s("se",-1,-1),new s("lo",-1,-1),new s("selo",5,-1),new s("las",-1,-1),new s("selas",7,-1),new s("les",-1,-1),new s("los",-1,-1),new s("selos",10,-1),new s("nos",-1,-1)],q=[new s("ando",-1,6),new s("iendo",-1,6),new s("yendo",-1,7),new s("ándo",-1,2),new s("iéndo",-1,1),new s("ar",-1,6),new s("er",-1,6),new s("ir",-1,6),new s("ár",-1,3),new s("ér",-1,4),new s("ír",-1,5)],C=[new s("ic",-1,-1),new s("ad",-1,-1),new s("os",-1,-1),new s("iv",-1,1)],P=[new s("able",-1,1),new s("ible",-1,1),new s("ante",-1,1)],F=[new s("ic",-1,1),new s("abil",-1,1),new s("iv",-1,1)],S=[new s("ica",-1,1),new s("ancia",-1,2),new s("encia",-1,5),new s("adora",-1,2),new s("osa",-1,1),new s("ista",-1,1),new s("iva",-1,9),new s("anza",-1,1),new s("logía",-1,3),new s("idad",-1,8),new s("able",-1,1),new s("ible",-1,1),new s("ante",-1,2),new s("mente",-1,7),new s("amente",13,6),new s("ación",-1,2),new s("ución",-1,4),new s("ico",-1,1),new s("ismo",-1,1),new s("oso",-1,1),new s("amiento",-1,1),new s("imiento",-1,1),new s("ivo",-1,9),new s("ador",-1,2),new s("icas",-1,1),new s("ancias",-1,2),new s("encias",-1,5),new s("adoras",-1,2),new s("osas",-1,1),new s("istas",-1,1),new s("ivas",-1,9),new s("anzas",-1,1),new s("logías",-1,3),new s("idades",-1,8),new s("ables",-1,1),new s("ibles",-1,1),new s("aciones",-1,2),new s("uciones",-1,4),new s("adores",-1,2),new s("antes",-1,2),new s("icos",-1,1),new s("ismos",-1,1),new s("osos",-1,1),new s("amientos",-1,1),new s("imientos",-1,1),new s("ivos",-1,9)],W=[new s("ya",-1,1),new s("ye",-1,1),new s("yan",-1,1),new s("yen",-1,1),new s("yeron",-1,1),new s("yendo",-1,1),new s("yo",-1,1),new s("yas",-1,1),new s("yes",-1,1),new s("yais",-1,1),new s("yamos",-1,1),new s("yó",-1,1)],L=[new s("aba",-1,2),new s("ada",-1,2),new s("ida",-1,2),new s("ara",-1,2),new s("iera",-1,2),new s("ía",-1,2),new s("aría",5,2),new s("ería",5,2),new s("iría",5,2),new s("ad",-1,2),new s("ed",-1,2),new s("id",-1,2),new s("ase",-1,2),new s("iese",-1,2),new s("aste",-1,2),new s("iste",-1,2),new s("an",-1,2),new s("aban",16,2),new s("aran",16,2),new s("ieran",16,2),new s("ían",16,2),new s("arían",20,2),new s("erían",20,2),new s("irían",20,2),new s("en",-1,1),new s("asen",24,2),new s("iesen",24,2),new s("aron",-1,2),new s("ieron",-1,2),new s("arán",-1,2),new s("erán",-1,2),new s("irán",-1,2),new s("ado",-1,2),new s("ido",-1,2),new s("ando",-1,2),new s("iendo",-1,2),new s("ar",-1,2),new s("er",-1,2),new s("ir",-1,2),new s("as",-1,2),new s("abas",39,2),new s("adas",39,2),new s("idas",39,2),new s("aras",39,2),new s("ieras",39,2),new s("ías",39,2),new s("arías",45,2),new s("erías",45,2),new s("irías",45,2),new s("es",-1,1),new s("ases",49,2),new s("ieses",49,2),new s("abais",-1,2),new s("arais",-1,2),new s("ierais",-1,2),new s("íais",-1,2),new s("aríais",55,2),new s("eríais",55,2),new s("iríais",55,2),new s("aseis",-1,2),new s("ieseis",-1,2),new s("asteis",-1,2),new s("isteis",-1,2),new s("áis",-1,2),new s("éis",-1,1),new s("aréis",64,2),new s("eréis",64,2),new s("iréis",64,2),new s("ados",-1,2),new s("idos",-1,2),new s("amos",-1,2),new s("ábamos",70,2),new s("áramos",70,2),new s("iéramos",70,2),new s("íamos",70,2),new s("aríamos",74,2),new s("eríamos",74,2),new s("iríamos",74,2),new s("emos",-1,1),new s("aremos",78,2),new s("eremos",78,2),new s("iremos",78,2),new s("ásemos",78,2),new s("iésemos",78,2),new s("imos",-1,2),new s("arás",-1,2),new s("erás",-1,2),new s("irás",-1,2),new s("ís",-1,2),new s("ará",-1,2),new s("erá",-1,2),new s("irá",-1,2),new s("aré",-1,2),new s("eré",-1,2),new s("iré",-1,2),new s("ió",-1,2)],z=[new s("a",-1,1),new s("e",-1,2),new s("o",-1,1),new s("os",-1,1),new s("á",-1,1),new s("é",-1,2),new s("í",-1,1),new s("ó",-1,1)],x=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,4,10],A=new r;this.setCurrent=function(e){A.setCurrent(e)},this.getCurrent=function(){return A.getCurrent()},this.stem=function(){var e=A.cursor;return t(),A.limit_backward=e,A.cursor=A.limit,m(),A.cursor=A.limit,b()||(A.cursor=A.limit,f()||(A.cursor=A.limit,_())),A.cursor=A.limit,h(),A.cursor=A.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.es.stemmer,"stemmer-es"),e.es.stopWordFilter=e.generateStopWordFilter("a al algo algunas algunos ante antes como con contra cual cuando de del desde donde durante e el ella ellas ellos en entre era erais eran eras eres es esa esas ese eso esos esta estaba estabais estaban estabas estad estada estadas estado estados estamos estando estar estaremos estará estarán estarás estaré estaréis estaría estaríais estaríamos estarían estarías estas este estemos esto estos estoy estuve estuviera estuvierais estuvieran estuvieras estuvieron estuviese estuvieseis estuviesen estuvieses estuvimos estuviste estuvisteis estuviéramos estuviésemos estuvo está estábamos estáis están estás esté estéis estén estés fue fuera fuerais fueran fueras fueron fuese fueseis fuesen fueses fui fuimos fuiste fuisteis fuéramos fuésemos ha habida habidas habido habidos habiendo habremos habrá habrán habrás habré habréis habría habríais habríamos habrían habrías habéis había habíais habíamos habían habías han has hasta hay haya hayamos hayan hayas hayáis he hemos hube hubiera hubierais hubieran hubieras hubieron hubiese hubieseis hubiesen hubieses hubimos hubiste hubisteis hubiéramos hubiésemos hubo la las le les lo los me mi mis mucho muchos muy más mí mía mías mío míos nada ni no nos nosotras nosotros nuestra nuestras nuestro nuestros o os otra otras otro otros para pero poco por porque que quien quienes qué se sea seamos sean seas seremos será serán serás seré seréis sería seríais seríamos serían serías seáis sido siendo sin sobre sois somos son soy su sus suya suyas suyo suyos sí también tanto te tendremos tendrá tendrán tendrás tendré tendréis tendría tendríais tendríamos tendrían tendrías tened tenemos tenga tengamos tengan tengas tengo tengáis tenida tenidas tenido tenidos teniendo tenéis tenía teníais teníamos tenían tenías ti tiene tienen tienes todo todos tu tus tuve tuviera tuvierais tuvieran tuvieras tuvieron tuviese tuvieseis tuviesen tuvieses tuvimos tuviste tuvisteis tuviéramos tuviésemos tuvo tuya tuyas tuyo tuyos tú un una uno unos vosotras vosotros vuestra vuestras vuestro vuestros y ya yo él éramos".split(" ")),e.Pipeline.registerFunction(e.es.stopWordFilter,"stopWordFilter-es")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.fi.min.js b/assets/javascripts/lunr/min/lunr.fi.min.js new file mode 100644 index 00000000..29f5dfce --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.fi.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Finnish` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(i,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():e()(i.lunr)}(this,function(){return function(i){if(void 0===i)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===i.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");i.fi=function(){this.pipeline.reset(),this.pipeline.add(i.fi.trimmer,i.fi.stopWordFilter,i.fi.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(i.fi.stemmer))},i.fi.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",i.fi.trimmer=i.trimmerSupport.generateTrimmer(i.fi.wordCharacters),i.Pipeline.registerFunction(i.fi.trimmer,"trimmer-fi"),i.fi.stemmer=function(){var e=i.stemmerSupport.Among,r=i.stemmerSupport.SnowballProgram,n=new function(){function i(){f=A.limit,d=f,n()||(f=A.cursor,n()||(d=A.cursor))}function n(){for(var i;;){if(i=A.cursor,A.in_grouping(W,97,246))break;if(A.cursor=i,i>=A.limit)return!0;A.cursor++}for(A.cursor=i;!A.out_grouping(W,97,246);){if(A.cursor>=A.limit)return!0;A.cursor++}return!1}function t(){return d<=A.cursor}function s(){var i,e;if(A.cursor>=f)if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,i=A.find_among_b(h,10)){switch(A.bra=A.cursor,A.limit_backward=e,i){case 1:if(!A.in_grouping_b(x,97,246))return;break;case 2:if(!t())return}A.slice_del()}else A.limit_backward=e}function o(){var i,e,r;if(A.cursor>=f)if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,i=A.find_among_b(v,9))switch(A.bra=A.cursor,A.limit_backward=e,i){case 1:r=A.limit-A.cursor,A.eq_s_b(1,"k")||(A.cursor=A.limit-r,A.slice_del());break;case 2:A.slice_del(),A.ket=A.cursor,A.eq_s_b(3,"kse")&&(A.bra=A.cursor,A.slice_from("ksi"));break;case 3:A.slice_del();break;case 4:A.find_among_b(p,6)&&A.slice_del();break;case 5:A.find_among_b(g,6)&&A.slice_del();break;case 6:A.find_among_b(j,2)&&A.slice_del()}else A.limit_backward=e}function l(){return A.find_among_b(q,7)}function a(){return A.eq_s_b(1,"i")&&A.in_grouping_b(L,97,246)}function u(){var i,e,r;if(A.cursor>=f)if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,i=A.find_among_b(C,30)){switch(A.bra=A.cursor,A.limit_backward=e,i){case 1:if(!A.eq_s_b(1,"a"))return;break;case 2:case 9:if(!A.eq_s_b(1,"e"))return;break;case 3:if(!A.eq_s_b(1,"i"))return;break;case 4:if(!A.eq_s_b(1,"o"))return;break;case 5:if(!A.eq_s_b(1,"ä"))return;break;case 6:if(!A.eq_s_b(1,"ö"))return;break;case 7:if(r=A.limit-A.cursor,!l()&&(A.cursor=A.limit-r,!A.eq_s_b(2,"ie"))){A.cursor=A.limit-r;break}if(A.cursor=A.limit-r,A.cursor<=A.limit_backward){A.cursor=A.limit-r;break}A.cursor--,A.bra=A.cursor;break;case 8:if(!A.in_grouping_b(W,97,246)||!A.out_grouping_b(W,97,246))return}A.slice_del(),k=!0}else A.limit_backward=e}function c(){var i,e,r;if(A.cursor>=d)if(e=A.limit_backward,A.limit_backward=d,A.ket=A.cursor,i=A.find_among_b(P,14)){if(A.bra=A.cursor,A.limit_backward=e,1==i){if(r=A.limit-A.cursor,A.eq_s_b(2,"po"))return;A.cursor=A.limit-r}A.slice_del()}else A.limit_backward=e}function m(){var i;A.cursor>=f&&(i=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,A.find_among_b(F,2)?(A.bra=A.cursor,A.limit_backward=i,A.slice_del()):A.limit_backward=i)}function w(){var i,e,r,n,t,s;if(A.cursor>=f){if(e=A.limit_backward,A.limit_backward=f,A.ket=A.cursor,A.eq_s_b(1,"t")&&(A.bra=A.cursor,r=A.limit-A.cursor,A.in_grouping_b(W,97,246)&&(A.cursor=A.limit-r,A.slice_del(),A.limit_backward=e,n=A.limit-A.cursor,A.cursor>=d&&(A.cursor=d,t=A.limit_backward,A.limit_backward=A.cursor,A.cursor=A.limit-n,A.ket=A.cursor,i=A.find_among_b(S,2))))){if(A.bra=A.cursor,A.limit_backward=t,1==i){if(s=A.limit-A.cursor,A.eq_s_b(2,"po"))return;A.cursor=A.limit-s}return void A.slice_del()}A.limit_backward=e}}function _(){var i,e,r,n;if(A.cursor>=f){for(i=A.limit_backward,A.limit_backward=f,e=A.limit-A.cursor,l()&&(A.cursor=A.limit-e,A.ket=A.cursor,A.cursor>A.limit_backward&&(A.cursor--,A.bra=A.cursor,A.slice_del())),A.cursor=A.limit-e,A.ket=A.cursor,A.in_grouping_b(y,97,228)&&(A.bra=A.cursor,A.out_grouping_b(W,97,246)&&A.slice_del()),A.cursor=A.limit-e,A.ket=A.cursor,A.eq_s_b(1,"j")&&(A.bra=A.cursor,r=A.limit-A.cursor,A.eq_s_b(1,"o")?A.slice_del():(A.cursor=A.limit-r,A.eq_s_b(1,"u")&&A.slice_del())),A.cursor=A.limit-e,A.ket=A.cursor,A.eq_s_b(1,"o")&&(A.bra=A.cursor,A.eq_s_b(1,"j")&&A.slice_del()),A.cursor=A.limit-e,A.limit_backward=i;;){if(n=A.limit-A.cursor,A.out_grouping_b(W,97,246)){A.cursor=A.limit-n;break}if(A.cursor=A.limit-n,A.cursor<=A.limit_backward)return;A.cursor--}A.ket=A.cursor,A.cursor>A.limit_backward&&(A.cursor--,A.bra=A.cursor,b=A.slice_to(),A.eq_v_b(b)&&A.slice_del())}}var k,b,d,f,h=[new e("pa",-1,1),new e("sti",-1,2),new e("kaan",-1,1),new e("han",-1,1),new e("kin",-1,1),new e("hän",-1,1),new e("kään",-1,1),new e("ko",-1,1),new e("pä",-1,1),new e("kö",-1,1)],p=[new e("lla",-1,-1),new e("na",-1,-1),new e("ssa",-1,-1),new e("ta",-1,-1),new e("lta",3,-1),new e("sta",3,-1)],g=[new e("llä",-1,-1),new e("nä",-1,-1),new e("ssä",-1,-1),new e("tä",-1,-1),new e("ltä",3,-1),new e("stä",3,-1)],j=[new e("lle",-1,-1),new e("ine",-1,-1)],v=[new e("nsa",-1,3),new e("mme",-1,3),new e("nne",-1,3),new e("ni",-1,2),new e("si",-1,1),new e("an",-1,4),new e("en",-1,6),new e("än",-1,5),new e("nsä",-1,3)],q=[new e("aa",-1,-1),new e("ee",-1,-1),new e("ii",-1,-1),new e("oo",-1,-1),new e("uu",-1,-1),new e("ää",-1,-1),new e("öö",-1,-1)],C=[new e("a",-1,8),new e("lla",0,-1),new e("na",0,-1),new e("ssa",0,-1),new e("ta",0,-1),new e("lta",4,-1),new e("sta",4,-1),new e("tta",4,9),new e("lle",-1,-1),new e("ine",-1,-1),new e("ksi",-1,-1),new e("n",-1,7),new e("han",11,1),new e("den",11,-1,a),new e("seen",11,-1,l),new e("hen",11,2),new e("tten",11,-1,a),new e("hin",11,3),new e("siin",11,-1,a),new e("hon",11,4),new e("hän",11,5),new e("hön",11,6),new e("ä",-1,8),new e("llä",22,-1),new e("nä",22,-1),new e("ssä",22,-1),new e("tä",22,-1),new e("ltä",26,-1),new e("stä",26,-1),new e("ttä",26,9)],P=[new e("eja",-1,-1),new e("mma",-1,1),new e("imma",1,-1),new e("mpa",-1,1),new e("impa",3,-1),new e("mmi",-1,1),new e("immi",5,-1),new e("mpi",-1,1),new e("impi",7,-1),new e("ejä",-1,-1),new e("mmä",-1,1),new e("immä",10,-1),new e("mpä",-1,1),new e("impä",12,-1)],F=[new e("i",-1,-1),new e("j",-1,-1)],S=[new e("mma",-1,1),new e("imma",0,-1)],y=[17,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8],W=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],L=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],x=[17,97,24,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],A=new r;this.setCurrent=function(i){A.setCurrent(i)},this.getCurrent=function(){return A.getCurrent()},this.stem=function(){var e=A.cursor;return i(),k=!1,A.limit_backward=e,A.cursor=A.limit,s(),A.cursor=A.limit,o(),A.cursor=A.limit,u(),A.cursor=A.limit,c(),A.cursor=A.limit,k?(m(),A.cursor=A.limit):(A.cursor=A.limit,w(),A.cursor=A.limit),_(),!0}};return function(i){return"function"==typeof i.update?i.update(function(i){return n.setCurrent(i),n.stem(),n.getCurrent()}):(n.setCurrent(i),n.stem(),n.getCurrent())}}(),i.Pipeline.registerFunction(i.fi.stemmer,"stemmer-fi"),i.fi.stopWordFilter=i.generateStopWordFilter("ei eivät emme en et ette että he heidän heidät heihin heille heillä heiltä heissä heistä heitä hän häneen hänelle hänellä häneltä hänen hänessä hänestä hänet häntä itse ja johon joiden joihin joiksi joilla joille joilta joina joissa joista joita joka joksi jolla jolle jolta jona jonka jos jossa josta jota jotka kanssa keiden keihin keiksi keille keillä keiltä keinä keissä keistä keitä keneen keneksi kenelle kenellä keneltä kenen kenenä kenessä kenestä kenet ketkä ketkä ketä koska kuin kuka kun me meidän meidät meihin meille meillä meiltä meissä meistä meitä mihin miksi mikä mille millä miltä minkä minkä minua minulla minulle minulta minun minussa minusta minut minuun minä minä missä mistä mitkä mitä mukaan mutta ne niiden niihin niiksi niille niillä niiltä niin niin niinä niissä niistä niitä noiden noihin noiksi noilla noille noilta noin noina noissa noista noita nuo nyt näiden näihin näiksi näille näillä näiltä näinä näissä näistä näitä nämä ole olemme olen olet olette oli olimme olin olisi olisimme olisin olisit olisitte olisivat olit olitte olivat olla olleet ollut on ovat poikki se sekä sen siihen siinä siitä siksi sille sillä sillä siltä sinua sinulla sinulle sinulta sinun sinussa sinusta sinut sinuun sinä sinä sitä tai te teidän teidät teihin teille teillä teiltä teissä teistä teitä tuo tuohon tuoksi tuolla tuolle tuolta tuon tuona tuossa tuosta tuota tähän täksi tälle tällä tältä tämä tämän tänä tässä tästä tätä vaan vai vaikka yli".split(" ")),i.Pipeline.registerFunction(i.fi.stopWordFilter,"stopWordFilter-fi")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.fr.min.js b/assets/javascripts/lunr/min/lunr.fr.min.js new file mode 100644 index 00000000..68cd0094 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.fr.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `French` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.fr=function(){this.pipeline.reset(),this.pipeline.add(e.fr.trimmer,e.fr.stopWordFilter,e.fr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.fr.stemmer))},e.fr.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.fr.trimmer=e.trimmerSupport.generateTrimmer(e.fr.wordCharacters),e.Pipeline.registerFunction(e.fr.trimmer,"trimmer-fr"),e.fr.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,s){return!(!W.eq_s(1,e)||(W.ket=W.cursor,!W.in_grouping(F,97,251)))&&(W.slice_from(r),W.cursor=s,!0)}function i(e,r,s){return!!W.eq_s(1,e)&&(W.ket=W.cursor,W.slice_from(r),W.cursor=s,!0)}function n(){for(var r,s;;){if(r=W.cursor,W.in_grouping(F,97,251)){if(W.bra=W.cursor,s=W.cursor,e("u","U",r))continue;if(W.cursor=s,e("i","I",r))continue;if(W.cursor=s,i("y","Y",r))continue}if(W.cursor=r,W.bra=r,!e("y","Y",r)){if(W.cursor=r,W.eq_s(1,"q")&&(W.bra=W.cursor,i("u","U",r)))continue;if(W.cursor=r,r>=W.limit)return;W.cursor++}}}function t(){for(;!W.in_grouping(F,97,251);){if(W.cursor>=W.limit)return!0;W.cursor++}for(;!W.out_grouping(F,97,251);){if(W.cursor>=W.limit)return!0;W.cursor++}return!1}function u(){var e=W.cursor;if(q=W.limit,g=q,p=q,W.in_grouping(F,97,251)&&W.in_grouping(F,97,251)&&W.cursor=W.limit){W.cursor=q;break}W.cursor++}while(!W.in_grouping(F,97,251))}q=W.cursor,W.cursor=e,t()||(g=W.cursor,t()||(p=W.cursor))}function o(){for(var e,r;;){if(r=W.cursor,W.bra=r,!(e=W.find_among(h,4)))break;switch(W.ket=W.cursor,e){case 1:W.slice_from("i");break;case 2:W.slice_from("u");break;case 3:W.slice_from("y");break;case 4:if(W.cursor>=W.limit)return;W.cursor++}}}function c(){return q<=W.cursor}function a(){return g<=W.cursor}function l(){return p<=W.cursor}function w(){var e,r;if(W.ket=W.cursor,e=W.find_among_b(C,43)){switch(W.bra=W.cursor,e){case 1:if(!l())return!1;W.slice_del();break;case 2:if(!l())return!1;W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"ic")&&(W.bra=W.cursor,l()?W.slice_del():W.slice_from("iqU"));break;case 3:if(!l())return!1;W.slice_from("log");break;case 4:if(!l())return!1;W.slice_from("u");break;case 5:if(!l())return!1;W.slice_from("ent");break;case 6:if(!c())return!1;if(W.slice_del(),W.ket=W.cursor,e=W.find_among_b(z,6))switch(W.bra=W.cursor,e){case 1:l()&&(W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"at")&&(W.bra=W.cursor,l()&&W.slice_del()));break;case 2:l()?W.slice_del():a()&&W.slice_from("eux");break;case 3:l()&&W.slice_del();break;case 4:c()&&W.slice_from("i")}break;case 7:if(!l())return!1;if(W.slice_del(),W.ket=W.cursor,e=W.find_among_b(y,3))switch(W.bra=W.cursor,e){case 1:l()?W.slice_del():W.slice_from("abl");break;case 2:l()?W.slice_del():W.slice_from("iqU");break;case 3:l()&&W.slice_del()}break;case 8:if(!l())return!1;if(W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"at")&&(W.bra=W.cursor,l()&&(W.slice_del(),W.ket=W.cursor,W.eq_s_b(2,"ic")))){W.bra=W.cursor,l()?W.slice_del():W.slice_from("iqU");break}break;case 9:W.slice_from("eau");break;case 10:if(!a())return!1;W.slice_from("al");break;case 11:if(l())W.slice_del();else{if(!a())return!1;W.slice_from("eux")}break;case 12:if(!a()||!W.out_grouping_b(F,97,251))return!1;W.slice_del();break;case 13:return c()&&W.slice_from("ant"),!1;case 14:return c()&&W.slice_from("ent"),!1;case 15:return r=W.limit-W.cursor,W.in_grouping_b(F,97,251)&&c()&&(W.cursor=W.limit-r,W.slice_del()),!1}return!0}return!1}function f(){var e,r;if(W.cursor=q){if(s=W.limit_backward,W.limit_backward=q,W.ket=W.cursor,e=W.find_among_b(P,7))switch(W.bra=W.cursor,e){case 1:if(l()){if(i=W.limit-W.cursor,!W.eq_s_b(1,"s")&&(W.cursor=W.limit-i,!W.eq_s_b(1,"t")))break;W.slice_del()}break;case 2:W.slice_from("i");break;case 3:W.slice_del();break;case 4:W.eq_s_b(2,"gu")&&W.slice_del()}W.limit_backward=s}}function b(){var e=W.limit-W.cursor;W.find_among_b(U,5)&&(W.cursor=W.limit-e,W.ket=W.cursor,W.cursor>W.limit_backward&&(W.cursor--,W.bra=W.cursor,W.slice_del()))}function d(){for(var e,r=1;W.out_grouping_b(F,97,251);)r--;if(r<=0){if(W.ket=W.cursor,e=W.limit-W.cursor,!W.eq_s_b(1,"é")&&(W.cursor=W.limit-e,!W.eq_s_b(1,"è")))return;W.bra=W.cursor,W.slice_from("e")}}function k(){if(!w()&&(W.cursor=W.limit,!f()&&(W.cursor=W.limit,!m())))return W.cursor=W.limit,void _();W.cursor=W.limit,W.ket=W.cursor,W.eq_s_b(1,"Y")?(W.bra=W.cursor,W.slice_from("i")):(W.cursor=W.limit,W.eq_s_b(1,"ç")&&(W.bra=W.cursor,W.slice_from("c")))}var p,g,q,v=[new r("col",-1,-1),new r("par",-1,-1),new r("tap",-1,-1)],h=[new r("",-1,4),new r("I",0,1),new r("U",0,2),new r("Y",0,3)],z=[new r("iqU",-1,3),new r("abl",-1,3),new r("Ièr",-1,4),new r("ièr",-1,4),new r("eus",-1,2),new r("iv",-1,1)],y=[new r("ic",-1,2),new r("abil",-1,1),new r("iv",-1,3)],C=[new r("iqUe",-1,1),new r("atrice",-1,2),new r("ance",-1,1),new r("ence",-1,5),new r("logie",-1,3),new r("able",-1,1),new r("isme",-1,1),new r("euse",-1,11),new r("iste",-1,1),new r("ive",-1,8),new r("if",-1,8),new r("usion",-1,4),new r("ation",-1,2),new r("ution",-1,4),new r("ateur",-1,2),new r("iqUes",-1,1),new r("atrices",-1,2),new r("ances",-1,1),new r("ences",-1,5),new r("logies",-1,3),new r("ables",-1,1),new r("ismes",-1,1),new r("euses",-1,11),new r("istes",-1,1),new r("ives",-1,8),new r("ifs",-1,8),new r("usions",-1,4),new r("ations",-1,2),new r("utions",-1,4),new r("ateurs",-1,2),new r("ments",-1,15),new r("ements",30,6),new r("issements",31,12),new r("ités",-1,7),new r("ment",-1,15),new r("ement",34,6),new r("issement",35,12),new r("amment",34,13),new r("emment",34,14),new r("aux",-1,10),new r("eaux",39,9),new r("eux",-1,1),new r("ité",-1,7)],x=[new r("ira",-1,1),new r("ie",-1,1),new r("isse",-1,1),new r("issante",-1,1),new r("i",-1,1),new r("irai",4,1),new r("ir",-1,1),new r("iras",-1,1),new r("ies",-1,1),new r("îmes",-1,1),new r("isses",-1,1),new r("issantes",-1,1),new r("îtes",-1,1),new r("is",-1,1),new r("irais",13,1),new r("issais",13,1),new r("irions",-1,1),new r("issions",-1,1),new r("irons",-1,1),new r("issons",-1,1),new r("issants",-1,1),new r("it",-1,1),new r("irait",21,1),new r("issait",21,1),new r("issant",-1,1),new r("iraIent",-1,1),new r("issaIent",-1,1),new r("irent",-1,1),new r("issent",-1,1),new r("iront",-1,1),new r("ît",-1,1),new r("iriez",-1,1),new r("issiez",-1,1),new r("irez",-1,1),new r("issez",-1,1)],I=[new r("a",-1,3),new r("era",0,2),new r("asse",-1,3),new r("ante",-1,3),new r("ée",-1,2),new r("ai",-1,3),new r("erai",5,2),new r("er",-1,2),new r("as",-1,3),new r("eras",8,2),new r("âmes",-1,3),new r("asses",-1,3),new r("antes",-1,3),new r("âtes",-1,3),new r("ées",-1,2),new r("ais",-1,3),new r("erais",15,2),new r("ions",-1,1),new r("erions",17,2),new r("assions",17,3),new r("erons",-1,2),new r("ants",-1,3),new r("és",-1,2),new r("ait",-1,3),new r("erait",23,2),new r("ant",-1,3),new r("aIent",-1,3),new r("eraIent",26,2),new r("èrent",-1,2),new r("assent",-1,3),new r("eront",-1,2),new r("ât",-1,3),new r("ez",-1,2),new r("iez",32,2),new r("eriez",33,2),new r("assiez",33,3),new r("erez",32,2),new r("é",-1,2)],P=[new r("e",-1,3),new r("Ière",0,2),new r("ière",0,2),new r("ion",-1,1),new r("Ier",-1,2),new r("ier",-1,2),new r("ë",-1,4)],U=[new r("ell",-1,-1),new r("eill",-1,-1),new r("enn",-1,-1),new r("onn",-1,-1),new r("ett",-1,-1)],F=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,128,130,103,8,5],S=[1,65,20,0,0,0,0,0,0,0,0,0,0,0,0,0,128],W=new s;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){var e=W.cursor;return n(),W.cursor=e,u(),W.limit_backward=e,W.cursor=W.limit,k(),W.cursor=W.limit,b(),W.cursor=W.limit,d(),W.cursor=W.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.fr.stemmer,"stemmer-fr"),e.fr.stopWordFilter=e.generateStopWordFilter("ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes".split(" ")),e.Pipeline.registerFunction(e.fr.stopWordFilter,"stopWordFilter-fr")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.hi.min.js b/assets/javascripts/lunr/min/lunr.hi.min.js new file mode 100644 index 00000000..7dbc4140 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.hi.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hi=function(){this.pipeline.reset(),this.pipeline.add(e.hi.trimmer,e.hi.stopWordFilter,e.hi.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hi.stemmer))},e.hi.wordCharacters="ऀ-ःऄ-एऐ-टठ-यर-िी-ॏॐ-य़ॠ-९॰-ॿa-zA-Za-zA-Z0-90-9",e.hi.trimmer=e.trimmerSupport.generateTrimmer(e.hi.wordCharacters),e.Pipeline.registerFunction(e.hi.trimmer,"trimmer-hi"),e.hi.stopWordFilter=e.generateStopWordFilter("अत अपना अपनी अपने अभी अंदर आदि आप इत्यादि इन इनका इन्हीं इन्हें इन्हों इस इसका इसकी इसके इसमें इसी इसे उन उनका उनकी उनके उनको उन्हीं उन्हें उन्हों उस उसके उसी उसे एक एवं एस ऐसे और कई कर करता करते करना करने करें कहते कहा का काफ़ी कि कितना किन्हें किन्हों किया किर किस किसी किसे की कुछ कुल के को कोई कौन कौनसा गया घर जब जहाँ जा जितना जिन जिन्हें जिन्हों जिस जिसे जीधर जैसा जैसे जो तक तब तरह तिन तिन्हें तिन्हों तिस तिसे तो था थी थे दबारा दिया दुसरा दूसरे दो द्वारा न नके नहीं ना निहायत नीचे ने पर पहले पूरा पे फिर बनी बही बहुत बाद बाला बिलकुल भी भीतर मगर मानो मे में यदि यह यहाँ यही या यिह ये रखें रहा रहे ऱ्वासा लिए लिये लेकिन व वग़ैरह वर्ग वह वहाँ वहीं वाले वुह वे वो सकता सकते सबसे सभी साथ साबुत साभ सारा से सो संग ही हुआ हुई हुए है हैं हो होता होती होते होना होने".split(" ")),e.hi.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}();var r=e.wordcut;r.init(),e.hi.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(r){return isLunr2?new e.Token(r.toLowerCase()):r.toLowerCase()});var t=i.toString().toLowerCase().replace(/^\s+/,"");return r.cut(t).split("|")},e.Pipeline.registerFunction(e.hi.stemmer,"stemmer-hi"),e.Pipeline.registerFunction(e.hi.stopWordFilter,"stopWordFilter-hi")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.hu.min.js b/assets/javascripts/lunr/min/lunr.hu.min.js new file mode 100644 index 00000000..ed9d909f --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.hu.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Hungarian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.hu=function(){this.pipeline.reset(),this.pipeline.add(e.hu.trimmer,e.hu.stopWordFilter,e.hu.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hu.stemmer))},e.hu.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.hu.trimmer=e.trimmerSupport.generateTrimmer(e.hu.wordCharacters),e.Pipeline.registerFunction(e.hu.trimmer,"trimmer-hu"),e.hu.stemmer=function(){var n=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,n=L.cursor;if(d=L.limit,L.in_grouping(W,97,252))for(;;){if(e=L.cursor,L.out_grouping(W,97,252))return L.cursor=e,L.find_among(g,8)||(L.cursor=e,e=L.limit)return void(d=e);L.cursor++}if(L.cursor=n,L.out_grouping(W,97,252)){for(;!L.in_grouping(W,97,252);){if(L.cursor>=L.limit)return;L.cursor++}d=L.cursor}}function i(){return d<=L.cursor}function a(){var e;if(L.ket=L.cursor,(e=L.find_among_b(h,2))&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("a");break;case 2:L.slice_from("e")}}function t(){var e=L.limit-L.cursor;return!!L.find_among_b(p,23)&&(L.cursor=L.limit-e,!0)}function s(){if(L.cursor>L.limit_backward){L.cursor--,L.ket=L.cursor;var e=L.cursor-1;L.limit_backward<=e&&e<=L.limit&&(L.cursor=e,L.bra=e,L.slice_del())}}function c(){var e;if(L.ket=L.cursor,(e=L.find_among_b(_,2))&&(L.bra=L.cursor,i())){if((1==e||2==e)&&!t())return;L.slice_del(),s()}}function o(){L.ket=L.cursor,L.find_among_b(v,44)&&(L.bra=L.cursor,i()&&(L.slice_del(),a()))}function w(){var e;if(L.ket=L.cursor,(e=L.find_among_b(z,3))&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("e");break;case 2:case 3:L.slice_from("a")}}function l(){var e;if(L.ket=L.cursor,(e=L.find_among_b(y,6))&&(L.bra=L.cursor,i()))switch(e){case 1:case 2:L.slice_del();break;case 3:L.slice_from("a");break;case 4:L.slice_from("e")}}function u(){var e;if(L.ket=L.cursor,(e=L.find_among_b(j,2))&&(L.bra=L.cursor,i())){if((1==e||2==e)&&!t())return;L.slice_del(),s()}}function m(){var e;if(L.ket=L.cursor,(e=L.find_among_b(C,7))&&(L.bra=L.cursor,i()))switch(e){case 1:L.slice_from("a");break;case 2:L.slice_from("e");break;case 3:case 4:case 5:case 6:case 7:L.slice_del()}}function k(){var e;if(L.ket=L.cursor,(e=L.find_among_b(P,12))&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 7:case 9:L.slice_del();break;case 2:case 5:case 8:L.slice_from("e");break;case 3:case 6:L.slice_from("a")}}function f(){var e;if(L.ket=L.cursor,(e=L.find_among_b(F,31))&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 7:case 8:case 9:case 12:case 13:case 16:case 17:case 18:L.slice_del();break;case 2:case 5:case 10:case 14:case 19:L.slice_from("a");break;case 3:case 6:case 11:case 15:case 20:L.slice_from("e")}}function b(){var e;if(L.ket=L.cursor,(e=L.find_among_b(S,42))&&(L.bra=L.cursor,i()))switch(e){case 1:case 4:case 5:case 6:case 9:case 10:case 11:case 14:case 15:case 16:case 17:case 20:case 21:case 24:case 25:case 26:case 29:L.slice_del();break;case 2:case 7:case 12:case 18:case 22:case 27:L.slice_from("a");break;case 3:case 8:case 13:case 19:case 23:case 28:L.slice_from("e")}}var d,g=[new n("cs",-1,-1),new n("dzs",-1,-1),new n("gy",-1,-1),new n("ly",-1,-1),new n("ny",-1,-1),new n("sz",-1,-1),new n("ty",-1,-1),new n("zs",-1,-1)],h=[new n("á",-1,1),new n("é",-1,2)],p=[new n("bb",-1,-1),new n("cc",-1,-1),new n("dd",-1,-1),new n("ff",-1,-1),new n("gg",-1,-1),new n("jj",-1,-1),new n("kk",-1,-1),new n("ll",-1,-1),new n("mm",-1,-1),new n("nn",-1,-1),new n("pp",-1,-1),new n("rr",-1,-1),new n("ccs",-1,-1),new n("ss",-1,-1),new n("zzs",-1,-1),new n("tt",-1,-1),new n("vv",-1,-1),new n("ggy",-1,-1),new n("lly",-1,-1),new n("nny",-1,-1),new n("tty",-1,-1),new n("ssz",-1,-1),new n("zz",-1,-1)],_=[new n("al",-1,1),new n("el",-1,2)],v=[new n("ba",-1,-1),new n("ra",-1,-1),new n("be",-1,-1),new n("re",-1,-1),new n("ig",-1,-1),new n("nak",-1,-1),new n("nek",-1,-1),new n("val",-1,-1),new n("vel",-1,-1),new n("ul",-1,-1),new n("nál",-1,-1),new n("nél",-1,-1),new n("ból",-1,-1),new n("ról",-1,-1),new n("tól",-1,-1),new n("bõl",-1,-1),new n("rõl",-1,-1),new n("tõl",-1,-1),new n("ül",-1,-1),new n("n",-1,-1),new n("an",19,-1),new n("ban",20,-1),new n("en",19,-1),new n("ben",22,-1),new n("képpen",22,-1),new n("on",19,-1),new n("ön",19,-1),new n("képp",-1,-1),new n("kor",-1,-1),new n("t",-1,-1),new n("at",29,-1),new n("et",29,-1),new n("ként",29,-1),new n("anként",32,-1),new n("enként",32,-1),new n("onként",32,-1),new n("ot",29,-1),new n("ért",29,-1),new n("öt",29,-1),new n("hez",-1,-1),new n("hoz",-1,-1),new n("höz",-1,-1),new n("vá",-1,-1),new n("vé",-1,-1)],z=[new n("án",-1,2),new n("én",-1,1),new n("ánként",-1,3)],y=[new n("stul",-1,2),new n("astul",0,1),new n("ástul",0,3),new n("stül",-1,2),new n("estül",3,1),new n("éstül",3,4)],j=[new n("á",-1,1),new n("é",-1,2)],C=[new n("k",-1,7),new n("ak",0,4),new n("ek",0,6),new n("ok",0,5),new n("ák",0,1),new n("ék",0,2),new n("ök",0,3)],P=[new n("éi",-1,7),new n("áéi",0,6),new n("ééi",0,5),new n("é",-1,9),new n("ké",3,4),new n("aké",4,1),new n("eké",4,1),new n("oké",4,1),new n("áké",4,3),new n("éké",4,2),new n("öké",4,1),new n("éé",3,8)],F=[new n("a",-1,18),new n("ja",0,17),new n("d",-1,16),new n("ad",2,13),new n("ed",2,13),new n("od",2,13),new n("ád",2,14),new n("éd",2,15),new n("öd",2,13),new n("e",-1,18),new n("je",9,17),new n("nk",-1,4),new n("unk",11,1),new n("ánk",11,2),new n("énk",11,3),new n("ünk",11,1),new n("uk",-1,8),new n("juk",16,7),new n("ájuk",17,5),new n("ük",-1,8),new n("jük",19,7),new n("éjük",20,6),new n("m",-1,12),new n("am",22,9),new n("em",22,9),new n("om",22,9),new n("ám",22,10),new n("ém",22,11),new n("o",-1,18),new n("á",-1,19),new n("é",-1,20)],S=[new n("id",-1,10),new n("aid",0,9),new n("jaid",1,6),new n("eid",0,9),new n("jeid",3,6),new n("áid",0,7),new n("éid",0,8),new n("i",-1,15),new n("ai",7,14),new n("jai",8,11),new n("ei",7,14),new n("jei",10,11),new n("ái",7,12),new n("éi",7,13),new n("itek",-1,24),new n("eitek",14,21),new n("jeitek",15,20),new n("éitek",14,23),new n("ik",-1,29),new n("aik",18,26),new n("jaik",19,25),new n("eik",18,26),new n("jeik",21,25),new n("áik",18,27),new n("éik",18,28),new n("ink",-1,20),new n("aink",25,17),new n("jaink",26,16),new n("eink",25,17),new n("jeink",28,16),new n("áink",25,18),new n("éink",25,19),new n("aitok",-1,21),new n("jaitok",32,20),new n("áitok",-1,22),new n("im",-1,5),new n("aim",35,4),new n("jaim",36,1),new n("eim",35,4),new n("jeim",38,1),new n("áim",35,2),new n("éim",35,3)],W=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,52,14],L=new r;this.setCurrent=function(e){L.setCurrent(e)},this.getCurrent=function(){return L.getCurrent()},this.stem=function(){var n=L.cursor;return e(),L.limit_backward=n,L.cursor=L.limit,c(),L.cursor=L.limit,o(),L.cursor=L.limit,w(),L.cursor=L.limit,l(),L.cursor=L.limit,u(),L.cursor=L.limit,k(),L.cursor=L.limit,f(),L.cursor=L.limit,b(),L.cursor=L.limit,m(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.hu.stemmer,"stemmer-hu"),e.hu.stopWordFilter=e.generateStopWordFilter("a abban ahhoz ahogy ahol aki akik akkor alatt amely amelyek amelyekben amelyeket amelyet amelynek ami amikor amit amolyan amíg annak arra arról az azok azon azonban azt aztán azután azzal azért be belül benne bár cikk cikkek cikkeket csak de e ebben eddig egy egyes egyetlen egyik egyre egyéb egész ehhez ekkor el ellen elsõ elég elõ elõször elõtt emilyen ennek erre ez ezek ezen ezt ezzel ezért fel felé hanem hiszen hogy hogyan igen ill ill. illetve ilyen ilyenkor ismét ison itt jobban jó jól kell kellett keressünk keresztül ki kívül között közül legalább legyen lehet lehetett lenne lenni lesz lett maga magát majd majd meg mellett mely melyek mert mi mikor milyen minden mindenki mindent mindig mint mintha mit mivel miért most már más másik még míg nagy nagyobb nagyon ne nekem neki nem nincs néha néhány nélkül olyan ott pedig persze rá s saját sem semmi sok sokat sokkal szemben szerint szinte számára talán tehát teljes tovább továbbá több ugyanis utolsó után utána vagy vagyis vagyok valaki valami valamint való van vannak vele vissza viszont volna volt voltak voltam voltunk által általában át én éppen és így õ õk õket össze úgy új újabb újra".split(" ")),e.Pipeline.registerFunction(e.hu.stopWordFilter,"stopWordFilter-hu")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.it.min.js b/assets/javascripts/lunr/min/lunr.it.min.js new file mode 100644 index 00000000..344b6a3c --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.it.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Italian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.it=function(){this.pipeline.reset(),this.pipeline.add(e.it.trimmer,e.it.stopWordFilter,e.it.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.it.stemmer))},e.it.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.it.trimmer=e.trimmerSupport.generateTrimmer(e.it.wordCharacters),e.Pipeline.registerFunction(e.it.trimmer,"trimmer-it"),e.it.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(e,r,n){return!(!x.eq_s(1,e)||(x.ket=x.cursor,!x.in_grouping(L,97,249)))&&(x.slice_from(r),x.cursor=n,!0)}function i(){for(var r,n,i,o,t=x.cursor;;){if(x.bra=x.cursor,r=x.find_among(h,7))switch(x.ket=x.cursor,r){case 1:x.slice_from("à");continue;case 2:x.slice_from("è");continue;case 3:x.slice_from("ì");continue;case 4:x.slice_from("ò");continue;case 5:x.slice_from("ù");continue;case 6:x.slice_from("qU");continue;case 7:if(x.cursor>=x.limit)break;x.cursor++;continue}break}for(x.cursor=t;;)for(n=x.cursor;;){if(i=x.cursor,x.in_grouping(L,97,249)){if(x.bra=x.cursor,o=x.cursor,e("u","U",i))break;if(x.cursor=o,e("i","I",i))break}if(x.cursor=i,x.cursor>=x.limit)return void(x.cursor=n);x.cursor++}}function o(e){if(x.cursor=e,!x.in_grouping(L,97,249))return!1;for(;!x.out_grouping(L,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}return!0}function t(){if(x.in_grouping(L,97,249)){var e=x.cursor;if(x.out_grouping(L,97,249)){for(;!x.in_grouping(L,97,249);){if(x.cursor>=x.limit)return o(e);x.cursor++}return!0}return o(e)}return!1}function s(){var e,r=x.cursor;if(!t()){if(x.cursor=r,!x.out_grouping(L,97,249))return;if(e=x.cursor,x.out_grouping(L,97,249)){for(;!x.in_grouping(L,97,249);){if(x.cursor>=x.limit)return x.cursor=e,void(x.in_grouping(L,97,249)&&x.cursor=x.limit)return;x.cursor++}k=x.cursor}function a(){for(;!x.in_grouping(L,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}for(;!x.out_grouping(L,97,249);){if(x.cursor>=x.limit)return!1;x.cursor++}return!0}function u(){var e=x.cursor;k=x.limit,p=k,g=k,s(),x.cursor=e,a()&&(p=x.cursor,a()&&(g=x.cursor))}function c(){for(var e;;){if(x.bra=x.cursor,!(e=x.find_among(q,3)))break;switch(x.ket=x.cursor,e){case 1:x.slice_from("i");break;case 2:x.slice_from("u");break;case 3:if(x.cursor>=x.limit)return;x.cursor++}}}function w(){return k<=x.cursor}function l(){return p<=x.cursor}function m(){return g<=x.cursor}function f(){var e;if(x.ket=x.cursor,x.find_among_b(C,37)&&(x.bra=x.cursor,(e=x.find_among_b(z,5))&&w()))switch(e){case 1:x.slice_del();break;case 2:x.slice_from("e")}}function v(){var e;if(x.ket=x.cursor,!(e=x.find_among_b(S,51)))return!1;switch(x.bra=x.cursor,e){case 1:if(!m())return!1;x.slice_del();break;case 2:if(!m())return!1;x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"ic")&&(x.bra=x.cursor,m()&&x.slice_del());break;case 3:if(!m())return!1;x.slice_from("log");break;case 4:if(!m())return!1;x.slice_from("u");break;case 5:if(!m())return!1;x.slice_from("ente");break;case 6:if(!w())return!1;x.slice_del();break;case 7:if(!l())return!1;x.slice_del(),x.ket=x.cursor,e=x.find_among_b(P,4),e&&(x.bra=x.cursor,m()&&(x.slice_del(),1==e&&(x.ket=x.cursor,x.eq_s_b(2,"at")&&(x.bra=x.cursor,m()&&x.slice_del()))));break;case 8:if(!m())return!1;x.slice_del(),x.ket=x.cursor,e=x.find_among_b(F,3),e&&(x.bra=x.cursor,1==e&&m()&&x.slice_del());break;case 9:if(!m())return!1;x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"at")&&(x.bra=x.cursor,m()&&(x.slice_del(),x.ket=x.cursor,x.eq_s_b(2,"ic")&&(x.bra=x.cursor,m()&&x.slice_del())))}return!0}function b(){var e,r;x.cursor>=k&&(r=x.limit_backward,x.limit_backward=k,x.ket=x.cursor,e=x.find_among_b(W,87),e&&(x.bra=x.cursor,1==e&&x.slice_del()),x.limit_backward=r)}function d(){var e=x.limit-x.cursor;if(x.ket=x.cursor,x.in_grouping_b(y,97,242)&&(x.bra=x.cursor,w()&&(x.slice_del(),x.ket=x.cursor,x.eq_s_b(1,"i")&&(x.bra=x.cursor,w()))))return void x.slice_del();x.cursor=x.limit-e}function _(){d(),x.ket=x.cursor,x.eq_s_b(1,"h")&&(x.bra=x.cursor,x.in_grouping_b(U,99,103)&&w()&&x.slice_del())}var g,p,k,h=[new r("",-1,7),new r("qu",0,6),new r("á",0,1),new r("é",0,2),new r("í",0,3),new r("ó",0,4),new r("ú",0,5)],q=[new r("",-1,3),new r("I",0,1),new r("U",0,2)],C=[new r("la",-1,-1),new r("cela",0,-1),new r("gliela",0,-1),new r("mela",0,-1),new r("tela",0,-1),new r("vela",0,-1),new r("le",-1,-1),new r("cele",6,-1),new r("gliele",6,-1),new r("mele",6,-1),new r("tele",6,-1),new r("vele",6,-1),new r("ne",-1,-1),new r("cene",12,-1),new r("gliene",12,-1),new r("mene",12,-1),new r("sene",12,-1),new r("tene",12,-1),new r("vene",12,-1),new r("ci",-1,-1),new r("li",-1,-1),new r("celi",20,-1),new r("glieli",20,-1),new r("meli",20,-1),new r("teli",20,-1),new r("veli",20,-1),new r("gli",20,-1),new r("mi",-1,-1),new r("si",-1,-1),new r("ti",-1,-1),new r("vi",-1,-1),new r("lo",-1,-1),new r("celo",31,-1),new r("glielo",31,-1),new r("melo",31,-1),new r("telo",31,-1),new r("velo",31,-1)],z=[new r("ando",-1,1),new r("endo",-1,1),new r("ar",-1,2),new r("er",-1,2),new r("ir",-1,2)],P=[new r("ic",-1,-1),new r("abil",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],F=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],S=[new r("ica",-1,1),new r("logia",-1,3),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,9),new r("anza",-1,1),new r("enza",-1,5),new r("ice",-1,1),new r("atrice",7,1),new r("iche",-1,1),new r("logie",-1,3),new r("abile",-1,1),new r("ibile",-1,1),new r("usione",-1,4),new r("azione",-1,2),new r("uzione",-1,4),new r("atore",-1,2),new r("ose",-1,1),new r("ante",-1,1),new r("mente",-1,1),new r("amente",19,7),new r("iste",-1,1),new r("ive",-1,9),new r("anze",-1,1),new r("enze",-1,5),new r("ici",-1,1),new r("atrici",25,1),new r("ichi",-1,1),new r("abili",-1,1),new r("ibili",-1,1),new r("ismi",-1,1),new r("usioni",-1,4),new r("azioni",-1,2),new r("uzioni",-1,4),new r("atori",-1,2),new r("osi",-1,1),new r("anti",-1,1),new r("amenti",-1,6),new r("imenti",-1,6),new r("isti",-1,1),new r("ivi",-1,9),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,6),new r("imento",-1,6),new r("ivo",-1,9),new r("ità",-1,8),new r("istà",-1,1),new r("istè",-1,1),new r("istì",-1,1)],W=[new r("isca",-1,1),new r("enda",-1,1),new r("ata",-1,1),new r("ita",-1,1),new r("uta",-1,1),new r("ava",-1,1),new r("eva",-1,1),new r("iva",-1,1),new r("erebbe",-1,1),new r("irebbe",-1,1),new r("isce",-1,1),new r("ende",-1,1),new r("are",-1,1),new r("ere",-1,1),new r("ire",-1,1),new r("asse",-1,1),new r("ate",-1,1),new r("avate",16,1),new r("evate",16,1),new r("ivate",16,1),new r("ete",-1,1),new r("erete",20,1),new r("irete",20,1),new r("ite",-1,1),new r("ereste",-1,1),new r("ireste",-1,1),new r("ute",-1,1),new r("erai",-1,1),new r("irai",-1,1),new r("isci",-1,1),new r("endi",-1,1),new r("erei",-1,1),new r("irei",-1,1),new r("assi",-1,1),new r("ati",-1,1),new r("iti",-1,1),new r("eresti",-1,1),new r("iresti",-1,1),new r("uti",-1,1),new r("avi",-1,1),new r("evi",-1,1),new r("ivi",-1,1),new r("isco",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("Yamo",-1,1),new r("iamo",-1,1),new r("avamo",-1,1),new r("evamo",-1,1),new r("ivamo",-1,1),new r("eremo",-1,1),new r("iremo",-1,1),new r("assimo",-1,1),new r("ammo",-1,1),new r("emmo",-1,1),new r("eremmo",54,1),new r("iremmo",54,1),new r("immo",-1,1),new r("ano",-1,1),new r("iscano",58,1),new r("avano",58,1),new r("evano",58,1),new r("ivano",58,1),new r("eranno",-1,1),new r("iranno",-1,1),new r("ono",-1,1),new r("iscono",65,1),new r("arono",65,1),new r("erono",65,1),new r("irono",65,1),new r("erebbero",-1,1),new r("irebbero",-1,1),new r("assero",-1,1),new r("essero",-1,1),new r("issero",-1,1),new r("ato",-1,1),new r("ito",-1,1),new r("uto",-1,1),new r("avo",-1,1),new r("evo",-1,1),new r("ivo",-1,1),new r("ar",-1,1),new r("ir",-1,1),new r("erà",-1,1),new r("irà",-1,1),new r("erò",-1,1),new r("irò",-1,1)],L=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2,1],y=[17,65,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2],U=[17],x=new n;this.setCurrent=function(e){x.setCurrent(e)},this.getCurrent=function(){return x.getCurrent()},this.stem=function(){var e=x.cursor;return i(),x.cursor=e,u(),x.limit_backward=e,x.cursor=x.limit,f(),x.cursor=x.limit,v()||(x.cursor=x.limit,b()),x.cursor=x.limit,_(),x.cursor=x.limit_backward,c(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.it.stemmer,"stemmer-it"),e.it.stopWordFilter=e.generateStopWordFilter("a abbia abbiamo abbiano abbiate ad agl agli ai al all alla alle allo anche avemmo avendo avesse avessero avessi avessimo aveste avesti avete aveva avevamo avevano avevate avevi avevo avrai avranno avrebbe avrebbero avrei avremmo avremo avreste avresti avrete avrà avrò avuta avute avuti avuto c che chi ci coi col come con contro cui da dagl dagli dai dal dall dalla dalle dallo degl degli dei del dell della delle dello di dov dove e ebbe ebbero ebbi ed era erano eravamo eravate eri ero essendo faccia facciamo facciano facciate faccio facemmo facendo facesse facessero facessi facessimo faceste facesti faceva facevamo facevano facevate facevi facevo fai fanno farai faranno farebbe farebbero farei faremmo faremo fareste faresti farete farà farò fece fecero feci fosse fossero fossi fossimo foste fosti fu fui fummo furono gli ha hai hanno ho i il in io l la le lei li lo loro lui ma mi mia mie miei mio ne negl negli nei nel nell nella nelle nello noi non nostra nostre nostri nostro o per perché più quale quanta quante quanti quanto quella quelle quelli quello questa queste questi questo sarai saranno sarebbe sarebbero sarei saremmo saremo sareste saresti sarete sarà sarò se sei si sia siamo siano siate siete sono sta stai stando stanno starai staranno starebbe starebbero starei staremmo staremo stareste staresti starete starà starò stava stavamo stavano stavate stavi stavo stemmo stesse stessero stessi stessimo steste stesti stette stettero stetti stia stiamo stiano stiate sto su sua sue sugl sugli sui sul sull sulla sulle sullo suo suoi ti tra tu tua tue tuo tuoi tutti tutto un una uno vi voi vostra vostre vostri vostro è".split(" ")),e.Pipeline.registerFunction(e.it.stopWordFilter,"stopWordFilter-it")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.ja.min.js b/assets/javascripts/lunr/min/lunr.ja.min.js new file mode 100644 index 00000000..5f254ebe --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.ja.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.ja=function(){this.pipeline.reset(),this.pipeline.add(e.ja.trimmer,e.ja.stopWordFilter,e.ja.stemmer),r?this.tokenizer=e.ja.tokenizer:(e.tokenizer&&(e.tokenizer=e.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.ja.tokenizer))};var t=new e.TinySegmenter;e.ja.tokenizer=function(i){var n,o,s,p,a,u,m,l,c,f;if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(o=i.toString().toLowerCase().replace(/^\s+/,""),n=o.length-1;n>=0;n--)if(/\S/.test(o.charAt(n))){o=o.substring(0,n+1);break}for(a=[],s=o.length,c=0,l=0;c<=s;c++)if(u=o.charAt(c),m=c-l,u.match(/\s/)||c==s){if(m>0)for(p=t.segment(o.slice(l,c)).filter(function(e){return!!e}),f=l,n=0;n=C.limit)break;C.cursor++;continue}break}for(C.cursor=o,C.bra=o,C.eq_s(1,"y")?(C.ket=C.cursor,C.slice_from("Y")):C.cursor=o;;)if(e=C.cursor,C.in_grouping(q,97,232)){if(i=C.cursor,C.bra=i,C.eq_s(1,"i"))C.ket=C.cursor,C.in_grouping(q,97,232)&&(C.slice_from("I"),C.cursor=e);else if(C.cursor=i,C.eq_s(1,"y"))C.ket=C.cursor,C.slice_from("Y"),C.cursor=e;else if(n(e))break}else if(n(e))break}function n(r){return C.cursor=r,r>=C.limit||(C.cursor++,!1)}function o(){_=C.limit,d=_,t()||(_=C.cursor,_<3&&(_=3),t()||(d=C.cursor))}function t(){for(;!C.in_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}for(;!C.out_grouping(q,97,232);){if(C.cursor>=C.limit)return!0;C.cursor++}return!1}function s(){for(var r;;)if(C.bra=C.cursor,r=C.find_among(p,3))switch(C.ket=C.cursor,r){case 1:C.slice_from("y");break;case 2:C.slice_from("i");break;case 3:if(C.cursor>=C.limit)return;C.cursor++}}function u(){return _<=C.cursor}function c(){return d<=C.cursor}function a(){var r=C.limit-C.cursor;C.find_among_b(g,3)&&(C.cursor=C.limit-r,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del()))}function l(){var r;w=!1,C.ket=C.cursor,C.eq_s_b(1,"e")&&(C.bra=C.cursor,u()&&(r=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-r,C.slice_del(),w=!0,a())))}function m(){var r;u()&&(r=C.limit-C.cursor,C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-r,C.eq_s_b(3,"gem")||(C.cursor=C.limit-r,C.slice_del(),a())))}function f(){var r,e,i,n,o,t,s=C.limit-C.cursor;if(C.ket=C.cursor,r=C.find_among_b(h,5))switch(C.bra=C.cursor,r){case 1:u()&&C.slice_from("heid");break;case 2:m();break;case 3:u()&&C.out_grouping_b(j,97,232)&&C.slice_del()}if(C.cursor=C.limit-s,l(),C.cursor=C.limit-s,C.ket=C.cursor,C.eq_s_b(4,"heid")&&(C.bra=C.cursor,c()&&(e=C.limit-C.cursor,C.eq_s_b(1,"c")||(C.cursor=C.limit-e,C.slice_del(),C.ket=C.cursor,C.eq_s_b(2,"en")&&(C.bra=C.cursor,m())))),C.cursor=C.limit-s,C.ket=C.cursor,r=C.find_among_b(k,6))switch(C.bra=C.cursor,r){case 1:if(c()){if(C.slice_del(),i=C.limit-C.cursor,C.ket=C.cursor,C.eq_s_b(2,"ig")&&(C.bra=C.cursor,c()&&(n=C.limit-C.cursor,!C.eq_s_b(1,"e")))){C.cursor=C.limit-n,C.slice_del();break}C.cursor=C.limit-i,a()}break;case 2:c()&&(o=C.limit-C.cursor,C.eq_s_b(1,"e")||(C.cursor=C.limit-o,C.slice_del()));break;case 3:c()&&(C.slice_del(),l());break;case 4:c()&&C.slice_del();break;case 5:c()&&w&&C.slice_del()}C.cursor=C.limit-s,C.out_grouping_b(z,73,232)&&(t=C.limit-C.cursor,C.find_among_b(v,4)&&C.out_grouping_b(q,97,232)&&(C.cursor=C.limit-t,C.ket=C.cursor,C.cursor>C.limit_backward&&(C.cursor--,C.bra=C.cursor,C.slice_del())))}var d,_,w,b=[new e("",-1,6),new e("á",0,1),new e("ä",0,1),new e("é",0,2),new e("ë",0,2),new e("í",0,3),new e("ï",0,3),new e("ó",0,4),new e("ö",0,4),new e("ú",0,5),new e("ü",0,5)],p=[new e("",-1,3),new e("I",0,2),new e("Y",0,1)],g=[new e("dd",-1,-1),new e("kk",-1,-1),new e("tt",-1,-1)],h=[new e("ene",-1,2),new e("se",-1,3),new e("en",-1,2),new e("heden",2,1),new e("s",-1,3)],k=[new e("end",-1,1),new e("ig",-1,2),new e("ing",-1,1),new e("lijk",-1,3),new e("baar",-1,4),new e("bar",-1,5)],v=[new e("aa",-1,-1),new e("ee",-1,-1),new e("oo",-1,-1),new e("uu",-1,-1)],q=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],z=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],j=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],C=new i;this.setCurrent=function(r){C.setCurrent(r)},this.getCurrent=function(){return C.getCurrent()},this.stem=function(){var e=C.cursor;return r(),C.cursor=e,o(),C.limit_backward=e,C.cursor=C.limit,f(),C.cursor=C.limit_backward,s(),!0}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.nl.stemmer,"stemmer-nl"),r.nl.stopWordFilter=r.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),r.Pipeline.registerFunction(r.nl.stopWordFilter,"stopWordFilter-nl")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.no.min.js b/assets/javascripts/lunr/min/lunr.no.min.js new file mode 100644 index 00000000..92bc7e4e --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.no.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Norwegian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,r=w.cursor+3;if(a=w.limit,0<=r||r<=w.limit){for(s=r;;){if(e=w.cursor,w.in_grouping(d,97,248)){w.cursor=e;break}if(e>=w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}a=w.cursor,a=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.pt.min.js b/assets/javascripts/lunr/min/lunr.pt.min.js new file mode 100644 index 00000000..6c16996d --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.pt.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Portuguese` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.pt=function(){this.pipeline.reset(),this.pipeline.add(e.pt.trimmer,e.pt.stopWordFilter,e.pt.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.pt.stemmer))},e.pt.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.pt.trimmer=e.trimmerSupport.generateTrimmer(e.pt.wordCharacters),e.Pipeline.registerFunction(e.pt.trimmer,"trimmer-pt"),e.pt.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(k,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("a~");continue;case 2:z.slice_from("o~");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function n(){if(z.out_grouping(y,97,250)){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!0;z.cursor++}return!1}return!0}function i(){if(z.in_grouping(y,97,250))for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return g=z.cursor,!0}function o(){var e,r,s=z.cursor;if(z.in_grouping(y,97,250))if(e=z.cursor,n()){if(z.cursor=e,i())return}else g=z.cursor;if(z.cursor=s,z.out_grouping(y,97,250)){if(r=z.cursor,n()){if(z.cursor=r,!z.in_grouping(y,97,250)||z.cursor>=z.limit)return;z.cursor++}g=z.cursor}}function t(){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return!0}function a(){var e=z.cursor;g=z.limit,b=g,h=g,o(),z.cursor=e,t()&&(b=z.cursor,t()&&(h=z.cursor))}function u(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(q,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("ã");continue;case 2:z.slice_from("õ");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function w(){return g<=z.cursor}function m(){return b<=z.cursor}function c(){return h<=z.cursor}function l(){var e;if(z.ket=z.cursor,!(e=z.find_among_b(F,45)))return!1;switch(z.bra=z.cursor,e){case 1:if(!c())return!1;z.slice_del();break;case 2:if(!c())return!1;z.slice_from("log");break;case 3:if(!c())return!1;z.slice_from("u");break;case 4:if(!c())return!1;z.slice_from("ente");break;case 5:if(!m())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(j,4),e&&(z.bra=z.cursor,c()&&(z.slice_del(),1==e&&(z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del()))));break;case 6:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(C,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 7:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(P,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 8:if(!c())return!1;z.slice_del(),z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del());break;case 9:if(!w()||!z.eq_s_b(1,"e"))return!1;z.slice_from("ir")}return!0}function f(){var e,r;if(z.cursor>=g){if(r=z.limit_backward,z.limit_backward=g,z.ket=z.cursor,e=z.find_among_b(S,120))return z.bra=z.cursor,1==e&&z.slice_del(),z.limit_backward=r,!0;z.limit_backward=r}return!1}function d(){var e;z.ket=z.cursor,(e=z.find_among_b(W,7))&&(z.bra=z.cursor,1==e&&w()&&z.slice_del())}function v(e,r){if(z.eq_s_b(1,e)){z.bra=z.cursor;var s=z.limit-z.cursor;if(z.eq_s_b(1,r))return z.cursor=z.limit-s,w()&&z.slice_del(),!1}return!0}function p(){var e;if(z.ket=z.cursor,e=z.find_among_b(L,4))switch(z.bra=z.cursor,e){case 1:w()&&(z.slice_del(),z.ket=z.cursor,z.limit-z.cursor,v("u","g")&&v("i","c"));break;case 2:z.slice_from("c")}}function _(){if(!l()&&(z.cursor=z.limit,!f()))return z.cursor=z.limit,void d();z.cursor=z.limit,z.ket=z.cursor,z.eq_s_b(1,"i")&&(z.bra=z.cursor,z.eq_s_b(1,"c")&&(z.cursor=z.limit,w()&&z.slice_del()))}var h,b,g,k=[new r("",-1,3),new r("ã",0,1),new r("õ",0,2)],q=[new r("",-1,3),new r("a~",0,1),new r("o~",0,2)],j=[new r("ic",-1,-1),new r("ad",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],C=[new r("ante",-1,1),new r("avel",-1,1),new r("ível",-1,1)],P=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],F=[new r("ica",-1,1),new r("ância",-1,1),new r("ência",-1,4),new r("ira",-1,9),new r("adora",-1,1),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,8),new r("eza",-1,1),new r("logía",-1,2),new r("idade",-1,7),new r("ante",-1,1),new r("mente",-1,6),new r("amente",12,5),new r("ável",-1,1),new r("ível",-1,1),new r("ución",-1,3),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,1),new r("imento",-1,1),new r("ivo",-1,8),new r("aça~o",-1,1),new r("ador",-1,1),new r("icas",-1,1),new r("ências",-1,4),new r("iras",-1,9),new r("adoras",-1,1),new r("osas",-1,1),new r("istas",-1,1),new r("ivas",-1,8),new r("ezas",-1,1),new r("logías",-1,2),new r("idades",-1,7),new r("uciones",-1,3),new r("adores",-1,1),new r("antes",-1,1),new r("aço~es",-1,1),new r("icos",-1,1),new r("ismos",-1,1),new r("osos",-1,1),new r("amentos",-1,1),new r("imentos",-1,1),new r("ivos",-1,8)],S=[new r("ada",-1,1),new r("ida",-1,1),new r("ia",-1,1),new r("aria",2,1),new r("eria",2,1),new r("iria",2,1),new r("ara",-1,1),new r("era",-1,1),new r("ira",-1,1),new r("ava",-1,1),new r("asse",-1,1),new r("esse",-1,1),new r("isse",-1,1),new r("aste",-1,1),new r("este",-1,1),new r("iste",-1,1),new r("ei",-1,1),new r("arei",16,1),new r("erei",16,1),new r("irei",16,1),new r("am",-1,1),new r("iam",20,1),new r("ariam",21,1),new r("eriam",21,1),new r("iriam",21,1),new r("aram",20,1),new r("eram",20,1),new r("iram",20,1),new r("avam",20,1),new r("em",-1,1),new r("arem",29,1),new r("erem",29,1),new r("irem",29,1),new r("assem",29,1),new r("essem",29,1),new r("issem",29,1),new r("ado",-1,1),new r("ido",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("indo",-1,1),new r("ara~o",-1,1),new r("era~o",-1,1),new r("ira~o",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("ir",-1,1),new r("as",-1,1),new r("adas",47,1),new r("idas",47,1),new r("ias",47,1),new r("arias",50,1),new r("erias",50,1),new r("irias",50,1),new r("aras",47,1),new r("eras",47,1),new r("iras",47,1),new r("avas",47,1),new r("es",-1,1),new r("ardes",58,1),new r("erdes",58,1),new r("irdes",58,1),new r("ares",58,1),new r("eres",58,1),new r("ires",58,1),new r("asses",58,1),new r("esses",58,1),new r("isses",58,1),new r("astes",58,1),new r("estes",58,1),new r("istes",58,1),new r("is",-1,1),new r("ais",71,1),new r("eis",71,1),new r("areis",73,1),new r("ereis",73,1),new r("ireis",73,1),new r("áreis",73,1),new r("éreis",73,1),new r("íreis",73,1),new r("ásseis",73,1),new r("ésseis",73,1),new r("ísseis",73,1),new r("áveis",73,1),new r("íeis",73,1),new r("aríeis",84,1),new r("eríeis",84,1),new r("iríeis",84,1),new r("ados",-1,1),new r("idos",-1,1),new r("amos",-1,1),new r("áramos",90,1),new r("éramos",90,1),new r("íramos",90,1),new r("ávamos",90,1),new r("íamos",90,1),new r("aríamos",95,1),new r("eríamos",95,1),new r("iríamos",95,1),new r("emos",-1,1),new r("aremos",99,1),new r("eremos",99,1),new r("iremos",99,1),new r("ássemos",99,1),new r("êssemos",99,1),new r("íssemos",99,1),new r("imos",-1,1),new r("armos",-1,1),new r("ermos",-1,1),new r("irmos",-1,1),new r("ámos",-1,1),new r("arás",-1,1),new r("erás",-1,1),new r("irás",-1,1),new r("eu",-1,1),new r("iu",-1,1),new r("ou",-1,1),new r("ará",-1,1),new r("erá",-1,1),new r("irá",-1,1)],W=[new r("a",-1,1),new r("i",-1,1),new r("o",-1,1),new r("os",-1,1),new r("á",-1,1),new r("í",-1,1),new r("ó",-1,1)],L=[new r("e",-1,1),new r("ç",-1,2),new r("é",-1,1),new r("ê",-1,1)],y=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,19,12,2],z=new s;this.setCurrent=function(e){z.setCurrent(e)},this.getCurrent=function(){return z.getCurrent()},this.stem=function(){var r=z.cursor;return e(),z.cursor=r,a(),z.limit_backward=r,z.cursor=z.limit,_(),z.cursor=z.limit,p(),z.cursor=z.limit_backward,u(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.pt.stemmer,"stemmer-pt"),e.pt.stopWordFilter=e.generateStopWordFilter("a ao aos aquela aquelas aquele aqueles aquilo as até com como da das de dela delas dele deles depois do dos e ela elas ele eles em entre era eram essa essas esse esses esta estamos estas estava estavam este esteja estejam estejamos estes esteve estive estivemos estiver estivera estiveram estiverem estivermos estivesse estivessem estivéramos estivéssemos estou está estávamos estão eu foi fomos for fora foram forem formos fosse fossem fui fôramos fôssemos haja hajam hajamos havemos hei houve houvemos houver houvera houveram houverei houverem houveremos houveria houveriam houvermos houverá houverão houveríamos houvesse houvessem houvéramos houvéssemos há hão isso isto já lhe lhes mais mas me mesmo meu meus minha minhas muito na nas nem no nos nossa nossas nosso nossos num numa não nós o os ou para pela pelas pelo pelos por qual quando que quem se seja sejam sejamos sem serei seremos seria seriam será serão seríamos seu seus somos sou sua suas são só também te tem temos tenha tenham tenhamos tenho terei teremos teria teriam terá terão teríamos teu teus teve tinha tinham tive tivemos tiver tivera tiveram tiverem tivermos tivesse tivessem tivéramos tivéssemos tu tua tuas tém tínhamos um uma você vocês vos à às éramos".split(" ")),e.Pipeline.registerFunction(e.pt.stopWordFilter,"stopWordFilter-pt")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.ro.min.js b/assets/javascripts/lunr/min/lunr.ro.min.js new file mode 100644 index 00000000..72771401 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.ro.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Romanian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ro=function(){this.pipeline.reset(),this.pipeline.add(e.ro.trimmer,e.ro.stopWordFilter,e.ro.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ro.stemmer))},e.ro.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.ro.trimmer=e.trimmerSupport.generateTrimmer(e.ro.wordCharacters),e.Pipeline.registerFunction(e.ro.trimmer,"trimmer-ro"),e.ro.stemmer=function(){var i=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,n=new function(){function e(e,i){L.eq_s(1,e)&&(L.ket=L.cursor,L.in_grouping(W,97,259)&&L.slice_from(i))}function n(){for(var i,r;;){if(i=L.cursor,L.in_grouping(W,97,259)&&(r=L.cursor,L.bra=r,e("u","U"),L.cursor=r,e("i","I")),L.cursor=i,L.cursor>=L.limit)break;L.cursor++}}function t(){if(L.out_grouping(W,97,259)){for(;!L.in_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}return!0}function a(){if(L.in_grouping(W,97,259))for(;!L.out_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}function o(){var e,i,r=L.cursor;if(L.in_grouping(W,97,259)){if(e=L.cursor,!t())return void(h=L.cursor);if(L.cursor=e,!a())return void(h=L.cursor)}L.cursor=r,L.out_grouping(W,97,259)&&(i=L.cursor,t()&&(L.cursor=i,L.in_grouping(W,97,259)&&L.cursor=L.limit)return!1;L.cursor++}for(;!L.out_grouping(W,97,259);){if(L.cursor>=L.limit)return!1;L.cursor++}return!0}function c(){var e=L.cursor;h=L.limit,k=h,g=h,o(),L.cursor=e,u()&&(k=L.cursor,u()&&(g=L.cursor))}function s(){for(var e;;){if(L.bra=L.cursor,e=L.find_among(z,3))switch(L.ket=L.cursor,e){case 1:L.slice_from("i");continue;case 2:L.slice_from("u");continue;case 3:if(L.cursor>=L.limit)break;L.cursor++;continue}break}}function w(){return h<=L.cursor}function m(){return k<=L.cursor}function l(){return g<=L.cursor}function f(){var e,i;if(L.ket=L.cursor,(e=L.find_among_b(C,16))&&(L.bra=L.cursor,m()))switch(e){case 1:L.slice_del();break;case 2:L.slice_from("a");break;case 3:L.slice_from("e");break;case 4:L.slice_from("i");break;case 5:i=L.limit-L.cursor,L.eq_s_b(2,"ab")||(L.cursor=L.limit-i,L.slice_from("i"));break;case 6:L.slice_from("at");break;case 7:L.slice_from("aţi")}}function p(){var e,i=L.limit-L.cursor;if(L.ket=L.cursor,(e=L.find_among_b(P,46))&&(L.bra=L.cursor,m())){switch(e){case 1:L.slice_from("abil");break;case 2:L.slice_from("ibil");break;case 3:L.slice_from("iv");break;case 4:L.slice_from("ic");break;case 5:L.slice_from("at");break;case 6:L.slice_from("it")}return _=!0,L.cursor=L.limit-i,!0}return!1}function d(){var e,i;for(_=!1;;)if(i=L.limit-L.cursor,!p()){L.cursor=L.limit-i;break}if(L.ket=L.cursor,(e=L.find_among_b(F,62))&&(L.bra=L.cursor,l())){switch(e){case 1:L.slice_del();break;case 2:L.eq_s_b(1,"ţ")&&(L.bra=L.cursor,L.slice_from("t"));break;case 3:L.slice_from("ist")}_=!0}}function b(){var e,i,r;if(L.cursor>=h){if(i=L.limit_backward,L.limit_backward=h,L.ket=L.cursor,e=L.find_among_b(q,94))switch(L.bra=L.cursor,e){case 1:if(r=L.limit-L.cursor,!L.out_grouping_b(W,97,259)&&(L.cursor=L.limit-r,!L.eq_s_b(1,"u")))break;case 2:L.slice_del()}L.limit_backward=i}}function v(){var e;L.ket=L.cursor,(e=L.find_among_b(S,5))&&(L.bra=L.cursor,w()&&1==e&&L.slice_del())}var _,g,k,h,z=[new i("",-1,3),new i("I",0,1),new i("U",0,2)],C=[new i("ea",-1,3),new i("aţia",-1,7),new i("aua",-1,2),new i("iua",-1,4),new i("aţie",-1,7),new i("ele",-1,3),new i("ile",-1,5),new i("iile",6,4),new i("iei",-1,4),new i("atei",-1,6),new i("ii",-1,4),new i("ului",-1,1),new i("ul",-1,1),new i("elor",-1,3),new i("ilor",-1,4),new i("iilor",14,4)],P=[new i("icala",-1,4),new i("iciva",-1,4),new i("ativa",-1,5),new i("itiva",-1,6),new i("icale",-1,4),new i("aţiune",-1,5),new i("iţiune",-1,6),new i("atoare",-1,5),new i("itoare",-1,6),new i("ătoare",-1,5),new i("icitate",-1,4),new i("abilitate",-1,1),new i("ibilitate",-1,2),new i("ivitate",-1,3),new i("icive",-1,4),new i("ative",-1,5),new i("itive",-1,6),new i("icali",-1,4),new i("atori",-1,5),new i("icatori",18,4),new i("itori",-1,6),new i("ători",-1,5),new i("icitati",-1,4),new i("abilitati",-1,1),new i("ivitati",-1,3),new i("icivi",-1,4),new i("ativi",-1,5),new i("itivi",-1,6),new i("icităi",-1,4),new i("abilităi",-1,1),new i("ivităi",-1,3),new i("icităţi",-1,4),new i("abilităţi",-1,1),new i("ivităţi",-1,3),new i("ical",-1,4),new i("ator",-1,5),new i("icator",35,4),new i("itor",-1,6),new i("ător",-1,5),new i("iciv",-1,4),new i("ativ",-1,5),new i("itiv",-1,6),new i("icală",-1,4),new i("icivă",-1,4),new i("ativă",-1,5),new i("itivă",-1,6)],F=[new i("ica",-1,1),new i("abila",-1,1),new i("ibila",-1,1),new i("oasa",-1,1),new i("ata",-1,1),new i("ita",-1,1),new i("anta",-1,1),new i("ista",-1,3),new i("uta",-1,1),new i("iva",-1,1),new i("ic",-1,1),new i("ice",-1,1),new i("abile",-1,1),new i("ibile",-1,1),new i("isme",-1,3),new i("iune",-1,2),new i("oase",-1,1),new i("ate",-1,1),new i("itate",17,1),new i("ite",-1,1),new i("ante",-1,1),new i("iste",-1,3),new i("ute",-1,1),new i("ive",-1,1),new i("ici",-1,1),new i("abili",-1,1),new i("ibili",-1,1),new i("iuni",-1,2),new i("atori",-1,1),new i("osi",-1,1),new i("ati",-1,1),new i("itati",30,1),new i("iti",-1,1),new i("anti",-1,1),new i("isti",-1,3),new i("uti",-1,1),new i("işti",-1,3),new i("ivi",-1,1),new i("ităi",-1,1),new i("oşi",-1,1),new i("ităţi",-1,1),new i("abil",-1,1),new i("ibil",-1,1),new i("ism",-1,3),new i("ator",-1,1),new i("os",-1,1),new i("at",-1,1),new i("it",-1,1),new i("ant",-1,1),new i("ist",-1,3),new i("ut",-1,1),new i("iv",-1,1),new i("ică",-1,1),new i("abilă",-1,1),new i("ibilă",-1,1),new i("oasă",-1,1),new i("ată",-1,1),new i("ită",-1,1),new i("antă",-1,1),new i("istă",-1,3),new i("ută",-1,1),new i("ivă",-1,1)],q=[new i("ea",-1,1),new i("ia",-1,1),new i("esc",-1,1),new i("ăsc",-1,1),new i("ind",-1,1),new i("ând",-1,1),new i("are",-1,1),new i("ere",-1,1),new i("ire",-1,1),new i("âre",-1,1),new i("se",-1,2),new i("ase",10,1),new i("sese",10,2),new i("ise",10,1),new i("use",10,1),new i("âse",10,1),new i("eşte",-1,1),new i("ăşte",-1,1),new i("eze",-1,1),new i("ai",-1,1),new i("eai",19,1),new i("iai",19,1),new i("sei",-1,2),new i("eşti",-1,1),new i("ăşti",-1,1),new i("ui",-1,1),new i("ezi",-1,1),new i("âi",-1,1),new i("aşi",-1,1),new i("seşi",-1,2),new i("aseşi",29,1),new i("seseşi",29,2),new i("iseşi",29,1),new i("useşi",29,1),new i("âseşi",29,1),new i("işi",-1,1),new i("uşi",-1,1),new i("âşi",-1,1),new i("aţi",-1,2),new i("eaţi",38,1),new i("iaţi",38,1),new i("eţi",-1,2),new i("iţi",-1,2),new i("âţi",-1,2),new i("arăţi",-1,1),new i("serăţi",-1,2),new i("aserăţi",45,1),new i("seserăţi",45,2),new i("iserăţi",45,1),new i("userăţi",45,1),new i("âserăţi",45,1),new i("irăţi",-1,1),new i("urăţi",-1,1),new i("ârăţi",-1,1),new i("am",-1,1),new i("eam",54,1),new i("iam",54,1),new i("em",-1,2),new i("asem",57,1),new i("sesem",57,2),new i("isem",57,1),new i("usem",57,1),new i("âsem",57,1),new i("im",-1,2),new i("âm",-1,2),new i("ăm",-1,2),new i("arăm",65,1),new i("serăm",65,2),new i("aserăm",67,1),new i("seserăm",67,2),new i("iserăm",67,1),new i("userăm",67,1),new i("âserăm",67,1),new i("irăm",65,1),new i("urăm",65,1),new i("ârăm",65,1),new i("au",-1,1),new i("eau",76,1),new i("iau",76,1),new i("indu",-1,1),new i("ându",-1,1),new i("ez",-1,1),new i("ească",-1,1),new i("ară",-1,1),new i("seră",-1,2),new i("aseră",84,1),new i("seseră",84,2),new i("iseră",84,1),new i("useră",84,1),new i("âseră",84,1),new i("iră",-1,1),new i("ură",-1,1),new i("âră",-1,1),new i("ează",-1,1)],S=[new i("a",-1,1),new i("e",-1,1),new i("ie",1,1),new i("i",-1,1),new i("ă",-1,1)],W=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,2,32,0,0,4],L=new r;this.setCurrent=function(e){L.setCurrent(e)},this.getCurrent=function(){return L.getCurrent()},this.stem=function(){var e=L.cursor;return n(),L.cursor=e,c(),L.limit_backward=e,L.cursor=L.limit,f(),L.cursor=L.limit,d(),L.cursor=L.limit,_||(L.cursor=L.limit,b(),L.cursor=L.limit),v(),L.cursor=L.limit_backward,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.ro.stemmer,"stemmer-ro"),e.ro.stopWordFilter=e.generateStopWordFilter("acea aceasta această aceea acei aceia acel acela acele acelea acest acesta aceste acestea aceşti aceştia acolo acord acum ai aia aibă aici al ale alea altceva altcineva am ar are asemenea asta astea astăzi asupra au avea avem aveţi azi aş aşadar aţi bine bucur bună ca care caut ce cel ceva chiar cinci cine cineva contra cu cum cumva curând curînd când cât câte câtva câţi cînd cît cîte cîtva cîţi că căci cărei căror cărui către da dacă dar datorită dată dau de deci deja deoarece departe deşi din dinaintea dintr- dintre doi doilea două drept după dă ea ei el ele eram este eu eşti face fata fi fie fiecare fii fim fiu fiţi frumos fără graţie halbă iar ieri la le li lor lui lângă lîngă mai mea mei mele mereu meu mi mie mine mult multă mulţi mulţumesc mâine mîine mă ne nevoie nici nicăieri nimeni nimeri nimic nişte noastre noastră noi noroc nostru nouă noştri nu opt ori oricare orice oricine oricum oricând oricât oricînd oricît oriunde patra patru patrulea pe pentru peste pic poate pot prea prima primul prin puţin puţina puţină până pînă rog sa sale sau se spate spre sub sunt suntem sunteţi sută sînt sîntem sînteţi să săi său ta tale te timp tine toate toată tot totuşi toţi trei treia treilea tu tăi tău un una unde undeva unei uneia unele uneori unii unor unora unu unui unuia unul vi voastre voastră voi vostru vouă voştri vreme vreo vreun vă zece zero zi zice îi îl îmi împotriva în înainte înaintea încotro încât încît între întrucât întrucît îţi ăla ălea ăsta ăstea ăştia şapte şase şi ştiu ţi ţie".split(" ")),e.Pipeline.registerFunction(e.ro.stopWordFilter,"stopWordFilter-ro")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.ru.min.js b/assets/javascripts/lunr/min/lunr.ru.min.js new file mode 100644 index 00000000..186cc485 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.ru.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Russian` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ru=function(){this.pipeline.reset(),this.pipeline.add(e.ru.trimmer,e.ru.stopWordFilter,e.ru.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ru.stemmer))},e.ru.wordCharacters="Ѐ-҄҇-ԯᴫᵸⷠ-ⷿꙀ-ꚟ︮︯",e.ru.trimmer=e.trimmerSupport.generateTrimmer(e.ru.wordCharacters),e.Pipeline.registerFunction(e.ru.trimmer,"trimmer-ru"),e.ru.stemmer=function(){var n=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,t=new function(){function e(){for(;!W.in_grouping(S,1072,1103);){if(W.cursor>=W.limit)return!1;W.cursor++}return!0}function t(){for(;!W.out_grouping(S,1072,1103);){if(W.cursor>=W.limit)return!1;W.cursor++}return!0}function w(){b=W.limit,_=b,e()&&(b=W.cursor,t()&&e()&&t()&&(_=W.cursor))}function i(){return _<=W.cursor}function u(e,n){var r,t;if(W.ket=W.cursor,r=W.find_among_b(e,n)){switch(W.bra=W.cursor,r){case 1:if(t=W.limit-W.cursor,!W.eq_s_b(1,"а")&&(W.cursor=W.limit-t,!W.eq_s_b(1,"я")))return!1;case 2:W.slice_del()}return!0}return!1}function o(){return u(h,9)}function s(e,n){var r;return W.ket=W.cursor,!!(r=W.find_among_b(e,n))&&(W.bra=W.cursor,1==r&&W.slice_del(),!0)}function c(){return s(g,26)}function m(){return!!c()&&(u(C,8),!0)}function f(){return s(k,2)}function l(){return u(P,46)}function a(){s(v,36)}function p(){var e;W.ket=W.cursor,(e=W.find_among_b(F,2))&&(W.bra=W.cursor,i()&&1==e&&W.slice_del())}function d(){var e;if(W.ket=W.cursor,e=W.find_among_b(q,4))switch(W.bra=W.cursor,e){case 1:if(W.slice_del(),W.ket=W.cursor,!W.eq_s_b(1,"н"))break;W.bra=W.cursor;case 2:if(!W.eq_s_b(1,"н"))break;case 3:W.slice_del()}}var _,b,h=[new n("в",-1,1),new n("ив",0,2),new n("ыв",0,2),new n("вши",-1,1),new n("ивши",3,2),new n("ывши",3,2),new n("вшись",-1,1),new n("ившись",6,2),new n("ывшись",6,2)],g=[new n("ее",-1,1),new n("ие",-1,1),new n("ое",-1,1),new n("ые",-1,1),new n("ими",-1,1),new n("ыми",-1,1),new n("ей",-1,1),new n("ий",-1,1),new n("ой",-1,1),new n("ый",-1,1),new n("ем",-1,1),new n("им",-1,1),new n("ом",-1,1),new n("ым",-1,1),new n("его",-1,1),new n("ого",-1,1),new n("ему",-1,1),new n("ому",-1,1),new n("их",-1,1),new n("ых",-1,1),new n("ею",-1,1),new n("ою",-1,1),new n("ую",-1,1),new n("юю",-1,1),new n("ая",-1,1),new n("яя",-1,1)],C=[new n("ем",-1,1),new n("нн",-1,1),new n("вш",-1,1),new n("ивш",2,2),new n("ывш",2,2),new n("щ",-1,1),new n("ющ",5,1),new n("ующ",6,2)],k=[new n("сь",-1,1),new n("ся",-1,1)],P=[new n("ла",-1,1),new n("ила",0,2),new n("ыла",0,2),new n("на",-1,1),new n("ена",3,2),new n("ете",-1,1),new n("ите",-1,2),new n("йте",-1,1),new n("ейте",7,2),new n("уйте",7,2),new n("ли",-1,1),new n("или",10,2),new n("ыли",10,2),new n("й",-1,1),new n("ей",13,2),new n("уй",13,2),new n("л",-1,1),new n("ил",16,2),new n("ыл",16,2),new n("ем",-1,1),new n("им",-1,2),new n("ым",-1,2),new n("н",-1,1),new n("ен",22,2),new n("ло",-1,1),new n("ило",24,2),new n("ыло",24,2),new n("но",-1,1),new n("ено",27,2),new n("нно",27,1),new n("ет",-1,1),new n("ует",30,2),new n("ит",-1,2),new n("ыт",-1,2),new n("ют",-1,1),new n("уют",34,2),new n("ят",-1,2),new n("ны",-1,1),new n("ены",37,2),new n("ть",-1,1),new n("ить",39,2),new n("ыть",39,2),new n("ешь",-1,1),new n("ишь",-1,2),new n("ю",-1,2),new n("ую",44,2)],v=[new n("а",-1,1),new n("ев",-1,1),new n("ов",-1,1),new n("е",-1,1),new n("ие",3,1),new n("ье",3,1),new n("и",-1,1),new n("еи",6,1),new n("ии",6,1),new n("ами",6,1),new n("ями",6,1),new n("иями",10,1),new n("й",-1,1),new n("ей",12,1),new n("ией",13,1),new n("ий",12,1),new n("ой",12,1),new n("ам",-1,1),new n("ем",-1,1),new n("ием",18,1),new n("ом",-1,1),new n("ям",-1,1),new n("иям",21,1),new n("о",-1,1),new n("у",-1,1),new n("ах",-1,1),new n("ях",-1,1),new n("иях",26,1),new n("ы",-1,1),new n("ь",-1,1),new n("ю",-1,1),new n("ию",30,1),new n("ью",30,1),new n("я",-1,1),new n("ия",33,1),new n("ья",33,1)],F=[new n("ост",-1,1),new n("ость",-1,1)],q=[new n("ейше",-1,1),new n("н",-1,2),new n("ейш",-1,1),new n("ь",-1,3)],S=[33,65,8,232],W=new r;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){return w(),W.cursor=W.limit,!(W.cursor=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursors||e>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor>1),f=0,l=o0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o=0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.sv.min.js b/assets/javascripts/lunr/min/lunr.sv.min.js new file mode 100644 index 00000000..3e5eb640 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.sv.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Swedish` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.th.min.js b/assets/javascripts/lunr/min/lunr.th.min.js new file mode 100644 index 00000000..dee3aac6 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.th.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.th=function(){this.pipeline.reset(),this.pipeline.add(e.th.trimmer),r?this.tokenizer=e.th.tokenizer:(e.tokenizer&&(e.tokenizer=e.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.th.tokenizer))},e.th.wordCharacters="[฀-๿]",e.th.trimmer=e.trimmerSupport.generateTrimmer(e.th.wordCharacters),e.Pipeline.registerFunction(e.th.trimmer,"trimmer-th");var t=e.wordcut;t.init(),e.th.tokenizer=function(i){if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t):t});var n=i.toString().replace(/^\s+/,"");return t.cut(n).split("|")}}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.tr.min.js b/assets/javascripts/lunr/min/lunr.tr.min.js new file mode 100644 index 00000000..563f6ec1 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.tr.min.js @@ -0,0 +1,18 @@ +/*! + * Lunr languages, `Turkish` language + * https://github.com/MihaiValentin/lunr-languages + * + * Copyright 2014, Mihai Valentin + * http://www.mozilla.org/MPL/ + */ +/*! + * based on + * Snowball JavaScript Library v0.3 + * http://code.google.com/p/urim/ + * http://snowball.tartarus.org/ + * + * Copyright 2010, Oleg Mazko + * http://www.mozilla.org/MPL/ + */ + +!function(r,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(r.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");r.tr=function(){this.pipeline.reset(),this.pipeline.add(r.tr.trimmer,r.tr.stopWordFilter,r.tr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(r.tr.stemmer))},r.tr.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.tr.trimmer=r.trimmerSupport.generateTrimmer(r.tr.wordCharacters),r.Pipeline.registerFunction(r.tr.trimmer,"trimmer-tr"),r.tr.stemmer=function(){var i=r.stemmerSupport.Among,e=r.stemmerSupport.SnowballProgram,n=new function(){function r(r,i,e){for(;;){var n=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(r,i,e)){Dr.cursor=Dr.limit-n;break}if(Dr.cursor=Dr.limit-n,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function n(){var i,e;i=Dr.limit-Dr.cursor,r(Wr,97,305);for(var n=0;nDr.limit_backward&&(Dr.cursor--,e=Dr.limit-Dr.cursor,i()))?(Dr.cursor=Dr.limit-e,!0):(Dr.cursor=Dr.limit-n,r()?(Dr.cursor=Dr.limit-n,!1):(Dr.cursor=Dr.limit-n,!(Dr.cursor<=Dr.limit_backward)&&(Dr.cursor--,!!i()&&(Dr.cursor=Dr.limit-n,!0))))}function u(r){return t(r,function(){return Dr.in_grouping_b(Wr,97,305)})}function o(){return u(function(){return Dr.eq_s_b(1,"n")})}function s(){return u(function(){return Dr.eq_s_b(1,"s")})}function c(){return u(function(){return Dr.eq_s_b(1,"y")})}function l(){return t(function(){return Dr.in_grouping_b(Lr,105,305)},function(){return Dr.out_grouping_b(Wr,97,305)})}function a(){return Dr.find_among_b(ur,10)&&l()}function m(){return n()&&Dr.in_grouping_b(Lr,105,305)&&s()}function d(){return Dr.find_among_b(or,2)}function f(){return n()&&Dr.in_grouping_b(Lr,105,305)&&c()}function b(){return n()&&Dr.find_among_b(sr,4)}function w(){return n()&&Dr.find_among_b(cr,4)&&o()}function _(){return n()&&Dr.find_among_b(lr,2)&&c()}function k(){return n()&&Dr.find_among_b(ar,2)}function p(){return n()&&Dr.find_among_b(mr,4)}function g(){return n()&&Dr.find_among_b(dr,2)}function y(){return n()&&Dr.find_among_b(fr,4)}function z(){return n()&&Dr.find_among_b(br,2)}function v(){return n()&&Dr.find_among_b(wr,2)&&c()}function h(){return Dr.eq_s_b(2,"ki")}function q(){return n()&&Dr.find_among_b(_r,2)&&o()}function C(){return n()&&Dr.find_among_b(kr,4)&&c()}function P(){return n()&&Dr.find_among_b(pr,4)}function F(){return n()&&Dr.find_among_b(gr,4)&&c()}function S(){return Dr.find_among_b(yr,4)}function W(){return n()&&Dr.find_among_b(zr,2)}function L(){return n()&&Dr.find_among_b(vr,4)}function x(){return n()&&Dr.find_among_b(hr,8)}function A(){return Dr.find_among_b(qr,2)}function E(){return n()&&Dr.find_among_b(Cr,32)&&c()}function j(){return Dr.find_among_b(Pr,8)&&c()}function T(){return n()&&Dr.find_among_b(Fr,4)&&c()}function Z(){return Dr.eq_s_b(3,"ken")&&c()}function B(){var r=Dr.limit-Dr.cursor;return!(T()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,Z()))))}function D(){if(A()){var r=Dr.limit-Dr.cursor;if(S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T())return!1}return!0}function G(){if(W()){Dr.bra=Dr.cursor,Dr.slice_del();var r=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,x()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,T()||(Dr.cursor=Dr.limit-r)))),nr=!1,!1}return!0}function H(){if(!L())return!0;var r=Dr.limit-Dr.cursor;return!E()&&(Dr.cursor=Dr.limit-r,!j())}function I(){var r,i=Dr.limit-Dr.cursor;return!(S()||(Dr.cursor=Dr.limit-i,F()||(Dr.cursor=Dr.limit-i,P()||(Dr.cursor=Dr.limit-i,C()))))||(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,T()||(Dr.cursor=Dr.limit-r),!1)}function J(){var r,i=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,nr=!0,B()&&(Dr.cursor=Dr.limit-i,D()&&(Dr.cursor=Dr.limit-i,G()&&(Dr.cursor=Dr.limit-i,H()&&(Dr.cursor=Dr.limit-i,I()))))){if(Dr.cursor=Dr.limit-i,!x())return;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T()||(Dr.cursor=Dr.limit-r)}Dr.bra=Dr.cursor,Dr.slice_del()}function K(){var r,i,e,n;if(Dr.ket=Dr.cursor,h()){if(r=Dr.limit-Dr.cursor,p())return Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,a()&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))),!0;if(Dr.cursor=Dr.limit-r,w()){if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,e=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-e,!m()&&(Dr.cursor=Dr.limit-e,!K())))return!0;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}return!0}if(Dr.cursor=Dr.limit-r,g()){if(n=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-n,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-n,!K())return!1;return!0}}return!1}function M(r){if(Dr.ket=Dr.cursor,!g()&&(Dr.cursor=Dr.limit-r,!k()))return!1;var i=Dr.limit-Dr.cursor;if(d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-i,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-i,!K())return!1;return!0}function N(r){if(Dr.ket=Dr.cursor,!z()&&(Dr.cursor=Dr.limit-r,!b()))return!1;var i=Dr.limit-Dr.cursor;return!(!m()&&(Dr.cursor=Dr.limit-i,!d()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)}function O(){var r,i=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,!(!w()&&(Dr.cursor=Dr.limit-i,!v()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,!(!W()||(Dr.bra=Dr.cursor,Dr.slice_del(),!K()))||(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!(a()||(Dr.cursor=Dr.limit-r,m()||(Dr.cursor=Dr.limit-r,K())))||(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)))}function Q(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,!p()&&(Dr.cursor=Dr.limit-e,!f()&&(Dr.cursor=Dr.limit-e,!_())))return!1;if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,a())Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()||(Dr.cursor=Dr.limit-i);else if(Dr.cursor=Dr.limit-r,!W())return!0;return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,K(),!0}function R(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,W())return Dr.bra=Dr.cursor,Dr.slice_del(),void K();if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,q())if(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-r,!m())){if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!W())return;if(Dr.bra=Dr.cursor,Dr.slice_del(),!K())return}Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}else if(Dr.cursor=Dr.limit-e,!M(e)&&(Dr.cursor=Dr.limit-e,!N(e))){if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,y())return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,i=Dr.limit-Dr.cursor,void(a()?(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())):(Dr.cursor=Dr.limit-i,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,K())));if(Dr.cursor=Dr.limit-e,!O()){if(Dr.cursor=Dr.limit-e,d())return Dr.bra=Dr.cursor,void Dr.slice_del();Dr.cursor=Dr.limit-e,K()||(Dr.cursor=Dr.limit-e,Q()||(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,(a()||(Dr.cursor=Dr.limit-e,m()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))))}}}function U(){var r;if(Dr.ket=Dr.cursor,r=Dr.find_among_b(Sr,4))switch(Dr.bra=Dr.cursor,r){case 1:Dr.slice_from("p");break;case 2:Dr.slice_from("ç");break;case 3:Dr.slice_from("t");break;case 4:Dr.slice_from("k")}}function V(){for(;;){var r=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(Wr,97,305)){Dr.cursor=Dr.limit-r;break}if(Dr.cursor=Dr.limit-r,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function X(r,i,e){if(Dr.cursor=Dr.limit-r,V()){var n=Dr.limit-Dr.cursor;if(!Dr.eq_s_b(1,i)&&(Dr.cursor=Dr.limit-n,!Dr.eq_s_b(1,e)))return!0;Dr.cursor=Dr.limit-r;var t=Dr.cursor;return Dr.insert(Dr.cursor,Dr.cursor,e),Dr.cursor=t,!1}return!0}function Y(){var r=Dr.limit-Dr.cursor;(Dr.eq_s_b(1,"d")||(Dr.cursor=Dr.limit-r,Dr.eq_s_b(1,"g")))&&X(r,"a","ı")&&X(r,"e","i")&&X(r,"o","u")&&X(r,"ö","ü")}function $(){for(var r,i=Dr.cursor,e=2;;){for(r=Dr.cursor;!Dr.in_grouping(Wr,97,305);){if(Dr.cursor>=Dr.limit)return Dr.cursor=r,!(e>0)&&(Dr.cursor=i,!0);Dr.cursor++}e--}}function rr(r,i,e){for(;!Dr.eq_s(i,e);){if(Dr.cursor>=Dr.limit)return!0;Dr.cursor++}return(tr=i)!=Dr.limit||(Dr.cursor=r,!1)}function ir(){var r=Dr.cursor;return!rr(r,2,"ad")||(Dr.cursor=r,!rr(r,5,"soyad"))}function er(){var r=Dr.cursor;return!ir()&&(Dr.limit_backward=r,Dr.cursor=Dr.limit,Y(),Dr.cursor=Dr.limit,U(),!0)}var nr,tr,ur=[new i("m",-1,-1),new i("n",-1,-1),new i("miz",-1,-1),new i("niz",-1,-1),new i("muz",-1,-1),new i("nuz",-1,-1),new i("müz",-1,-1),new i("nüz",-1,-1),new i("mız",-1,-1),new i("nız",-1,-1)],or=[new i("leri",-1,-1),new i("ları",-1,-1)],sr=[new i("ni",-1,-1),new i("nu",-1,-1),new i("nü",-1,-1),new i("nı",-1,-1)],cr=[new i("in",-1,-1),new i("un",-1,-1),new i("ün",-1,-1),new i("ın",-1,-1)],lr=[new i("a",-1,-1),new i("e",-1,-1)],ar=[new i("na",-1,-1),new i("ne",-1,-1)],mr=[new i("da",-1,-1),new i("ta",-1,-1),new i("de",-1,-1),new i("te",-1,-1)],dr=[new i("nda",-1,-1),new i("nde",-1,-1)],fr=[new i("dan",-1,-1),new i("tan",-1,-1),new i("den",-1,-1),new i("ten",-1,-1)],br=[new i("ndan",-1,-1),new i("nden",-1,-1)],wr=[new i("la",-1,-1),new i("le",-1,-1)],_r=[new i("ca",-1,-1),new i("ce",-1,-1)],kr=[new i("im",-1,-1),new i("um",-1,-1),new i("üm",-1,-1),new i("ım",-1,-1)],pr=[new i("sin",-1,-1),new i("sun",-1,-1),new i("sün",-1,-1),new i("sın",-1,-1)],gr=[new i("iz",-1,-1),new i("uz",-1,-1),new i("üz",-1,-1),new i("ız",-1,-1)],yr=[new i("siniz",-1,-1),new i("sunuz",-1,-1),new i("sünüz",-1,-1),new i("sınız",-1,-1)],zr=[new i("lar",-1,-1),new i("ler",-1,-1)],vr=[new i("niz",-1,-1),new i("nuz",-1,-1),new i("nüz",-1,-1),new i("nız",-1,-1)],hr=[new i("dir",-1,-1),new i("tir",-1,-1),new i("dur",-1,-1),new i("tur",-1,-1),new i("dür",-1,-1),new i("tür",-1,-1),new i("dır",-1,-1),new i("tır",-1,-1)],qr=[new i("casına",-1,-1),new i("cesine",-1,-1)],Cr=[new i("di",-1,-1),new i("ti",-1,-1),new i("dik",-1,-1),new i("tik",-1,-1),new i("duk",-1,-1),new i("tuk",-1,-1),new i("dük",-1,-1),new i("tük",-1,-1),new i("dık",-1,-1),new i("tık",-1,-1),new i("dim",-1,-1),new i("tim",-1,-1),new i("dum",-1,-1),new i("tum",-1,-1),new i("düm",-1,-1),new i("tüm",-1,-1),new i("dım",-1,-1),new i("tım",-1,-1),new i("din",-1,-1),new i("tin",-1,-1),new i("dun",-1,-1),new i("tun",-1,-1),new i("dün",-1,-1),new i("tün",-1,-1),new i("dın",-1,-1),new i("tın",-1,-1),new i("du",-1,-1),new i("tu",-1,-1),new i("dü",-1,-1),new i("tü",-1,-1),new i("dı",-1,-1),new i("tı",-1,-1)],Pr=[new i("sa",-1,-1),new i("se",-1,-1),new i("sak",-1,-1),new i("sek",-1,-1),new i("sam",-1,-1),new i("sem",-1,-1),new i("san",-1,-1),new i("sen",-1,-1)],Fr=[new i("miş",-1,-1),new i("muş",-1,-1),new i("müş",-1,-1),new i("mış",-1,-1)],Sr=[new i("b",-1,1),new i("c",-1,2),new i("d",-1,3),new i("ğ",-1,4)],Wr=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,8,0,0,0,0,0,0,1],Lr=[1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,1],xr=[1,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],Ar=[17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130],Er=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],jr=[17],Tr=[65],Zr=[65],Br=[["a",xr,97,305],["e",Ar,101,252],["ı",Er,97,305],["i",jr,101,105],["o",Tr,111,117],["ö",Zr,246,252],["u",Tr,111,117]],Dr=new e;this.setCurrent=function(r){Dr.setCurrent(r)},this.getCurrent=function(){return Dr.getCurrent()},this.stem=function(){return!!($()&&(Dr.limit_backward=Dr.cursor,Dr.cursor=Dr.limit,J(),Dr.cursor=Dr.limit,nr&&(R(),Dr.cursor=Dr.limit_backward,er())))}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.tr.stemmer,"stemmer-tr"),r.tr.stopWordFilter=r.generateStopWordFilter("acaba altmış altı ama ancak arada aslında ayrıca bana bazı belki ben benden beni benim beri beş bile bin bir biri birkaç birkez birçok birşey birşeyi biz bizden bize bizi bizim bu buna bunda bundan bunlar bunları bunların bunu bunun burada böyle böylece da daha dahi de defa değil diye diğer doksan dokuz dolayı dolayısıyla dört edecek eden ederek edilecek ediliyor edilmesi ediyor elli en etmesi etti ettiği ettiğini eğer gibi göre halen hangi hatta hem henüz hep hepsi her herhangi herkesin hiç hiçbir iki ile ilgili ise itibaren itibariyle için işte kadar karşın katrilyon kendi kendilerine kendini kendisi kendisine kendisini kez ki kim kimden kime kimi kimse kırk milyar milyon mu mü mı nasıl ne neden nedenle nerde nerede nereye niye niçin o olan olarak oldu olduklarını olduğu olduğunu olmadı olmadığı olmak olması olmayan olmaz olsa olsun olup olur olursa oluyor on ona ondan onlar onlardan onları onların onu onun otuz oysa pek rağmen sadece sanki sekiz seksen sen senden seni senin siz sizden sizi sizin tarafından trilyon tüm var vardı ve veya ya yani yapacak yapmak yaptı yaptıkları yaptığı yaptığını yapılan yapılması yapıyor yedi yerine yetmiş yine yirmi yoksa yüz zaten çok çünkü öyle üzere üç şey şeyden şeyi şeyler şu şuna şunda şundan şunları şunu şöyle".split(" ")),r.Pipeline.registerFunction(r.tr.stopWordFilter,"stopWordFilter-tr")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.vi.min.js b/assets/javascripts/lunr/min/lunr.vi.min.js new file mode 100644 index 00000000..22aed28c --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.vi.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.vi=function(){this.pipeline.reset(),this.pipeline.add(e.vi.stopWordFilter,e.vi.trimmer)},e.vi.wordCharacters="[A-Za-ẓ̀͐́͑̉̃̓ÂâÊêÔôĂ-ăĐ-đƠ-ơƯ-ư]",e.vi.trimmer=e.trimmerSupport.generateTrimmer(e.vi.wordCharacters),e.Pipeline.registerFunction(e.vi.trimmer,"trimmer-vi"),e.vi.stopWordFilter=e.generateStopWordFilter("là cái nhưng mà".split(" "))}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/min/lunr.zh.min.js b/assets/javascripts/lunr/min/lunr.zh.min.js new file mode 100644 index 00000000..7727bbe2 --- /dev/null +++ b/assets/javascripts/lunr/min/lunr.zh.min.js @@ -0,0 +1 @@ +!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r(require("nodejieba")):r()(e.lunr)}(this,function(e){return function(r,t){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==r.version[0];r.zh=function(){this.pipeline.reset(),this.pipeline.add(r.zh.trimmer,r.zh.stopWordFilter,r.zh.stemmer),i?this.tokenizer=r.zh.tokenizer:(r.tokenizer&&(r.tokenizer=r.zh.tokenizer),this.tokenizerFn&&(this.tokenizerFn=r.zh.tokenizer))},r.zh.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(e){return i?new r.Token(e.toLowerCase()):e.toLowerCase()});t&&e.load(t);var o=n.toString().trim().toLowerCase(),s=[];e.cut(o,!0).forEach(function(e){s=s.concat(e.split(" "))}),s=s.filter(function(e){return!!e});var u=0;return s.map(function(e,t){if(i){var n=o.indexOf(e,u),s={};return s.position=[n,e.length],s.index=t,u=n,new r.Token(e,s)}return e})},r.zh.wordCharacters="\\w一-龥",r.zh.trimmer=r.trimmerSupport.generateTrimmer(r.zh.wordCharacters),r.Pipeline.registerFunction(r.zh.trimmer,"trimmer-zh"),r.zh.stemmer=function(){return function(e){return e}}(),r.Pipeline.registerFunction(r.zh.stemmer,"stemmer-zh"),r.zh.stopWordFilter=r.generateStopWordFilter("的 一 不 在 人 有 是 为 以 于 上 他 而 后 之 来 及 了 因 下 可 到 由 这 与 也 此 但 并 个 其 已 无 小 我 们 起 最 再 今 去 好 只 又 或 很 亦 某 把 那 你 乃 它 吧 被 比 别 趁 当 从 到 得 打 凡 儿 尔 该 各 给 跟 和 何 还 即 几 既 看 据 距 靠 啦 了 另 么 每 们 嘛 拿 哪 那 您 凭 且 却 让 仍 啥 如 若 使 谁 虽 随 同 所 她 哇 嗡 往 哪 些 向 沿 哟 用 于 咱 则 怎 曾 至 致 着 诸 自".split(" ")),r.Pipeline.registerFunction(r.zh.stopWordFilter,"stopWordFilter-zh")}}); \ No newline at end of file diff --git a/assets/javascripts/lunr/tinyseg.js b/assets/javascripts/lunr/tinyseg.js new file mode 100644 index 00000000..167fa6dd --- /dev/null +++ b/assets/javascripts/lunr/tinyseg.js @@ -0,0 +1,206 @@ +/** + * export the module via AMD, CommonJS or as a browser global + * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js + */ +;(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory) + } else if (typeof exports === 'object') { + /** + * Node. Does not work with strict CommonJS, but + * only CommonJS-like environments that support module.exports, + * like Node. + */ + module.exports = factory() + } else { + // Browser globals (root is window) + factory()(root.lunr); + } +}(this, function () { + /** + * Just return a value to define the module export. + * This example returns an object, but the module + * can return a function as the exported value. + */ + + return function(lunr) { + // TinySegmenter 0.1 -- Super compact Japanese tokenizer in Javascript + // (c) 2008 Taku Kudo + // TinySegmenter is freely distributable under the terms of a new BSD licence. + // For details, see http://chasen.org/~taku/software/TinySegmenter/LICENCE.txt + + function TinySegmenter() { + var patterns = { + "[一二三四五六七八九十百千万億兆]":"M", + "[一-龠々〆ヵヶ]":"H", + "[ぁ-ん]":"I", + "[ァ-ヴーア-ン゙ー]":"K", + "[a-zA-Za-zA-Z]":"A", + "[0-90-9]":"N" + } + this.chartype_ = []; + for (var i in patterns) { + var regexp = new RegExp(i); + this.chartype_.push([regexp, patterns[i]]); + } + + this.BIAS__ = -332 + this.BC1__ = {"HH":6,"II":2461,"KH":406,"OH":-1378}; + this.BC2__ = {"AA":-3267,"AI":2744,"AN":-878,"HH":-4070,"HM":-1711,"HN":4012,"HO":3761,"IA":1327,"IH":-1184,"II":-1332,"IK":1721,"IO":5492,"KI":3831,"KK":-8741,"MH":-3132,"MK":3334,"OO":-2920}; + this.BC3__ = {"HH":996,"HI":626,"HK":-721,"HN":-1307,"HO":-836,"IH":-301,"KK":2762,"MK":1079,"MM":4034,"OA":-1652,"OH":266}; + this.BP1__ = {"BB":295,"OB":304,"OO":-125,"UB":352}; + this.BP2__ = {"BO":60,"OO":-1762}; + this.BQ1__ = {"BHH":1150,"BHM":1521,"BII":-1158,"BIM":886,"BMH":1208,"BNH":449,"BOH":-91,"BOO":-2597,"OHI":451,"OIH":-296,"OKA":1851,"OKH":-1020,"OKK":904,"OOO":2965}; + this.BQ2__ = {"BHH":118,"BHI":-1159,"BHM":466,"BIH":-919,"BKK":-1720,"BKO":864,"OHH":-1139,"OHM":-181,"OIH":153,"UHI":-1146}; + this.BQ3__ = {"BHH":-792,"BHI":2664,"BII":-299,"BKI":419,"BMH":937,"BMM":8335,"BNN":998,"BOH":775,"OHH":2174,"OHM":439,"OII":280,"OKH":1798,"OKI":-793,"OKO":-2242,"OMH":-2402,"OOO":11699}; + this.BQ4__ = {"BHH":-3895,"BIH":3761,"BII":-4654,"BIK":1348,"BKK":-1806,"BMI":-3385,"BOO":-12396,"OAH":926,"OHH":266,"OHK":-2036,"ONN":-973}; + this.BW1__ = {",と":660,",同":727,"B1あ":1404,"B1同":542,"、と":660,"、同":727,"」と":1682,"あっ":1505,"いう":1743,"いっ":-2055,"いる":672,"うし":-4817,"うん":665,"から":3472,"がら":600,"こう":-790,"こと":2083,"こん":-1262,"さら":-4143,"さん":4573,"した":2641,"して":1104,"すで":-3399,"そこ":1977,"それ":-871,"たち":1122,"ため":601,"った":3463,"つい":-802,"てい":805,"てき":1249,"でき":1127,"です":3445,"では":844,"とい":-4915,"とみ":1922,"どこ":3887,"ない":5713,"なっ":3015,"など":7379,"なん":-1113,"にし":2468,"には":1498,"にも":1671,"に対":-912,"の一":-501,"の中":741,"ませ":2448,"まで":1711,"まま":2600,"まる":-2155,"やむ":-1947,"よっ":-2565,"れた":2369,"れで":-913,"をし":1860,"を見":731,"亡く":-1886,"京都":2558,"取り":-2784,"大き":-2604,"大阪":1497,"平方":-2314,"引き":-1336,"日本":-195,"本当":-2423,"毎日":-2113,"目指":-724,"B1あ":1404,"B1同":542,"」と":1682}; + this.BW2__ = {"..":-11822,"11":-669,"――":-5730,"−−":-13175,"いう":-1609,"うか":2490,"かし":-1350,"かも":-602,"から":-7194,"かれ":4612,"がい":853,"がら":-3198,"きた":1941,"くな":-1597,"こと":-8392,"この":-4193,"させ":4533,"され":13168,"さん":-3977,"しい":-1819,"しか":-545,"した":5078,"して":972,"しな":939,"その":-3744,"たい":-1253,"たた":-662,"ただ":-3857,"たち":-786,"たと":1224,"たは":-939,"った":4589,"って":1647,"っと":-2094,"てい":6144,"てき":3640,"てく":2551,"ては":-3110,"ても":-3065,"でい":2666,"でき":-1528,"でし":-3828,"です":-4761,"でも":-4203,"とい":1890,"とこ":-1746,"とと":-2279,"との":720,"とみ":5168,"とも":-3941,"ない":-2488,"なが":-1313,"など":-6509,"なの":2614,"なん":3099,"にお":-1615,"にし":2748,"にな":2454,"によ":-7236,"に対":-14943,"に従":-4688,"に関":-11388,"のか":2093,"ので":-7059,"のに":-6041,"のの":-6125,"はい":1073,"はが":-1033,"はず":-2532,"ばれ":1813,"まし":-1316,"まで":-6621,"まれ":5409,"めて":-3153,"もい":2230,"もの":-10713,"らか":-944,"らし":-1611,"らに":-1897,"りし":651,"りま":1620,"れた":4270,"れて":849,"れば":4114,"ろう":6067,"われ":7901,"を通":-11877,"んだ":728,"んな":-4115,"一人":602,"一方":-1375,"一日":970,"一部":-1051,"上が":-4479,"会社":-1116,"出て":2163,"分の":-7758,"同党":970,"同日":-913,"大阪":-2471,"委員":-1250,"少な":-1050,"年度":-8669,"年間":-1626,"府県":-2363,"手権":-1982,"新聞":-4066,"日新":-722,"日本":-7068,"日米":3372,"曜日":-601,"朝鮮":-2355,"本人":-2697,"東京":-1543,"然と":-1384,"社会":-1276,"立て":-990,"第に":-1612,"米国":-4268,"11":-669}; + this.BW3__ = {"あた":-2194,"あり":719,"ある":3846,"い.":-1185,"い。":-1185,"いい":5308,"いえ":2079,"いく":3029,"いた":2056,"いっ":1883,"いる":5600,"いわ":1527,"うち":1117,"うと":4798,"えと":1454,"か.":2857,"か。":2857,"かけ":-743,"かっ":-4098,"かに":-669,"から":6520,"かり":-2670,"が,":1816,"が、":1816,"がき":-4855,"がけ":-1127,"がっ":-913,"がら":-4977,"がり":-2064,"きた":1645,"けど":1374,"こと":7397,"この":1542,"ころ":-2757,"さい":-714,"さを":976,"し,":1557,"し、":1557,"しい":-3714,"した":3562,"して":1449,"しな":2608,"しま":1200,"す.":-1310,"す。":-1310,"する":6521,"ず,":3426,"ず、":3426,"ずに":841,"そう":428,"た.":8875,"た。":8875,"たい":-594,"たの":812,"たり":-1183,"たる":-853,"だ.":4098,"だ。":4098,"だっ":1004,"った":-4748,"って":300,"てい":6240,"てお":855,"ても":302,"です":1437,"でに":-1482,"では":2295,"とう":-1387,"とし":2266,"との":541,"とも":-3543,"どう":4664,"ない":1796,"なく":-903,"など":2135,"に,":-1021,"に、":-1021,"にし":1771,"にな":1906,"には":2644,"の,":-724,"の、":-724,"の子":-1000,"は,":1337,"は、":1337,"べき":2181,"まし":1113,"ます":6943,"まっ":-1549,"まで":6154,"まれ":-793,"らし":1479,"られ":6820,"るる":3818,"れ,":854,"れ、":854,"れた":1850,"れて":1375,"れば":-3246,"れる":1091,"われ":-605,"んだ":606,"んで":798,"カ月":990,"会議":860,"入り":1232,"大会":2217,"始め":1681,"市":965,"新聞":-5055,"日,":974,"日、":974,"社会":2024,"カ月":990}; + this.TC1__ = {"AAA":1093,"HHH":1029,"HHM":580,"HII":998,"HOH":-390,"HOM":-331,"IHI":1169,"IOH":-142,"IOI":-1015,"IOM":467,"MMH":187,"OOI":-1832}; + this.TC2__ = {"HHO":2088,"HII":-1023,"HMM":-1154,"IHI":-1965,"KKH":703,"OII":-2649}; + this.TC3__ = {"AAA":-294,"HHH":346,"HHI":-341,"HII":-1088,"HIK":731,"HOH":-1486,"IHH":128,"IHI":-3041,"IHO":-1935,"IIH":-825,"IIM":-1035,"IOI":-542,"KHH":-1216,"KKA":491,"KKH":-1217,"KOK":-1009,"MHH":-2694,"MHM":-457,"MHO":123,"MMH":-471,"NNH":-1689,"NNO":662,"OHO":-3393}; + this.TC4__ = {"HHH":-203,"HHI":1344,"HHK":365,"HHM":-122,"HHN":182,"HHO":669,"HIH":804,"HII":679,"HOH":446,"IHH":695,"IHO":-2324,"IIH":321,"III":1497,"IIO":656,"IOO":54,"KAK":4845,"KKA":3386,"KKK":3065,"MHH":-405,"MHI":201,"MMH":-241,"MMM":661,"MOM":841}; + this.TQ1__ = {"BHHH":-227,"BHHI":316,"BHIH":-132,"BIHH":60,"BIII":1595,"BNHH":-744,"BOHH":225,"BOOO":-908,"OAKK":482,"OHHH":281,"OHIH":249,"OIHI":200,"OIIH":-68}; + this.TQ2__ = {"BIHH":-1401,"BIII":-1033,"BKAK":-543,"BOOO":-5591}; + this.TQ3__ = {"BHHH":478,"BHHM":-1073,"BHIH":222,"BHII":-504,"BIIH":-116,"BIII":-105,"BMHI":-863,"BMHM":-464,"BOMH":620,"OHHH":346,"OHHI":1729,"OHII":997,"OHMH":481,"OIHH":623,"OIIH":1344,"OKAK":2792,"OKHH":587,"OKKA":679,"OOHH":110,"OOII":-685}; + this.TQ4__ = {"BHHH":-721,"BHHM":-3604,"BHII":-966,"BIIH":-607,"BIII":-2181,"OAAA":-2763,"OAKK":180,"OHHH":-294,"OHHI":2446,"OHHO":480,"OHIH":-1573,"OIHH":1935,"OIHI":-493,"OIIH":626,"OIII":-4007,"OKAK":-8156}; + this.TW1__ = {"につい":-4681,"東京都":2026}; + this.TW2__ = {"ある程":-2049,"いった":-1256,"ころが":-2434,"しょう":3873,"その後":-4430,"だって":-1049,"ていた":1833,"として":-4657,"ともに":-4517,"もので":1882,"一気に":-792,"初めて":-1512,"同時に":-8097,"大きな":-1255,"対して":-2721,"社会党":-3216}; + this.TW3__ = {"いただ":-1734,"してい":1314,"として":-4314,"につい":-5483,"にとっ":-5989,"に当た":-6247,"ので,":-727,"ので、":-727,"のもの":-600,"れから":-3752,"十二月":-2287}; + this.TW4__ = {"いう.":8576,"いう。":8576,"からな":-2348,"してい":2958,"たが,":1516,"たが、":1516,"ている":1538,"という":1349,"ました":5543,"ません":1097,"ようと":-4258,"よると":5865}; + this.UC1__ = {"A":484,"K":93,"M":645,"O":-505}; + this.UC2__ = {"A":819,"H":1059,"I":409,"M":3987,"N":5775,"O":646}; + this.UC3__ = {"A":-1370,"I":2311}; + this.UC4__ = {"A":-2643,"H":1809,"I":-1032,"K":-3450,"M":3565,"N":3876,"O":6646}; + this.UC5__ = {"H":313,"I":-1238,"K":-799,"M":539,"O":-831}; + this.UC6__ = {"H":-506,"I":-253,"K":87,"M":247,"O":-387}; + this.UP1__ = {"O":-214}; + this.UP2__ = {"B":69,"O":935}; + this.UP3__ = {"B":189}; + this.UQ1__ = {"BH":21,"BI":-12,"BK":-99,"BN":142,"BO":-56,"OH":-95,"OI":477,"OK":410,"OO":-2422}; + this.UQ2__ = {"BH":216,"BI":113,"OK":1759}; + this.UQ3__ = {"BA":-479,"BH":42,"BI":1913,"BK":-7198,"BM":3160,"BN":6427,"BO":14761,"OI":-827,"ON":-3212}; + this.UW1__ = {",":156,"、":156,"「":-463,"あ":-941,"う":-127,"が":-553,"き":121,"こ":505,"で":-201,"と":-547,"ど":-123,"に":-789,"の":-185,"は":-847,"も":-466,"や":-470,"よ":182,"ら":-292,"り":208,"れ":169,"を":-446,"ん":-137,"・":-135,"主":-402,"京":-268,"区":-912,"午":871,"国":-460,"大":561,"委":729,"市":-411,"日":-141,"理":361,"生":-408,"県":-386,"都":-718,"「":-463,"・":-135}; + this.UW2__ = {",":-829,"、":-829,"〇":892,"「":-645,"」":3145,"あ":-538,"い":505,"う":134,"お":-502,"か":1454,"が":-856,"く":-412,"こ":1141,"さ":878,"ざ":540,"し":1529,"す":-675,"せ":300,"そ":-1011,"た":188,"だ":1837,"つ":-949,"て":-291,"で":-268,"と":-981,"ど":1273,"な":1063,"に":-1764,"の":130,"は":-409,"ひ":-1273,"べ":1261,"ま":600,"も":-1263,"や":-402,"よ":1639,"り":-579,"る":-694,"れ":571,"を":-2516,"ん":2095,"ア":-587,"カ":306,"キ":568,"ッ":831,"三":-758,"不":-2150,"世":-302,"中":-968,"主":-861,"事":492,"人":-123,"会":978,"保":362,"入":548,"初":-3025,"副":-1566,"北":-3414,"区":-422,"大":-1769,"天":-865,"太":-483,"子":-1519,"学":760,"実":1023,"小":-2009,"市":-813,"年":-1060,"強":1067,"手":-1519,"揺":-1033,"政":1522,"文":-1355,"新":-1682,"日":-1815,"明":-1462,"最":-630,"朝":-1843,"本":-1650,"東":-931,"果":-665,"次":-2378,"民":-180,"気":-1740,"理":752,"発":529,"目":-1584,"相":-242,"県":-1165,"立":-763,"第":810,"米":509,"自":-1353,"行":838,"西":-744,"見":-3874,"調":1010,"議":1198,"込":3041,"開":1758,"間":-1257,"「":-645,"」":3145,"ッ":831,"ア":-587,"カ":306,"キ":568}; + this.UW3__ = {",":4889,"1":-800,"−":-1723,"、":4889,"々":-2311,"〇":5827,"」":2670,"〓":-3573,"あ":-2696,"い":1006,"う":2342,"え":1983,"お":-4864,"か":-1163,"が":3271,"く":1004,"け":388,"げ":401,"こ":-3552,"ご":-3116,"さ":-1058,"し":-395,"す":584,"せ":3685,"そ":-5228,"た":842,"ち":-521,"っ":-1444,"つ":-1081,"て":6167,"で":2318,"と":1691,"ど":-899,"な":-2788,"に":2745,"の":4056,"は":4555,"ひ":-2171,"ふ":-1798,"へ":1199,"ほ":-5516,"ま":-4384,"み":-120,"め":1205,"も":2323,"や":-788,"よ":-202,"ら":727,"り":649,"る":5905,"れ":2773,"わ":-1207,"を":6620,"ん":-518,"ア":551,"グ":1319,"ス":874,"ッ":-1350,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278,"・":-3794,"一":-1619,"下":-1759,"世":-2087,"両":3815,"中":653,"主":-758,"予":-1193,"二":974,"人":2742,"今":792,"他":1889,"以":-1368,"低":811,"何":4265,"作":-361,"保":-2439,"元":4858,"党":3593,"全":1574,"公":-3030,"六":755,"共":-1880,"円":5807,"再":3095,"分":457,"初":2475,"別":1129,"前":2286,"副":4437,"力":365,"動":-949,"務":-1872,"化":1327,"北":-1038,"区":4646,"千":-2309,"午":-783,"協":-1006,"口":483,"右":1233,"各":3588,"合":-241,"同":3906,"和":-837,"員":4513,"国":642,"型":1389,"場":1219,"外":-241,"妻":2016,"学":-1356,"安":-423,"実":-1008,"家":1078,"小":-513,"少":-3102,"州":1155,"市":3197,"平":-1804,"年":2416,"広":-1030,"府":1605,"度":1452,"建":-2352,"当":-3885,"得":1905,"思":-1291,"性":1822,"戸":-488,"指":-3973,"政":-2013,"教":-1479,"数":3222,"文":-1489,"新":1764,"日":2099,"旧":5792,"昨":-661,"時":-1248,"曜":-951,"最":-937,"月":4125,"期":360,"李":3094,"村":364,"東":-805,"核":5156,"森":2438,"業":484,"氏":2613,"民":-1694,"決":-1073,"法":1868,"海":-495,"無":979,"物":461,"特":-3850,"生":-273,"用":914,"町":1215,"的":7313,"直":-1835,"省":792,"県":6293,"知":-1528,"私":4231,"税":401,"立":-960,"第":1201,"米":7767,"系":3066,"約":3663,"級":1384,"統":-4229,"総":1163,"線":1255,"者":6457,"能":725,"自":-2869,"英":785,"見":1044,"調":-562,"財":-733,"費":1777,"車":1835,"軍":1375,"込":-1504,"通":-1136,"選":-681,"郎":1026,"郡":4404,"部":1200,"金":2163,"長":421,"開":-1432,"間":1302,"関":-1282,"雨":2009,"電":-1045,"非":2066,"駅":1620,"1":-800,"」":2670,"・":-3794,"ッ":-1350,"ア":551,"グ":1319,"ス":874,"ト":521,"ム":1109,"ル":1591,"ロ":2201,"ン":278}; + this.UW4__ = {",":3930,".":3508,"―":-4841,"、":3930,"。":3508,"〇":4999,"「":1895,"」":3798,"〓":-5156,"あ":4752,"い":-3435,"う":-640,"え":-2514,"お":2405,"か":530,"が":6006,"き":-4482,"ぎ":-3821,"く":-3788,"け":-4376,"げ":-4734,"こ":2255,"ご":1979,"さ":2864,"し":-843,"じ":-2506,"す":-731,"ず":1251,"せ":181,"そ":4091,"た":5034,"だ":5408,"ち":-3654,"っ":-5882,"つ":-1659,"て":3994,"で":7410,"と":4547,"な":5433,"に":6499,"ぬ":1853,"ね":1413,"の":7396,"は":8578,"ば":1940,"ひ":4249,"び":-4134,"ふ":1345,"へ":6665,"べ":-744,"ほ":1464,"ま":1051,"み":-2082,"む":-882,"め":-5046,"も":4169,"ゃ":-2666,"や":2795,"ょ":-1544,"よ":3351,"ら":-2922,"り":-9726,"る":-14896,"れ":-2613,"ろ":-4570,"わ":-1783,"を":13150,"ん":-2352,"カ":2145,"コ":1789,"セ":1287,"ッ":-724,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637,"・":-4371,"ー":-11870,"一":-2069,"中":2210,"予":782,"事":-190,"井":-1768,"人":1036,"以":544,"会":950,"体":-1286,"作":530,"側":4292,"先":601,"党":-2006,"共":-1212,"内":584,"円":788,"初":1347,"前":1623,"副":3879,"力":-302,"動":-740,"務":-2715,"化":776,"区":4517,"協":1013,"参":1555,"合":-1834,"和":-681,"員":-910,"器":-851,"回":1500,"国":-619,"園":-1200,"地":866,"場":-1410,"塁":-2094,"士":-1413,"多":1067,"大":571,"子":-4802,"学":-1397,"定":-1057,"寺":-809,"小":1910,"屋":-1328,"山":-1500,"島":-2056,"川":-2667,"市":2771,"年":374,"庁":-4556,"後":456,"性":553,"感":916,"所":-1566,"支":856,"改":787,"政":2182,"教":704,"文":522,"方":-856,"日":1798,"時":1829,"最":845,"月":-9066,"木":-485,"来":-442,"校":-360,"業":-1043,"氏":5388,"民":-2716,"気":-910,"沢":-939,"済":-543,"物":-735,"率":672,"球":-1267,"生":-1286,"産":-1101,"田":-2900,"町":1826,"的":2586,"目":922,"省":-3485,"県":2997,"空":-867,"立":-2112,"第":788,"米":2937,"系":786,"約":2171,"経":1146,"統":-1169,"総":940,"線":-994,"署":749,"者":2145,"能":-730,"般":-852,"行":-792,"規":792,"警":-1184,"議":-244,"谷":-1000,"賞":730,"車":-1481,"軍":1158,"輪":-1433,"込":-3370,"近":929,"道":-1291,"選":2596,"郎":-4866,"都":1192,"野":-1100,"銀":-2213,"長":357,"間":-2344,"院":-2297,"際":-2604,"電":-878,"領":-1659,"題":-792,"館":-1984,"首":1749,"高":2120,"「":1895,"」":3798,"・":-4371,"ッ":-724,"ー":-11870,"カ":2145,"コ":1789,"セ":1287,"ト":-403,"メ":-1635,"ラ":-881,"リ":-541,"ル":-856,"ン":-3637}; + this.UW5__ = {",":465,".":-299,"1":-514,"E2":-32768,"]":-2762,"、":465,"。":-299,"「":363,"あ":1655,"い":331,"う":-503,"え":1199,"お":527,"か":647,"が":-421,"き":1624,"ぎ":1971,"く":312,"げ":-983,"さ":-1537,"し":-1371,"す":-852,"だ":-1186,"ち":1093,"っ":52,"つ":921,"て":-18,"で":-850,"と":-127,"ど":1682,"な":-787,"に":-1224,"の":-635,"は":-578,"べ":1001,"み":502,"め":865,"ゃ":3350,"ょ":854,"り":-208,"る":429,"れ":504,"わ":419,"を":-1264,"ん":327,"イ":241,"ル":451,"ン":-343,"中":-871,"京":722,"会":-1153,"党":-654,"務":3519,"区":-901,"告":848,"員":2104,"大":-1296,"学":-548,"定":1785,"嵐":-1304,"市":-2991,"席":921,"年":1763,"思":872,"所":-814,"挙":1618,"新":-1682,"日":218,"月":-4353,"査":932,"格":1356,"機":-1508,"氏":-1347,"田":240,"町":-3912,"的":-3149,"相":1319,"省":-1052,"県":-4003,"研":-997,"社":-278,"空":-813,"統":1955,"者":-2233,"表":663,"語":-1073,"議":1219,"選":-1018,"郎":-368,"長":786,"間":1191,"題":2368,"館":-689,"1":-514,"E2":-32768,"「":363,"イ":241,"ル":451,"ン":-343}; + this.UW6__ = {",":227,".":808,"1":-270,"E1":306,"、":227,"。":808,"あ":-307,"う":189,"か":241,"が":-73,"く":-121,"こ":-200,"じ":1782,"す":383,"た":-428,"っ":573,"て":-1014,"で":101,"と":-105,"な":-253,"に":-149,"の":-417,"は":-236,"も":-206,"り":187,"る":-135,"を":195,"ル":-673,"ン":-496,"一":-277,"中":201,"件":-800,"会":624,"前":302,"区":1792,"員":-1212,"委":798,"学":-960,"市":887,"広":-695,"後":535,"業":-697,"相":753,"社":-507,"福":974,"空":-822,"者":1811,"連":463,"郎":1082,"1":-270,"E1":306,"ル":-673,"ン":-496}; + + return this; + } + TinySegmenter.prototype.ctype_ = function(str) { + for (var i in this.chartype_) { + if (str.match(this.chartype_[i][0])) { + return this.chartype_[i][1]; + } + } + return "O"; + } + + TinySegmenter.prototype.ts_ = function(v) { + if (v) { return v; } + return 0; + } + + TinySegmenter.prototype.segment = function(input) { + if (input == null || input == undefined || input == "") { + return []; + } + var result = []; + var seg = ["B3","B2","B1"]; + var ctype = ["O","O","O"]; + var o = input.split(""); + for (i = 0; i < o.length; ++i) { + seg.push(o[i]); + ctype.push(this.ctype_(o[i])) + } + seg.push("E1"); + seg.push("E2"); + seg.push("E3"); + ctype.push("O"); + ctype.push("O"); + ctype.push("O"); + var word = seg[3]; + var p1 = "U"; + var p2 = "U"; + var p3 = "U"; + for (var i = 4; i < seg.length - 3; ++i) { + var score = this.BIAS__; + var w1 = seg[i-3]; + var w2 = seg[i-2]; + var w3 = seg[i-1]; + var w4 = seg[i]; + var w5 = seg[i+1]; + var w6 = seg[i+2]; + var c1 = ctype[i-3]; + var c2 = ctype[i-2]; + var c3 = ctype[i-1]; + var c4 = ctype[i]; + var c5 = ctype[i+1]; + var c6 = ctype[i+2]; + score += this.ts_(this.UP1__[p1]); + score += this.ts_(this.UP2__[p2]); + score += this.ts_(this.UP3__[p3]); + score += this.ts_(this.BP1__[p1 + p2]); + score += this.ts_(this.BP2__[p2 + p3]); + score += this.ts_(this.UW1__[w1]); + score += this.ts_(this.UW2__[w2]); + score += this.ts_(this.UW3__[w3]); + score += this.ts_(this.UW4__[w4]); + score += this.ts_(this.UW5__[w5]); + score += this.ts_(this.UW6__[w6]); + score += this.ts_(this.BW1__[w2 + w3]); + score += this.ts_(this.BW2__[w3 + w4]); + score += this.ts_(this.BW3__[w4 + w5]); + score += this.ts_(this.TW1__[w1 + w2 + w3]); + score += this.ts_(this.TW2__[w2 + w3 + w4]); + score += this.ts_(this.TW3__[w3 + w4 + w5]); + score += this.ts_(this.TW4__[w4 + w5 + w6]); + score += this.ts_(this.UC1__[c1]); + score += this.ts_(this.UC2__[c2]); + score += this.ts_(this.UC3__[c3]); + score += this.ts_(this.UC4__[c4]); + score += this.ts_(this.UC5__[c5]); + score += this.ts_(this.UC6__[c6]); + score += this.ts_(this.BC1__[c2 + c3]); + score += this.ts_(this.BC2__[c3 + c4]); + score += this.ts_(this.BC3__[c4 + c5]); + score += this.ts_(this.TC1__[c1 + c2 + c3]); + score += this.ts_(this.TC2__[c2 + c3 + c4]); + score += this.ts_(this.TC3__[c3 + c4 + c5]); + score += this.ts_(this.TC4__[c4 + c5 + c6]); + // score += this.ts_(this.TC5__[c4 + c5 + c6]); + score += this.ts_(this.UQ1__[p1 + c1]); + score += this.ts_(this.UQ2__[p2 + c2]); + score += this.ts_(this.UQ3__[p3 + c3]); + score += this.ts_(this.BQ1__[p2 + c2 + c3]); + score += this.ts_(this.BQ2__[p2 + c3 + c4]); + score += this.ts_(this.BQ3__[p3 + c2 + c3]); + score += this.ts_(this.BQ4__[p3 + c3 + c4]); + score += this.ts_(this.TQ1__[p2 + c1 + c2 + c3]); + score += this.ts_(this.TQ2__[p2 + c2 + c3 + c4]); + score += this.ts_(this.TQ3__[p3 + c1 + c2 + c3]); + score += this.ts_(this.TQ4__[p3 + c2 + c3 + c4]); + var p = "O"; + if (score > 0) { + result.push(word); + word = ""; + p = "B"; + } + p1 = p2; + p2 = p3; + p3 = p; + word += seg[i]; + } + result.push(word); + + return result; + } + + lunr.TinySegmenter = TinySegmenter; + }; + +})); \ No newline at end of file diff --git a/assets/javascripts/lunr/wordcut.js b/assets/javascripts/lunr/wordcut.js new file mode 100644 index 00000000..146f4b44 --- /dev/null +++ b/assets/javascripts/lunr/wordcut.js @@ -0,0 +1,6708 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.lunr || (g.lunr = {})).wordcut = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1; + }) + this.addWords(words, false) + } + if(finalize){ + this.finalizeDict(); + } + }, + + dictSeek: function (l, r, ch, strOffset, pos) { + var ans = null; + while (l <= r) { + var m = Math.floor((l + r) / 2), + dict_item = this.dict[m], + len = dict_item.length; + if (len <= strOffset) { + l = m + 1; + } else { + var ch_ = dict_item[strOffset]; + if (ch_ < ch) { + l = m + 1; + } else if (ch_ > ch) { + r = m - 1; + } else { + ans = m; + if (pos == LEFT) { + r = m - 1; + } else { + l = m + 1; + } + } + } + } + return ans; + }, + + isFinal: function (acceptor) { + return this.dict[acceptor.l].length == acceptor.strOffset; + }, + + createAcceptor: function () { + return { + l: 0, + r: this.dict.length - 1, + strOffset: 0, + isFinal: false, + dict: this, + transit: function (ch) { + return this.dict.transit(this, ch); + }, + isError: false, + tag: "DICT", + w: 1, + type: "DICT" + }; + }, + + transit: function (acceptor, ch) { + var l = this.dictSeek(acceptor.l, + acceptor.r, + ch, + acceptor.strOffset, + LEFT); + if (l !== null) { + var r = this.dictSeek(l, + acceptor.r, + ch, + acceptor.strOffset, + RIGHT); + acceptor.l = l; + acceptor.r = r; + acceptor.strOffset++; + acceptor.isFinal = this.isFinal(acceptor); + } else { + acceptor.isError = true; + } + return acceptor; + }, + + sortuniq: function(a){ + return a.sort().filter(function(item, pos, arr){ + return !pos || item != arr[pos - 1]; + }) + }, + + flatten: function(a){ + //[[1,2],[3]] -> [1,2,3] + return [].concat.apply([], a); + } +}; +module.exports = WordcutDict; + +}).call(this,"/dist/tmp") +},{"glob":16,"path":22}],3:[function(require,module,exports){ +var WordRule = { + createAcceptor: function(tag) { + if (tag["WORD_RULE"]) + return null; + + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + var lch = ch.toLowerCase(); + if (lch >= "a" && lch <= "z") { + this.isFinal = true; + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "WORD_RULE", + type: "WORD_RULE", + w: 1}; + } +}; + +var NumberRule = { + createAcceptor: function(tag) { + if (tag["NUMBER_RULE"]) + return null; + + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + if (ch >= "0" && ch <= "9") { + this.isFinal = true; + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "NUMBER_RULE", + type: "NUMBER_RULE", + w: 1}; + } +}; + +var SpaceRule = { + tag: "SPACE_RULE", + createAcceptor: function(tag) { + + if (tag["SPACE_RULE"]) + return null; + + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + if (ch == " " || ch == "\t" || ch == "\r" || ch == "\n" || + ch == "\u00A0" || ch=="\u2003"//nbsp and emsp + ) { + this.isFinal = true; + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: SpaceRule.tag, + w: 1, + type: "SPACE_RULE"}; + } +} + +var SingleSymbolRule = { + tag: "SINSYM", + createAcceptor: function(tag) { + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + if (this.strOffset == 0 && ch.match(/^[\@\(\)\/\,\-\."`]$/)) { + this.isFinal = true; + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "SINSYM", + w: 1, + type: "SINSYM"}; + } +} + + +var LatinRules = [WordRule, SpaceRule, SingleSymbolRule, NumberRule]; + +module.exports = LatinRules; + +},{}],4:[function(require,module,exports){ +var _ = require("underscore") + , WordcutCore = require("./wordcut_core"); +var PathInfoBuilder = { + + /* + buildByPartAcceptors: function(path, acceptors, i) { + var + var genInfos = partAcceptors.reduce(function(genInfos, acceptor) { + + }, []); + + return genInfos; + } + */ + + buildByAcceptors: function(path, finalAcceptors, i) { + var self = this; + var infos = finalAcceptors.map(function(acceptor) { + var p = i - acceptor.strOffset + 1 + , _info = path[p]; + + var info = {p: p, + mw: _info.mw + (acceptor.mw === undefined ? 0 : acceptor.mw), + w: acceptor.w + _info.w, + unk: (acceptor.unk ? acceptor.unk : 0) + _info.unk, + type: acceptor.type}; + + if (acceptor.type == "PART") { + for(var j = p + 1; j <= i; j++) { + path[j].merge = p; + } + info.merge = p; + } + + return info; + }); + return infos.filter(function(info) { return info; }); + }, + + fallback: function(path, leftBoundary, text, i) { + var _info = path[leftBoundary]; + if (text[i].match(/[\u0E48-\u0E4E]/)) { + if (leftBoundary != 0) + leftBoundary = path[leftBoundary].p; + return {p: leftBoundary, + mw: 0, + w: 1 + _info.w, + unk: 1 + _info.unk, + type: "UNK"}; +/* } else if(leftBoundary > 0 && path[leftBoundary].type !== "UNK") { + leftBoundary = path[leftBoundary].p; + return {p: leftBoundary, + w: 1 + _info.w, + unk: 1 + _info.unk, + type: "UNK"}; */ + } else { + return {p: leftBoundary, + mw: _info.mw, + w: 1 + _info.w, + unk: 1 + _info.unk, + type: "UNK"}; + } + }, + + build: function(path, finalAcceptors, i, leftBoundary, text) { + var basicPathInfos = this.buildByAcceptors(path, finalAcceptors, i); + if (basicPathInfos.length > 0) { + return basicPathInfos; + } else { + return [this.fallback(path, leftBoundary, text, i)]; + } + } +}; + +module.exports = function() { + return _.clone(PathInfoBuilder); +} + +},{"./wordcut_core":8,"underscore":25}],5:[function(require,module,exports){ +var _ = require("underscore"); + + +var PathSelector = { + selectPath: function(paths) { + var path = paths.reduce(function(selectedPath, path) { + if (selectedPath == null) { + return path; + } else { + if (path.unk < selectedPath.unk) + return path; + if (path.unk == selectedPath.unk) { + if (path.mw < selectedPath.mw) + return path + if (path.mw == selectedPath.mw) { + if (path.w < selectedPath.w) + return path; + } + } + return selectedPath; + } + }, null); + return path; + }, + + createPath: function() { + return [{p:null, w:0, unk:0, type: "INIT", mw:0}]; + } +}; + +module.exports = function() { + return _.clone(PathSelector); +}; + +},{"underscore":25}],6:[function(require,module,exports){ +function isMatch(pat, offset, ch) { + if (pat.length <= offset) + return false; + var _ch = pat[offset]; + return _ch == ch || + (_ch.match(/[กข]/) && ch.match(/[ก-ฮ]/)) || + (_ch.match(/[มบ]/) && ch.match(/[ก-ฮ]/)) || + (_ch.match(/\u0E49/) && ch.match(/[\u0E48-\u0E4B]/)); +} + +var Rule0 = { + pat: "เหก็ม", + createAcceptor: function(tag) { + return {strOffset: 0, + isFinal: false, + transit: function(ch) { + if (isMatch(Rule0.pat, this.strOffset,ch)) { + this.isFinal = (this.strOffset + 1 == Rule0.pat.length); + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "THAI_RULE", + type: "THAI_RULE", + w: 1}; + } +}; + +var PartRule = { + createAcceptor: function(tag) { + return {strOffset: 0, + patterns: [ + "แก", "เก", "ก้", "กก์", "กา", "กี", "กิ", "กืก" + ], + isFinal: false, + transit: function(ch) { + var offset = this.strOffset; + this.patterns = this.patterns.filter(function(pat) { + return isMatch(pat, offset, ch); + }); + + if (this.patterns.length > 0) { + var len = 1 + offset; + this.isFinal = this.patterns.some(function(pat) { + return pat.length == len; + }); + this.strOffset++; + } else { + this.isError = true; + } + return this; + }, + isError: false, + tag: "PART", + type: "PART", + unk: 1, + w: 1}; + } +}; + +var ThaiRules = [Rule0, PartRule]; + +module.exports = ThaiRules; + +},{}],7:[function(require,module,exports){ +var sys = require("sys") + , WordcutDict = require("./dict") + , WordcutCore = require("./wordcut_core") + , PathInfoBuilder = require("./path_info_builder") + , PathSelector = require("./path_selector") + , Acceptors = require("./acceptors") + , latinRules = require("./latin_rules") + , thaiRules = require("./thai_rules") + , _ = require("underscore"); + + +var Wordcut = Object.create(WordcutCore); +Wordcut.defaultPathInfoBuilder = PathInfoBuilder; +Wordcut.defaultPathSelector = PathSelector; +Wordcut.defaultAcceptors = Acceptors; +Wordcut.defaultLatinRules = latinRules; +Wordcut.defaultThaiRules = thaiRules; +Wordcut.defaultDict = WordcutDict; + + +Wordcut.initNoDict = function(dict_path) { + var self = this; + self.pathInfoBuilder = new self.defaultPathInfoBuilder; + self.pathSelector = new self.defaultPathSelector; + self.acceptors = new self.defaultAcceptors; + self.defaultLatinRules.forEach(function(rule) { + self.acceptors.creators.push(rule); + }); + self.defaultThaiRules.forEach(function(rule) { + self.acceptors.creators.push(rule); + }); +}; + +Wordcut.init = function(dict_path, withDefault, additionalWords) { + withDefault = withDefault || false; + this.initNoDict(); + var dict = _.clone(this.defaultDict); + dict.init(dict_path, withDefault, additionalWords); + this.acceptors.creators.push(dict); +}; + +module.exports = Wordcut; + +},{"./acceptors":1,"./dict":2,"./latin_rules":3,"./path_info_builder":4,"./path_selector":5,"./thai_rules":6,"./wordcut_core":8,"sys":28,"underscore":25}],8:[function(require,module,exports){ +var WordcutCore = { + + buildPath: function(text) { + var self = this + , path = self.pathSelector.createPath() + , leftBoundary = 0; + self.acceptors.reset(); + for (var i = 0; i < text.length; i++) { + var ch = text[i]; + self.acceptors.transit(ch); + + var possiblePathInfos = self + .pathInfoBuilder + .build(path, + self.acceptors.getFinalAcceptors(), + i, + leftBoundary, + text); + var selectedPath = self.pathSelector.selectPath(possiblePathInfos) + + path.push(selectedPath); + if (selectedPath.type !== "UNK") { + leftBoundary = i; + } + } + return path; + }, + + pathToRanges: function(path) { + var e = path.length - 1 + , ranges = []; + + while (e > 0) { + var info = path[e] + , s = info.p; + + if (info.merge !== undefined && ranges.length > 0) { + var r = ranges[ranges.length - 1]; + r.s = info.merge; + s = r.s; + } else { + ranges.push({s:s, e:e}); + } + e = s; + } + return ranges.reverse(); + }, + + rangesToText: function(text, ranges, delimiter) { + return ranges.map(function(r) { + return text.substring(r.s, r.e); + }).join(delimiter); + }, + + cut: function(text, delimiter) { + var path = this.buildPath(text) + , ranges = this.pathToRanges(path); + return this + .rangesToText(text, ranges, + (delimiter === undefined ? "|" : delimiter)); + }, + + cutIntoRanges: function(text, noText) { + var path = this.buildPath(text) + , ranges = this.pathToRanges(path); + + if (!noText) { + ranges.forEach(function(r) { + r.text = text.substring(r.s, r.e); + }); + } + return ranges; + }, + + cutIntoArray: function(text) { + var path = this.buildPath(text) + , ranges = this.pathToRanges(path); + + return ranges.map(function(r) { + return text.substring(r.s, r.e) + }); + } +}; + +module.exports = WordcutCore; + +},{}],9:[function(require,module,exports){ +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 +// +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! +// +// Originally from narwhal.js (http://narwhaljs.org) +// Copyright (c) 2009 Thomas Robinson <280north.com> +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the 'Software'), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// when used in node, this will actually load the util module we depend on +// versus loading the builtin util module as happens otherwise +// this is a bug in node module loading as far as I am concerned +var util = require('util/'); + +var pSlice = Array.prototype.slice; +var hasOwn = Object.prototype.hasOwnProperty; + +// 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. + +var assert = module.exports = ok; + +// 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) + +assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + if (options.message) { + this.message = options.message; + this.generatedMessage = false; + } else { + this.message = getMessage(this); + this.generatedMessage = true; + } + var stackStartFunction = options.stackStartFunction || fail; + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, stackStartFunction); + } + else { + // non v8 browsers so we can have a stacktrace + var err = new Error(); + if (err.stack) { + var out = err.stack; + + // try to strip useless frames + var fn_name = stackStartFunction.name; + var idx = out.indexOf('\n' + fn_name); + if (idx >= 0) { + // once we have located the function frame + // we need to strip out everything before it (and its line) + var next_line = out.indexOf('\n', idx + 1); + out = out.substring(next_line + 1); + } + + this.stack = out; + } + } +}; + +// assert.AssertionError instanceof Error +util.inherits(assert.AssertionError, Error); + +function replacer(key, value) { + if (util.isUndefined(value)) { + return '' + value; + } + if (util.isNumber(value) && !isFinite(value)) { + return value.toString(); + } + if (util.isFunction(value) || util.isRegExp(value)) { + return value.toString(); + } + return value; +} + +function truncate(s, n) { + if (util.isString(s)) { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } +} + +function getMessage(self) { + return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' + + self.operator + ' ' + + truncate(JSON.stringify(self.expected, replacer), 128); +} + +// At present only the three keys mentioned above are used and +// understood by the spec. Implementations or sub modules can pass +// other keys to the AssertionError's constructor - they will be +// ignored. + +// 3. All of the following functions must throw an AssertionError +// when a corresponding condition is not met, with a message that +// may be undefined if not provided. All assertion methods provide +// both the actual and expected values to the assertion error for +// display purposes. + +function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} + +// EXTENSION! allows for well behaved errors defined elsewhere. +assert.fail = fail; + +// 4. Pure assertion tests whether a value is truthy, as determined +// by !!guard. +// assert.ok(guard, message_opt); +// This statement is equivalent to assert.equal(true, !!guard, +// message_opt);. To test strictly for the value true, use +// assert.strictEqual(true, guard, message_opt);. + +function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); +} +assert.ok = ok; + +// 5. The equality assertion tests shallow, coercive equality with +// ==. +// assert.equal(actual, expected, message_opt); + +assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); +}; + +// 6. The non-equality assertion tests for whether two objects are not equal +// with != assert.notEqual(actual, expected, message_opt); + +assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } +}; + +// 7. The equivalence assertion tests a deep equality relation. +// assert.deepEqual(actual, expected, message_opt); + +assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } +}; + +function _deepEqual(actual, expected) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (util.isBuffer(actual) && util.isBuffer(expected)) { + if (actual.length != expected.length) return false; + + for (var i = 0; i < actual.length; i++) { + if (actual[i] !== expected[i]) return false; + } + + return true; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); + + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; + + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!util.isObject(actual) && !util.isObject(expected)) { + return actual == expected; + + // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected); + } +} + +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function objEquiv(a, b) { + if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + // if one is a primitive, the other must be same + if (util.isPrimitive(a) || util.isPrimitive(b)) { + return a === b; + } + var aIsArgs = isArguments(a), + bIsArgs = isArguments(b); + if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) + return false; + if (aIsArgs) { + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b); + } + var ka = objectKeys(a), + kb = objectKeys(b), + key, i; + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key])) return false; + } + return true; +} + +// 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); + +assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } +}; + +// 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); + +assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } +}; + +// 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); + +assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } +}; + +function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } else if (actual instanceof expected) { + return true; + } else if (expected.call({}, actual) === true) { + return true; + } + + return false; +} + +function _throws(shouldThrow, block, expected, message) { + var actual; + + if (util.isString(expected)) { + message = expected; + expected = null; + } + + try { + block(); + } catch (e) { + actual = e; + } + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + if (!shouldThrow && expectedException(actual, expected)) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; + } +} + +// 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); + +assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws.apply(this, [true].concat(pSlice.call(arguments))); +}; + +// EXTENSION! This is annoying to write outside this module. +assert.doesNotThrow = function(block, /*optional*/message) { + _throws.apply(this, [false].concat(pSlice.call(arguments))); +}; + +assert.ifError = function(err) { if (err) {throw err;}}; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + if (hasOwn.call(obj, key)) keys.push(key); + } + return keys; +}; + +},{"util/":28}],10:[function(require,module,exports){ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} + +},{}],11:[function(require,module,exports){ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + + +},{"balanced-match":10,"concat-map":13}],12:[function(require,module,exports){ + +},{}],13:[function(require,module,exports){ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +},{}],14:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } + throw TypeError('Uncaught, unspecified "error" event.'); + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + handler.apply(this, args); + } + } else if (isObject(handler)) { + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + var m; + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.listenerCount = function(emitter, type) { + var ret; + if (!emitter._events || !emitter._events[type]) + ret = 0; + else if (isFunction(emitter._events[type])) + ret = 1; + else + ret = emitter._events[type].length; + return ret; +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} + +},{}],15:[function(require,module,exports){ +(function (process){ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern) + } + + return { + matcher: new Minimatch(pattern), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation unless the user explicitly + // passes in false as the option. + options.nonegate = options.nonegate === false ? false : true + options.nocomment = options.nocomment === false ? false : true + deprecationWarning(options) + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +// TODO(isaacs): remove entirely in v6 +// exported to reset in tests +exports.deprecationWarned +function deprecationWarning(options) { + if (!options.nonegate || !options.nocomment) { + if (process.noDeprecation !== true && !exports.deprecationWarned) { + var msg = 'glob WARNING: comments and negation will be disabled in v6' + if (process.throwDeprecation) + throw new Error(msg) + else if (process.traceDeprecation) + console.trace(msg) + else + console.error(msg) + + exports.deprecationWarned = true + } + } +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +}).call(this,require('_process')) +},{"_process":24,"minimatch":20,"path":22,"path-is-absolute":23}],16:[function(require,module,exports){ +(function (process){ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +glob.hasMagic = function (pattern, options_) { + var options = util._extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} + +}).call(this,require('_process')) +},{"./common.js":15,"./sync.js":17,"_process":24,"assert":9,"events":14,"fs":12,"inflight":18,"inherits":19,"minimatch":20,"once":21,"path":22,"path-is-absolute":23,"util":28}],17:[function(require,module,exports){ +(function (process){ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +}).call(this,require('_process')) +},{"./common.js":15,"./glob.js":16,"_process":24,"assert":9,"fs":12,"minimatch":20,"path":22,"path-is-absolute":23,"util":28}],18:[function(require,module,exports){ +(function (process){ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} + +}).call(this,require('_process')) +},{"_process":24,"once":21,"wrappy":29}],19:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],20:[function(require,module,exports){ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} + +},{"brace-expansion":11,"path":22}],21:[function(require,module,exports){ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} + +},{"wrappy":29}],22:[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// resolves . and .. elements in a path array with directory names there +// must be no slashes, empty elements, or device names (c:\) in the array +// (so also no leading and trailing slashes - it does not distinguish +// relative and absolute paths) +function normalizeArray(parts, allowAboveRoot) { + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === '.') { + parts.splice(i, 1); + } else if (last === '..') { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (allowAboveRoot) { + for (; up--; up) { + parts.unshift('..'); + } + } + + return parts; +} + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var splitPath = function(filename) { + return splitPathRe.exec(filename).slice(1); +}; + +// path.resolve([from ...], to) +// posix version +exports.resolve = function() { + var resolvedPath = '', + resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = (i >= 0) ? arguments[i] : process.cwd(); + + // Skip empty and invalid entries + if (typeof path !== 'string') { + throw new TypeError('Arguments to path.resolve must be strings'); + } else if (!path) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charAt(0) === '/'; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { + return !!p; + }), !resolvedAbsolute).join('/'); + + return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; +}; + +// path.normalize(path) +// posix version +exports.normalize = function(path) { + var isAbsolute = exports.isAbsolute(path), + trailingSlash = substr(path, -1) === '/'; + + // Normalize the path + path = normalizeArray(filter(path.split('/'), function(p) { + return !!p; + }), !isAbsolute).join('/'); + + if (!path && !isAbsolute) { + path = '.'; + } + if (path && trailingSlash) { + path += '/'; + } + + return (isAbsolute ? '/' : '') + path; +}; + +// posix version +exports.isAbsolute = function(path) { + return path.charAt(0) === '/'; +}; + +// posix version +exports.join = function() { + var paths = Array.prototype.slice.call(arguments, 0); + return exports.normalize(filter(paths, function(p, index) { + if (typeof p !== 'string') { + throw new TypeError('Arguments to path.join must be strings'); + } + return p; + }).join('/')); +}; + + +// path.relative(from, to) +// posix version +exports.relative = function(from, to) { + from = exports.resolve(from).substr(1); + to = exports.resolve(to).substr(1); + + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== '') break; + } + + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== '') break; + } + + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + + var fromParts = trim(from.split('/')); + var toParts = trim(to.split('/')); + + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push('..'); + } + + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + + return outputParts.join('/'); +}; + +exports.sep = '/'; +exports.delimiter = ':'; + +exports.dirname = function(path) { + var result = splitPath(path), + root = result[0], + dir = result[1]; + + if (!root && !dir) { + // No dirname whatsoever + return '.'; + } + + if (dir) { + // It has a dirname, strip trailing slash + dir = dir.substr(0, dir.length - 1); + } + + return root + dir; +}; + + +exports.basename = function(path, ext) { + var f = splitPath(path)[2]; + // TODO: make this comparison case-insensitive on windows? + if (ext && f.substr(-1 * ext.length) === ext) { + f = f.substr(0, f.length - ext.length); + } + return f; +}; + + +exports.extname = function(path) { + return splitPath(path)[3]; +}; + +function filter (xs, f) { + if (xs.filter) return xs.filter(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + if (f(xs[i], i, xs)) res.push(xs[i]); + } + return res; +} + +// String.prototype.substr - negative index don't work in IE8 +var substr = 'ab'.substr(-1) === 'b' + ? function (str, start, len) { return str.substr(start, len) } + : function (str, start, len) { + if (start < 0) start = str.length + start; + return str.substr(start, len); + } +; + +}).call(this,require('_process')) +},{"_process":24}],23:[function(require,module,exports){ +(function (process){ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; + +}).call(this,require('_process')) +},{"_process":24}],24:[function(require,module,exports){ +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],25:[function(require,module,exports){ +// Underscore.js 1.8.3 +// http://underscorejs.org +// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. + +(function() { + + // Baseline setup + // -------------- + + // Establish the root object, `window` in the browser, or `exports` on the server. + var root = this; + + // Save the previous value of the `_` variable. + var previousUnderscore = root._; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + + // Create quick reference variables for speed access to core prototypes. + var + push = ArrayProto.push, + slice = ArrayProto.slice, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind, + nativeCreate = Object.create; + + // Naked function reference for surrogate-prototype-swapping. + var Ctor = function(){}; + + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; + }; + + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object. + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; + } + exports._ = _; + } else { + root._ = _; + } + + // Current version. + _.VERSION = '1.8.3'; + + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + var optimizeCb = function(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + case 2: return function(value, other) { + return func.call(context, value, other); + }; + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; + }; + + // A mostly-internal function to generate callbacks that can be applied + // to each element in a collection, returning the desired result — either + // identity, an arbitrary callback, a property matcher, or a property accessor. + var cb = function(value, context, argCount) { + if (value == null) return _.identity; + if (_.isFunction(value)) return optimizeCb(value, context, argCount); + if (_.isObject(value)) return _.matcher(value); + return _.property(value); + }; + _.iteratee = function(value, context) { + return cb(value, context, Infinity); + }; + + // An internal function for creating assigner functions. + var createAssigner = function(keysFunc, undefinedOnly) { + return function(obj) { + var length = arguments.length; + if (length < 2 || obj == null) return obj; + for (var index = 1; index < length; index++) { + var source = arguments[index], + keys = keysFunc(source), + l = keys.length; + for (var i = 0; i < l; i++) { + var key = keys[i]; + if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key]; + } + } + return obj; + }; + }; + + // An internal function for creating a new object that inherits from another. + var baseCreate = function(prototype) { + if (!_.isObject(prototype)) return {}; + if (nativeCreate) return nativeCreate(prototype); + Ctor.prototype = prototype; + var result = new Ctor; + Ctor.prototype = null; + return result; + }; + + var property = function(key) { + return function(obj) { + return obj == null ? void 0 : obj[key]; + }; + }; + + // Helper for collection methods to determine whether a collection + // should be iterated as an array or as an object + // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 + var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; + var getLength = property('length'); + var isArrayLike = function(collection) { + var length = getLength(collection); + return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; + }; + + // Collection Functions + // -------------------- + + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + _.each = _.forEach = function(obj, iteratee, context) { + iteratee = optimizeCb(iteratee, context); + var i, length; + if (isArrayLike(obj)) { + for (i = 0, length = obj.length; i < length; i++) { + iteratee(obj[i], i, obj); + } + } else { + var keys = _.keys(obj); + for (i = 0, length = keys.length; i < length; i++) { + iteratee(obj[keys[i]], keys[i], obj); + } + } + return obj; + }; + + // Return the results of applying the iteratee to each element. + _.map = _.collect = function(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length, + results = Array(length); + for (var index = 0; index < length; index++) { + var currentKey = keys ? keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + }; + + // Create a reducing function iterating left or right. + function createReduce(dir) { + // Optimized iterator function as using arguments.length + // in the main function will deoptimize the, see #1991. + function iterator(obj, iteratee, memo, keys, index, length) { + for (; index >= 0 && index < length; index += dir) { + var currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + } + + return function(obj, iteratee, memo, context) { + iteratee = optimizeCb(iteratee, context, 4); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length, + index = dir > 0 ? 0 : length - 1; + // Determine the initial value if none is provided. + if (arguments.length < 3) { + memo = obj[keys ? keys[index] : index]; + index += dir; + } + return iterator(obj, iteratee, memo, keys, index, length); + }; + } + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. + _.reduce = _.foldl = _.inject = createReduce(1); + + // The right-associative version of reduce, also known as `foldr`. + _.reduceRight = _.foldr = createReduce(-1); + + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, predicate, context) { + var key; + if (isArrayLike(obj)) { + key = _.findIndex(obj, predicate, context); + } else { + key = _.findKey(obj, predicate, context); + } + if (key !== void 0 && key !== -1) return obj[key]; + }; + + // Return all the elements that pass a truth test. + // Aliased as `select`. + _.filter = _.select = function(obj, predicate, context) { + var results = []; + predicate = cb(predicate, context); + _.each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, predicate, context) { + return _.filter(obj, _.negate(cb(predicate)), context); + }; + + // Determine whether all of the elements match a truth test. + // Aliased as `all`. + _.every = _.all = function(obj, predicate, context) { + predicate = cb(predicate, context); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = keys ? keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; + }; + + // Determine if at least one element in the object matches a truth test. + // Aliased as `any`. + _.some = _.any = function(obj, predicate, context) { + predicate = cb(predicate, context); + var keys = !isArrayLike(obj) && _.keys(obj), + length = (keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = keys ? keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; + }; + + // Determine if the array or object contains a given item (using `===`). + // Aliased as `includes` and `include`. + _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) { + if (!isArrayLike(obj)) obj = _.values(obj); + if (typeof fromIndex != 'number' || guard) fromIndex = 0; + return _.indexOf(obj, item, fromIndex) >= 0; + }; + + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + var isFunc = _.isFunction(method); + return _.map(obj, function(value) { + var func = isFunc ? method : value[method]; + return func == null ? func : func.apply(value, args); + }); + }; + + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, _.property(key)); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // containing specific `key:value` pairs. + _.where = function(obj, attrs) { + return _.filter(obj, _.matcher(attrs)); + }; + + // Convenience version of a common use case of `find`: getting the first object + // containing specific `key:value` pairs. + _.findWhere = function(obj, attrs) { + return _.find(obj, _.matcher(attrs)); + }; + + // Return the maximum element (or element-based computation). + _.max = function(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = isArrayLike(obj) ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value > result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = value; + lastComputed = computed; + } + }); + } + return result; + }; + + // Return the minimum element (or element-based computation). + _.min = function(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = isArrayLike(obj) ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value < result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = value; + lastComputed = computed; + } + }); + } + return result; + }; + + // Shuffle a collection, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). + _.shuffle = function(obj) { + var set = isArrayLike(obj) ? obj : _.values(obj); + var length = set.length; + var shuffled = Array(length); + for (var index = 0, rand; index < length; index++) { + rand = _.random(0, index); + if (rand !== index) shuffled[index] = shuffled[rand]; + shuffled[rand] = set[index]; + } + return shuffled; + }; + + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (!isArrayLike(obj)) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; + } + return _.shuffle(obj).slice(0, Math.max(0, n)); + }; + + // Sort the object's values by a criterion produced by an iteratee. + _.sortBy = function(obj, iteratee, context) { + iteratee = cb(iteratee, context); + return _.pluck(_.map(obj, function(value, index, list) { + return { + value: value, + index: index, + criteria: iteratee(value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); + }; + + // An internal function used for aggregate "group by" operations. + var group = function(behavior) { + return function(obj, iteratee, context) { + var result = {}; + iteratee = cb(iteratee, context); + _.each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; + }; + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = group(function(result, value, key) { + if (_.has(result, key)) result[key].push(value); else result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, value, key) { + result[key] = value; + }); + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + _.countBy = group(function(result, value, key) { + if (_.has(result, key)) result[key]++; else result[key] = 1; + }); + + // Safely create a real, live array from anything iterable. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (isArrayLike(obj)) return _.map(obj, _.identity); + return _.values(obj); + }; + + // Return the number of elements in an object. + _.size = function(obj) { + if (obj == null) return 0; + return isArrayLike(obj) ? obj.length : _.keys(obj).length; + }; + + // Split a collection into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(obj, predicate, context) { + predicate = cb(predicate, context); + var pass = [], fail = []; + _.each(obj, function(value, key, obj) { + (predicate(value, key, obj) ? pass : fail).push(value); + }); + return [pass, fail]; + }; + + // Array Functions + // --------------- + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[0]; + return _.initial(array, array.length - n); + }; + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. + _.initial = function(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); + }; + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. + _.last = function(array, n, guard) { + if (array == null) return void 0; + if (n == null || guard) return array[array.length - 1]; + return _.rest(array, Math.max(0, array.length - n)); + }; + + // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. + // Especially useful on the arguments object. Passing an **n** will return + // the rest N values in the array. + _.rest = _.tail = _.drop = function(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); + }; + + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, _.identity); + }; + + // Internal implementation of a recursive `flatten` function. + var flatten = function(input, shallow, strict, startIndex) { + var output = [], idx = 0; + for (var i = startIndex || 0, length = getLength(input); i < length; i++) { + var value = input[i]; + if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { + //flatten current level of array or arguments object + if (!shallow) value = flatten(value, shallow, strict); + var j = 0, len = value.length; + output.length += len; + while (j < len) { + output[idx++] = value[j++]; + } + } else if (!strict) { + output[idx++] = value; + } + } + return output; + }; + + // Flatten out an array, either recursively (by default), or just one level. + _.flatten = function(array, shallow) { + return flatten(array, shallow, false); + }; + + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iteratee, context) { + if (!_.isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; + } + if (iteratee != null) iteratee = cb(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = getLength(array); i < length; i++) { + var value = array[i], + computed = iteratee ? iteratee(value, i, array) : value; + if (isSorted) { + if (!i || seen !== computed) result.push(value); + seen = computed; + } else if (iteratee) { + if (!_.contains(seen, computed)) { + seen.push(computed); + result.push(value); + } + } else if (!_.contains(result, value)) { + result.push(value); + } + } + return result; + }; + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(flatten(arguments, true, true)); + }; + + // Produce an array that contains every item shared between all the + // passed-in arrays. + _.intersection = function(array) { + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = getLength(array); i < length; i++) { + var item = array[i]; + if (_.contains(result, item)) continue; + for (var j = 1; j < argsLength; j++) { + if (!_.contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; + }; + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = flatten(arguments, true, true, 1); + return _.filter(array, function(value){ + return !_.contains(rest, value); + }); + }; + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function() { + return _.unzip(arguments); + }; + + // Complement of _.zip. Unzip accepts an array of arrays and groups + // each array's elements on shared indices + _.unzip = function(array) { + var length = array && _.max(array, getLength).length || 0; + var result = Array(length); + + for (var index = 0; index < length; index++) { + result[index] = _.pluck(array, index); + } + return result; + }; + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + _.object = function(list, values) { + var result = {}; + for (var i = 0, length = getLength(list); i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + }; + + // Generator function to create the findIndex and findLastIndex functions + function createPredicateIndexFinder(dir) { + return function(array, predicate, context) { + predicate = cb(predicate, context); + var length = getLength(array); + var index = dir > 0 ? 0 : length - 1; + for (; index >= 0 && index < length; index += dir) { + if (predicate(array[index], index, array)) return index; + } + return -1; + }; + } + + // Returns the first index on an array-like that passes a predicate test + _.findIndex = createPredicateIndexFinder(1); + _.findLastIndex = createPredicateIndexFinder(-1); + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iteratee, context) { + iteratee = cb(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = getLength(array); + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; + } + return low; + }; + + // Generator function to create the indexOf and lastIndexOf functions + function createIndexFinder(dir, predicateFind, sortedIndex) { + return function(array, item, idx) { + var i = 0, length = getLength(array); + if (typeof idx == 'number') { + if (dir > 0) { + i = idx >= 0 ? idx : Math.max(idx + length, i); + } else { + length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; + } + } else if (sortedIndex && idx && length) { + idx = sortedIndex(array, item); + return array[idx] === item ? idx : -1; + } + if (item !== item) { + idx = predicateFind(slice.call(array, i, length), _.isNaN); + return idx >= 0 ? idx + i : -1; + } + for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { + if (array[idx] === item) return idx; + } + return -1; + }; + } + + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex); + _.lastIndexOf = createIndexFinder(-1, _.findLastIndex); + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (stop == null) { + stop = start || 0; + start = 0; + } + step = step || 1; + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); + + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; + } + + return range; + }; + + // Function (ahem) Functions + // ------------------ + + // Determines whether to execute a function as a constructor + // or a normal function with the provided arguments + var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { + if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); + var self = baseCreate(sourceFunc.prototype); + var result = sourceFunc.apply(self, args); + if (_.isObject(result)) return result; + return self; + }; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); + var args = slice.call(arguments, 2); + var bound = function() { + return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); + }; + return bound; + }; + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. + _.partial = function(func) { + var boundArgs = slice.call(arguments, 1); + var bound = function() { + var position = 0, length = boundArgs.length; + var args = Array(length); + for (var i = 0; i < length; i++) { + args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; + } + while (position < arguments.length) args.push(arguments[position++]); + return executeBound(func, bound, this, this, args); + }; + return bound; + }; + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + _.bindAll = function(obj) { + var i, length = arguments.length, key; + if (length <= 1) throw new Error('bindAll must be passed function names'); + for (i = 1; i < length; i++) { + key = arguments[i]; + obj[key] = _.bind(obj[key], obj); + } + return obj; + }; + + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = '' + (hasher ? hasher.apply(this, arguments) : key); + if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; + }; + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ + return func.apply(null, args); + }, wait); + }; + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = _.partial(_.delay, _, 1); + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; + var previous = 0; + if (!options) options = {}; + var later = function() { + previous = options.leading === false ? 0 : _.now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + return function() { + var now = _.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + previous = now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }; + + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + + if (last < wait && last >= 0) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + if (!timeout) context = args = null; + } + } + }; + + return function() { + context = this; + args = arguments; + timestamp = _.now(); + var callNow = immediate && !timeout; + if (!timeout) timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + + return result; + }; + }; + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return _.partial(wrapper, func); + }; + + // Returns a negated version of the passed-in predicate. + _.negate = function(predicate) { + return function() { + return !predicate.apply(this, arguments); + }; + }; + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var args = arguments; + var start = args.length - 1; + return function() { + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; + }; + }; + + // Returns a function that will only be executed on and after the Nth call. + _.after = function(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + }; + + // Returns a function that will only be executed up to (but not including) the Nth call. + _.before = function(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } + if (times <= 1) func = null; + return memo; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = _.partial(_.before, 2); + + // Object Functions + // ---------------- + + // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. + var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); + var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', + 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; + + function collectNonEnumProps(obj, keys) { + var nonEnumIdx = nonEnumerableProps.length; + var constructor = obj.constructor; + var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto; + + // Constructor is a special case. + var prop = 'constructor'; + if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop); + + while (nonEnumIdx--) { + prop = nonEnumerableProps[nonEnumIdx]; + if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) { + keys.push(prop); + } + } + } + + // Retrieve the names of an object's own properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + }; + + // Retrieve all the property names of an object. + _.allKeys = function(obj) { + if (!_.isObject(obj)) return []; + var keys = []; + for (var key in obj) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + }; + + // Retrieve the values of an object's properties. + _.values = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } + return values; + }; + + // Returns the results of applying the iteratee to each element of the object + // In contrast to _.map it returns an object + _.mapObject = function(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var keys = _.keys(obj), + length = keys.length, + results = {}, + currentKey; + for (var index = 0; index < length; index++) { + currentKey = keys[index]; + results[currentKey] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + }; + + // Convert an object into a list of `[key, value]` pairs. + _.pairs = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; + } + return pairs; + }; + + // Invert the keys and values of an object. The values must be serializable. + _.invert = function(obj) { + var result = {}; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } + return result; + }; + + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); + } + return names.sort(); + }; + + // Extend a given object with all the properties in passed-in object(s). + _.extend = createAssigner(_.allKeys); + + // Assigns a given object with all the own properties in the passed-in object(s) + // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + _.extendOwn = _.assign = createAssigner(_.keys); + + // Returns the first key on an object that passes a predicate test + _.findKey = function(obj, predicate, context) { + predicate = cb(predicate, context); + var keys = _.keys(obj), key; + for (var i = 0, length = keys.length; i < length; i++) { + key = keys[i]; + if (predicate(obj[key], key, obj)) return key; + } + }; + + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(object, oiteratee, context) { + var result = {}, obj = object, iteratee, keys; + if (obj == null) return result; + if (_.isFunction(oiteratee)) { + keys = _.allKeys(obj); + iteratee = optimizeCb(oiteratee, context); + } else { + keys = flatten(arguments, false, false, 1); + iteratee = function(value, key, obj) { return key in obj; }; + obj = Object(obj); + } + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + return result; + }; + + // Return a copy of the object without the blacklisted properties. + _.omit = function(obj, iteratee, context) { + if (_.isFunction(iteratee)) { + iteratee = _.negate(iteratee); + } else { + var keys = _.map(flatten(arguments, false, false, 1), String); + iteratee = function(value, key) { + return !_.contains(keys, key); + }; + } + return _.pick(obj, iteratee, context); + }; + + // Fill in a given object with default properties. + _.defaults = createAssigner(_.allKeys, true); + + // Creates an object that inherits from the given prototype object. + // If additional properties are provided then they will be added to the + // created object. + _.create = function(prototype, props) { + var result = baseCreate(prototype); + if (props) _.extendOwn(result, props); + return result; + }; + + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; + + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; + + // Returns whether an object has a given set of `key:value` pairs. + _.isMatch = function(object, attrs) { + var keys = _.keys(attrs), length = keys.length; + if (object == null) return !length; + var obj = Object(object); + for (var i = 0; i < length; i++) { + var key = keys[i]; + if (attrs[key] !== obj[key] || !(key in obj)) return false; + } + return true; + }; + + + // Internal recursive comparison function for `isEqual`. + var eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + switch (className) { + // Strings, numbers, regular expressions, dates, and booleans are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a === +b; + } + + var areArrays = className === '[object Array]'; + if (!areArrays) { + if (typeof a != 'object' || typeof b != 'object') return false; + + // Objects with different constructors are not equivalent, but `Object`s or `Array`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && + _.isFunction(bCtor) && bCtor instanceof bCtor) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + } + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + + // Initializing stack of traversed objects. + // It's done here since we only need them for objects and arrays comparison. + aStack = aStack || []; + bStack = bStack || []; + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + + // Recursively compare objects and arrays. + if (areArrays) { + // Compare array lengths to determine if a deep comparison is necessary. + length = a.length; + if (length !== b.length) return false; + // Deep compare the contents, ignoring non-numeric properties. + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) return false; + } + } else { + // Deep compare objects. + var keys = _.keys(a), key; + length = keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + if (_.keys(b).length !== length) return false; + while (length--) { + // Deep compare each member + key = keys[length]; + if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return true; + }; + + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b); + }; + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0; + return _.keys(obj).length === 0; + }; + + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType === 1); + }; + + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) === '[object Array]'; + }; + + // Is a given variable an object? + _.isObject = function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + }; + + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { + _['is' + name] = function(obj) { + return toString.call(obj) === '[object ' + name + ']'; + }; + }); + + // Define a fallback version of the method in browsers (ahem, IE < 9), where + // there isn't any inspectable "Arguments" type. + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return _.has(obj, 'callee'); + }; + } + + // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, + // IE 11 (#1621), and in Safari 8 (#1929). + if (typeof /./ != 'function' && typeof Int8Array != 'object') { + _.isFunction = function(obj) { + return typeof obj == 'function' || false; + }; + } + + // Is a given object a finite number? + _.isFinite = function(obj) { + return isFinite(obj) && !isNaN(parseFloat(obj)); + }; + + // Is the given value `NaN`? (NaN is the only number which does not equal itself). + _.isNaN = function(obj) { + return _.isNumber(obj) && obj !== +obj; + }; + + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; + }; + + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; + + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; + + // Shortcut function for checking if an object has a given property directly + // on itself (in other words, not on a prototype). + _.has = function(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); + }; + + // Utility Functions + // ----------------- + + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; + + // Keep the identity function around for default iteratees. + _.identity = function(value) { + return value; + }; + + // Predicate-generating functions. Often useful outside of Underscore. + _.constant = function(value) { + return function() { + return value; + }; + }; + + _.noop = function(){}; + + _.property = property; + + // Generates a function for a given object that returns a given property. + _.propertyOf = function(obj) { + return obj == null ? function(){} : function(key) { + return obj[key]; + }; + }; + + // Returns a predicate for checking whether an object has a given set of + // `key:value` pairs. + _.matcher = _.matches = function(attrs) { + attrs = _.extendOwn({}, attrs); + return function(obj) { + return _.isMatch(obj, attrs); + }; + }; + + // Run a function **n** times. + _.times = function(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = optimizeCb(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; + }; + + // Return a random integer between min and max (inclusive). + _.random = function(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); + }; + + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { + return new Date().getTime(); + }; + + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + var unescapeMap = _.invert(escapeMap); + + // Functions for escaping and unescaping strings to/from HTML interpolation. + var createEscaper = function(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped + var source = '(?:' + _.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + }; + _.escape = createEscaper(escapeMap); + _.unescape = createEscaper(unescapeMap); + + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. + _.result = function(object, property, fallback) { + var value = object == null ? void 0 : object[property]; + if (value === void 0) { + value = fallback; + } + return _.isFunction(value) ? value.call(object) : value; + }; + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escaper = /\\|'|\r|\n|\u2028|\u2029/g; + + var escapeChar = function(match) { + return '\\' + escapes[match]; + }; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + // NB: `oldSettings` only exists for backwards compatibility. + _.template = function(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escaper, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offest. + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; + + try { + var render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; + + return template; + }; + + // Add a "chain" function. Start chaining a wrapped Underscore object. + _.chain = function(obj) { + var instance = _(obj); + instance._chain = true; + return instance; + }; + + // OOP + // --------------- + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + + // Helper function to continue chaining intermediate results. + var result = function(instance, obj) { + return instance._chain ? _(obj).chain() : obj; + }; + + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + _.each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result(this, func.apply(_, args)); + }; + }); + }; + + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); + + // Add all mutator Array functions to the wrapper. + _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; + return result(this, obj); + }; + }); + + // Add all accessor Array functions to the wrapper. + _.each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + return result(this, method.apply(this._wrapped, arguments)); + }; + }); + + // Extracts the result from a wrapped and chained object. + _.prototype.value = function() { + return this._wrapped; + }; + + // Provide unwrapping proxy for some methods used in engine operations + // such as arithmetic and JSON stringification. + _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; + + _.prototype.toString = function() { + return '' + this._wrapped; + }; + + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (typeof define === 'function' && define.amd) { + define('underscore', [], function() { + return _; + }); + } +}.call(this)); + +},{}],26:[function(require,module,exports){ +arguments[4][19][0].apply(exports,arguments) +},{"dup":19}],27:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],28:[function(require,module,exports){ +(function (process,global){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./support/isBuffer":27,"_process":24,"inherits":26}],29:[function(require,module,exports){ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} + +},{}]},{},[7])(7) +}); \ No newline at end of file diff --git a/assets/javascripts/workers/search.b97dbffb.min.js b/assets/javascripts/workers/search.b97dbffb.min.js new file mode 100644 index 00000000..8201c5e5 --- /dev/null +++ b/assets/javascripts/workers/search.b97dbffb.min.js @@ -0,0 +1,48 @@ +"use strict";(()=>{var ge=Object.create;var W=Object.defineProperty,ye=Object.defineProperties,me=Object.getOwnPropertyDescriptor,ve=Object.getOwnPropertyDescriptors,xe=Object.getOwnPropertyNames,G=Object.getOwnPropertySymbols,Se=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable;var J=(t,e,r)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e)=>{for(var r in e||(e={}))X.call(e,r)&&J(t,r,e[r]);if(G)for(var r of G(e))Qe.call(e,r)&&J(t,r,e[r]);return t},Z=(t,e)=>ye(t,ve(e));var K=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var be=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xe(e))!X.call(t,i)&&i!==r&&W(t,i,{get:()=>e[i],enumerable:!(n=me(e,i))||n.enumerable});return t};var H=(t,e,r)=>(r=t!=null?ge(Se(t)):{},be(e||!t||!t.__esModule?W(r,"default",{value:t,enumerable:!0}):r,t));var z=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())});var re=K((ee,te)=>{/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + */(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";/*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + */t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var h=t.utils.clone(r)||{};h.position=[a,c],h.index=s.length,s.push(new t.Token(n.slice(a,o),h))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;/*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + */t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ou?h+=2:a==u&&(r+=n[c+1]*i[h+1],c+=2,h+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}if(s.str.length==0&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new t.TokenSet;s.node.edges["*"]=c}s.str.length==1&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var h=s.str.charAt(0),y=s.str.charAt(1),g;y in s.node.edges?g=s.node.edges[y]:(g=new t.TokenSet,s.node.edges[y]=g),s.str.length==1&&(g.final=!0),i.push({node:g,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};/*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + */t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof ee=="object"?te.exports=r():e.lunr=r()}(this,function(){return t})})()});var q=K((Re,ne)=>{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var Le=/["'&<>]/;ne.exports=we;function we(t){var e=""+t,r=Le.exec(e);if(!r)return e;var n,i="",s=0,o=0;for(s=r.index;s=0;r--){let n=t[r];typeof n!="object"?n=document.createTextNode(n):n.parentNode&&n.parentNode.removeChild(n),r?e.insertBefore(this.previousSibling,n):e.replaceChild(n,this)}}}));var ie=H(q());function se(t){let e=new Map,r=new Set;for(let n of t){let[i,s]=n.location.split("#"),o=n.location,a=n.title,u=n.tags,c=(0,ie.default)(n.text).replace(/\s+(?=[,.:;!?])/g,"").replace(/\s+/g," ");if(s){let h=e.get(i);r.has(h)?e.set(o,{location:o,title:a,text:c,parent:h}):(h.title=n.title,h.text=c,r.add(h))}else e.set(o,M({location:o,title:a,text:c},u&&{tags:u}))}return e}var oe=H(q());function ae(t,e){let r=new RegExp(t.separator,"img"),n=(i,s,o)=>`${s}${o}`;return i=>{i=i.replace(/[\s*+\-:~^]+/g," ").trim();let s=new RegExp(`(^|${t.separator})(${i.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&").replace(r,"|")})`,"img");return o=>(e?(0,oe.default)(o):o).replace(s,n).replace(/<\/mark>(\s+)]*>/img,"$1")}}function ue(t){let e=new lunr.Query(["title","text"]);return new lunr.QueryParser(t,e).parse(),e.clauses}function ce(t,e){var i;let r=new Set(t),n={};for(let s=0;s!n.has(i)))]}var U=class{constructor({config:e,docs:r,options:n}){this.options=n,this.documents=se(r),this.highlight=ae(e,!1),lunr.tokenizer.separator=new RegExp(e.separator),this.index=lunr(function(){e.lang.length===1&&e.lang[0]!=="en"?this.use(lunr[e.lang[0]]):e.lang.length>1&&this.use(lunr.multiLanguage(...e.lang));let i=Ee(["trimmer","stopWordFilter","stemmer"],n.pipeline);for(let s of e.lang.map(o=>o==="en"?lunr:lunr[o]))for(let o of i)this.pipeline.remove(s[o]),this.searchPipeline.remove(s[o]);this.ref("location"),this.field("title",{boost:1e3}),this.field("text"),this.field("tags",{boost:1e6,extractor:s=>{let{tags:o=[]}=s;return o.reduce((a,u)=>[...a,...lunr.tokenizer(u)],[])}});for(let s of r)this.add(s,{boost:s.boost})})}search(e){if(e)try{let r=this.highlight(e),n=ue(e).filter(o=>o.presence!==lunr.Query.presence.PROHIBITED),i=this.index.search(`${e}*`).reduce((o,{ref:a,score:u,matchData:c})=>{let h=this.documents.get(a);if(typeof h!="undefined"){let{location:y,title:g,text:b,tags:m,parent:Q}=h,p=ce(n,Object.keys(c.metadata)),d=+!Q+ +Object.values(p).every(w=>w);o.push(Z(M({location:y,title:r(g),text:r(b)},m&&{tags:m.map(r)}),{score:u*(1+d),terms:p}))}return o},[]).sort((o,a)=>a.score-o.score).reduce((o,a)=>{let u=this.documents.get(a.location);if(typeof u!="undefined"){let c="parent"in u?u.parent.location:u.location;o.set(c,[...o.get(c)||[],a])}return o},new Map),s;if(this.options.suggestions){let o=this.index.query(a=>{for(let u of n)a.term(u.term,{fields:["title"],presence:lunr.Query.presence.REQUIRED,wildcard:lunr.Query.wildcard.TRAILING})});s=o.length?Object.keys(o[0].matchData.metadata):[]}return M({items:[...i.values()]},typeof s!="undefined"&&{suggestions:s})}catch(r){console.warn(`Invalid query: ${e} \u2013 see https://bit.ly/2s3ChXG`)}return{items:[]}}};var Y;function ke(t){return z(this,null,function*(){let e="../lunr";if(typeof parent!="undefined"&&"IFrameWorker"in parent){let n=document.querySelector("script[src]"),[i]=n.src.split("/worker");e=e.replace("..",i)}let r=[];for(let n of t.lang){switch(n){case"ja":r.push(`${e}/tinyseg.js`);break;case"hi":case"th":r.push(`${e}/wordcut.js`);break}n!=="en"&&r.push(`${e}/min/lunr.${n}.min.js`)}t.lang.length>1&&r.push(`${e}/min/lunr.multi.min.js`),r.length&&(yield importScripts(`${e}/min/lunr.stemmer.support.min.js`,...r))})}function Te(t){return z(this,null,function*(){switch(t.type){case 0:return yield ke(t.data.config),Y=new U(t.data),{type:1};case 2:return{type:3,data:Y?Y.search(t.data):{items:[]}};default:throw new TypeError("Invalid message type")}})}self.lunr=le.default;addEventListener("message",t=>z(void 0,null,function*(){postMessage(yield Te(t.data))}));})(); +//# sourceMappingURL=search.b97dbffb.min.js.map + diff --git a/assets/javascripts/workers/search.b97dbffb.min.js.map b/assets/javascripts/workers/search.b97dbffb.min.js.map new file mode 100644 index 00000000..5764b1b3 --- /dev/null +++ b/assets/javascripts/workers/search.b97dbffb.min.js.map @@ -0,0 +1,8 @@ +{ + "version": 3, + "sources": ["node_modules/lunr/lunr.js", "node_modules/escape-html/index.js", "src/assets/javascripts/integrations/search/worker/main/index.ts", "src/assets/javascripts/polyfills/index.ts", "src/assets/javascripts/integrations/search/document/index.ts", "src/assets/javascripts/integrations/search/highlighter/index.ts", "src/assets/javascripts/integrations/search/query/_/index.ts", "src/assets/javascripts/integrations/search/_/index.ts"], + "sourceRoot": "../../../..", + "sourcesContent": ["/**\n * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9\n * Copyright (C) 2020 Oliver Nightingale\n * @license MIT\n */\n\n;(function(){\n\n/**\n * A convenience function for configuring and constructing\n * a new lunr Index.\n *\n * A lunr.Builder instance is created and the pipeline setup\n * with a trimmer, stop word filter and stemmer.\n *\n * This builder object is yielded to the configuration function\n * that is passed as a parameter, allowing the list of fields\n * and other builder parameters to be customised.\n *\n * All documents _must_ be added within the passed config function.\n *\n * @example\n * var idx = lunr(function () {\n * this.field('title')\n * this.field('body')\n * this.ref('id')\n *\n * documents.forEach(function (doc) {\n * this.add(doc)\n * }, this)\n * })\n *\n * @see {@link lunr.Builder}\n * @see {@link lunr.Pipeline}\n * @see {@link lunr.trimmer}\n * @see {@link lunr.stopWordFilter}\n * @see {@link lunr.stemmer}\n * @namespace {function} lunr\n */\nvar lunr = function (config) {\n var builder = new lunr.Builder\n\n builder.pipeline.add(\n lunr.trimmer,\n lunr.stopWordFilter,\n lunr.stemmer\n )\n\n builder.searchPipeline.add(\n lunr.stemmer\n )\n\n config.call(builder, builder)\n return builder.build()\n}\n\nlunr.version = \"2.3.9\"\n/*!\n * lunr.utils\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A namespace containing utils for the rest of the lunr library\n * @namespace lunr.utils\n */\nlunr.utils = {}\n\n/**\n * Print a warning message to the console.\n *\n * @param {String} message The message to be printed.\n * @memberOf lunr.utils\n * @function\n */\nlunr.utils.warn = (function (global) {\n /* eslint-disable no-console */\n return function (message) {\n if (global.console && console.warn) {\n console.warn(message)\n }\n }\n /* eslint-enable no-console */\n})(this)\n\n/**\n * Convert an object to a string.\n *\n * In the case of `null` and `undefined` the function returns\n * the empty string, in all other cases the result of calling\n * `toString` on the passed object is returned.\n *\n * @param {Any} obj The object to convert to a string.\n * @return {String} string representation of the passed object.\n * @memberOf lunr.utils\n */\nlunr.utils.asString = function (obj) {\n if (obj === void 0 || obj === null) {\n return \"\"\n } else {\n return obj.toString()\n }\n}\n\n/**\n * Clones an object.\n *\n * Will create a copy of an existing object such that any mutations\n * on the copy cannot affect the original.\n *\n * Only shallow objects are supported, passing a nested object to this\n * function will cause a TypeError.\n *\n * Objects with primitives, and arrays of primitives are supported.\n *\n * @param {Object} obj The object to clone.\n * @return {Object} a clone of the passed object.\n * @throws {TypeError} when a nested object is passed.\n * @memberOf Utils\n */\nlunr.utils.clone = function (obj) {\n if (obj === null || obj === undefined) {\n return obj\n }\n\n var clone = Object.create(null),\n keys = Object.keys(obj)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i],\n val = obj[key]\n\n if (Array.isArray(val)) {\n clone[key] = val.slice()\n continue\n }\n\n if (typeof val === 'string' ||\n typeof val === 'number' ||\n typeof val === 'boolean') {\n clone[key] = val\n continue\n }\n\n throw new TypeError(\"clone is not deep and does not support nested objects\")\n }\n\n return clone\n}\nlunr.FieldRef = function (docRef, fieldName, stringValue) {\n this.docRef = docRef\n this.fieldName = fieldName\n this._stringValue = stringValue\n}\n\nlunr.FieldRef.joiner = \"/\"\n\nlunr.FieldRef.fromString = function (s) {\n var n = s.indexOf(lunr.FieldRef.joiner)\n\n if (n === -1) {\n throw \"malformed field ref string\"\n }\n\n var fieldRef = s.slice(0, n),\n docRef = s.slice(n + 1)\n\n return new lunr.FieldRef (docRef, fieldRef, s)\n}\n\nlunr.FieldRef.prototype.toString = function () {\n if (this._stringValue == undefined) {\n this._stringValue = this.fieldName + lunr.FieldRef.joiner + this.docRef\n }\n\n return this._stringValue\n}\n/*!\n * lunr.Set\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A lunr set.\n *\n * @constructor\n */\nlunr.Set = function (elements) {\n this.elements = Object.create(null)\n\n if (elements) {\n this.length = elements.length\n\n for (var i = 0; i < this.length; i++) {\n this.elements[elements[i]] = true\n }\n } else {\n this.length = 0\n }\n}\n\n/**\n * A complete set that contains all elements.\n *\n * @static\n * @readonly\n * @type {lunr.Set}\n */\nlunr.Set.complete = {\n intersect: function (other) {\n return other\n },\n\n union: function () {\n return this\n },\n\n contains: function () {\n return true\n }\n}\n\n/**\n * An empty set that contains no elements.\n *\n * @static\n * @readonly\n * @type {lunr.Set}\n */\nlunr.Set.empty = {\n intersect: function () {\n return this\n },\n\n union: function (other) {\n return other\n },\n\n contains: function () {\n return false\n }\n}\n\n/**\n * Returns true if this set contains the specified object.\n *\n * @param {object} object - Object whose presence in this set is to be tested.\n * @returns {boolean} - True if this set contains the specified object.\n */\nlunr.Set.prototype.contains = function (object) {\n return !!this.elements[object]\n}\n\n/**\n * Returns a new set containing only the elements that are present in both\n * this set and the specified set.\n *\n * @param {lunr.Set} other - set to intersect with this set.\n * @returns {lunr.Set} a new set that is the intersection of this and the specified set.\n */\n\nlunr.Set.prototype.intersect = function (other) {\n var a, b, elements, intersection = []\n\n if (other === lunr.Set.complete) {\n return this\n }\n\n if (other === lunr.Set.empty) {\n return other\n }\n\n if (this.length < other.length) {\n a = this\n b = other\n } else {\n a = other\n b = this\n }\n\n elements = Object.keys(a.elements)\n\n for (var i = 0; i < elements.length; i++) {\n var element = elements[i]\n if (element in b.elements) {\n intersection.push(element)\n }\n }\n\n return new lunr.Set (intersection)\n}\n\n/**\n * Returns a new set combining the elements of this and the specified set.\n *\n * @param {lunr.Set} other - set to union with this set.\n * @return {lunr.Set} a new set that is the union of this and the specified set.\n */\n\nlunr.Set.prototype.union = function (other) {\n if (other === lunr.Set.complete) {\n return lunr.Set.complete\n }\n\n if (other === lunr.Set.empty) {\n return this\n }\n\n return new lunr.Set(Object.keys(this.elements).concat(Object.keys(other.elements)))\n}\n/**\n * A function to calculate the inverse document frequency for\n * a posting. This is shared between the builder and the index\n *\n * @private\n * @param {object} posting - The posting for a given term\n * @param {number} documentCount - The total number of documents.\n */\nlunr.idf = function (posting, documentCount) {\n var documentsWithTerm = 0\n\n for (var fieldName in posting) {\n if (fieldName == '_index') continue // Ignore the term index, its not a field\n documentsWithTerm += Object.keys(posting[fieldName]).length\n }\n\n var x = (documentCount - documentsWithTerm + 0.5) / (documentsWithTerm + 0.5)\n\n return Math.log(1 + Math.abs(x))\n}\n\n/**\n * A token wraps a string representation of a token\n * as it is passed through the text processing pipeline.\n *\n * @constructor\n * @param {string} [str=''] - The string token being wrapped.\n * @param {object} [metadata={}] - Metadata associated with this token.\n */\nlunr.Token = function (str, metadata) {\n this.str = str || \"\"\n this.metadata = metadata || {}\n}\n\n/**\n * Returns the token string that is being wrapped by this object.\n *\n * @returns {string}\n */\nlunr.Token.prototype.toString = function () {\n return this.str\n}\n\n/**\n * A token update function is used when updating or optionally\n * when cloning a token.\n *\n * @callback lunr.Token~updateFunction\n * @param {string} str - The string representation of the token.\n * @param {Object} metadata - All metadata associated with this token.\n */\n\n/**\n * Applies the given function to the wrapped string token.\n *\n * @example\n * token.update(function (str, metadata) {\n * return str.toUpperCase()\n * })\n *\n * @param {lunr.Token~updateFunction} fn - A function to apply to the token string.\n * @returns {lunr.Token}\n */\nlunr.Token.prototype.update = function (fn) {\n this.str = fn(this.str, this.metadata)\n return this\n}\n\n/**\n * Creates a clone of this token. Optionally a function can be\n * applied to the cloned token.\n *\n * @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token.\n * @returns {lunr.Token}\n */\nlunr.Token.prototype.clone = function (fn) {\n fn = fn || function (s) { return s }\n return new lunr.Token (fn(this.str, this.metadata), this.metadata)\n}\n/*!\n * lunr.tokenizer\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A function for splitting a string into tokens ready to be inserted into\n * the search index. Uses `lunr.tokenizer.separator` to split strings, change\n * the value of this property to change how strings are split into tokens.\n *\n * This tokenizer will convert its parameter to a string by calling `toString` and\n * then will split this string on the character in `lunr.tokenizer.separator`.\n * Arrays will have their elements converted to strings and wrapped in a lunr.Token.\n *\n * Optional metadata can be passed to the tokenizer, this metadata will be cloned and\n * added as metadata to every token that is created from the object to be tokenized.\n *\n * @static\n * @param {?(string|object|object[])} obj - The object to convert into tokens\n * @param {?object} metadata - Optional metadata to associate with every token\n * @returns {lunr.Token[]}\n * @see {@link lunr.Pipeline}\n */\nlunr.tokenizer = function (obj, metadata) {\n if (obj == null || obj == undefined) {\n return []\n }\n\n if (Array.isArray(obj)) {\n return obj.map(function (t) {\n return new lunr.Token(\n lunr.utils.asString(t).toLowerCase(),\n lunr.utils.clone(metadata)\n )\n })\n }\n\n var str = obj.toString().toLowerCase(),\n len = str.length,\n tokens = []\n\n for (var sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) {\n var char = str.charAt(sliceEnd),\n sliceLength = sliceEnd - sliceStart\n\n if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) {\n\n if (sliceLength > 0) {\n var tokenMetadata = lunr.utils.clone(metadata) || {}\n tokenMetadata[\"position\"] = [sliceStart, sliceLength]\n tokenMetadata[\"index\"] = tokens.length\n\n tokens.push(\n new lunr.Token (\n str.slice(sliceStart, sliceEnd),\n tokenMetadata\n )\n )\n }\n\n sliceStart = sliceEnd + 1\n }\n\n }\n\n return tokens\n}\n\n/**\n * The separator used to split a string into tokens. Override this property to change the behaviour of\n * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens.\n *\n * @static\n * @see lunr.tokenizer\n */\nlunr.tokenizer.separator = /[\\s\\-]+/\n/*!\n * lunr.Pipeline\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.Pipelines maintain an ordered list of functions to be applied to all\n * tokens in documents entering the search index and queries being ran against\n * the index.\n *\n * An instance of lunr.Index created with the lunr shortcut will contain a\n * pipeline with a stop word filter and an English language stemmer. Extra\n * functions can be added before or after either of these functions or these\n * default functions can be removed.\n *\n * When run the pipeline will call each function in turn, passing a token, the\n * index of that token in the original list of all tokens and finally a list of\n * all the original tokens.\n *\n * The output of functions in the pipeline will be passed to the next function\n * in the pipeline. To exclude a token from entering the index the function\n * should return undefined, the rest of the pipeline will not be called with\n * this token.\n *\n * For serialisation of pipelines to work, all functions used in an instance of\n * a pipeline should be registered with lunr.Pipeline. Registered functions can\n * then be loaded. If trying to load a serialised pipeline that uses functions\n * that are not registered an error will be thrown.\n *\n * If not planning on serialising the pipeline then registering pipeline functions\n * is not necessary.\n *\n * @constructor\n */\nlunr.Pipeline = function () {\n this._stack = []\n}\n\nlunr.Pipeline.registeredFunctions = Object.create(null)\n\n/**\n * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token\n * string as well as all known metadata. A pipeline function can mutate the token string\n * or mutate (or add) metadata for a given token.\n *\n * A pipeline function can indicate that the passed token should be discarded by returning\n * null, undefined or an empty string. This token will not be passed to any downstream pipeline\n * functions and will not be added to the index.\n *\n * Multiple tokens can be returned by returning an array of tokens. Each token will be passed\n * to any downstream pipeline functions and all will returned tokens will be added to the index.\n *\n * Any number of pipeline functions may be chained together using a lunr.Pipeline.\n *\n * @interface lunr.PipelineFunction\n * @param {lunr.Token} token - A token from the document being processed.\n * @param {number} i - The index of this token in the complete list of tokens for this document/field.\n * @param {lunr.Token[]} tokens - All tokens for this document/field.\n * @returns {(?lunr.Token|lunr.Token[])}\n */\n\n/**\n * Register a function with the pipeline.\n *\n * Functions that are used in the pipeline should be registered if the pipeline\n * needs to be serialised, or a serialised pipeline needs to be loaded.\n *\n * Registering a function does not add it to a pipeline, functions must still be\n * added to instances of the pipeline for them to be used when running a pipeline.\n *\n * @param {lunr.PipelineFunction} fn - The function to check for.\n * @param {String} label - The label to register this function with\n */\nlunr.Pipeline.registerFunction = function (fn, label) {\n if (label in this.registeredFunctions) {\n lunr.utils.warn('Overwriting existing registered function: ' + label)\n }\n\n fn.label = label\n lunr.Pipeline.registeredFunctions[fn.label] = fn\n}\n\n/**\n * Warns if the function is not registered as a Pipeline function.\n *\n * @param {lunr.PipelineFunction} fn - The function to check for.\n * @private\n */\nlunr.Pipeline.warnIfFunctionNotRegistered = function (fn) {\n var isRegistered = fn.label && (fn.label in this.registeredFunctions)\n\n if (!isRegistered) {\n lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\\n', fn)\n }\n}\n\n/**\n * Loads a previously serialised pipeline.\n *\n * All functions to be loaded must already be registered with lunr.Pipeline.\n * If any function from the serialised data has not been registered then an\n * error will be thrown.\n *\n * @param {Object} serialised - The serialised pipeline to load.\n * @returns {lunr.Pipeline}\n */\nlunr.Pipeline.load = function (serialised) {\n var pipeline = new lunr.Pipeline\n\n serialised.forEach(function (fnName) {\n var fn = lunr.Pipeline.registeredFunctions[fnName]\n\n if (fn) {\n pipeline.add(fn)\n } else {\n throw new Error('Cannot load unregistered function: ' + fnName)\n }\n })\n\n return pipeline\n}\n\n/**\n * Adds new functions to the end of the pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline.\n */\nlunr.Pipeline.prototype.add = function () {\n var fns = Array.prototype.slice.call(arguments)\n\n fns.forEach(function (fn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(fn)\n this._stack.push(fn)\n }, this)\n}\n\n/**\n * Adds a single function after a function that already exists in the\n * pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.\n * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.\n */\nlunr.Pipeline.prototype.after = function (existingFn, newFn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(newFn)\n\n var pos = this._stack.indexOf(existingFn)\n if (pos == -1) {\n throw new Error('Cannot find existingFn')\n }\n\n pos = pos + 1\n this._stack.splice(pos, 0, newFn)\n}\n\n/**\n * Adds a single function before a function that already exists in the\n * pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.\n * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.\n */\nlunr.Pipeline.prototype.before = function (existingFn, newFn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(newFn)\n\n var pos = this._stack.indexOf(existingFn)\n if (pos == -1) {\n throw new Error('Cannot find existingFn')\n }\n\n this._stack.splice(pos, 0, newFn)\n}\n\n/**\n * Removes a function from the pipeline.\n *\n * @param {lunr.PipelineFunction} fn The function to remove from the pipeline.\n */\nlunr.Pipeline.prototype.remove = function (fn) {\n var pos = this._stack.indexOf(fn)\n if (pos == -1) {\n return\n }\n\n this._stack.splice(pos, 1)\n}\n\n/**\n * Runs the current list of functions that make up the pipeline against the\n * passed tokens.\n *\n * @param {Array} tokens The tokens to run through the pipeline.\n * @returns {Array}\n */\nlunr.Pipeline.prototype.run = function (tokens) {\n var stackLength = this._stack.length\n\n for (var i = 0; i < stackLength; i++) {\n var fn = this._stack[i]\n var memo = []\n\n for (var j = 0; j < tokens.length; j++) {\n var result = fn(tokens[j], j, tokens)\n\n if (result === null || result === void 0 || result === '') continue\n\n if (Array.isArray(result)) {\n for (var k = 0; k < result.length; k++) {\n memo.push(result[k])\n }\n } else {\n memo.push(result)\n }\n }\n\n tokens = memo\n }\n\n return tokens\n}\n\n/**\n * Convenience method for passing a string through a pipeline and getting\n * strings out. This method takes care of wrapping the passed string in a\n * token and mapping the resulting tokens back to strings.\n *\n * @param {string} str - The string to pass through the pipeline.\n * @param {?object} metadata - Optional metadata to associate with the token\n * passed to the pipeline.\n * @returns {string[]}\n */\nlunr.Pipeline.prototype.runString = function (str, metadata) {\n var token = new lunr.Token (str, metadata)\n\n return this.run([token]).map(function (t) {\n return t.toString()\n })\n}\n\n/**\n * Resets the pipeline by removing any existing processors.\n *\n */\nlunr.Pipeline.prototype.reset = function () {\n this._stack = []\n}\n\n/**\n * Returns a representation of the pipeline ready for serialisation.\n *\n * Logs a warning if the function has not been registered.\n *\n * @returns {Array}\n */\nlunr.Pipeline.prototype.toJSON = function () {\n return this._stack.map(function (fn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(fn)\n\n return fn.label\n })\n}\n/*!\n * lunr.Vector\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A vector is used to construct the vector space of documents and queries. These\n * vectors support operations to determine the similarity between two documents or\n * a document and a query.\n *\n * Normally no parameters are required for initializing a vector, but in the case of\n * loading a previously dumped vector the raw elements can be provided to the constructor.\n *\n * For performance reasons vectors are implemented with a flat array, where an elements\n * index is immediately followed by its value. E.g. [index, value, index, value]. This\n * allows the underlying array to be as sparse as possible and still offer decent\n * performance when being used for vector calculations.\n *\n * @constructor\n * @param {Number[]} [elements] - The flat list of element index and element value pairs.\n */\nlunr.Vector = function (elements) {\n this._magnitude = 0\n this.elements = elements || []\n}\n\n\n/**\n * Calculates the position within the vector to insert a given index.\n *\n * This is used internally by insert and upsert. If there are duplicate indexes then\n * the position is returned as if the value for that index were to be updated, but it\n * is the callers responsibility to check whether there is a duplicate at that index\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @returns {Number}\n */\nlunr.Vector.prototype.positionForIndex = function (index) {\n // For an empty vector the tuple can be inserted at the beginning\n if (this.elements.length == 0) {\n return 0\n }\n\n var start = 0,\n end = this.elements.length / 2,\n sliceLength = end - start,\n pivotPoint = Math.floor(sliceLength / 2),\n pivotIndex = this.elements[pivotPoint * 2]\n\n while (sliceLength > 1) {\n if (pivotIndex < index) {\n start = pivotPoint\n }\n\n if (pivotIndex > index) {\n end = pivotPoint\n }\n\n if (pivotIndex == index) {\n break\n }\n\n sliceLength = end - start\n pivotPoint = start + Math.floor(sliceLength / 2)\n pivotIndex = this.elements[pivotPoint * 2]\n }\n\n if (pivotIndex == index) {\n return pivotPoint * 2\n }\n\n if (pivotIndex > index) {\n return pivotPoint * 2\n }\n\n if (pivotIndex < index) {\n return (pivotPoint + 1) * 2\n }\n}\n\n/**\n * Inserts an element at an index within the vector.\n *\n * Does not allow duplicates, will throw an error if there is already an entry\n * for this index.\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @param {Number} val - The value to be inserted into the vector.\n */\nlunr.Vector.prototype.insert = function (insertIdx, val) {\n this.upsert(insertIdx, val, function () {\n throw \"duplicate index\"\n })\n}\n\n/**\n * Inserts or updates an existing index within the vector.\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @param {Number} val - The value to be inserted into the vector.\n * @param {function} fn - A function that is called for updates, the existing value and the\n * requested value are passed as arguments\n */\nlunr.Vector.prototype.upsert = function (insertIdx, val, fn) {\n this._magnitude = 0\n var position = this.positionForIndex(insertIdx)\n\n if (this.elements[position] == insertIdx) {\n this.elements[position + 1] = fn(this.elements[position + 1], val)\n } else {\n this.elements.splice(position, 0, insertIdx, val)\n }\n}\n\n/**\n * Calculates the magnitude of this vector.\n *\n * @returns {Number}\n */\nlunr.Vector.prototype.magnitude = function () {\n if (this._magnitude) return this._magnitude\n\n var sumOfSquares = 0,\n elementsLength = this.elements.length\n\n for (var i = 1; i < elementsLength; i += 2) {\n var val = this.elements[i]\n sumOfSquares += val * val\n }\n\n return this._magnitude = Math.sqrt(sumOfSquares)\n}\n\n/**\n * Calculates the dot product of this vector and another vector.\n *\n * @param {lunr.Vector} otherVector - The vector to compute the dot product with.\n * @returns {Number}\n */\nlunr.Vector.prototype.dot = function (otherVector) {\n var dotProduct = 0,\n a = this.elements, b = otherVector.elements,\n aLen = a.length, bLen = b.length,\n aVal = 0, bVal = 0,\n i = 0, j = 0\n\n while (i < aLen && j < bLen) {\n aVal = a[i], bVal = b[j]\n if (aVal < bVal) {\n i += 2\n } else if (aVal > bVal) {\n j += 2\n } else if (aVal == bVal) {\n dotProduct += a[i + 1] * b[j + 1]\n i += 2\n j += 2\n }\n }\n\n return dotProduct\n}\n\n/**\n * Calculates the similarity between this vector and another vector.\n *\n * @param {lunr.Vector} otherVector - The other vector to calculate the\n * similarity with.\n * @returns {Number}\n */\nlunr.Vector.prototype.similarity = function (otherVector) {\n return this.dot(otherVector) / this.magnitude() || 0\n}\n\n/**\n * Converts the vector to an array of the elements within the vector.\n *\n * @returns {Number[]}\n */\nlunr.Vector.prototype.toArray = function () {\n var output = new Array (this.elements.length / 2)\n\n for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) {\n output[j] = this.elements[i]\n }\n\n return output\n}\n\n/**\n * A JSON serializable representation of the vector.\n *\n * @returns {Number[]}\n */\nlunr.Vector.prototype.toJSON = function () {\n return this.elements\n}\n/* eslint-disable */\n/*!\n * lunr.stemmer\n * Copyright (C) 2020 Oliver Nightingale\n * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt\n */\n\n/**\n * lunr.stemmer is an english language stemmer, this is a JavaScript\n * implementation of the PorterStemmer taken from http://tartarus.org/~martin\n *\n * @static\n * @implements {lunr.PipelineFunction}\n * @param {lunr.Token} token - The string to stem\n * @returns {lunr.Token}\n * @see {@link lunr.Pipeline}\n * @function\n */\nlunr.stemmer = (function(){\n var step2list = {\n \"ational\" : \"ate\",\n \"tional\" : \"tion\",\n \"enci\" : \"ence\",\n \"anci\" : \"ance\",\n \"izer\" : \"ize\",\n \"bli\" : \"ble\",\n \"alli\" : \"al\",\n \"entli\" : \"ent\",\n \"eli\" : \"e\",\n \"ousli\" : \"ous\",\n \"ization\" : \"ize\",\n \"ation\" : \"ate\",\n \"ator\" : \"ate\",\n \"alism\" : \"al\",\n \"iveness\" : \"ive\",\n \"fulness\" : \"ful\",\n \"ousness\" : \"ous\",\n \"aliti\" : \"al\",\n \"iviti\" : \"ive\",\n \"biliti\" : \"ble\",\n \"logi\" : \"log\"\n },\n\n step3list = {\n \"icate\" : \"ic\",\n \"ative\" : \"\",\n \"alize\" : \"al\",\n \"iciti\" : \"ic\",\n \"ical\" : \"ic\",\n \"ful\" : \"\",\n \"ness\" : \"\"\n },\n\n c = \"[^aeiou]\", // consonant\n v = \"[aeiouy]\", // vowel\n C = c + \"[^aeiouy]*\", // consonant sequence\n V = v + \"[aeiou]*\", // vowel sequence\n\n mgr0 = \"^(\" + C + \")?\" + V + C, // [C]VC... is m>0\n meq1 = \"^(\" + C + \")?\" + V + C + \"(\" + V + \")?$\", // [C]VC[V] is m=1\n mgr1 = \"^(\" + C + \")?\" + V + C + V + C, // [C]VCVC... is m>1\n s_v = \"^(\" + C + \")?\" + v; // vowel in stem\n\n var re_mgr0 = new RegExp(mgr0);\n var re_mgr1 = new RegExp(mgr1);\n var re_meq1 = new RegExp(meq1);\n var re_s_v = new RegExp(s_v);\n\n var re_1a = /^(.+?)(ss|i)es$/;\n var re2_1a = /^(.+?)([^s])s$/;\n var re_1b = /^(.+?)eed$/;\n var re2_1b = /^(.+?)(ed|ing)$/;\n var re_1b_2 = /.$/;\n var re2_1b_2 = /(at|bl|iz)$/;\n var re3_1b_2 = new RegExp(\"([^aeiouylsz])\\\\1$\");\n var re4_1b_2 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n\n var re_1c = /^(.+?[^aeiou])y$/;\n var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;\n\n var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;\n\n var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;\n var re2_4 = /^(.+?)(s|t)(ion)$/;\n\n var re_5 = /^(.+?)e$/;\n var re_5_1 = /ll$/;\n var re3_5 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n\n var porterStemmer = function porterStemmer(w) {\n var stem,\n suffix,\n firstch,\n re,\n re2,\n re3,\n re4;\n\n if (w.length < 3) { return w; }\n\n firstch = w.substr(0,1);\n if (firstch == \"y\") {\n w = firstch.toUpperCase() + w.substr(1);\n }\n\n // Step 1a\n re = re_1a\n re2 = re2_1a;\n\n if (re.test(w)) { w = w.replace(re,\"$1$2\"); }\n else if (re2.test(w)) { w = w.replace(re2,\"$1$2\"); }\n\n // Step 1b\n re = re_1b;\n re2 = re2_1b;\n if (re.test(w)) {\n var fp = re.exec(w);\n re = re_mgr0;\n if (re.test(fp[1])) {\n re = re_1b_2;\n w = w.replace(re,\"\");\n }\n } else if (re2.test(w)) {\n var fp = re2.exec(w);\n stem = fp[1];\n re2 = re_s_v;\n if (re2.test(stem)) {\n w = stem;\n re2 = re2_1b_2;\n re3 = re3_1b_2;\n re4 = re4_1b_2;\n if (re2.test(w)) { w = w + \"e\"; }\n else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,\"\"); }\n else if (re4.test(w)) { w = w + \"e\"; }\n }\n }\n\n // Step 1c - replace suffix y or Y by i if preceded by a non-vowel which is not the first letter of the word (so cry -> cri, by -> by, say -> say)\n re = re_1c;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n w = stem + \"i\";\n }\n\n // Step 2\n re = re_2;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n suffix = fp[2];\n re = re_mgr0;\n if (re.test(stem)) {\n w = stem + step2list[suffix];\n }\n }\n\n // Step 3\n re = re_3;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n suffix = fp[2];\n re = re_mgr0;\n if (re.test(stem)) {\n w = stem + step3list[suffix];\n }\n }\n\n // Step 4\n re = re_4;\n re2 = re2_4;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n re = re_mgr1;\n if (re.test(stem)) {\n w = stem;\n }\n } else if (re2.test(w)) {\n var fp = re2.exec(w);\n stem = fp[1] + fp[2];\n re2 = re_mgr1;\n if (re2.test(stem)) {\n w = stem;\n }\n }\n\n // Step 5\n re = re_5;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n re = re_mgr1;\n re2 = re_meq1;\n re3 = re3_5;\n if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) {\n w = stem;\n }\n }\n\n re = re_5_1;\n re2 = re_mgr1;\n if (re.test(w) && re2.test(w)) {\n re = re_1b_2;\n w = w.replace(re,\"\");\n }\n\n // and turn initial Y back to y\n\n if (firstch == \"y\") {\n w = firstch.toLowerCase() + w.substr(1);\n }\n\n return w;\n };\n\n return function (token) {\n return token.update(porterStemmer);\n }\n})();\n\nlunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer')\n/*!\n * lunr.stopWordFilter\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.generateStopWordFilter builds a stopWordFilter function from the provided\n * list of stop words.\n *\n * The built in lunr.stopWordFilter is built using this generator and can be used\n * to generate custom stopWordFilters for applications or non English languages.\n *\n * @function\n * @param {Array} token The token to pass through the filter\n * @returns {lunr.PipelineFunction}\n * @see lunr.Pipeline\n * @see lunr.stopWordFilter\n */\nlunr.generateStopWordFilter = function (stopWords) {\n var words = stopWords.reduce(function (memo, stopWord) {\n memo[stopWord] = stopWord\n return memo\n }, {})\n\n return function (token) {\n if (token && words[token.toString()] !== token.toString()) return token\n }\n}\n\n/**\n * lunr.stopWordFilter is an English language stop word list filter, any words\n * contained in the list will not be passed through the filter.\n *\n * This is intended to be used in the Pipeline. If the token does not pass the\n * filter then undefined will be returned.\n *\n * @function\n * @implements {lunr.PipelineFunction}\n * @params {lunr.Token} token - A token to check for being a stop word.\n * @returns {lunr.Token}\n * @see {@link lunr.Pipeline}\n */\nlunr.stopWordFilter = lunr.generateStopWordFilter([\n 'a',\n 'able',\n 'about',\n 'across',\n 'after',\n 'all',\n 'almost',\n 'also',\n 'am',\n 'among',\n 'an',\n 'and',\n 'any',\n 'are',\n 'as',\n 'at',\n 'be',\n 'because',\n 'been',\n 'but',\n 'by',\n 'can',\n 'cannot',\n 'could',\n 'dear',\n 'did',\n 'do',\n 'does',\n 'either',\n 'else',\n 'ever',\n 'every',\n 'for',\n 'from',\n 'get',\n 'got',\n 'had',\n 'has',\n 'have',\n 'he',\n 'her',\n 'hers',\n 'him',\n 'his',\n 'how',\n 'however',\n 'i',\n 'if',\n 'in',\n 'into',\n 'is',\n 'it',\n 'its',\n 'just',\n 'least',\n 'let',\n 'like',\n 'likely',\n 'may',\n 'me',\n 'might',\n 'most',\n 'must',\n 'my',\n 'neither',\n 'no',\n 'nor',\n 'not',\n 'of',\n 'off',\n 'often',\n 'on',\n 'only',\n 'or',\n 'other',\n 'our',\n 'own',\n 'rather',\n 'said',\n 'say',\n 'says',\n 'she',\n 'should',\n 'since',\n 'so',\n 'some',\n 'than',\n 'that',\n 'the',\n 'their',\n 'them',\n 'then',\n 'there',\n 'these',\n 'they',\n 'this',\n 'tis',\n 'to',\n 'too',\n 'twas',\n 'us',\n 'wants',\n 'was',\n 'we',\n 'were',\n 'what',\n 'when',\n 'where',\n 'which',\n 'while',\n 'who',\n 'whom',\n 'why',\n 'will',\n 'with',\n 'would',\n 'yet',\n 'you',\n 'your'\n])\n\nlunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter')\n/*!\n * lunr.trimmer\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.trimmer is a pipeline function for trimming non word\n * characters from the beginning and end of tokens before they\n * enter the index.\n *\n * This implementation may not work correctly for non latin\n * characters and should either be removed or adapted for use\n * with languages with non-latin characters.\n *\n * @static\n * @implements {lunr.PipelineFunction}\n * @param {lunr.Token} token The token to pass through the filter\n * @returns {lunr.Token}\n * @see lunr.Pipeline\n */\nlunr.trimmer = function (token) {\n return token.update(function (s) {\n return s.replace(/^\\W+/, '').replace(/\\W+$/, '')\n })\n}\n\nlunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer')\n/*!\n * lunr.TokenSet\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A token set is used to store the unique list of all tokens\n * within an index. Token sets are also used to represent an\n * incoming query to the index, this query token set and index\n * token set are then intersected to find which tokens to look\n * up in the inverted index.\n *\n * A token set can hold multiple tokens, as in the case of the\n * index token set, or it can hold a single token as in the\n * case of a simple query token set.\n *\n * Additionally token sets are used to perform wildcard matching.\n * Leading, contained and trailing wildcards are supported, and\n * from this edit distance matching can also be provided.\n *\n * Token sets are implemented as a minimal finite state automata,\n * where both common prefixes and suffixes are shared between tokens.\n * This helps to reduce the space used for storing the token set.\n *\n * @constructor\n */\nlunr.TokenSet = function () {\n this.final = false\n this.edges = {}\n this.id = lunr.TokenSet._nextId\n lunr.TokenSet._nextId += 1\n}\n\n/**\n * Keeps track of the next, auto increment, identifier to assign\n * to a new tokenSet.\n *\n * TokenSets require a unique identifier to be correctly minimised.\n *\n * @private\n */\nlunr.TokenSet._nextId = 1\n\n/**\n * Creates a TokenSet instance from the given sorted array of words.\n *\n * @param {String[]} arr - A sorted array of strings to create the set from.\n * @returns {lunr.TokenSet}\n * @throws Will throw an error if the input array is not sorted.\n */\nlunr.TokenSet.fromArray = function (arr) {\n var builder = new lunr.TokenSet.Builder\n\n for (var i = 0, len = arr.length; i < len; i++) {\n builder.insert(arr[i])\n }\n\n builder.finish()\n return builder.root\n}\n\n/**\n * Creates a token set from a query clause.\n *\n * @private\n * @param {Object} clause - A single clause from lunr.Query.\n * @param {string} clause.term - The query clause term.\n * @param {number} [clause.editDistance] - The optional edit distance for the term.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.fromClause = function (clause) {\n if ('editDistance' in clause) {\n return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance)\n } else {\n return lunr.TokenSet.fromString(clause.term)\n }\n}\n\n/**\n * Creates a token set representing a single string with a specified\n * edit distance.\n *\n * Insertions, deletions, substitutions and transpositions are each\n * treated as an edit distance of 1.\n *\n * Increasing the allowed edit distance will have a dramatic impact\n * on the performance of both creating and intersecting these TokenSets.\n * It is advised to keep the edit distance less than 3.\n *\n * @param {string} str - The string to create the token set from.\n * @param {number} editDistance - The allowed edit distance to match.\n * @returns {lunr.Vector}\n */\nlunr.TokenSet.fromFuzzyString = function (str, editDistance) {\n var root = new lunr.TokenSet\n\n var stack = [{\n node: root,\n editsRemaining: editDistance,\n str: str\n }]\n\n while (stack.length) {\n var frame = stack.pop()\n\n // no edit\n if (frame.str.length > 0) {\n var char = frame.str.charAt(0),\n noEditNode\n\n if (char in frame.node.edges) {\n noEditNode = frame.node.edges[char]\n } else {\n noEditNode = new lunr.TokenSet\n frame.node.edges[char] = noEditNode\n }\n\n if (frame.str.length == 1) {\n noEditNode.final = true\n }\n\n stack.push({\n node: noEditNode,\n editsRemaining: frame.editsRemaining,\n str: frame.str.slice(1)\n })\n }\n\n if (frame.editsRemaining == 0) {\n continue\n }\n\n // insertion\n if (\"*\" in frame.node.edges) {\n var insertionNode = frame.node.edges[\"*\"]\n } else {\n var insertionNode = new lunr.TokenSet\n frame.node.edges[\"*\"] = insertionNode\n }\n\n if (frame.str.length == 0) {\n insertionNode.final = true\n }\n\n stack.push({\n node: insertionNode,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str\n })\n\n // deletion\n // can only do a deletion if we have enough edits remaining\n // and if there are characters left to delete in the string\n if (frame.str.length > 1) {\n stack.push({\n node: frame.node,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str.slice(1)\n })\n }\n\n // deletion\n // just removing the last character from the str\n if (frame.str.length == 1) {\n frame.node.final = true\n }\n\n // substitution\n // can only do a substitution if we have enough edits remaining\n // and if there are characters left to substitute\n if (frame.str.length >= 1) {\n if (\"*\" in frame.node.edges) {\n var substitutionNode = frame.node.edges[\"*\"]\n } else {\n var substitutionNode = new lunr.TokenSet\n frame.node.edges[\"*\"] = substitutionNode\n }\n\n if (frame.str.length == 1) {\n substitutionNode.final = true\n }\n\n stack.push({\n node: substitutionNode,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str.slice(1)\n })\n }\n\n // transposition\n // can only do a transposition if there are edits remaining\n // and there are enough characters to transpose\n if (frame.str.length > 1) {\n var charA = frame.str.charAt(0),\n charB = frame.str.charAt(1),\n transposeNode\n\n if (charB in frame.node.edges) {\n transposeNode = frame.node.edges[charB]\n } else {\n transposeNode = new lunr.TokenSet\n frame.node.edges[charB] = transposeNode\n }\n\n if (frame.str.length == 1) {\n transposeNode.final = true\n }\n\n stack.push({\n node: transposeNode,\n editsRemaining: frame.editsRemaining - 1,\n str: charA + frame.str.slice(2)\n })\n }\n }\n\n return root\n}\n\n/**\n * Creates a TokenSet from a string.\n *\n * The string may contain one or more wildcard characters (*)\n * that will allow wildcard matching when intersecting with\n * another TokenSet.\n *\n * @param {string} str - The string to create a TokenSet from.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.fromString = function (str) {\n var node = new lunr.TokenSet,\n root = node\n\n /*\n * Iterates through all characters within the passed string\n * appending a node for each character.\n *\n * When a wildcard character is found then a self\n * referencing edge is introduced to continually match\n * any number of any characters.\n */\n for (var i = 0, len = str.length; i < len; i++) {\n var char = str[i],\n final = (i == len - 1)\n\n if (char == \"*\") {\n node.edges[char] = node\n node.final = final\n\n } else {\n var next = new lunr.TokenSet\n next.final = final\n\n node.edges[char] = next\n node = next\n }\n }\n\n return root\n}\n\n/**\n * Converts this TokenSet into an array of strings\n * contained within the TokenSet.\n *\n * This is not intended to be used on a TokenSet that\n * contains wildcards, in these cases the results are\n * undefined and are likely to cause an infinite loop.\n *\n * @returns {string[]}\n */\nlunr.TokenSet.prototype.toArray = function () {\n var words = []\n\n var stack = [{\n prefix: \"\",\n node: this\n }]\n\n while (stack.length) {\n var frame = stack.pop(),\n edges = Object.keys(frame.node.edges),\n len = edges.length\n\n if (frame.node.final) {\n /* In Safari, at this point the prefix is sometimes corrupted, see:\n * https://github.com/olivernn/lunr.js/issues/279 Calling any\n * String.prototype method forces Safari to \"cast\" this string to what\n * it's supposed to be, fixing the bug. */\n frame.prefix.charAt(0)\n words.push(frame.prefix)\n }\n\n for (var i = 0; i < len; i++) {\n var edge = edges[i]\n\n stack.push({\n prefix: frame.prefix.concat(edge),\n node: frame.node.edges[edge]\n })\n }\n }\n\n return words\n}\n\n/**\n * Generates a string representation of a TokenSet.\n *\n * This is intended to allow TokenSets to be used as keys\n * in objects, largely to aid the construction and minimisation\n * of a TokenSet. As such it is not designed to be a human\n * friendly representation of the TokenSet.\n *\n * @returns {string}\n */\nlunr.TokenSet.prototype.toString = function () {\n // NOTE: Using Object.keys here as this.edges is very likely\n // to enter 'hash-mode' with many keys being added\n //\n // avoiding a for-in loop here as it leads to the function\n // being de-optimised (at least in V8). From some simple\n // benchmarks the performance is comparable, but allowing\n // V8 to optimize may mean easy performance wins in the future.\n\n if (this._str) {\n return this._str\n }\n\n var str = this.final ? '1' : '0',\n labels = Object.keys(this.edges).sort(),\n len = labels.length\n\n for (var i = 0; i < len; i++) {\n var label = labels[i],\n node = this.edges[label]\n\n str = str + label + node.id\n }\n\n return str\n}\n\n/**\n * Returns a new TokenSet that is the intersection of\n * this TokenSet and the passed TokenSet.\n *\n * This intersection will take into account any wildcards\n * contained within the TokenSet.\n *\n * @param {lunr.TokenSet} b - An other TokenSet to intersect with.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.prototype.intersect = function (b) {\n var output = new lunr.TokenSet,\n frame = undefined\n\n var stack = [{\n qNode: b,\n output: output,\n node: this\n }]\n\n while (stack.length) {\n frame = stack.pop()\n\n // NOTE: As with the #toString method, we are using\n // Object.keys and a for loop instead of a for-in loop\n // as both of these objects enter 'hash' mode, causing\n // the function to be de-optimised in V8\n var qEdges = Object.keys(frame.qNode.edges),\n qLen = qEdges.length,\n nEdges = Object.keys(frame.node.edges),\n nLen = nEdges.length\n\n for (var q = 0; q < qLen; q++) {\n var qEdge = qEdges[q]\n\n for (var n = 0; n < nLen; n++) {\n var nEdge = nEdges[n]\n\n if (nEdge == qEdge || qEdge == '*') {\n var node = frame.node.edges[nEdge],\n qNode = frame.qNode.edges[qEdge],\n final = node.final && qNode.final,\n next = undefined\n\n if (nEdge in frame.output.edges) {\n // an edge already exists for this character\n // no need to create a new node, just set the finality\n // bit unless this node is already final\n next = frame.output.edges[nEdge]\n next.final = next.final || final\n\n } else {\n // no edge exists yet, must create one\n // set the finality bit and insert it\n // into the output\n next = new lunr.TokenSet\n next.final = final\n frame.output.edges[nEdge] = next\n }\n\n stack.push({\n qNode: qNode,\n output: next,\n node: node\n })\n }\n }\n }\n }\n\n return output\n}\nlunr.TokenSet.Builder = function () {\n this.previousWord = \"\"\n this.root = new lunr.TokenSet\n this.uncheckedNodes = []\n this.minimizedNodes = {}\n}\n\nlunr.TokenSet.Builder.prototype.insert = function (word) {\n var node,\n commonPrefix = 0\n\n if (word < this.previousWord) {\n throw new Error (\"Out of order word insertion\")\n }\n\n for (var i = 0; i < word.length && i < this.previousWord.length; i++) {\n if (word[i] != this.previousWord[i]) break\n commonPrefix++\n }\n\n this.minimize(commonPrefix)\n\n if (this.uncheckedNodes.length == 0) {\n node = this.root\n } else {\n node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child\n }\n\n for (var i = commonPrefix; i < word.length; i++) {\n var nextNode = new lunr.TokenSet,\n char = word[i]\n\n node.edges[char] = nextNode\n\n this.uncheckedNodes.push({\n parent: node,\n char: char,\n child: nextNode\n })\n\n node = nextNode\n }\n\n node.final = true\n this.previousWord = word\n}\n\nlunr.TokenSet.Builder.prototype.finish = function () {\n this.minimize(0)\n}\n\nlunr.TokenSet.Builder.prototype.minimize = function (downTo) {\n for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) {\n var node = this.uncheckedNodes[i],\n childKey = node.child.toString()\n\n if (childKey in this.minimizedNodes) {\n node.parent.edges[node.char] = this.minimizedNodes[childKey]\n } else {\n // Cache the key for this node since\n // we know it can't change anymore\n node.child._str = childKey\n\n this.minimizedNodes[childKey] = node.child\n }\n\n this.uncheckedNodes.pop()\n }\n}\n/*!\n * lunr.Index\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * An index contains the built index of all documents and provides a query interface\n * to the index.\n *\n * Usually instances of lunr.Index will not be created using this constructor, instead\n * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be\n * used to load previously built and serialized indexes.\n *\n * @constructor\n * @param {Object} attrs - The attributes of the built search index.\n * @param {Object} attrs.invertedIndex - An index of term/field to document reference.\n * @param {Object} attrs.fieldVectors - Field vectors\n * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens.\n * @param {string[]} attrs.fields - The names of indexed document fields.\n * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms.\n */\nlunr.Index = function (attrs) {\n this.invertedIndex = attrs.invertedIndex\n this.fieldVectors = attrs.fieldVectors\n this.tokenSet = attrs.tokenSet\n this.fields = attrs.fields\n this.pipeline = attrs.pipeline\n}\n\n/**\n * A result contains details of a document matching a search query.\n * @typedef {Object} lunr.Index~Result\n * @property {string} ref - The reference of the document this result represents.\n * @property {number} score - A number between 0 and 1 representing how similar this document is to the query.\n * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match.\n */\n\n/**\n * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple\n * query language which itself is parsed into an instance of lunr.Query.\n *\n * For programmatically building queries it is advised to directly use lunr.Query, the query language\n * is best used for human entered text rather than program generated text.\n *\n * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported\n * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello'\n * or 'world', though those that contain both will rank higher in the results.\n *\n * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can\n * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding\n * wildcards will increase the number of documents that will be found but can also have a negative\n * impact on query performance, especially with wildcards at the beginning of a term.\n *\n * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term\n * hello in the title field will match this query. Using a field not present in the index will lead\n * to an error being thrown.\n *\n * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term\n * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported\n * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2.\n * Avoid large values for edit distance to improve query performance.\n *\n * Each term also supports a presence modifier. By default a term's presence in document is optional, however\n * this can be changed to either required or prohibited. For a term's presence to be required in a document the\n * term should be prefixed with a '+', e.g. `+foo bar` is a search for documents that must contain 'foo' and\n * optionally contain 'bar'. Conversely a leading '-' sets the terms presence to prohibited, i.e. it must not\n * appear in a document, e.g. `-foo bar` is a search for documents that do not contain 'foo' but may contain 'bar'.\n *\n * To escape special characters the backslash character '\\' can be used, this allows searches to include\n * characters that would normally be considered modifiers, e.g. `foo\\~2` will search for a term \"foo~2\" instead\n * of attempting to apply a boost of 2 to the search term \"foo\".\n *\n * @typedef {string} lunr.Index~QueryString\n * @example Simple single term query\n * hello\n * @example Multiple term query\n * hello world\n * @example term scoped to a field\n * title:hello\n * @example term with a boost of 10\n * hello^10\n * @example term with an edit distance of 2\n * hello~2\n * @example terms with presence modifiers\n * -foo +bar baz\n */\n\n/**\n * Performs a search against the index using lunr query syntax.\n *\n * Results will be returned sorted by their score, the most relevant results\n * will be returned first. For details on how the score is calculated, please see\n * the {@link https://lunrjs.com/guides/searching.html#scoring|guide}.\n *\n * For more programmatic querying use lunr.Index#query.\n *\n * @param {lunr.Index~QueryString} queryString - A string containing a lunr query.\n * @throws {lunr.QueryParseError} If the passed query string cannot be parsed.\n * @returns {lunr.Index~Result[]}\n */\nlunr.Index.prototype.search = function (queryString) {\n return this.query(function (query) {\n var parser = new lunr.QueryParser(queryString, query)\n parser.parse()\n })\n}\n\n/**\n * A query builder callback provides a query object to be used to express\n * the query to perform on the index.\n *\n * @callback lunr.Index~queryBuilder\n * @param {lunr.Query} query - The query object to build up.\n * @this lunr.Query\n */\n\n/**\n * Performs a query against the index using the yielded lunr.Query object.\n *\n * If performing programmatic queries against the index, this method is preferred\n * over lunr.Index#search so as to avoid the additional query parsing overhead.\n *\n * A query object is yielded to the supplied function which should be used to\n * express the query to be run against the index.\n *\n * Note that although this function takes a callback parameter it is _not_ an\n * asynchronous operation, the callback is just yielded a query object to be\n * customized.\n *\n * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query.\n * @returns {lunr.Index~Result[]}\n */\nlunr.Index.prototype.query = function (fn) {\n // for each query clause\n // * process terms\n // * expand terms from token set\n // * find matching documents and metadata\n // * get document vectors\n // * score documents\n\n var query = new lunr.Query(this.fields),\n matchingFields = Object.create(null),\n queryVectors = Object.create(null),\n termFieldCache = Object.create(null),\n requiredMatches = Object.create(null),\n prohibitedMatches = Object.create(null)\n\n /*\n * To support field level boosts a query vector is created per\n * field. An empty vector is eagerly created to support negated\n * queries.\n */\n for (var i = 0; i < this.fields.length; i++) {\n queryVectors[this.fields[i]] = new lunr.Vector\n }\n\n fn.call(query, query)\n\n for (var i = 0; i < query.clauses.length; i++) {\n /*\n * Unless the pipeline has been disabled for this term, which is\n * the case for terms with wildcards, we need to pass the clause\n * term through the search pipeline. A pipeline returns an array\n * of processed terms. Pipeline functions may expand the passed\n * term, which means we may end up performing multiple index lookups\n * for a single query term.\n */\n var clause = query.clauses[i],\n terms = null,\n clauseMatches = lunr.Set.empty\n\n if (clause.usePipeline) {\n terms = this.pipeline.runString(clause.term, {\n fields: clause.fields\n })\n } else {\n terms = [clause.term]\n }\n\n for (var m = 0; m < terms.length; m++) {\n var term = terms[m]\n\n /*\n * Each term returned from the pipeline needs to use the same query\n * clause object, e.g. the same boost and or edit distance. The\n * simplest way to do this is to re-use the clause object but mutate\n * its term property.\n */\n clause.term = term\n\n /*\n * From the term in the clause we create a token set which will then\n * be used to intersect the indexes token set to get a list of terms\n * to lookup in the inverted index\n */\n var termTokenSet = lunr.TokenSet.fromClause(clause),\n expandedTerms = this.tokenSet.intersect(termTokenSet).toArray()\n\n /*\n * If a term marked as required does not exist in the tokenSet it is\n * impossible for the search to return any matches. We set all the field\n * scoped required matches set to empty and stop examining any further\n * clauses.\n */\n if (expandedTerms.length === 0 && clause.presence === lunr.Query.presence.REQUIRED) {\n for (var k = 0; k < clause.fields.length; k++) {\n var field = clause.fields[k]\n requiredMatches[field] = lunr.Set.empty\n }\n\n break\n }\n\n for (var j = 0; j < expandedTerms.length; j++) {\n /*\n * For each term get the posting and termIndex, this is required for\n * building the query vector.\n */\n var expandedTerm = expandedTerms[j],\n posting = this.invertedIndex[expandedTerm],\n termIndex = posting._index\n\n for (var k = 0; k < clause.fields.length; k++) {\n /*\n * For each field that this query term is scoped by (by default\n * all fields are in scope) we need to get all the document refs\n * that have this term in that field.\n *\n * The posting is the entry in the invertedIndex for the matching\n * term from above.\n */\n var field = clause.fields[k],\n fieldPosting = posting[field],\n matchingDocumentRefs = Object.keys(fieldPosting),\n termField = expandedTerm + \"/\" + field,\n matchingDocumentsSet = new lunr.Set(matchingDocumentRefs)\n\n /*\n * if the presence of this term is required ensure that the matching\n * documents are added to the set of required matches for this clause.\n *\n */\n if (clause.presence == lunr.Query.presence.REQUIRED) {\n clauseMatches = clauseMatches.union(matchingDocumentsSet)\n\n if (requiredMatches[field] === undefined) {\n requiredMatches[field] = lunr.Set.complete\n }\n }\n\n /*\n * if the presence of this term is prohibited ensure that the matching\n * documents are added to the set of prohibited matches for this field,\n * creating that set if it does not yet exist.\n */\n if (clause.presence == lunr.Query.presence.PROHIBITED) {\n if (prohibitedMatches[field] === undefined) {\n prohibitedMatches[field] = lunr.Set.empty\n }\n\n prohibitedMatches[field] = prohibitedMatches[field].union(matchingDocumentsSet)\n\n /*\n * Prohibited matches should not be part of the query vector used for\n * similarity scoring and no metadata should be extracted so we continue\n * to the next field\n */\n continue\n }\n\n /*\n * The query field vector is populated using the termIndex found for\n * the term and a unit value with the appropriate boost applied.\n * Using upsert because there could already be an entry in the vector\n * for the term we are working with. In that case we just add the scores\n * together.\n */\n queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b })\n\n /**\n * If we've already seen this term, field combo then we've already collected\n * the matching documents and metadata, no need to go through all that again\n */\n if (termFieldCache[termField]) {\n continue\n }\n\n for (var l = 0; l < matchingDocumentRefs.length; l++) {\n /*\n * All metadata for this term/field/document triple\n * are then extracted and collected into an instance\n * of lunr.MatchData ready to be returned in the query\n * results\n */\n var matchingDocumentRef = matchingDocumentRefs[l],\n matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field),\n metadata = fieldPosting[matchingDocumentRef],\n fieldMatch\n\n if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) {\n matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata)\n } else {\n fieldMatch.add(expandedTerm, field, metadata)\n }\n\n }\n\n termFieldCache[termField] = true\n }\n }\n }\n\n /**\n * If the presence was required we need to update the requiredMatches field sets.\n * We do this after all fields for the term have collected their matches because\n * the clause terms presence is required in _any_ of the fields not _all_ of the\n * fields.\n */\n if (clause.presence === lunr.Query.presence.REQUIRED) {\n for (var k = 0; k < clause.fields.length; k++) {\n var field = clause.fields[k]\n requiredMatches[field] = requiredMatches[field].intersect(clauseMatches)\n }\n }\n }\n\n /**\n * Need to combine the field scoped required and prohibited\n * matching documents into a global set of required and prohibited\n * matches\n */\n var allRequiredMatches = lunr.Set.complete,\n allProhibitedMatches = lunr.Set.empty\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i]\n\n if (requiredMatches[field]) {\n allRequiredMatches = allRequiredMatches.intersect(requiredMatches[field])\n }\n\n if (prohibitedMatches[field]) {\n allProhibitedMatches = allProhibitedMatches.union(prohibitedMatches[field])\n }\n }\n\n var matchingFieldRefs = Object.keys(matchingFields),\n results = [],\n matches = Object.create(null)\n\n /*\n * If the query is negated (contains only prohibited terms)\n * we need to get _all_ fieldRefs currently existing in the\n * index. This is only done when we know that the query is\n * entirely prohibited terms to avoid any cost of getting all\n * fieldRefs unnecessarily.\n *\n * Additionally, blank MatchData must be created to correctly\n * populate the results.\n */\n if (query.isNegated()) {\n matchingFieldRefs = Object.keys(this.fieldVectors)\n\n for (var i = 0; i < matchingFieldRefs.length; i++) {\n var matchingFieldRef = matchingFieldRefs[i]\n var fieldRef = lunr.FieldRef.fromString(matchingFieldRef)\n matchingFields[matchingFieldRef] = new lunr.MatchData\n }\n }\n\n for (var i = 0; i < matchingFieldRefs.length; i++) {\n /*\n * Currently we have document fields that match the query, but we\n * need to return documents. The matchData and scores are combined\n * from multiple fields belonging to the same document.\n *\n * Scores are calculated by field, using the query vectors created\n * above, and combined into a final document score using addition.\n */\n var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]),\n docRef = fieldRef.docRef\n\n if (!allRequiredMatches.contains(docRef)) {\n continue\n }\n\n if (allProhibitedMatches.contains(docRef)) {\n continue\n }\n\n var fieldVector = this.fieldVectors[fieldRef],\n score = queryVectors[fieldRef.fieldName].similarity(fieldVector),\n docMatch\n\n if ((docMatch = matches[docRef]) !== undefined) {\n docMatch.score += score\n docMatch.matchData.combine(matchingFields[fieldRef])\n } else {\n var match = {\n ref: docRef,\n score: score,\n matchData: matchingFields[fieldRef]\n }\n matches[docRef] = match\n results.push(match)\n }\n }\n\n /*\n * Sort the results objects by score, highest first.\n */\n return results.sort(function (a, b) {\n return b.score - a.score\n })\n}\n\n/**\n * Prepares the index for JSON serialization.\n *\n * The schema for this JSON blob will be described in a\n * separate JSON schema file.\n *\n * @returns {Object}\n */\nlunr.Index.prototype.toJSON = function () {\n var invertedIndex = Object.keys(this.invertedIndex)\n .sort()\n .map(function (term) {\n return [term, this.invertedIndex[term]]\n }, this)\n\n var fieldVectors = Object.keys(this.fieldVectors)\n .map(function (ref) {\n return [ref, this.fieldVectors[ref].toJSON()]\n }, this)\n\n return {\n version: lunr.version,\n fields: this.fields,\n fieldVectors: fieldVectors,\n invertedIndex: invertedIndex,\n pipeline: this.pipeline.toJSON()\n }\n}\n\n/**\n * Loads a previously serialized lunr.Index\n *\n * @param {Object} serializedIndex - A previously serialized lunr.Index\n * @returns {lunr.Index}\n */\nlunr.Index.load = function (serializedIndex) {\n var attrs = {},\n fieldVectors = {},\n serializedVectors = serializedIndex.fieldVectors,\n invertedIndex = Object.create(null),\n serializedInvertedIndex = serializedIndex.invertedIndex,\n tokenSetBuilder = new lunr.TokenSet.Builder,\n pipeline = lunr.Pipeline.load(serializedIndex.pipeline)\n\n if (serializedIndex.version != lunr.version) {\n lunr.utils.warn(\"Version mismatch when loading serialised index. Current version of lunr '\" + lunr.version + \"' does not match serialized index '\" + serializedIndex.version + \"'\")\n }\n\n for (var i = 0; i < serializedVectors.length; i++) {\n var tuple = serializedVectors[i],\n ref = tuple[0],\n elements = tuple[1]\n\n fieldVectors[ref] = new lunr.Vector(elements)\n }\n\n for (var i = 0; i < serializedInvertedIndex.length; i++) {\n var tuple = serializedInvertedIndex[i],\n term = tuple[0],\n posting = tuple[1]\n\n tokenSetBuilder.insert(term)\n invertedIndex[term] = posting\n }\n\n tokenSetBuilder.finish()\n\n attrs.fields = serializedIndex.fields\n\n attrs.fieldVectors = fieldVectors\n attrs.invertedIndex = invertedIndex\n attrs.tokenSet = tokenSetBuilder.root\n attrs.pipeline = pipeline\n\n return new lunr.Index(attrs)\n}\n/*!\n * lunr.Builder\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.Builder performs indexing on a set of documents and\n * returns instances of lunr.Index ready for querying.\n *\n * All configuration of the index is done via the builder, the\n * fields to index, the document reference, the text processing\n * pipeline and document scoring parameters are all set on the\n * builder before indexing.\n *\n * @constructor\n * @property {string} _ref - Internal reference to the document reference field.\n * @property {string[]} _fields - Internal reference to the document fields to index.\n * @property {object} invertedIndex - The inverted index maps terms to document fields.\n * @property {object} documentTermFrequencies - Keeps track of document term frequencies.\n * @property {object} documentLengths - Keeps track of the length of documents added to the index.\n * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing.\n * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing.\n * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index.\n * @property {number} documentCount - Keeps track of the total number of documents indexed.\n * @property {number} _b - A parameter to control field length normalization, setting this to 0 disabled normalization, 1 fully normalizes field lengths, the default value is 0.75.\n * @property {number} _k1 - A parameter to control how quickly an increase in term frequency results in term frequency saturation, the default value is 1.2.\n * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space.\n * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index.\n */\nlunr.Builder = function () {\n this._ref = \"id\"\n this._fields = Object.create(null)\n this._documents = Object.create(null)\n this.invertedIndex = Object.create(null)\n this.fieldTermFrequencies = {}\n this.fieldLengths = {}\n this.tokenizer = lunr.tokenizer\n this.pipeline = new lunr.Pipeline\n this.searchPipeline = new lunr.Pipeline\n this.documentCount = 0\n this._b = 0.75\n this._k1 = 1.2\n this.termIndex = 0\n this.metadataWhitelist = []\n}\n\n/**\n * Sets the document field used as the document reference. Every document must have this field.\n * The type of this field in the document should be a string, if it is not a string it will be\n * coerced into a string by calling toString.\n *\n * The default ref is 'id'.\n *\n * The ref should _not_ be changed during indexing, it should be set before any documents are\n * added to the index. Changing it during indexing can lead to inconsistent results.\n *\n * @param {string} ref - The name of the reference field in the document.\n */\nlunr.Builder.prototype.ref = function (ref) {\n this._ref = ref\n}\n\n/**\n * A function that is used to extract a field from a document.\n *\n * Lunr expects a field to be at the top level of a document, if however the field\n * is deeply nested within a document an extractor function can be used to extract\n * the right field for indexing.\n *\n * @callback fieldExtractor\n * @param {object} doc - The document being added to the index.\n * @returns {?(string|object|object[])} obj - The object that will be indexed for this field.\n * @example Extracting a nested field\n * function (doc) { return doc.nested.field }\n */\n\n/**\n * Adds a field to the list of document fields that will be indexed. Every document being\n * indexed should have this field. Null values for this field in indexed documents will\n * not cause errors but will limit the chance of that document being retrieved by searches.\n *\n * All fields should be added before adding documents to the index. Adding fields after\n * a document has been indexed will have no effect on already indexed documents.\n *\n * Fields can be boosted at build time. This allows terms within that field to have more\n * importance when ranking search results. Use a field boost to specify that matches within\n * one field are more important than other fields.\n *\n * @param {string} fieldName - The name of a field to index in all documents.\n * @param {object} attributes - Optional attributes associated with this field.\n * @param {number} [attributes.boost=1] - Boost applied to all terms within this field.\n * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document.\n * @throws {RangeError} fieldName cannot contain unsupported characters '/'\n */\nlunr.Builder.prototype.field = function (fieldName, attributes) {\n if (/\\//.test(fieldName)) {\n throw new RangeError (\"Field '\" + fieldName + \"' contains illegal character '/'\")\n }\n\n this._fields[fieldName] = attributes || {}\n}\n\n/**\n * A parameter to tune the amount of field length normalisation that is applied when\n * calculating relevance scores. A value of 0 will completely disable any normalisation\n * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b\n * will be clamped to the range 0 - 1.\n *\n * @param {number} number - The value to set for this tuning parameter.\n */\nlunr.Builder.prototype.b = function (number) {\n if (number < 0) {\n this._b = 0\n } else if (number > 1) {\n this._b = 1\n } else {\n this._b = number\n }\n}\n\n/**\n * A parameter that controls the speed at which a rise in term frequency results in term\n * frequency saturation. The default value is 1.2. Setting this to a higher value will give\n * slower saturation levels, a lower value will result in quicker saturation.\n *\n * @param {number} number - The value to set for this tuning parameter.\n */\nlunr.Builder.prototype.k1 = function (number) {\n this._k1 = number\n}\n\n/**\n * Adds a document to the index.\n *\n * Before adding fields to the index the index should have been fully setup, with the document\n * ref and all fields to index already having been specified.\n *\n * The document must have a field name as specified by the ref (by default this is 'id') and\n * it should have all fields defined for indexing, though null or undefined values will not\n * cause errors.\n *\n * Entire documents can be boosted at build time. Applying a boost to a document indicates that\n * this document should rank higher in search results than other documents.\n *\n * @param {object} doc - The document to add to the index.\n * @param {object} attributes - Optional attributes associated with this document.\n * @param {number} [attributes.boost=1] - Boost applied to all terms within this document.\n */\nlunr.Builder.prototype.add = function (doc, attributes) {\n var docRef = doc[this._ref],\n fields = Object.keys(this._fields)\n\n this._documents[docRef] = attributes || {}\n this.documentCount += 1\n\n for (var i = 0; i < fields.length; i++) {\n var fieldName = fields[i],\n extractor = this._fields[fieldName].extractor,\n field = extractor ? extractor(doc) : doc[fieldName],\n tokens = this.tokenizer(field, {\n fields: [fieldName]\n }),\n terms = this.pipeline.run(tokens),\n fieldRef = new lunr.FieldRef (docRef, fieldName),\n fieldTerms = Object.create(null)\n\n this.fieldTermFrequencies[fieldRef] = fieldTerms\n this.fieldLengths[fieldRef] = 0\n\n // store the length of this field for this document\n this.fieldLengths[fieldRef] += terms.length\n\n // calculate term frequencies for this field\n for (var j = 0; j < terms.length; j++) {\n var term = terms[j]\n\n if (fieldTerms[term] == undefined) {\n fieldTerms[term] = 0\n }\n\n fieldTerms[term] += 1\n\n // add to inverted index\n // create an initial posting if one doesn't exist\n if (this.invertedIndex[term] == undefined) {\n var posting = Object.create(null)\n posting[\"_index\"] = this.termIndex\n this.termIndex += 1\n\n for (var k = 0; k < fields.length; k++) {\n posting[fields[k]] = Object.create(null)\n }\n\n this.invertedIndex[term] = posting\n }\n\n // add an entry for this term/fieldName/docRef to the invertedIndex\n if (this.invertedIndex[term][fieldName][docRef] == undefined) {\n this.invertedIndex[term][fieldName][docRef] = Object.create(null)\n }\n\n // store all whitelisted metadata about this token in the\n // inverted index\n for (var l = 0; l < this.metadataWhitelist.length; l++) {\n var metadataKey = this.metadataWhitelist[l],\n metadata = term.metadata[metadataKey]\n\n if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) {\n this.invertedIndex[term][fieldName][docRef][metadataKey] = []\n }\n\n this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata)\n }\n }\n\n }\n}\n\n/**\n * Calculates the average document length for this index\n *\n * @private\n */\nlunr.Builder.prototype.calculateAverageFieldLengths = function () {\n\n var fieldRefs = Object.keys(this.fieldLengths),\n numberOfFields = fieldRefs.length,\n accumulator = {},\n documentsWithField = {}\n\n for (var i = 0; i < numberOfFields; i++) {\n var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),\n field = fieldRef.fieldName\n\n documentsWithField[field] || (documentsWithField[field] = 0)\n documentsWithField[field] += 1\n\n accumulator[field] || (accumulator[field] = 0)\n accumulator[field] += this.fieldLengths[fieldRef]\n }\n\n var fields = Object.keys(this._fields)\n\n for (var i = 0; i < fields.length; i++) {\n var fieldName = fields[i]\n accumulator[fieldName] = accumulator[fieldName] / documentsWithField[fieldName]\n }\n\n this.averageFieldLength = accumulator\n}\n\n/**\n * Builds a vector space model of every document using lunr.Vector\n *\n * @private\n */\nlunr.Builder.prototype.createFieldVectors = function () {\n var fieldVectors = {},\n fieldRefs = Object.keys(this.fieldTermFrequencies),\n fieldRefsLength = fieldRefs.length,\n termIdfCache = Object.create(null)\n\n for (var i = 0; i < fieldRefsLength; i++) {\n var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),\n fieldName = fieldRef.fieldName,\n fieldLength = this.fieldLengths[fieldRef],\n fieldVector = new lunr.Vector,\n termFrequencies = this.fieldTermFrequencies[fieldRef],\n terms = Object.keys(termFrequencies),\n termsLength = terms.length\n\n\n var fieldBoost = this._fields[fieldName].boost || 1,\n docBoost = this._documents[fieldRef.docRef].boost || 1\n\n for (var j = 0; j < termsLength; j++) {\n var term = terms[j],\n tf = termFrequencies[term],\n termIndex = this.invertedIndex[term]._index,\n idf, score, scoreWithPrecision\n\n if (termIdfCache[term] === undefined) {\n idf = lunr.idf(this.invertedIndex[term], this.documentCount)\n termIdfCache[term] = idf\n } else {\n idf = termIdfCache[term]\n }\n\n score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[fieldName])) + tf)\n score *= fieldBoost\n score *= docBoost\n scoreWithPrecision = Math.round(score * 1000) / 1000\n // Converts 1.23456789 to 1.234.\n // Reducing the precision so that the vectors take up less\n // space when serialised. Doing it now so that they behave\n // the same before and after serialisation. Also, this is\n // the fastest approach to reducing a number's precision in\n // JavaScript.\n\n fieldVector.insert(termIndex, scoreWithPrecision)\n }\n\n fieldVectors[fieldRef] = fieldVector\n }\n\n this.fieldVectors = fieldVectors\n}\n\n/**\n * Creates a token set of all tokens in the index using lunr.TokenSet\n *\n * @private\n */\nlunr.Builder.prototype.createTokenSet = function () {\n this.tokenSet = lunr.TokenSet.fromArray(\n Object.keys(this.invertedIndex).sort()\n )\n}\n\n/**\n * Builds the index, creating an instance of lunr.Index.\n *\n * This completes the indexing process and should only be called\n * once all documents have been added to the index.\n *\n * @returns {lunr.Index}\n */\nlunr.Builder.prototype.build = function () {\n this.calculateAverageFieldLengths()\n this.createFieldVectors()\n this.createTokenSet()\n\n return new lunr.Index({\n invertedIndex: this.invertedIndex,\n fieldVectors: this.fieldVectors,\n tokenSet: this.tokenSet,\n fields: Object.keys(this._fields),\n pipeline: this.searchPipeline\n })\n}\n\n/**\n * Applies a plugin to the index builder.\n *\n * A plugin is a function that is called with the index builder as its context.\n * Plugins can be used to customise or extend the behaviour of the index\n * in some way. A plugin is just a function, that encapsulated the custom\n * behaviour that should be applied when building the index.\n *\n * The plugin function will be called with the index builder as its argument, additional\n * arguments can also be passed when calling use. The function will be called\n * with the index builder as its context.\n *\n * @param {Function} plugin The plugin to apply.\n */\nlunr.Builder.prototype.use = function (fn) {\n var args = Array.prototype.slice.call(arguments, 1)\n args.unshift(this)\n fn.apply(this, args)\n}\n/**\n * Contains and collects metadata about a matching document.\n * A single instance of lunr.MatchData is returned as part of every\n * lunr.Index~Result.\n *\n * @constructor\n * @param {string} term - The term this match data is associated with\n * @param {string} field - The field in which the term was found\n * @param {object} metadata - The metadata recorded about this term in this field\n * @property {object} metadata - A cloned collection of metadata associated with this document.\n * @see {@link lunr.Index~Result}\n */\nlunr.MatchData = function (term, field, metadata) {\n var clonedMetadata = Object.create(null),\n metadataKeys = Object.keys(metadata || {})\n\n // Cloning the metadata to prevent the original\n // being mutated during match data combination.\n // Metadata is kept in an array within the inverted\n // index so cloning the data can be done with\n // Array#slice\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i]\n clonedMetadata[key] = metadata[key].slice()\n }\n\n this.metadata = Object.create(null)\n\n if (term !== undefined) {\n this.metadata[term] = Object.create(null)\n this.metadata[term][field] = clonedMetadata\n }\n}\n\n/**\n * An instance of lunr.MatchData will be created for every term that matches a\n * document. However only one instance is required in a lunr.Index~Result. This\n * method combines metadata from another instance of lunr.MatchData with this\n * objects metadata.\n *\n * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one.\n * @see {@link lunr.Index~Result}\n */\nlunr.MatchData.prototype.combine = function (otherMatchData) {\n var terms = Object.keys(otherMatchData.metadata)\n\n for (var i = 0; i < terms.length; i++) {\n var term = terms[i],\n fields = Object.keys(otherMatchData.metadata[term])\n\n if (this.metadata[term] == undefined) {\n this.metadata[term] = Object.create(null)\n }\n\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j],\n keys = Object.keys(otherMatchData.metadata[term][field])\n\n if (this.metadata[term][field] == undefined) {\n this.metadata[term][field] = Object.create(null)\n }\n\n for (var k = 0; k < keys.length; k++) {\n var key = keys[k]\n\n if (this.metadata[term][field][key] == undefined) {\n this.metadata[term][field][key] = otherMatchData.metadata[term][field][key]\n } else {\n this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key])\n }\n\n }\n }\n }\n}\n\n/**\n * Add metadata for a term/field pair to this instance of match data.\n *\n * @param {string} term - The term this match data is associated with\n * @param {string} field - The field in which the term was found\n * @param {object} metadata - The metadata recorded about this term in this field\n */\nlunr.MatchData.prototype.add = function (term, field, metadata) {\n if (!(term in this.metadata)) {\n this.metadata[term] = Object.create(null)\n this.metadata[term][field] = metadata\n return\n }\n\n if (!(field in this.metadata[term])) {\n this.metadata[term][field] = metadata\n return\n }\n\n var metadataKeys = Object.keys(metadata)\n\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i]\n\n if (key in this.metadata[term][field]) {\n this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key])\n } else {\n this.metadata[term][field][key] = metadata[key]\n }\n }\n}\n/**\n * A lunr.Query provides a programmatic way of defining queries to be performed\n * against a {@link lunr.Index}.\n *\n * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method\n * so the query object is pre-initialized with the right index fields.\n *\n * @constructor\n * @property {lunr.Query~Clause[]} clauses - An array of query clauses.\n * @property {string[]} allFields - An array of all available fields in a lunr.Index.\n */\nlunr.Query = function (allFields) {\n this.clauses = []\n this.allFields = allFields\n}\n\n/**\n * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause.\n *\n * This allows wildcards to be added to the beginning and end of a term without having to manually do any string\n * concatenation.\n *\n * The wildcard constants can be bitwise combined to select both leading and trailing wildcards.\n *\n * @constant\n * @default\n * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour\n * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists\n * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists\n * @see lunr.Query~Clause\n * @see lunr.Query#clause\n * @see lunr.Query#term\n * @example query term with trailing wildcard\n * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING })\n * @example query term with leading and trailing wildcard\n * query.term('foo', {\n * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING\n * })\n */\n\nlunr.Query.wildcard = new String (\"*\")\nlunr.Query.wildcard.NONE = 0\nlunr.Query.wildcard.LEADING = 1\nlunr.Query.wildcard.TRAILING = 2\n\n/**\n * Constants for indicating what kind of presence a term must have in matching documents.\n *\n * @constant\n * @enum {number}\n * @see lunr.Query~Clause\n * @see lunr.Query#clause\n * @see lunr.Query#term\n * @example query term with required presence\n * query.term('foo', { presence: lunr.Query.presence.REQUIRED })\n */\nlunr.Query.presence = {\n /**\n * Term's presence in a document is optional, this is the default value.\n */\n OPTIONAL: 1,\n\n /**\n * Term's presence in a document is required, documents that do not contain\n * this term will not be returned.\n */\n REQUIRED: 2,\n\n /**\n * Term's presence in a document is prohibited, documents that do contain\n * this term will not be returned.\n */\n PROHIBITED: 3\n}\n\n/**\n * A single clause in a {@link lunr.Query} contains a term and details on how to\n * match that term against a {@link lunr.Index}.\n *\n * @typedef {Object} lunr.Query~Clause\n * @property {string[]} fields - The fields in an index this clause should be matched against.\n * @property {number} [boost=1] - Any boost that should be applied when matching this clause.\n * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be.\n * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline.\n * @property {number} [wildcard=lunr.Query.wildcard.NONE] - Whether the term should have wildcards appended or prepended.\n * @property {number} [presence=lunr.Query.presence.OPTIONAL] - The terms presence in any matching documents.\n */\n\n/**\n * Adds a {@link lunr.Query~Clause} to this query.\n *\n * Unless the clause contains the fields to be matched all fields will be matched. In addition\n * a default boost of 1 is applied to the clause.\n *\n * @param {lunr.Query~Clause} clause - The clause to add to this query.\n * @see lunr.Query~Clause\n * @returns {lunr.Query}\n */\nlunr.Query.prototype.clause = function (clause) {\n if (!('fields' in clause)) {\n clause.fields = this.allFields\n }\n\n if (!('boost' in clause)) {\n clause.boost = 1\n }\n\n if (!('usePipeline' in clause)) {\n clause.usePipeline = true\n }\n\n if (!('wildcard' in clause)) {\n clause.wildcard = lunr.Query.wildcard.NONE\n }\n\n if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) {\n clause.term = \"*\" + clause.term\n }\n\n if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) {\n clause.term = \"\" + clause.term + \"*\"\n }\n\n if (!('presence' in clause)) {\n clause.presence = lunr.Query.presence.OPTIONAL\n }\n\n this.clauses.push(clause)\n\n return this\n}\n\n/**\n * A negated query is one in which every clause has a presence of\n * prohibited. These queries require some special processing to return\n * the expected results.\n *\n * @returns boolean\n */\nlunr.Query.prototype.isNegated = function () {\n for (var i = 0; i < this.clauses.length; i++) {\n if (this.clauses[i].presence != lunr.Query.presence.PROHIBITED) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause}\n * to the list of clauses that make up this query.\n *\n * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion\n * to a token or token-like string should be done before calling this method.\n *\n * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an\n * array, each term in the array will share the same options.\n *\n * @param {object|object[]} term - The term(s) to add to the query.\n * @param {object} [options] - Any additional properties to add to the query clause.\n * @returns {lunr.Query}\n * @see lunr.Query#clause\n * @see lunr.Query~Clause\n * @example adding a single term to a query\n * query.term(\"foo\")\n * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard\n * query.term(\"foo\", {\n * fields: [\"title\"],\n * boost: 10,\n * wildcard: lunr.Query.wildcard.TRAILING\n * })\n * @example using lunr.tokenizer to convert a string to tokens before using them as terms\n * query.term(lunr.tokenizer(\"foo bar\"))\n */\nlunr.Query.prototype.term = function (term, options) {\n if (Array.isArray(term)) {\n term.forEach(function (t) { this.term(t, lunr.utils.clone(options)) }, this)\n return this\n }\n\n var clause = options || {}\n clause.term = term.toString()\n\n this.clause(clause)\n\n return this\n}\nlunr.QueryParseError = function (message, start, end) {\n this.name = \"QueryParseError\"\n this.message = message\n this.start = start\n this.end = end\n}\n\nlunr.QueryParseError.prototype = new Error\nlunr.QueryLexer = function (str) {\n this.lexemes = []\n this.str = str\n this.length = str.length\n this.pos = 0\n this.start = 0\n this.escapeCharPositions = []\n}\n\nlunr.QueryLexer.prototype.run = function () {\n var state = lunr.QueryLexer.lexText\n\n while (state) {\n state = state(this)\n }\n}\n\nlunr.QueryLexer.prototype.sliceString = function () {\n var subSlices = [],\n sliceStart = this.start,\n sliceEnd = this.pos\n\n for (var i = 0; i < this.escapeCharPositions.length; i++) {\n sliceEnd = this.escapeCharPositions[i]\n subSlices.push(this.str.slice(sliceStart, sliceEnd))\n sliceStart = sliceEnd + 1\n }\n\n subSlices.push(this.str.slice(sliceStart, this.pos))\n this.escapeCharPositions.length = 0\n\n return subSlices.join('')\n}\n\nlunr.QueryLexer.prototype.emit = function (type) {\n this.lexemes.push({\n type: type,\n str: this.sliceString(),\n start: this.start,\n end: this.pos\n })\n\n this.start = this.pos\n}\n\nlunr.QueryLexer.prototype.escapeCharacter = function () {\n this.escapeCharPositions.push(this.pos - 1)\n this.pos += 1\n}\n\nlunr.QueryLexer.prototype.next = function () {\n if (this.pos >= this.length) {\n return lunr.QueryLexer.EOS\n }\n\n var char = this.str.charAt(this.pos)\n this.pos += 1\n return char\n}\n\nlunr.QueryLexer.prototype.width = function () {\n return this.pos - this.start\n}\n\nlunr.QueryLexer.prototype.ignore = function () {\n if (this.start == this.pos) {\n this.pos += 1\n }\n\n this.start = this.pos\n}\n\nlunr.QueryLexer.prototype.backup = function () {\n this.pos -= 1\n}\n\nlunr.QueryLexer.prototype.acceptDigitRun = function () {\n var char, charCode\n\n do {\n char = this.next()\n charCode = char.charCodeAt(0)\n } while (charCode > 47 && charCode < 58)\n\n if (char != lunr.QueryLexer.EOS) {\n this.backup()\n }\n}\n\nlunr.QueryLexer.prototype.more = function () {\n return this.pos < this.length\n}\n\nlunr.QueryLexer.EOS = 'EOS'\nlunr.QueryLexer.FIELD = 'FIELD'\nlunr.QueryLexer.TERM = 'TERM'\nlunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE'\nlunr.QueryLexer.BOOST = 'BOOST'\nlunr.QueryLexer.PRESENCE = 'PRESENCE'\n\nlunr.QueryLexer.lexField = function (lexer) {\n lexer.backup()\n lexer.emit(lunr.QueryLexer.FIELD)\n lexer.ignore()\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexTerm = function (lexer) {\n if (lexer.width() > 1) {\n lexer.backup()\n lexer.emit(lunr.QueryLexer.TERM)\n }\n\n lexer.ignore()\n\n if (lexer.more()) {\n return lunr.QueryLexer.lexText\n }\n}\n\nlunr.QueryLexer.lexEditDistance = function (lexer) {\n lexer.ignore()\n lexer.acceptDigitRun()\n lexer.emit(lunr.QueryLexer.EDIT_DISTANCE)\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexBoost = function (lexer) {\n lexer.ignore()\n lexer.acceptDigitRun()\n lexer.emit(lunr.QueryLexer.BOOST)\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexEOS = function (lexer) {\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n}\n\n// This matches the separator used when tokenising fields\n// within a document. These should match otherwise it is\n// not possible to search for some tokens within a document.\n//\n// It is possible for the user to change the separator on the\n// tokenizer so it _might_ clash with any other of the special\n// characters already used within the search string, e.g. :.\n//\n// This means that it is possible to change the separator in\n// such a way that makes some words unsearchable using a search\n// string.\nlunr.QueryLexer.termSeparator = lunr.tokenizer.separator\n\nlunr.QueryLexer.lexText = function (lexer) {\n while (true) {\n var char = lexer.next()\n\n if (char == lunr.QueryLexer.EOS) {\n return lunr.QueryLexer.lexEOS\n }\n\n // Escape character is '\\'\n if (char.charCodeAt(0) == 92) {\n lexer.escapeCharacter()\n continue\n }\n\n if (char == \":\") {\n return lunr.QueryLexer.lexField\n }\n\n if (char == \"~\") {\n lexer.backup()\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n return lunr.QueryLexer.lexEditDistance\n }\n\n if (char == \"^\") {\n lexer.backup()\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n return lunr.QueryLexer.lexBoost\n }\n\n // \"+\" indicates term presence is required\n // checking for length to ensure that only\n // leading \"+\" are considered\n if (char == \"+\" && lexer.width() === 1) {\n lexer.emit(lunr.QueryLexer.PRESENCE)\n return lunr.QueryLexer.lexText\n }\n\n // \"-\" indicates term presence is prohibited\n // checking for length to ensure that only\n // leading \"-\" are considered\n if (char == \"-\" && lexer.width() === 1) {\n lexer.emit(lunr.QueryLexer.PRESENCE)\n return lunr.QueryLexer.lexText\n }\n\n if (char.match(lunr.QueryLexer.termSeparator)) {\n return lunr.QueryLexer.lexTerm\n }\n }\n}\n\nlunr.QueryParser = function (str, query) {\n this.lexer = new lunr.QueryLexer (str)\n this.query = query\n this.currentClause = {}\n this.lexemeIdx = 0\n}\n\nlunr.QueryParser.prototype.parse = function () {\n this.lexer.run()\n this.lexemes = this.lexer.lexemes\n\n var state = lunr.QueryParser.parseClause\n\n while (state) {\n state = state(this)\n }\n\n return this.query\n}\n\nlunr.QueryParser.prototype.peekLexeme = function () {\n return this.lexemes[this.lexemeIdx]\n}\n\nlunr.QueryParser.prototype.consumeLexeme = function () {\n var lexeme = this.peekLexeme()\n this.lexemeIdx += 1\n return lexeme\n}\n\nlunr.QueryParser.prototype.nextClause = function () {\n var completedClause = this.currentClause\n this.query.clause(completedClause)\n this.currentClause = {}\n}\n\nlunr.QueryParser.parseClause = function (parser) {\n var lexeme = parser.peekLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n switch (lexeme.type) {\n case lunr.QueryLexer.PRESENCE:\n return lunr.QueryParser.parsePresence\n case lunr.QueryLexer.FIELD:\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expected either a field or a term, found \" + lexeme.type\n\n if (lexeme.str.length >= 1) {\n errorMessage += \" with value '\" + lexeme.str + \"'\"\n }\n\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n}\n\nlunr.QueryParser.parsePresence = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n switch (lexeme.str) {\n case \"-\":\n parser.currentClause.presence = lunr.Query.presence.PROHIBITED\n break\n case \"+\":\n parser.currentClause.presence = lunr.Query.presence.REQUIRED\n break\n default:\n var errorMessage = \"unrecognised presence operator'\" + lexeme.str + \"'\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n var errorMessage = \"expecting term or field, found nothing\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.FIELD:\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expecting term or field, found '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseField = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n if (parser.query.allFields.indexOf(lexeme.str) == -1) {\n var possibleFields = parser.query.allFields.map(function (f) { return \"'\" + f + \"'\" }).join(', '),\n errorMessage = \"unrecognised field '\" + lexeme.str + \"', possible fields: \" + possibleFields\n\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.fields = [lexeme.str]\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n var errorMessage = \"expecting term, found nothing\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expecting term, found '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseTerm = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n parser.currentClause.term = lexeme.str.toLowerCase()\n\n if (lexeme.str.indexOf(\"*\") != -1) {\n parser.currentClause.usePipeline = false\n }\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseEditDistance = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n var editDistance = parseInt(lexeme.str, 10)\n\n if (isNaN(editDistance)) {\n var errorMessage = \"edit distance must be numeric\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.editDistance = editDistance\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseBoost = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n var boost = parseInt(lexeme.str, 10)\n\n if (isNaN(boost)) {\n var errorMessage = \"boost must be numeric\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.boost = boost\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\n /**\n * export the module via AMD, CommonJS or as a browser global\n * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js\n */\n ;(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory)\n } else if (typeof exports === 'object') {\n /**\n * Node. Does not work with strict CommonJS, but\n * only CommonJS-like enviroments that support module.exports,\n * like Node.\n */\n module.exports = factory()\n } else {\n // Browser globals (root is window)\n root.lunr = factory()\n }\n }(this, function () {\n /**\n * Just return a value to define the module export.\n * This example returns an object, but the module\n * can return a function as the exported value.\n */\n return lunr\n }))\n})();\n", "/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport lunr from \"lunr\"\n\nimport \"~/polyfills\"\n\nimport { Search, SearchIndexConfig } from \"../../_\"\nimport {\n SearchMessage,\n SearchMessageType\n} from \"../message\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Add support for usage with `iframe-worker` polyfill\n *\n * While `importScripts` is synchronous when executed inside of a web worker,\n * it's not possible to provide a synchronous polyfilled implementation. The\n * cool thing is that awaiting a non-Promise is a noop, so extending the type\n * definition to return a `Promise` shouldn't break anything.\n *\n * @see https://bit.ly/2PjDnXi - GitHub comment\n */\ndeclare global {\n function importScripts(...urls: string[]): Promise | void\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nlet index: Search\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch (= import) multi-language support through `lunr-languages`\n *\n * This function automatically imports the stemmers necessary to process the\n * languages, which are defined through the search index configuration.\n *\n * If the worker runs inside of an `iframe` (when using `iframe-worker` as\n * a shim), the base URL for the stemmers to be loaded must be determined by\n * searching for the first `script` element with a `src` attribute, which will\n * contain the contents of this script.\n *\n * @param config - Search index configuration\n *\n * @returns Promise resolving with no result\n */\nasync function setupSearchLanguages(\n config: SearchIndexConfig\n): Promise {\n let base = \"../lunr\"\n\n /* Detect `iframe-worker` and fix base URL */\n if (typeof parent !== \"undefined\" && \"IFrameWorker\" in parent) {\n const worker = document.querySelector(\"script[src]\")!\n const [path] = worker.src.split(\"/worker\")\n\n /* Prefix base with path */\n base = base.replace(\"..\", path)\n }\n\n /* Add scripts for languages */\n const scripts = []\n for (const lang of config.lang) {\n switch (lang) {\n\n /* Add segmenter for Japanese */\n case \"ja\":\n scripts.push(`${base}/tinyseg.js`)\n break\n\n /* Add segmenter for Hindi and Thai */\n case \"hi\":\n case \"th\":\n scripts.push(`${base}/wordcut.js`)\n break\n }\n\n /* Add language support */\n if (lang !== \"en\")\n scripts.push(`${base}/min/lunr.${lang}.min.js`)\n }\n\n /* Add multi-language support */\n if (config.lang.length > 1)\n scripts.push(`${base}/min/lunr.multi.min.js`)\n\n /* Load scripts synchronously */\n if (scripts.length)\n await importScripts(\n `${base}/min/lunr.stemmer.support.min.js`,\n ...scripts\n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Message handler\n *\n * @param message - Source message\n *\n * @returns Target message\n */\nexport async function handler(\n message: SearchMessage\n): Promise {\n switch (message.type) {\n\n /* Search setup message */\n case SearchMessageType.SETUP:\n await setupSearchLanguages(message.data.config)\n index = new Search(message.data)\n return {\n type: SearchMessageType.READY\n }\n\n /* Search query message */\n case SearchMessageType.QUERY:\n return {\n type: SearchMessageType.RESULT,\n data: index ? index.search(message.data) : { items: [] }\n }\n\n /* All other messages */\n default:\n throw new TypeError(\"Invalid message type\")\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Worker\n * ------------------------------------------------------------------------- */\n\n/* @ts-expect-error - expose Lunr.js in global scope, or stemmers won't work */\nself.lunr = lunr\n\n/* Handle messages */\naddEventListener(\"message\", async ev => {\n postMessage(await handler(ev.data))\n})\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Polyfills\n * ------------------------------------------------------------------------- */\n\n/* Polyfill `Object.entries` */\nif (!Object.entries)\n Object.entries = function (obj: object) {\n const data: [string, string][] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push([key, obj[key]])\n\n /* Return entries */\n return data\n }\n\n/* Polyfill `Object.values` */\nif (!Object.values)\n Object.values = function (obj: object) {\n const data: string[] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push(obj[key])\n\n /* Return values */\n return data\n }\n\n/* ------------------------------------------------------------------------- */\n\n/* Polyfills for `Element` */\nif (typeof Element !== \"undefined\") {\n\n /* Polyfill `Element.scrollTo` */\n if (!Element.prototype.scrollTo)\n Element.prototype.scrollTo = function (\n x?: ScrollToOptions | number, y?: number\n ): void {\n if (typeof x === \"object\") {\n this.scrollLeft = x.left!\n this.scrollTop = x.top!\n } else {\n this.scrollLeft = x!\n this.scrollTop = y!\n }\n }\n\n /* Polyfill `Element.replaceWith` */\n if (!Element.prototype.replaceWith)\n Element.prototype.replaceWith = function (\n ...nodes: Array\n ): void {\n const parent = this.parentNode\n if (parent) {\n if (nodes.length === 0)\n parent.removeChild(this)\n\n /* Replace children and create text nodes */\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i]\n if (typeof node !== \"object\")\n node = document.createTextNode(node)\n else if (node.parentNode)\n node.parentNode.removeChild(node)\n\n /* Replace child or insert before previous sibling */\n if (!i)\n parent.replaceChild(node, this)\n else\n parent.insertBefore(this.previousSibling!, node)\n }\n }\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport escapeHTML from \"escape-html\"\n\nimport { SearchIndexDocument } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search document\n */\nexport interface SearchDocument extends SearchIndexDocument {\n parent?: SearchIndexDocument /* Parent article */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search document mapping\n */\nexport type SearchDocumentMap = Map\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search document mapping\n *\n * @param docs - Search index documents\n *\n * @returns Search document map\n */\nexport function setupSearchDocumentMap(\n docs: SearchIndexDocument[]\n): SearchDocumentMap {\n const documents = new Map()\n const parents = new Set()\n for (const doc of docs) {\n const [path, hash] = doc.location.split(\"#\")\n\n /* Extract location, title and tags */\n const location = doc.location\n const title = doc.title\n const tags = doc.tags\n\n /* Escape and cleanup text */\n const text = escapeHTML(doc.text)\n .replace(/\\s+(?=[,.:;!?])/g, \"\")\n .replace(/\\s+/g, \" \")\n\n /* Handle section */\n if (hash) {\n const parent = documents.get(path)!\n\n /* Ignore first section, override article */\n if (!parents.has(parent)) {\n parent.title = doc.title\n parent.text = text\n\n /* Remember that we processed the article */\n parents.add(parent)\n\n /* Add subsequent section */\n } else {\n documents.set(location, {\n location,\n title,\n text,\n parent\n })\n }\n\n /* Add article */\n } else {\n documents.set(location, {\n location,\n title,\n text,\n ...tags && { tags }\n })\n }\n }\n return documents\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport escapeHTML from \"escape-html\"\n\nimport { SearchIndexConfig } from \"../_\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search highlight function\n *\n * @param value - Value\n *\n * @returns Highlighted value\n */\nexport type SearchHighlightFn = (value: string) => string\n\n/**\n * Search highlight factory function\n *\n * @param query - Query value\n *\n * @returns Search highlight function\n */\nexport type SearchHighlightFactoryFn = (query: string) => SearchHighlightFn\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search highlighter\n *\n * @param config - Search index configuration\n * @param escape - Whether to escape HTML\n *\n * @returns Search highlight factory function\n */\nexport function setupSearchHighlighter(\n config: SearchIndexConfig, escape: boolean\n): SearchHighlightFactoryFn {\n const separator = new RegExp(config.separator, \"img\")\n const highlight = (_: unknown, data: string, term: string) => {\n return `${data}${term}`\n }\n\n /* Return factory function */\n return (query: string) => {\n query = query\n .replace(/[\\s*+\\-:~^]+/g, \" \")\n .trim()\n\n /* Create search term match expression */\n const match = new RegExp(`(^|${config.separator})(${\n query\n .replace(/[|\\\\{}()[\\]^$+*?.-]/g, \"\\\\$&\")\n .replace(separator, \"|\")\n })`, \"img\")\n\n /* Highlight string value */\n return value => (\n escape\n ? escapeHTML(value)\n : value\n )\n .replace(match, highlight)\n .replace(/<\\/mark>(\\s+)]*>/img, \"$1\")\n }\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query clause\n */\nexport interface SearchQueryClause {\n presence: lunr.Query.presence /* Clause presence */\n term: string /* Clause term */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search query terms\n */\nexport type SearchQueryTerms = Record\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Parse a search query for analysis\n *\n * @param value - Query value\n *\n * @returns Search query clauses\n */\nexport function parseSearchQuery(\n value: string\n): SearchQueryClause[] {\n const query = new (lunr as any).Query([\"title\", \"text\"])\n const parser = new (lunr as any).QueryParser(value, query)\n\n /* Parse and return query clauses */\n parser.parse()\n return query.clauses\n}\n\n/**\n * Analyze the search query clauses in regard to the search terms found\n *\n * @param query - Search query clauses\n * @param terms - Search terms\n *\n * @returns Search query terms\n */\nexport function getSearchQueryTerms(\n query: SearchQueryClause[], terms: string[]\n): SearchQueryTerms {\n const clauses = new Set(query)\n\n /* Match query clauses against terms */\n const result: SearchQueryTerms = {}\n for (let t = 0; t < terms.length; t++)\n for (const clause of clauses)\n if (terms[t].startsWith(clause.term)) {\n result[clause.term] = true\n clauses.delete(clause)\n }\n\n /* Annotate unmatched non-stopword query clauses */\n for (const clause of clauses)\n if (lunr.stopWordFilter?.(clause.term as any))\n result[clause.term] = false\n\n /* Return query terms */\n return result\n}\n", "/*\n * Copyright (c) 2016-2022 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n SearchDocument,\n SearchDocumentMap,\n setupSearchDocumentMap\n} from \"../document\"\nimport {\n SearchHighlightFactoryFn,\n setupSearchHighlighter\n} from \"../highlighter\"\nimport { SearchOptions } from \"../options\"\nimport {\n SearchQueryTerms,\n getSearchQueryTerms,\n parseSearchQuery\n} from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index configuration\n */\nexport interface SearchIndexConfig {\n lang: string[] /* Search languages */\n separator: string /* Search separator */\n}\n\n/**\n * Search index document\n */\nexport interface SearchIndexDocument {\n location: string /* Document location */\n title: string /* Document title */\n text: string /* Document text */\n tags?: string[] /* Document tags */\n boost?: number /* Document boost */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search index\n *\n * This interfaces describes the format of the `search_index.json` file which\n * is automatically built by the MkDocs search plugin.\n */\nexport interface SearchIndex {\n config: SearchIndexConfig /* Search index configuration */\n docs: SearchIndexDocument[] /* Search index documents */\n options: SearchOptions /* Search options */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search metadata\n */\nexport interface SearchMetadata {\n score: number /* Score (relevance) */\n terms: SearchQueryTerms /* Search query terms */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search result document\n */\nexport type SearchResultDocument = SearchDocument & SearchMetadata\n\n/**\n * Search result item\n */\nexport type SearchResultItem = SearchResultDocument[]\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search result\n */\nexport interface SearchResult {\n items: SearchResultItem[] /* Search result items */\n suggestions?: string[] /* Search suggestions */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Compute the difference of two lists of strings\n *\n * @param a - 1st list of strings\n * @param b - 2nd list of strings\n *\n * @returns Difference\n */\nfunction difference(a: string[], b: string[]): string[] {\n const [x, y] = [new Set(a), new Set(b)]\n return [\n ...new Set([...x].filter(value => !y.has(value)))\n ]\n}\n\n/* ----------------------------------------------------------------------------\n * Class\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nexport class Search {\n\n /**\n * Search document mapping\n *\n * A mapping of URLs (including hash fragments) to the actual articles and\n * sections of the documentation. The search document mapping must be created\n * regardless of whether the index was prebuilt or not, as Lunr.js itself\n * only stores the actual index.\n */\n protected documents: SearchDocumentMap\n\n /**\n * Search highlight factory function\n */\n protected highlight: SearchHighlightFactoryFn\n\n /**\n * The underlying Lunr.js search index\n */\n protected index: lunr.Index\n\n /**\n * Search options\n */\n protected options: SearchOptions\n\n /**\n * Create the search integration\n *\n * @param data - Search index\n */\n public constructor({ config, docs, options }: SearchIndex) {\n this.options = options\n\n /* Set up document map and highlighter factory */\n this.documents = setupSearchDocumentMap(docs)\n this.highlight = setupSearchHighlighter(config, false)\n\n /* Set separator for tokenizer */\n lunr.tokenizer.separator = new RegExp(config.separator)\n\n /* Create search index */\n this.index = lunr(function () {\n\n /* Set up multi-language support */\n if (config.lang.length === 1 && config.lang[0] !== \"en\") {\n this.use((lunr as any)[config.lang[0]])\n } else if (config.lang.length > 1) {\n this.use((lunr as any).multiLanguage(...config.lang))\n }\n\n /* Compute functions to be removed from the pipeline */\n const fns = difference([\n \"trimmer\", \"stopWordFilter\", \"stemmer\"\n ], options.pipeline)\n\n /* Remove functions from the pipeline for registered languages */\n for (const lang of config.lang.map(language => (\n language === \"en\" ? lunr : (lunr as any)[language]\n ))) {\n for (const fn of fns) {\n this.pipeline.remove(lang[fn])\n this.searchPipeline.remove(lang[fn])\n }\n }\n\n /* Set up reference */\n this.ref(\"location\")\n\n /* Set up fields */\n this.field(\"title\", { boost: 1e3 })\n this.field(\"text\")\n this.field(\"tags\", { boost: 1e6, extractor: doc => {\n const { tags = [] } = doc as SearchDocument\n return tags.reduce((list, tag) => [\n ...list,\n ...lunr.tokenizer(tag)\n ], [] as lunr.Token[])\n } })\n\n /* Index documents */\n for (const doc of docs)\n this.add(doc, { boost: doc.boost })\n })\n }\n\n /**\n * Search for matching documents\n *\n * The search index which MkDocs provides is divided up into articles, which\n * contain the whole content of the individual pages, and sections, which only\n * contain the contents of the subsections obtained by breaking the individual\n * pages up at `h1` ... `h6`. As there may be many sections on different pages\n * with identical titles (for example within this very project, e.g. \"Usage\"\n * or \"Installation\"), they need to be put into the context of the containing\n * page. For this reason, section results are grouped within their respective\n * articles which are the top-level results that are returned.\n *\n * @param query - Query value\n *\n * @returns Search results\n */\n public search(query: string): SearchResult {\n if (query) {\n try {\n const highlight = this.highlight(query)\n\n /* Parse query to extract clauses for analysis */\n const clauses = parseSearchQuery(query)\n .filter(clause => (\n clause.presence !== lunr.Query.presence.PROHIBITED\n ))\n\n /* Perform search and post-process results */\n const groups = this.index.search(`${query}*`)\n\n /* Apply post-query boosts based on title and search query terms */\n .reduce((item, { ref, score, matchData }) => {\n const document = this.documents.get(ref)\n if (typeof document !== \"undefined\") {\n const { location, title, text, tags, parent } = document\n\n /* Compute and analyze search query terms */\n const terms = getSearchQueryTerms(\n clauses,\n Object.keys(matchData.metadata)\n )\n\n /* Highlight title and text and apply post-query boosts */\n const boost = +!parent + +Object.values(terms).every(t => t)\n item.push({\n location,\n title: highlight(title),\n text: highlight(text),\n ...tags && { tags: tags.map(highlight) },\n score: score * (1 + boost),\n terms\n })\n }\n return item\n }, [])\n\n /* Sort search results again after applying boosts */\n .sort((a, b) => b.score - a.score)\n\n /* Group search results by page */\n .reduce((items, result) => {\n const document = this.documents.get(result.location)\n if (typeof document !== \"undefined\") {\n const ref = \"parent\" in document\n ? document.parent!.location\n : document.location\n items.set(ref, [...items.get(ref) || [], result])\n }\n return items\n }, new Map())\n\n /* Generate search suggestions, if desired */\n let suggestions: string[] | undefined\n if (this.options.suggestions) {\n const titles = this.index.query(builder => {\n for (const clause of clauses)\n builder.term(clause.term, {\n fields: [\"title\"],\n presence: lunr.Query.presence.REQUIRED,\n wildcard: lunr.Query.wildcard.TRAILING\n })\n })\n\n /* Retrieve suggestions for best match */\n suggestions = titles.length\n ? Object.keys(titles[0].matchData.metadata)\n : []\n }\n\n /* Return items and suggestions */\n return {\n items: [...groups.values()],\n ...typeof suggestions !== \"undefined\" && { suggestions }\n }\n\n /* Log errors to console (for now) */\n } catch {\n console.warn(`Invalid query: ${query} \u2013 see https://bit.ly/2s3ChXG`)\n }\n }\n\n /* Return nothing in case of error or empty query */\n return { items: [] }\n }\n}\n"], + "mappings": "glCAAA;AAAA;AAAA;AAAA;AAAA,GAMC,AAAC,WAAU,CAiCZ,GAAI,GAAO,SAAU,EAAQ,CAC3B,GAAI,GAAU,GAAI,GAAK,QAEvB,SAAQ,SAAS,IACf,EAAK,QACL,EAAK,eACL,EAAK,OACP,EAEA,EAAQ,eAAe,IACrB,EAAK,OACP,EAEA,EAAO,KAAK,EAAS,CAAO,EACrB,EAAQ,MAAM,CACvB,EAEA,EAAK,QAAU,QACf;AAAA;AAAA;AAAA,GASA,EAAK,MAAQ,CAAC,EASd,EAAK,MAAM,KAAQ,SAAU,EAAQ,CAEnC,MAAO,UAAU,EAAS,CACxB,AAAI,EAAO,SAAW,QAAQ,MAC5B,QAAQ,KAAK,CAAO,CAExB,CAEF,EAAG,IAAI,EAaP,EAAK,MAAM,SAAW,SAAU,EAAK,CACnC,MAAI,AAAkB,IAAQ,KACrB,GAEA,EAAI,SAAS,CAExB,EAkBA,EAAK,MAAM,MAAQ,SAAU,EAAK,CAChC,GAAI,GAAQ,KACV,MAAO,GAMT,OAHI,GAAQ,OAAO,OAAO,IAAI,EAC1B,EAAO,OAAO,KAAK,CAAG,EAEjB,EAAI,EAAG,EAAI,EAAK,OAAQ,IAAK,CACpC,GAAI,GAAM,EAAK,GACX,EAAM,EAAI,GAEd,GAAI,MAAM,QAAQ,CAAG,EAAG,CACtB,EAAM,GAAO,EAAI,MAAM,EACvB,QACF,CAEA,GAAI,MAAO,IAAQ,UACf,MAAO,IAAQ,UACf,MAAO,IAAQ,UAAW,CAC5B,EAAM,GAAO,EACb,QACF,CAEA,KAAM,IAAI,WAAU,uDAAuD,CAC7E,CAEA,MAAO,EACT,EACA,EAAK,SAAW,SAAU,EAAQ,EAAW,EAAa,CACxD,KAAK,OAAS,E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SAAS,KAAO,EAAM,SAAS,EAAG,MAAO,EACpE,CACF,EAeA,EAAK,eAAiB,EAAK,uBAAuB,CAChD,IACA,OACA,QACA,SACA,QACA,MACA,SACA,OACA,KACA,QACA,KACA,MACA,MACA,MACA,KACA,KACA,KACA,UACA,OACA,MACA,KACA,MACA,SACA,QACA,OACA,MACA,KACA,OACA,SACA,OACA,OACA,QACA,MACA,OACA,MACA,MACA,MACA,MACA,OACA,KACA,MACA,OACA,MACA,MACA,MACA,UACA,IACA,KACA,KACA,OACA,KACA,KACA,MACA,OACA,QACA,MACA,OACA,SACA,MACA,KACA,QACA,OACA,OACA,KACA,UACA,KACA,MACA,MACA,KACA,MACA,QACA,KACA,OACA,KACA,QACA,MACA,MACA,SACA,OACA,MACA,OACA,MACA,SACA,QACA,KACA,OACA,OACA,OACA,MACA,QACA,OACA,OACA,QACA,QACA,OACA,OACA,MACA,KACA,MACA,OACA,KACA,QACA,MACA,KACA,OACA,OACA,OACA,QACA,QACA,QACA,MACA,OACA,MACA,OACA,OACA,QACA,MACA,MACA,MACF,CAAC,EAED,EAAK,SAAS,iBAAiB,EAAK,eAAgB,gBAAgB,EACpE;AAAA;AAAA;AAAA,GAoBA,EAAK,QAAU,SAAU,EAAO,CAC9B,MAAO,GAAM,OAAO,SAAU,EAAG,CAC/B,MAAO,GAAE,QAAQ,OAAQ,EAAE,EAAE,QAAQ,OAAQ,EAAE,CACjD,CAAC,CACH,EAEA,EAAK,SAAS,iBAAiB,EAAK,QAAS,SAAS,EACtD;AAAA;AAAA;AAAA,GA0BA,EAAK,SAAW,UAAY,CAC1B,KAAK,MAAQ,GACb,KAAK,MAAQ,CAAC,EACd,KAAK,GAAK,EAAK,SAAS,QACxB,EAAK,SAAS,SAAW,CAC3B,EAUA,EAAK,SAAS,QAAU,EASxB,EAAK,SAAS,UAAY,SAAU,EAAK,CAGvC,OAFI,GAAU,GAAI,GAAK,SAAS,QAEvB,EAAI,EAAG,EAAM,EAAI,OAAQ,EAAI,EAA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oCACH,GAAG,CACL,EACJ,GAaA,YACE,EACwB,gCACxB,OAAQ,EAAQ,UAGT,GACH,YAAM,IAAqB,EAAQ,KAAK,MAAM,EAC9C,EAAQ,GAAI,GAAO,EAAQ,IAAI,EACxB,CACL,KAAM,CACR,MAGG,GACH,MAAO,CACL,KAAM,EACN,KAAM,EAAQ,EAAM,OAAO,EAAQ,IAAI,EAAI,CAAE,MAAO,CAAC,CAAE,CACzD,UAIA,KAAM,IAAI,WAAU,sBAAsB,EAEhD,GAOA,KAAK,KAAO,WAGZ,iBAAiB,UAAW,AAAM,GAAM,0BACtC,YAAY,KAAM,IAAQ,EAAG,IAAI,CAAC,CACpC,EAAC", + "names": [] +} diff --git a/assets/stylesheets/main.1d29e8d0.min.css b/assets/stylesheets/main.1d29e8d0.min.css new file mode 100644 index 00000000..2730c642 --- /dev/null +++ b/assets/stylesheets/main.1d29e8d0.min.css @@ -0,0 +1 @@ +@charset "UTF-8";html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;box-sizing:border-box}*,:after,:before{box-sizing:inherit}@media (prefers-reduced-motion){*,:after,:before{transition:none!important}}body{margin:0}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}hr{border:0;box-sizing:initial;display:block;height:.05rem;overflow:visible;padding:0}small{font-size:80%}sub,sup{line-height:1em}img{border-style:none}table{border-collapse:initial;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{background:transparent;border:0;font-family:inherit;font-size:inherit;margin:0;padding:0}input{border:0;outline:none}:root,[data-md-color-scheme=default]{--md-default-fg-color:rgba(0,0,0,.87);--md-default-fg-color--light:rgba(0,0,0,.54);--md-default-fg-color--lighter:rgba(0,0,0,.32);--md-default-fg-color--lightest:rgba(0,0,0,.07);--md-default-bg-color:#fff;--md-default-bg-color--light:hsla(0,0%,100%,.7);--md-default-bg-color--lighter:hsla(0,0%,100%,.3);--md-default-bg-color--lightest:hsla(0,0%,100%,.12);--md-primary-fg-color:#4051b5;--md-primary-fg-color--light:#5d6cc0;--md-primary-fg-color--dark:#303fa1;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7);--md-accent-fg-color:#526cfe;--md-accent-fg-color--transparent:rgba(82,108,254,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7);--md-code-fg-color:#36464e;--md-code-bg-color:#f5f5f5;--md-code-hl-color:rgba(255,255,0,.5);--md-code-hl-number-color:#d52a2a;--md-code-hl-special-color:#db1457;--md-code-hl-function-color:#a846b9;--md-code-hl-constant-color:#6e59d9;--md-code-hl-keyword-color:#3f6ec6;--md-code-hl-string-color:#1c7d4d;--md-code-hl-name-color:var(--md-code-fg-color);--md-code-hl-operator-color:var(--md-default-fg-color--light);--md-code-hl-punctuation-color:var(--md-default-fg-color--light);--md-code-hl-comment-color:var(--md-default-fg-color--light);--md-code-hl-generic-color:var(--md-default-fg-color--light);--md-code-hl-variable-color:var(--md-default-fg-color--light);--md-typeset-color:var(--md-default-fg-color);--md-typeset-a-color:var(--md-primary-fg-color);--md-typeset-mark-color:rgba(255,255,0,.5);--md-typeset-del-color:rgba(245,80,61,.15);--md-typeset-ins-color:rgba(11,213,112,.15);--md-typeset-kbd-color:#fafafa;--md-typeset-kbd-accent-color:#fff;--md-typeset-kbd-border-color:#b8b8b8;--md-typeset-table-color:rgba(0,0,0,.12);--md-admonition-fg-color:var(--md-default-fg-color);--md-admonition-bg-color:var(--md-default-bg-color);--md-footer-fg-color:#fff;--md-footer-fg-color--light:hsla(0,0%,100%,.7);--md-footer-fg-color--lighter:hsla(0,0%,100%,.3);--md-footer-bg-color:rgba(0,0,0,.87);--md-footer-bg-color--dark:rgba(0,0,0,.32);--md-shadow-z1:0 0.2rem 0.5rem rgba(0,0,0,.05),0 0 0.05rem rgba(0,0,0,.1);--md-shadow-z2:0 0.2rem 0.5rem rgba(0,0,0,.1),0 0 0.05rem rgba(0,0,0,.25);--md-shadow-z3:0 0.2rem 0.5rem rgba(0,0,0,.2),0 0 0.05rem rgba(0,0,0,.35)}.md-icon svg{fill:currentcolor;display:block;height:1.2rem;width:1.2rem}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--md-text-font-family:var(--md-text-font,_),-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif;--md-code-font-family:var(--md-code-font,_),SFMono-Regular,Consolas,Menlo,monospace}body,input{font-feature-settings:"kern","liga";font-family:var(--md-text-font-family)}body,code,input,kbd,pre{color:var(--md-typeset-color)}code,kbd,pre{font-feature-settings:"kern";font-family:var(--md-code-font-family)}:root{--md-typeset-table-sort-icon:url('data:image/svg+xml;charset=utf-8,');--md-typeset-table-sort-icon--asc:url('data:image/svg+xml;charset=utf-8,');--md-typeset-table-sort-icon--desc:url('data:image/svg+xml;charset=utf-8,')}.md-typeset{-webkit-print-color-adjust:exact;color-adjust:exact;font-size:.8rem;line-height:1.6}@media print{.md-typeset{font-size:.68rem}}.md-typeset blockquote,.md-typeset dl,.md-typeset figure,.md-typeset ol,.md-typeset pre,.md-typeset ul{margin-bottom:1em;margin-top:1em}.md-typeset h1{color:var(--md-default-fg-color--light);font-size:2em;line-height:1.3;margin:0 0 1.25em}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{font-size:1.5625em;line-height:1.4;margin:1.6em 0 .64em}.md-typeset h3{font-size:1.25em;font-weight:400;letter-spacing:-.01em;line-height:1.5;margin:1.6em 0 .8em}.md-typeset h2+h3{margin-top:.8em}.md-typeset h4{font-weight:700;letter-spacing:-.01em;margin:1em 0}.md-typeset h5,.md-typeset h6{color:var(--md-default-fg-color--light);font-size:.8em;font-weight:700;letter-spacing:-.01em;margin:1.25em 0}.md-typeset h5{text-transform:uppercase}.md-typeset hr{border-bottom:.05rem solid var(--md-default-fg-color--lightest);display:flow-root;margin:1.5em 0}.md-typeset a{color:var(--md-typeset-a-color);word-break:break-word}.md-typeset a,.md-typeset a:before{transition:color 125ms}.md-typeset a:focus,.md-typeset a:hover{color:var(--md-accent-fg-color)}.md-typeset a:focus code,.md-typeset a:hover code{background-color:var(--md-accent-fg-color--transparent)}.md-typeset a code{color:currentcolor;transition:background-color 125ms}.md-typeset a.focus-visible{outline-color:var(--md-accent-fg-color);outline-offset:.2rem}.md-typeset code,.md-typeset kbd,.md-typeset pre{color:var(--md-code-fg-color);direction:ltr}@media print{.md-typeset code,.md-typeset kbd,.md-typeset pre{white-space:pre-wrap}}.md-typeset code{background-color:var(--md-code-bg-color);border-radius:.1rem;-webkit-box-decoration-break:clone;box-decoration-break:clone;font-size:.85em;padding:0 .2941176471em;word-break:break-word}.md-typeset code:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}.md-typeset pre{display:flow-root;line-height:1.4;position:relative}.md-typeset pre>code{-webkit-box-decoration-break:slice;box-decoration-break:slice;box-shadow:none;display:block;margin:0;outline-color:var(--md-accent-fg-color);overflow:auto;padding:.7720588235em 1.1764705882em;scrollbar-color:var(--md-default-fg-color--lighter) transparent;scrollbar-width:thin;touch-action:auto;word-break:normal}.md-typeset pre>code:hover{scrollbar-color:var(--md-accent-fg-color) transparent}.md-typeset pre>code::-webkit-scrollbar{height:.2rem;width:.2rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:var(--md-default-fg-color--lighter)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:var(--md-accent-fg-color)}.md-typeset kbd{background-color:var(--md-typeset-kbd-color);border-radius:.1rem;box-shadow:0 .1rem 0 .05rem var(--md-typeset-kbd-border-color),0 .1rem 0 var(--md-typeset-kbd-border-color),0 -.1rem .2rem var(--md-typeset-kbd-accent-color) inset;color:var(--md-default-fg-color);display:inline-block;font-size:.75em;padding:0 .6666666667em;vertical-align:text-top;word-break:break-word}.md-typeset mark{background-color:var(--md-typeset-mark-color);-webkit-box-decoration-break:clone;box-decoration-break:clone;color:inherit;word-break:break-word}.md-typeset abbr{border-bottom:.05rem dotted var(--md-default-fg-color--light);cursor:help;text-decoration:none}@media (hover:none){.md-typeset abbr{position:relative}.md-typeset abbr[title]:-webkit-any(:focus,:hover):after{background-color:var(--md-default-fg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z3);color:var(--md-default-bg-color);content:attr(title);display:inline-block;font-size:.7rem;margin-top:2em;max-width:80%;min-width:-webkit-max-content;min-width:max-content;padding:.2rem .3rem;position:absolute;width:auto}.md-typeset abbr[title]:-moz-any(:focus,:hover):after{background-color:var(--md-default-fg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z3);color:var(--md-default-bg-color);content:attr(title);display:inline-block;font-size:.7rem;margin-top:2em;max-width:80%;min-width:-moz-max-content;min-width:max-content;padding:.2rem .3rem;position:absolute;width:auto}[dir=ltr] .md-typeset abbr[title]:-webkit-any(:focus,:hover):after{left:0}[dir=ltr] .md-typeset abbr[title]:-moz-any(:focus,:hover):after{left:0}[dir=ltr] .md-typeset abbr[title]:is(:focus,:hover):after{left:0}[dir=rtl] .md-typeset abbr[title]:-webkit-any(:focus,:hover):after{right:0}[dir=rtl] .md-typeset abbr[title]:-moz-any(:focus,:hover):after{right:0}[dir=rtl] .md-typeset abbr[title]:is(:focus,:hover):after{right:0}.md-typeset abbr[title]:is(:focus,:hover):after{background-color:var(--md-default-fg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z3);color:var(--md-default-bg-color);content:attr(title);display:inline-block;font-size:.7rem;margin-top:2em;max-width:80%;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:.2rem .3rem;position:absolute;width:auto}}.md-typeset small{opacity:.75}[dir=ltr] .md-typeset sub,[dir=ltr] .md-typeset sup{margin-left:.078125em}[dir=rtl] .md-typeset sub,[dir=rtl] .md-typeset sup{margin-right:.078125em}[dir=ltr] .md-typeset blockquote{padding-left:.6rem}[dir=rtl] .md-typeset blockquote{padding-right:.6rem}[dir=ltr] .md-typeset blockquote{border-left:.2rem solid var(--md-default-fg-color--lighter)}[dir=rtl] .md-typeset blockquote{border-right:.2rem solid var(--md-default-fg-color--lighter)}.md-typeset blockquote{color:var(--md-default-fg-color--light);margin-left:0;margin-right:0}.md-typeset ul{list-style-type:disc}[dir=ltr] .md-typeset ol,[dir=ltr] .md-typeset ul{margin-left:.625em}[dir=rtl] .md-typeset ol,[dir=rtl] .md-typeset ul{margin-right:.625em}.md-typeset ol,.md-typeset ul{padding:0}.md-typeset ol:not([hidden]),.md-typeset ul:not([hidden]){display:flow-root}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}[dir=ltr] .md-typeset ol li,[dir=ltr] .md-typeset ul li{margin-left:1.25em}[dir=rtl] .md-typeset ol li,[dir=rtl] .md-typeset ul li{margin-right:1.25em}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li :-webkit-any(ul,ol),.md-typeset ul li :-webkit-any(ul,ol){margin-bottom:.5em;margin-top:.5em}.md-typeset ol li :-moz-any(ul,ol),.md-typeset ul li :-moz-any(ul,ol){margin-bottom:.5em;margin-top:.5em}[dir=ltr] .md-typeset ol li :-webkit-any(ul,ol),[dir=ltr] .md-typeset ul li :-webkit-any(ul,ol){margin-left:.625em}[dir=ltr] .md-typeset ol li :-moz-any(ul,ol),[dir=ltr] .md-typeset ul li :-moz-any(ul,ol){margin-left:.625em}[dir=ltr] .md-typeset ol li :is(ul,ol),[dir=ltr] .md-typeset ul li :is(ul,ol){margin-left:.625em}[dir=rtl] .md-typeset ol li :-webkit-any(ul,ol),[dir=rtl] .md-typeset ul li :-webkit-any(ul,ol){margin-right:.625em}[dir=rtl] .md-typeset ol li :-moz-any(ul,ol),[dir=rtl] .md-typeset ul li :-moz-any(ul,ol){margin-right:.625em}[dir=rtl] .md-typeset ol li :is(ul,ol),[dir=rtl] .md-typeset ul li :is(ul,ol){margin-right:.625em}.md-typeset ol li :is(ul,ol),.md-typeset ul li :is(ul,ol){margin-bottom:.5em;margin-top:.5em}[dir=ltr] .md-typeset dd{margin-left:1.875em}[dir=rtl] .md-typeset dd{margin-right:1.875em}.md-typeset dd{margin-bottom:1.5em;margin-top:1em}.md-typeset img,.md-typeset svg,.md-typeset video{height:auto;max-width:100%}.md-typeset img[align=left]{margin:1em 1em 1em 0}.md-typeset img[align=right]{margin:1em 0 1em 1em}.md-typeset img[align]:only-child{margin-top:0}.md-typeset img[src$="#gh-dark-mode-only"],.md-typeset img[src$="#only-dark"]{display:none}.md-typeset figure{display:flow-root;margin:1em auto;max-width:100%;text-align:center;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.md-typeset figure img{display:block}.md-typeset figcaption{font-style:italic;margin:1em auto;max-width:24rem}.md-typeset iframe{max-width:100%}.md-typeset table:not([class]){background-color:var(--md-default-bg-color);border:.05rem solid var(--md-typeset-table-color);border-radius:.1rem;display:inline-block;font-size:.64rem;max-width:100%;overflow:auto;touch-action:auto}@media print{.md-typeset table:not([class]){display:table}}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) :-webkit-any(th,td)>:first-child{margin-top:0}.md-typeset table:not([class]) :-moz-any(th,td)>:first-child{margin-top:0}.md-typeset table:not([class]) :is(th,td)>:first-child{margin-top:0}.md-typeset table:not([class]) :-webkit-any(th,td)>:last-child{margin-bottom:0}.md-typeset table:not([class]) :-moz-any(th,td)>:last-child{margin-bottom:0}.md-typeset table:not([class]) :is(th,td)>:last-child{margin-bottom:0}.md-typeset table:not([class]) :-webkit-any(th,td):not([align]){text-align:left}.md-typeset table:not([class]) :-moz-any(th,td):not([align]){text-align:left}.md-typeset table:not([class]) :is(th,td):not([align]){text-align:left}[dir=rtl] .md-typeset table:not([class]) :-webkit-any(th,td):not([align]){text-align:right}[dir=rtl] .md-typeset table:not([class]) :-moz-any(th,td):not([align]){text-align:right}[dir=rtl] .md-typeset table:not([class]) :is(th,td):not([align]){text-align:right}.md-typeset table:not([class]) th{font-weight:700;min-width:5rem;padding:.9375em 1.25em;vertical-align:top}.md-typeset table:not([class]) th a{color:inherit}.md-typeset table:not([class]) td{border-top:.05rem solid var(--md-typeset-table-color);padding:.9375em 1.25em;vertical-align:top}.md-typeset table:not([class]) tbody tr{transition:background-color 125ms}.md-typeset table:not([class]) tbody tr:hover{background-color:rgba(0,0,0,.035);box-shadow:0 .05rem 0 var(--md-default-bg-color) inset}.md-typeset table:not([class]) a{word-break:normal}.md-typeset table th[role=columnheader]{cursor:pointer}[dir=ltr] .md-typeset table th[role=columnheader]:after{margin-left:.5em}[dir=rtl] .md-typeset table th[role=columnheader]:after{margin-right:.5em}.md-typeset table th[role=columnheader]:after{content:"";display:inline-block;height:1.2em;-webkit-mask-image:var(--md-typeset-table-sort-icon);mask-image:var(--md-typeset-table-sort-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;transition:background-color 125ms;vertical-align:text-bottom;width:1.2em}.md-typeset table th[role=columnheader]:hover:after{background-color:var(--md-default-fg-color--lighter)}.md-typeset table th[role=columnheader][aria-sort=ascending]:after{background-color:var(--md-default-fg-color--light);-webkit-mask-image:var(--md-typeset-table-sort-icon--asc);mask-image:var(--md-typeset-table-sort-icon--asc)}.md-typeset table th[role=columnheader][aria-sort=descending]:after{background-color:var(--md-default-fg-color--light);-webkit-mask-image:var(--md-typeset-table-sort-icon--desc);mask-image:var(--md-typeset-table-sort-icon--desc)}.md-typeset__scrollwrap{margin:1em -.8rem;overflow-x:auto;touch-action:auto}.md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 .8rem}@media print{.md-typeset__table{display:block}}html .md-typeset__table table{display:table;margin:0;overflow:hidden;width:100%}@media screen and (max-width:44.9375em){.md-content__inner>pre{margin:1em -.8rem}.md-content__inner>pre code{border-radius:0}}.md-banner{background-color:var(--md-footer-bg-color);color:var(--md-footer-fg-color);overflow:auto}@media print{.md-banner{display:none}}.md-banner--warning{background:var(--md-typeset-mark-color);color:var(--md-default-fg-color)}.md-banner__inner{font-size:.7rem;margin:.6rem auto;padding:0 .8rem}html{font-size:125%;height:100%;overflow-x:hidden}@media screen and (min-width:100em){html{font-size:137.5%}}@media screen and (min-width:125em){html{font-size:150%}}body{background-color:var(--md-default-bg-color);display:flex;flex-direction:column;font-size:.5rem;min-height:100%;position:relative;width:100%}@media print{body{display:block}}@media screen and (max-width:59.9375em){body[data-md-scrolllock]{position:fixed}}.md-grid{margin-left:auto;margin-right:auto;max-width:61rem}.md-container{display:flex;flex-direction:column;flex-grow:1}@media print{.md-container{display:block}}.md-main{flex-grow:1}.md-main__inner{display:flex;height:100%;margin-top:1.5rem}.md-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md-toggle{display:none}.md-option{height:0;opacity:0;position:absolute;width:0}.md-option:checked+label:not([hidden]){display:block}.md-option.focus-visible+label{outline-color:var(--md-accent-fg-color);outline-style:auto}.md-skip{background-color:var(--md-default-fg-color);border-radius:.1rem;color:var(--md-default-bg-color);font-size:.64rem;margin:.5rem;opacity:0;outline-color:var(--md-accent-fg-color);padding:.3rem .5rem;position:fixed;transform:translateY(.4rem);z-index:-1}.md-skip:focus{opacity:1;transform:translateY(0);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity 175ms 75ms;z-index:10}@page{margin:25mm}:root{--md-clipboard-icon:url('data:image/svg+xml;charset=utf-8,')}.md-clipboard{border-radius:.1rem;color:var(--md-default-fg-color--lightest);cursor:pointer;height:1.5em;outline-color:var(--md-accent-fg-color);outline-offset:.1rem;position:absolute;right:.5em;top:.5em;transition:color .25s;width:1.5em;z-index:1}@media print{.md-clipboard{display:none}}.md-clipboard:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}:hover>.md-clipboard{color:var(--md-default-fg-color--light)}.md-clipboard:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-clipboard:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-clipboard:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-clipboard:after{background-color:currentcolor;content:"";display:block;height:1.125em;margin:0 auto;-webkit-mask-image:var(--md-clipboard-icon);mask-image:var(--md-clipboard-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:1.125em}.md-clipboard--inline{cursor:pointer}.md-clipboard--inline code{transition:color .25s,background-color .25s}.md-clipboard--inline:-webkit-any(:focus,:hover) code{background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-clipboard--inline:-moz-any(:focus,:hover) code{background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-clipboard--inline:is(:focus,:hover) code{background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-content{flex-grow:1;min-width:0}.md-content__inner{margin:0 .8rem 1.2rem;padding-top:.6rem}@media screen and (min-width:76.25em){[dir=ltr] .md-sidebar--primary:not([hidden])~.md-content>.md-content__inner{margin-left:1.2rem}[dir=ltr] .md-sidebar--secondary:not([hidden])~.md-content>.md-content__inner,[dir=rtl] .md-sidebar--primary:not([hidden])~.md-content>.md-content__inner{margin-right:1.2rem}[dir=rtl] .md-sidebar--secondary:not([hidden])~.md-content>.md-content__inner{margin-left:1.2rem}}.md-content__inner:before{content:"";display:block;height:.4rem}.md-content__inner>:last-child{margin-bottom:0}[dir=ltr] .md-content__button{margin-left:.4rem}[dir=rtl] .md-content__button{margin-right:.4rem}.md-content__button{float:right;margin:.4rem 0;padding:0}@media print{.md-content__button{display:none}}[dir=rtl] .md-content__button{float:left}.md-typeset .md-content__button{color:var(--md-default-fg-color--lighter)}.md-content__button svg{display:inline;vertical-align:top}[dir=rtl] .md-content__button svg{transform:scaleX(-1)}[dir=ltr] .md-dialog{right:.8rem}[dir=rtl] .md-dialog{left:.8rem}.md-dialog{background-color:var(--md-default-fg-color);border-radius:.1rem;bottom:.8rem;box-shadow:var(--md-shadow-z3);min-width:11.1rem;opacity:0;padding:.4rem .6rem;pointer-events:none;position:fixed;transform:translateY(100%);transition:transform 0ms .4s,opacity .4s;z-index:4}@media print{.md-dialog{display:none}}.md-dialog--active{opacity:1;pointer-events:auto;transform:translateY(0);transition:transform .4s cubic-bezier(.075,.85,.175,1),opacity .4s}.md-dialog__inner{color:var(--md-default-bg-color);font-size:.7rem}.md-footer{background-color:var(--md-footer-bg-color);color:var(--md-footer-fg-color)}@media print{.md-footer{display:none}}.md-footer__inner{justify-content:space-between;overflow:auto;padding:.2rem}.md-footer__inner:not([hidden]){display:flex}.md-footer__link{display:flex;flex-grow:0.01;outline-color:var(--md-accent-fg-color);overflow:hidden;padding-bottom:.4rem;padding-top:1.4rem;transition:opacity .25s}.md-footer__link:-webkit-any(:focus,:hover){opacity:.7}.md-footer__link:-moz-any(:focus,:hover){opacity:.7}.md-footer__link:is(:focus,:hover){opacity:.7}[dir=rtl] .md-footer__link svg{transform:scaleX(-1)}@media screen and (max-width:44.9375em){.md-footer__link--prev .md-footer__title{display:none}}[dir=ltr] .md-footer__link--next{margin-left:auto}[dir=rtl] .md-footer__link--next{margin-right:auto}.md-footer__link--next{text-align:right}[dir=rtl] .md-footer__link--next{text-align:left}.md-footer__title{flex-grow:1;font-size:.9rem;line-height:2.4rem;max-width:calc(100% - 2.4rem);padding:0 1rem;position:relative;white-space:nowrap}.md-footer__button{margin:.2rem;padding:.4rem}.md-footer__direction{font-size:.64rem;left:0;margin-top:-1rem;opacity:.7;padding:0 1rem;position:absolute;right:0}.md-footer-meta{background-color:var(--md-footer-bg-color--dark)}.md-footer-meta__inner{display:flex;flex-wrap:wrap;justify-content:space-between;padding:.2rem}html .md-footer-meta.md-typeset a{color:var(--md-footer-fg-color--light)}html .md-footer-meta.md-typeset a:-webkit-any(:focus,:hover){color:var(--md-footer-fg-color)}html .md-footer-meta.md-typeset a:-moz-any(:focus,:hover){color:var(--md-footer-fg-color)}html .md-footer-meta.md-typeset a:is(:focus,:hover){color:var(--md-footer-fg-color)}.md-copyright{color:var(--md-footer-fg-color--lighter);font-size:.64rem;margin:auto .6rem;padding:.4rem 0;width:100%}@media screen and (min-width:45em){.md-copyright{width:auto}}.md-copyright__highlight{color:var(--md-footer-fg-color--light)}.md-social{margin:0 .4rem;padding:.2rem 0 .6rem}@media screen and (min-width:45em){.md-social{padding:.6rem 0}}.md-social__link{display:inline-block;height:1.6rem;text-align:center;width:1.6rem}.md-social__link:before{line-height:1.9}.md-social__link svg{fill:currentcolor;max-height:.8rem;vertical-align:-25%}.md-typeset .md-button{border:.1rem solid;border-radius:.1rem;color:var(--md-primary-fg-color);cursor:pointer;display:inline-block;font-weight:700;padding:.625em 2em;transition:color 125ms,background-color 125ms,border-color 125ms}.md-typeset .md-button--primary{background-color:var(--md-primary-fg-color);border-color:var(--md-primary-fg-color);color:var(--md-primary-bg-color)}.md-typeset .md-button:-webkit-any(:focus,:hover){background-color:var(--md-accent-fg-color);border-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-typeset .md-button:-moz-any(:focus,:hover){background-color:var(--md-accent-fg-color);border-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-typeset .md-button:is(:focus,:hover){background-color:var(--md-accent-fg-color);border-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}[dir=ltr] .md-typeset .md-input{border-top-left-radius:.1rem}[dir=ltr] .md-typeset .md-input,[dir=rtl] .md-typeset .md-input{border-top-right-radius:.1rem}[dir=rtl] .md-typeset .md-input{border-top-left-radius:.1rem}.md-typeset .md-input{border-bottom:.1rem solid var(--md-default-fg-color--lighter);box-shadow:var(--md-shadow-z1);font-size:.8rem;height:1.8rem;padding:0 .6rem;transition:border .25s,box-shadow .25s}.md-typeset .md-input:-webkit-any(:focus,:hover){border-bottom-color:var(--md-accent-fg-color);box-shadow:var(--md-shadow-z2)}.md-typeset .md-input:-moz-any(:focus,:hover){border-bottom-color:var(--md-accent-fg-color);box-shadow:var(--md-shadow-z2)}.md-typeset .md-input:is(:focus,:hover){border-bottom-color:var(--md-accent-fg-color);box-shadow:var(--md-shadow-z2)}.md-typeset .md-input--stretch{width:100%}.md-header{background-color:var(--md-primary-fg-color);box-shadow:0 0 .2rem transparent,0 .2rem .4rem transparent;color:var(--md-primary-bg-color);display:block;left:0;position:-webkit-sticky;position:sticky;right:0;top:0;z-index:4}@media print{.md-header{display:none}}.md-header[hidden]{transform:translateY(-100%);transition:transform .25s cubic-bezier(.8,0,.6,1),box-shadow .25s}.md-header--shadow{box-shadow:0 0 .2rem rgba(0,0,0,.1),0 .2rem .4rem rgba(0,0,0,.2);transition:transform .25s cubic-bezier(.1,.7,.1,1),box-shadow .25s}.md-header__inner{align-items:center;display:flex;padding:0 .2rem}.md-header__button{color:currentcolor;cursor:pointer;margin:.2rem;outline-color:var(--md-accent-fg-color);padding:.4rem;position:relative;transition:opacity .25s;vertical-align:middle;z-index:1}.md-header__button:hover{opacity:.7}.md-header__button:not([hidden]){display:inline-block}.md-header__button:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}.md-header__button.md-logo{margin:.2rem;padding:.4rem}@media screen and (max-width:76.1875em){.md-header__button.md-logo{display:none}}.md-header__button.md-logo :-webkit-any(img,svg){fill:currentcolor;display:block;height:1.2rem;width:auto}.md-header__button.md-logo :-moz-any(img,svg){fill:currentcolor;display:block;height:1.2rem;width:auto}.md-header__button.md-logo :is(img,svg){fill:currentcolor;display:block;height:1.2rem;width:auto}@media screen and (min-width:60em){.md-header__button[for=__search]{display:none}}.no-js .md-header__button[for=__search]{display:none}[dir=rtl] .md-header__button[for=__search] svg{transform:scaleX(-1)}@media screen and (min-width:76.25em){.md-header__button[for=__drawer]{display:none}}.md-header__topic{display:flex;max-width:100%;position:absolute;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;white-space:nowrap}.md-header__topic+.md-header__topic{opacity:0;pointer-events:none;transform:translateX(1.25rem);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;z-index:-1}[dir=rtl] .md-header__topic+.md-header__topic{transform:translateX(-1.25rem)}.md-header__topic:first-child{font-weight:700}[dir=ltr] .md-header__title{margin-right:.4rem}[dir=rtl] .md-header__title{margin-left:.4rem}[dir=ltr] .md-header__title{margin-left:1rem}[dir=rtl] .md-header__title{margin-right:1rem}.md-header__title{flex-grow:1;font-size:.9rem;height:2.4rem;line-height:2.4rem}.md-header__title--active .md-header__topic{opacity:0;pointer-events:none;transform:translateX(-1.25rem);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;z-index:-1}[dir=rtl] .md-header__title--active .md-header__topic{transform:translateX(1.25rem)}.md-header__title--active .md-header__topic+.md-header__topic{opacity:1;pointer-events:auto;transform:translateX(0);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;z-index:0}.md-header__title>.md-header__ellipsis{height:100%;position:relative;width:100%}.md-header__option{display:flex;flex-shrink:0;max-width:100%;transition:max-width 0ms .25s,opacity .25s .25s;white-space:nowrap}[data-md-toggle=search]:checked~.md-header .md-header__option{max-width:0;opacity:0;transition:max-width 0ms,opacity 0ms}.md-header__source{display:none}@media screen and (min-width:60em){[dir=ltr] .md-header__source{margin-left:1rem}[dir=rtl] .md-header__source{margin-right:1rem}.md-header__source{display:block;max-width:11.7rem;width:11.7rem}}@media screen and (min-width:76.25em){[dir=ltr] .md-header__source{margin-left:1.4rem}[dir=rtl] .md-header__source{margin-right:1.4rem}}:root{--md-nav-icon--prev:url('data:image/svg+xml;charset=utf-8,');--md-nav-icon--next:url('data:image/svg+xml;charset=utf-8,');--md-toc-icon:url('data:image/svg+xml;charset=utf-8,')}.md-nav{font-size:.7rem;line-height:1.3}.md-nav__title{display:block;font-weight:700;overflow:hidden;padding:0 .6rem;text-overflow:ellipsis}.md-nav__title .md-nav__button{display:none}.md-nav__title .md-nav__button img{height:100%;width:auto}.md-nav__title .md-nav__button.md-logo :-webkit-any(img,svg){fill:currentcolor;display:block;height:2.4rem;max-width:100%;object-fit:contain;width:auto}.md-nav__title .md-nav__button.md-logo :-moz-any(img,svg){fill:currentcolor;display:block;height:2.4rem;max-width:100%;object-fit:contain;width:auto}.md-nav__title .md-nav__button.md-logo :is(img,svg){fill:currentcolor;display:block;height:2.4rem;max-width:100%;object-fit:contain;width:auto}.md-nav__list{list-style:none;margin:0;padding:0}.md-nav__item{padding:0 .6rem}[dir=ltr] .md-nav__item .md-nav__item{padding-right:0}[dir=rtl] .md-nav__item .md-nav__item{padding-left:0}.md-nav__link{align-items:center;cursor:pointer;display:flex;justify-content:space-between;margin-top:.625em;overflow:hidden;scroll-snap-align:start;text-overflow:ellipsis;transition:color 125ms}.md-nav__link--passed{color:var(--md-default-fg-color--light)}.md-nav__item .md-nav__link--active{color:var(--md-typeset-a-color)}.md-nav__item .md-nav__link--index [href]{width:100%}.md-nav__link:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav__link:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav__link:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav__link.focus-visible{outline-color:var(--md-accent-fg-color);outline-offset:.2rem}.md-nav--primary .md-nav__link[for=__toc]{display:none}.md-nav--primary .md-nav__link[for=__toc] .md-icon:after{background-color:currentcolor;display:block;height:100%;-webkit-mask-image:var(--md-toc-icon);mask-image:var(--md-toc-icon);width:100%}.md-nav--primary .md-nav__link[for=__toc]~.md-nav{display:none}.md-nav__link>*{cursor:pointer;display:flex}.md-nav__icon{flex-shrink:0}.md-nav__source{display:none}@media screen and (max-width:76.1875em){.md-nav--primary,.md-nav--primary .md-nav{background-color:var(--md-default-bg-color);display:flex;flex-direction:column;height:100%;left:0;position:absolute;right:0;top:0;z-index:1}.md-nav--primary :-webkit-any(.md-nav__title,.md-nav__item){font-size:.8rem;line-height:1.5}.md-nav--primary :-moz-any(.md-nav__title,.md-nav__item){font-size:.8rem;line-height:1.5}.md-nav--primary :is(.md-nav__title,.md-nav__item){font-size:.8rem;line-height:1.5}.md-nav--primary .md-nav__title{background-color:var(--md-default-fg-color--lightest);color:var(--md-default-fg-color--light);cursor:pointer;height:5.6rem;line-height:2.4rem;padding:3rem .8rem .2rem;position:relative;white-space:nowrap}[dir=ltr] .md-nav--primary .md-nav__title .md-nav__icon{left:.4rem}[dir=rtl] .md-nav--primary .md-nav__title .md-nav__icon{right:.4rem}.md-nav--primary .md-nav__title .md-nav__icon{display:block;height:1.2rem;margin:.2rem;position:absolute;top:.4rem;width:1.2rem}.md-nav--primary .md-nav__title .md-nav__icon:after{background-color:currentcolor;content:"";display:block;height:100%;-webkit-mask-image:var(--md-nav-icon--prev);mask-image:var(--md-nav-icon--prev);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:100%}.md-nav--primary .md-nav__title~.md-nav__list{background-color:var(--md-default-bg-color);box-shadow:0 .05rem 0 var(--md-default-fg-color--lightest) inset;overflow-y:auto;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;touch-action:pan-y}.md-nav--primary .md-nav__title~.md-nav__list>:first-child{border-top:0}.md-nav--primary .md-nav__title[for=__drawer]{background-color:var(--md-primary-fg-color);color:var(--md-primary-bg-color);font-weight:700}.md-nav--primary .md-nav__title .md-logo{display:block;left:.2rem;margin:.2rem;padding:.4rem;position:absolute;right:.2rem;top:.2rem}.md-nav--primary .md-nav__list{flex:1}.md-nav--primary .md-nav__item{border-top:.05rem solid var(--md-default-fg-color--lightest);padding:0}.md-nav--primary .md-nav__item--active>.md-nav__link{color:var(--md-typeset-a-color)}.md-nav--primary .md-nav__item--active>.md-nav__link:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav--primary .md-nav__item--active>.md-nav__link:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav--primary .md-nav__item--active>.md-nav__link:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-nav--primary .md-nav__link{margin-top:0;padding:.6rem .8rem}[dir=ltr] .md-nav--primary .md-nav__link .md-nav__icon{margin-right:-.2rem}[dir=rtl] .md-nav--primary .md-nav__link .md-nav__icon{margin-left:-.2rem}.md-nav--primary .md-nav__link .md-nav__icon{font-size:1.2rem;height:1.2rem;width:1.2rem}.md-nav--primary .md-nav__link .md-nav__icon:after{background-color:currentcolor;content:"";display:block;height:100%;-webkit-mask-image:var(--md-nav-icon--next);mask-image:var(--md-nav-icon--next);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:100%}[dir=rtl] .md-nav--primary .md-nav__icon:after{transform:scale(-1)}.md-nav--primary .md-nav--secondary .md-nav{background-color:initial;position:static}[dir=ltr] .md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:1.4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-right:1.4rem}[dir=ltr] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-right:2rem}[dir=ltr] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:2.6rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-right:2.6rem}[dir=ltr] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:3.2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-right:3.2rem}.md-nav--secondary{background-color:initial}.md-nav__toggle~.md-nav{display:flex;opacity:0;transform:translateX(100%);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity 125ms 50ms}[dir=rtl] .md-nav__toggle~.md-nav{transform:translateX(-100%)}.md-nav__toggle:checked~.md-nav{opacity:1;transform:translateX(0);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity 125ms 125ms}.md-nav__toggle:checked~.md-nav>.md-nav__list{-webkit-backface-visibility:hidden;backface-visibility:hidden}}@media screen and (max-width:59.9375em){.md-nav--primary .md-nav__link[for=__toc]{display:flex}.md-nav--primary .md-nav__link[for=__toc] .md-icon:after{content:""}.md-nav--primary .md-nav__link[for=__toc]+.md-nav__link{display:none}.md-nav--primary .md-nav__link[for=__toc]~.md-nav{display:flex}.md-nav__source{background-color:var(--md-primary-fg-color--dark);color:var(--md-primary-bg-color);display:block;padding:0 .2rem}}@media screen and (min-width:60em) and (max-width:76.1875em){.md-nav--integrated .md-nav__link[for=__toc]{display:flex}.md-nav--integrated .md-nav__link[for=__toc] .md-icon:after{content:""}.md-nav--integrated .md-nav__link[for=__toc]+.md-nav__link{display:none}.md-nav--integrated .md-nav__link[for=__toc]~.md-nav{display:flex}}@media screen and (min-width:60em){.md-nav--secondary .md-nav__title[for=__toc]{scroll-snap-align:start}.md-nav--secondary .md-nav__title .md-nav__icon{display:none}}@media screen and (min-width:76.25em){.md-nav{transition:max-height .25s cubic-bezier(.86,0,.07,1)}.md-nav--primary .md-nav__title[for=__drawer]{scroll-snap-align:start}.md-nav--primary .md-nav__title .md-nav__icon,.md-nav__toggle~.md-nav{display:none}.md-nav__toggle:-webkit-any(:checked,:indeterminate)~.md-nav{display:block}.md-nav__toggle:-moz-any(:checked,:indeterminate)~.md-nav{display:block}.md-nav__toggle:is(:checked,:indeterminate)~.md-nav{display:block}.md-nav__item--nested>.md-nav>.md-nav__title{display:none}.md-nav__item--section{display:block;margin:1.25em 0}.md-nav__item--section:last-child{margin-bottom:0}.md-nav__item--section>.md-nav__link{font-weight:700;pointer-events:none}.md-nav__item--section>.md-nav__link--index [href]{pointer-events:auto}.md-nav__item--section>.md-nav__link .md-nav__icon{display:none}.md-nav__item--section>.md-nav{display:block}.md-nav__item--section>.md-nav>.md-nav__list>.md-nav__item{padding:0}.md-nav__icon{border-radius:100%;float:right;height:.9rem;transition:background-color .25s,transform .25s;width:.9rem}[dir=rtl] .md-nav__icon{float:left;transform:rotate(180deg)}.md-nav__icon:hover{background-color:var(--md-accent-fg-color--transparent)}.md-nav__icon:after{background-color:currentcolor;content:"";display:inline-block;height:100%;-webkit-mask-image:var(--md-nav-icon--next);mask-image:var(--md-nav-icon--next);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;vertical-align:-.1rem;width:100%}.md-nav__item--nested .md-nav__toggle:checked~.md-nav__link .md-nav__icon,.md-nav__item--nested .md-nav__toggle:indeterminate~.md-nav__link .md-nav__icon{transform:rotate(90deg)}.md-nav--lifted>.md-nav__list>.md-nav__item,.md-nav--lifted>.md-nav__list>.md-nav__item--nested,.md-nav--lifted>.md-nav__title{display:none}.md-nav--lifted>.md-nav__list>.md-nav__item--active{display:block;padding:0}.md-nav--lifted>.md-nav__list>.md-nav__item--active>.md-nav__link{font-weight:700;margin-top:0;padding:0 .6rem;pointer-events:none}.md-nav--lifted>.md-nav__list>.md-nav__item--active>.md-nav__link--index [href]{pointer-events:auto}.md-nav--lifted>.md-nav__list>.md-nav__item--active>.md-nav__link .md-nav__icon{display:none}.md-nav--lifted .md-nav[data-md-level="1"]{display:block}[dir=ltr] .md-nav--lifted .md-nav[data-md-level="1"]>.md-nav__list>.md-nav__item{padding-right:.6rem}[dir=rtl] .md-nav--lifted .md-nav[data-md-level="1"]>.md-nav__list>.md-nav__item{padding-left:.6rem}.md-nav--integrated>.md-nav__list>.md-nav__item--active:not(.md-nav__item--nested){padding:0 .6rem}.md-nav--integrated>.md-nav__list>.md-nav__item--active:not(.md-nav__item--nested)>.md-nav__link{padding:0}[dir=ltr] .md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary{border-left:.05rem solid var(--md-primary-fg-color)}[dir=rtl] .md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary{border-right:.05rem solid var(--md-primary-fg-color)}.md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary{display:block;margin-bottom:1.25em}.md-nav--integrated>.md-nav__list>.md-nav__item--active .md-nav--secondary>.md-nav__title{display:none}}:root{--md-search-result-icon:url('data:image/svg+xml;charset=utf-8,')}.md-search{position:relative}@media screen and (min-width:60em){.md-search{padding:.2rem 0}}.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}@media screen and (max-width:59.9375em){[dir=ltr] .md-search__overlay{left:-2.2rem}[dir=rtl] .md-search__overlay{right:-2.2rem}.md-search__overlay{background-color:var(--md-default-bg-color);border-radius:1rem;height:2rem;overflow:hidden;pointer-events:none;position:absolute;top:-1rem;transform-origin:center;transition:transform .3s .1s,opacity .2s .2s;width:2rem}[data-md-toggle=search]:checked~.md-header .md-search__overlay{opacity:1;transition:transform .4s,opacity .1s}}@media screen and (min-width:60em){[dir=ltr] .md-search__overlay{left:0}[dir=rtl] .md-search__overlay{right:0}.md-search__overlay{background-color:rgba(0,0,0,.54);cursor:pointer;height:0;position:fixed;top:0;transition:width 0ms .25s,height 0ms .25s,opacity .25s;width:0}[data-md-toggle=search]:checked~.md-header .md-search__overlay{height:200vh;opacity:1;transition:width 0ms,height 0ms,opacity .25s;width:100%}}@media screen and (max-width:29.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{transform:scale(45)}}@media screen and (min-width:30em) and (max-width:44.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{transform:scale(60)}}@media screen and (min-width:45em) and (max-width:59.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{transform:scale(75)}}.md-search__inner{-webkit-backface-visibility:hidden;backface-visibility:hidden}@media screen and (max-width:59.9375em){[dir=ltr] .md-search__inner{left:0}[dir=rtl] .md-search__inner{right:0}.md-search__inner{height:0;opacity:0;overflow:hidden;position:fixed;top:0;transform:translateX(5%);transition:width 0ms .3s,height 0ms .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;width:0;z-index:2}[dir=rtl] .md-search__inner{transform:translateX(-5%)}[data-md-toggle=search]:checked~.md-header .md-search__inner{height:100%;opacity:1;transform:translateX(0);transition:width 0ms 0ms,height 0ms 0ms,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;width:100%}}@media screen and (min-width:60em){.md-search__inner{float:right;padding:.1rem 0;position:relative;transition:width .25s cubic-bezier(.1,.7,.1,1);width:11.7rem}[dir=rtl] .md-search__inner{float:left}}@media screen and (min-width:60em) and (max-width:76.1875em){[data-md-toggle=search]:checked~.md-header .md-search__inner{width:23.4rem}}@media screen and (min-width:76.25em){[data-md-toggle=search]:checked~.md-header .md-search__inner{width:34.4rem}}.md-search__form{background-color:var(--md-default-bg-color);box-shadow:0 0 .6rem transparent;height:2.4rem;position:relative;transition:color .25s,background-color .25s;z-index:2}@media screen and (min-width:60em){.md-search__form{background-color:rgba(0,0,0,.26);border-radius:.1rem;height:1.8rem}.md-search__form:hover{background-color:hsla(0,0%,100%,.12)}}[data-md-toggle=search]:checked~.md-header .md-search__form{background-color:var(--md-default-bg-color);border-radius:.1rem .1rem 0 0;box-shadow:0 0 .6rem rgba(0,0,0,.07);color:var(--md-default-fg-color)}[dir=ltr] .md-search__input{padding-left:3.6rem;padding-right:2.2rem}[dir=rtl] .md-search__input{padding-left:2.2rem;padding-right:3.6rem}.md-search__input{background:transparent;font-size:.9rem;height:100%;position:relative;text-overflow:ellipsis;width:100%;z-index:2}.md-search__input::-ms-input-placeholder{-ms-transition:color .25s;transition:color .25s}.md-search__input::placeholder{transition:color .25s}.md-search__input::-ms-input-placeholder{color:var(--md-default-fg-color--light)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:var(--md-default-fg-color--light)}.md-search__input::-ms-clear{display:none}@media screen and (max-width:59.9375em){.md-search__input{font-size:.9rem;height:2.4rem;width:100%}}@media screen and (min-width:60em){[dir=ltr] .md-search__input{padding-left:2.2rem}[dir=rtl] .md-search__input{padding-right:2.2rem}.md-search__input{color:inherit;font-size:.8rem}.md-search__input::-ms-input-placeholder{color:var(--md-primary-bg-color--light)}.md-search__input::placeholder{color:var(--md-primary-bg-color--light)}.md-search__input+.md-search__icon{color:var(--md-primary-bg-color)}[data-md-toggle=search]:checked~.md-header .md-search__input{text-overflow:clip}[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:var(--md-default-fg-color--light)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:var(--md-default-fg-color--light)}}.md-search__icon{cursor:pointer;display:inline-block;height:1.2rem;transition:color .25s,opacity .25s;width:1.2rem}.md-search__icon:hover{opacity:.7}[dir=ltr] .md-search__icon[for=__search]{left:.5rem}[dir=rtl] .md-search__icon[for=__search]{right:.5rem}.md-search__icon[for=__search]{position:absolute;top:.3rem;z-index:2}[dir=rtl] .md-search__icon[for=__search] svg{transform:scaleX(-1)}@media screen and (max-width:59.9375em){[dir=ltr] .md-search__icon[for=__search]{left:.8rem}[dir=rtl] .md-search__icon[for=__search]{right:.8rem}.md-search__icon[for=__search]{top:.6rem}.md-search__icon[for=__search] svg:first-child{display:none}}@media screen and (min-width:60em){.md-search__icon[for=__search]{pointer-events:none}.md-search__icon[for=__search] svg:last-child{display:none}}[dir=ltr] .md-search__options{right:.5rem}[dir=rtl] .md-search__options{left:.5rem}.md-search__options{pointer-events:none;position:absolute;top:.3rem;z-index:2}@media screen and (max-width:59.9375em){[dir=ltr] .md-search__options{right:.8rem}[dir=rtl] .md-search__options{left:.8rem}.md-search__options{top:.6rem}}[dir=ltr] .md-search__options>*{margin-left:.2rem}[dir=rtl] .md-search__options>*{margin-right:.2rem}.md-search__options>*{color:var(--md-default-fg-color--light);opacity:0;transform:scale(.75);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s}.md-search__options>:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__options>*{opacity:1;pointer-events:auto;transform:scale(1)}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__options>:hover{opacity:.7}[dir=ltr] .md-search__suggest{padding-left:3.6rem;padding-right:2.2rem}[dir=rtl] .md-search__suggest{padding-left:2.2rem;padding-right:3.6rem}.md-search__suggest{align-items:center;color:var(--md-default-fg-color--lighter);display:flex;font-size:.9rem;height:100%;opacity:0;position:absolute;top:0;transition:opacity 50ms;white-space:nowrap;width:100%}@media screen and (min-width:60em){[dir=ltr] .md-search__suggest{padding-left:2.2rem}[dir=rtl] .md-search__suggest{padding-right:2.2rem}.md-search__suggest{font-size:.8rem}}[data-md-toggle=search]:checked~.md-header .md-search__suggest{opacity:1;transition:opacity .3s .1s}[dir=ltr] .md-search__output{border-bottom-left-radius:.1rem}[dir=ltr] .md-search__output,[dir=rtl] .md-search__output{border-bottom-right-radius:.1rem}[dir=rtl] .md-search__output{border-bottom-left-radius:.1rem}.md-search__output{overflow:hidden;position:absolute;width:100%;z-index:1}@media screen and (max-width:59.9375em){.md-search__output{bottom:0;top:2.4rem}}@media screen and (min-width:60em){.md-search__output{opacity:0;top:1.9rem;transition:opacity .4s}[data-md-toggle=search]:checked~.md-header .md-search__output{box-shadow:var(--md-shadow-z3);opacity:1}}.md-search__scrollwrap{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--md-default-bg-color);height:100%;overflow-y:auto;touch-action:pan-y}@media (-webkit-max-device-pixel-ratio:1),(max-resolution:1dppx){.md-search__scrollwrap{transform:translateZ(0)}}@media screen and (min-width:60em) and (max-width:76.1875em){.md-search__scrollwrap{width:23.4rem}}@media screen and (min-width:76.25em){.md-search__scrollwrap{width:34.4rem}}@media screen and (min-width:60em){.md-search__scrollwrap{max-height:0;scrollbar-color:var(--md-default-fg-color--lighter) transparent;scrollbar-width:thin}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap:hover{scrollbar-color:var(--md-accent-fg-color) transparent}.md-search__scrollwrap::-webkit-scrollbar{height:.2rem;width:.2rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:var(--md-default-fg-color--lighter)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:var(--md-accent-fg-color)}}.md-search-result{color:var(--md-default-fg-color);word-break:break-word}.md-search-result__meta{background-color:var(--md-default-fg-color--lightest);color:var(--md-default-fg-color--light);font-size:.64rem;line-height:1.8rem;padding:0 .8rem;scroll-snap-align:start}@media screen and (min-width:60em){[dir=ltr] .md-search-result__meta{padding-left:2.2rem}[dir=rtl] .md-search-result__meta{padding-right:2.2rem}}.md-search-result__list{list-style:none;margin:0;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-search-result__item{box-shadow:0 -.05rem var(--md-default-fg-color--lightest)}.md-search-result__item:first-child{box-shadow:none}.md-search-result__link{display:block;outline:none;scroll-snap-align:start;transition:background-color .25s}.md-search-result__link:-webkit-any(:focus,:hover){background-color:var(--md-accent-fg-color--transparent)}.md-search-result__link:-moz-any(:focus,:hover){background-color:var(--md-accent-fg-color--transparent)}.md-search-result__link:is(:focus,:hover){background-color:var(--md-accent-fg-color--transparent)}.md-search-result__link:last-child p:last-child{margin-bottom:.6rem}.md-search-result__more summary{color:var(--md-typeset-a-color);cursor:pointer;display:block;font-size:.64rem;outline:none;padding:.75em .8rem;scroll-snap-align:start;transition:color .25s,background-color .25s}@media screen and (min-width:60em){[dir=ltr] .md-search-result__more summary{padding-left:2.2rem}[dir=rtl] .md-search-result__more summary{padding-right:2.2rem}}.md-search-result__more summary:-webkit-any(:focus,:hover){background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-search-result__more summary:-moz-any(:focus,:hover){background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-search-result__more summary:is(:focus,:hover){background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-search-result__more summary::marker{display:none}.md-search-result__more summary::-webkit-details-marker{display:none}.md-search-result__more summary~*>*{opacity:.65}.md-search-result__article{overflow:hidden;padding:0 .8rem;position:relative}@media screen and (min-width:60em){[dir=ltr] .md-search-result__article{padding-left:2.2rem}[dir=rtl] .md-search-result__article{padding-right:2.2rem}}.md-search-result__article--document .md-search-result__title{font-size:.8rem;font-weight:400;line-height:1.4;margin:.55rem 0}[dir=ltr] .md-search-result__icon{left:0}[dir=rtl] .md-search-result__icon{right:0}.md-search-result__icon{color:var(--md-default-fg-color--light);height:1.2rem;margin:.5rem;position:absolute;width:1.2rem}@media screen and (max-width:59.9375em){.md-search-result__icon{display:none}}.md-search-result__icon:after{background-color:currentcolor;content:"";display:inline-block;height:100%;-webkit-mask-image:var(--md-search-result-icon);mask-image:var(--md-search-result-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:100%}[dir=rtl] .md-search-result__icon:after{transform:scaleX(-1)}.md-search-result__title{font-size:.64rem;font-weight:700;line-height:1.6;margin:.5em 0}.md-search-result__teaser{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:var(--md-default-fg-color--light);display:-webkit-box;font-size:.64rem;line-height:1.6;margin:.5em 0;max-height:2rem;overflow:hidden;text-overflow:ellipsis}@media screen and (max-width:44.9375em){.md-search-result__teaser{-webkit-line-clamp:3;max-height:3rem}}@media screen and (min-width:60em) and (max-width:76.1875em){.md-search-result__teaser{-webkit-line-clamp:3;max-height:3rem}}.md-search-result__teaser mark{background-color:initial;text-decoration:underline}.md-search-result__terms{font-size:.64rem;font-style:italic;margin:.5em 0}.md-search-result mark{background-color:initial;color:var(--md-accent-fg-color)}.md-select{position:relative;z-index:1}.md-select__inner{background-color:var(--md-default-bg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z2);color:var(--md-default-fg-color);left:50%;margin-top:.2rem;max-height:0;opacity:0;position:absolute;top:calc(100% - .2rem);transform:translate3d(-50%,.3rem,0);transition:transform .25s 375ms,opacity .25s .25s,max-height 0ms .5s}.md-select:-webkit-any(:focus-within,:hover) .md-select__inner{max-height:10rem;opacity:1;transform:translate3d(-50%,0,0);-webkit-transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms;transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms}.md-select:-moz-any(:focus-within,:hover) .md-select__inner{max-height:10rem;opacity:1;transform:translate3d(-50%,0,0);-moz-transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms;transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms}.md-select:is(:focus-within,:hover) .md-select__inner{max-height:10rem;opacity:1;transform:translate3d(-50%,0,0);transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height 0ms}.md-select__inner:after{border-bottom:.2rem solid transparent;border-bottom-color:var(--md-default-bg-color);border-left:.2rem solid transparent;border-right:.2rem solid transparent;border-top:0;content:"";height:0;left:50%;margin-left:-.2rem;margin-top:-.2rem;position:absolute;top:0;width:0}.md-select__list{border-radius:.1rem;font-size:.8rem;list-style-type:none;margin:0;max-height:inherit;overflow:auto;padding:0}.md-select__item{line-height:1.8rem}[dir=ltr] .md-select__link{padding-left:.6rem;padding-right:1.2rem}[dir=rtl] .md-select__link{padding-left:1.2rem;padding-right:.6rem}.md-select__link{cursor:pointer;display:block;outline:none;scroll-snap-align:start;transition:background-color .25s,color .25s;width:100%}.md-select__link:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-select__link:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-select__link:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-select__link:focus{background-color:var(--md-default-fg-color--lightest)}.md-sidebar{align-self:flex-start;flex-shrink:0;padding:1.2rem 0;position:-webkit-sticky;position:sticky;top:2.4rem;width:12.1rem}@media print{.md-sidebar{display:none}}@media screen and (max-width:76.1875em){[dir=ltr] .md-sidebar--primary{left:-12.1rem}[dir=rtl] .md-sidebar--primary{right:-12.1rem}.md-sidebar--primary{background-color:var(--md-default-bg-color);display:block;height:100%;position:fixed;top:0;transform:translateX(0);transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;width:12.1rem;z-index:5}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{box-shadow:var(--md-shadow-z3);transform:translateX(12.1rem)}[dir=rtl] [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{transform:translateX(-12.1rem)}.md-sidebar--primary .md-sidebar__scrollwrap{bottom:0;left:0;margin:0;overflow:hidden;position:absolute;right:0;-ms-scroll-snap-type:none;scroll-snap-type:none;top:0}}@media screen and (min-width:76.25em){.md-sidebar{height:0}.no-js .md-sidebar{height:auto}}.md-sidebar--secondary{display:none;order:2}@media screen and (min-width:60em){.md-sidebar--secondary{height:0}.no-js .md-sidebar--secondary{height:auto}.md-sidebar--secondary:not([hidden]){display:block}.md-sidebar--secondary .md-sidebar__scrollwrap{touch-action:pan-y}}.md-sidebar__scrollwrap{-webkit-backface-visibility:hidden;backface-visibility:hidden;margin:0 .2rem;overflow-y:auto;scrollbar-color:var(--md-default-fg-color--lighter) transparent;scrollbar-width:thin}.md-sidebar__scrollwrap:hover{scrollbar-color:var(--md-accent-fg-color) transparent}.md-sidebar__scrollwrap::-webkit-scrollbar{height:.2rem;width:.2rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:var(--md-default-fg-color--lighter)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:var(--md-accent-fg-color)}@media screen and (max-width:76.1875em){.md-overlay{background-color:rgba(0,0,0,.54);height:0;opacity:0;position:fixed;top:0;transition:width 0ms .25s,height 0ms .25s,opacity .25s;width:0;z-index:5}[data-md-toggle=drawer]:checked~.md-overlay{height:100%;opacity:1;transition:width 0ms,height 0ms,opacity .25s;width:100%}}@-webkit-keyframes facts{0%{height:0}to{height:.65rem}}@keyframes facts{0%{height:0}to{height:.65rem}}@-webkit-keyframes fact{0%{opacity:0;transform:translateY(100%)}50%{opacity:0}to{opacity:1;transform:translateY(0)}}@keyframes fact{0%{opacity:0;transform:translateY(100%)}50%{opacity:0}to{opacity:1;transform:translateY(0)}}:root{--md-source-forks-icon:url('data:image/svg+xml;charset=utf-8,');--md-source-repositories-icon:url('data:image/svg+xml;charset=utf-8,');--md-source-stars-icon:url('data:image/svg+xml;charset=utf-8,');--md-source-version-icon:url('data:image/svg+xml;charset=utf-8,')}.md-source{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:block;font-size:.65rem;line-height:1.2;outline-color:var(--md-accent-fg-color);transition:opacity .25s;white-space:nowrap}.md-source:hover{opacity:.7}.md-source__icon{display:inline-block;height:2.4rem;vertical-align:middle;width:2rem}[dir=ltr] .md-source__icon svg{margin-left:.6rem}[dir=rtl] .md-source__icon svg{margin-right:.6rem}.md-source__icon svg{margin-top:.6rem}[dir=ltr] .md-source__icon+.md-source__repository{margin-left:-2rem}[dir=rtl] .md-source__icon+.md-source__repository{margin-right:-2rem}[dir=ltr] .md-source__icon+.md-source__repository{padding-left:2rem}[dir=rtl] .md-source__icon+.md-source__repository{padding-right:2rem}[dir=ltr] .md-source__repository{margin-left:.6rem}[dir=rtl] .md-source__repository{margin-right:.6rem}.md-source__repository{display:inline-block;max-width:calc(100% - 1.2rem);overflow:hidden;text-overflow:ellipsis;vertical-align:middle}.md-source__facts{font-size:.55rem;list-style-type:none;margin:.1rem 0 0;opacity:.75;overflow:hidden;padding:0}.md-source__repository--active .md-source__facts{-webkit-animation:facts .25s ease-in;animation:facts .25s ease-in}.md-source__fact{display:inline-block}.md-source__repository--active .md-source__fact{-webkit-animation:fact .4s ease-out;animation:fact .4s ease-out}[dir=ltr] .md-source__fact:before{margin-right:.1rem}[dir=rtl] .md-source__fact:before{margin-left:.1rem}.md-source__fact:before{background-color:currentcolor;content:"";display:inline-block;height:.6rem;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;vertical-align:text-top;width:.6rem}[dir=ltr] .md-source__fact:nth-child(1n+2):before{margin-left:.4rem}[dir=rtl] .md-source__fact:nth-child(1n+2):before{margin-right:.4rem}.md-source__fact--version:before{-webkit-mask-image:var(--md-source-version-icon);mask-image:var(--md-source-version-icon)}.md-source__fact--stars:before{-webkit-mask-image:var(--md-source-stars-icon);mask-image:var(--md-source-stars-icon)}.md-source__fact--forks:before{-webkit-mask-image:var(--md-source-forks-icon);mask-image:var(--md-source-forks-icon)}.md-source__fact--repositories:before{-webkit-mask-image:var(--md-source-repositories-icon);mask-image:var(--md-source-repositories-icon)}.md-tabs{background-color:var(--md-primary-fg-color);color:var(--md-primary-bg-color);display:block;line-height:1.3;overflow:auto;width:100%;z-index:3}@media print{.md-tabs{display:none}}@media screen and (max-width:76.1875em){.md-tabs{display:none}}.md-tabs[hidden]{pointer-events:none}[dir=ltr] .md-tabs__list{margin-left:.2rem}[dir=rtl] .md-tabs__list{margin-right:.2rem}.md-tabs__list{contain:content;list-style:none;margin:0;padding:0;white-space:nowrap}.md-tabs__item{display:inline-block;height:2.4rem;padding-left:.6rem;padding-right:.6rem}.md-tabs__link{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:block;font-size:.7rem;margin-top:.8rem;opacity:.7;outline-color:var(--md-accent-fg-color);outline-offset:.2rem;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s}.md-tabs__link--active,.md-tabs__link:-webkit-any(:focus,:hover){color:inherit;opacity:1}.md-tabs__link--active,.md-tabs__link:-moz-any(:focus,:hover){color:inherit;opacity:1}.md-tabs__link--active,.md-tabs__link:is(:focus,:hover){color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{transition-delay:20ms}.md-tabs__item:nth-child(3) .md-tabs__link{transition-delay:40ms}.md-tabs__item:nth-child(4) .md-tabs__link{transition-delay:60ms}.md-tabs__item:nth-child(5) .md-tabs__link{transition-delay:80ms}.md-tabs__item:nth-child(6) .md-tabs__link{transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{transition-delay:.3s}.md-tabs[hidden] .md-tabs__link{opacity:0;transform:translateY(50%);transition:transform 0ms .1s,opacity .1s}.md-tags{margin-bottom:.75em}[dir=ltr] .md-tag{margin-right:.5em}[dir=rtl] .md-tag{margin-left:.5em}.md-tag{background:var(--md-default-fg-color--lightest);border-radius:.4rem;display:inline-block;font-size:.64rem;font-weight:700;line-height:1.6;margin-bottom:.5em;padding:.3125em .9375em}.md-tag[href]{-webkit-tap-highlight-color:transparent;color:inherit;outline:none;transition:color 125ms,background-color 125ms}.md-tag[href]:focus,.md-tag[href]:hover{background-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}[id]>.md-tag{vertical-align:text-top}@-webkit-keyframes pulse{0%{box-shadow:0 0 0 0 var(--md-default-fg-color--lightest);transform:scale(.95)}75%{box-shadow:0 0 0 .625em transparent;transform:scale(1)}to{box-shadow:0 0 0 0 transparent;transform:scale(.95)}}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--md-default-fg-color--lightest);transform:scale(.95)}75%{box-shadow:0 0 0 .625em transparent;transform:scale(1)}to{box-shadow:0 0 0 0 transparent;transform:scale(.95)}}:root{--md-tooltip-width:20rem}.md-tooltip{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--md-default-bg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z2);color:var(--md-default-fg-color);left:clamp(var(--md-tooltip-0,0rem) + .8rem,var(--md-tooltip-x),100vw + var(--md-tooltip-0,0rem) + .8rem - var(--md-tooltip-width) - 2 * .8rem);max-height:0;max-width:calc(100vw - 1.6rem);opacity:0;position:absolute;top:var(--md-tooltip-y);transform:translateY(-.4rem);transition:transform 0ms .25s,opacity .25s,max-height 0ms .25s,z-index .25s;width:var(--md-tooltip-width);z-index:0}:focus-within>.md-tooltip{max-height:1000%;opacity:1;transform:translateY(0);transition:transform .25s cubic-bezier(.1,.7,.1,1),opacity .25s,max-height .25s,z-index 0ms}.focus-visible>.md-tooltip{outline:var(--md-accent-fg-color) auto}.md-tooltip__inner{font-size:.64rem;padding:.8rem}.md-tooltip__inner.md-typeset>:first-child{margin-top:0}.md-tooltip__inner.md-typeset>:last-child{margin-bottom:0}.md-annotation{outline:none;white-space:normal}[dir=rtl] .md-annotation{direction:rtl}.md-annotation:not([hidden]){display:inline-block;line-height:1.325}.md-annotation:focus-within>*{z-index:2}.md-annotation__inner{font-family:var(--md-text-font-family);top:calc(var(--md-tooltip-y) + 1.2ch)}:not(:focus-within)>.md-annotation__inner{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-annotation__index{color:#fff;cursor:pointer;margin:0 1ch;position:relative;transition:z-index .25s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0}.md-annotation__index:after{background-color:var(--md-default-fg-color--lighter);border-radius:2ch;content:"";height:2.2ch;left:-.126em;margin:0 -.4ch;padding:0 .4ch;position:absolute;transition:color .25s,background-color .25s;width:calc(100% + 1.2ch);width:max(2.2ch,100% + 1.2ch);z-index:-1}@media not all and (prefers-reduced-motion){[data-md-visible]>.md-annotation__index:after{-webkit-animation:pulse 2s infinite;animation:pulse 2s infinite}}:-webkit-any(:focus-within,:hover)>.md-annotation__index:after{background-color:var(--md-accent-fg-color)}:-moz-any(:focus-within,:hover)>.md-annotation__index:after{background-color:var(--md-accent-fg-color)}:is(:focus-within,:hover)>.md-annotation__index:after{background-color:var(--md-accent-fg-color)}:focus-within>.md-annotation__index:after{-webkit-animation:none;animation:none;transition:color .25s,background-color .25s}.md-annotation__index [data-md-annotation-id]{display:inline-block;line-height:90%}.md-annotation__index [data-md-annotation-id]:before{content:attr(data-md-annotation-id);display:inline-block;padding-bottom:.1em;transform:scale(1.15);transition:transform .4s cubic-bezier(.1,.7,.1,1);vertical-align:.065em}@media not print{.md-annotation__index [data-md-annotation-id]:before{content:"+"}:focus-within>.md-annotation__index [data-md-annotation-id]:before{transform:scale(1.25) rotate(45deg)}}:-webkit-any(:focus-within,:hover)>.md-annotation__index{color:var(--md-accent-bg-color)}:-moz-any(:focus-within,:hover)>.md-annotation__index{color:var(--md-accent-bg-color)}:is(:focus-within,:hover)>.md-annotation__index{color:var(--md-accent-bg-color)}:focus-within>.md-annotation__index{-webkit-animation:none;animation:none;transition:none}[dir=ltr] .md-top{margin-left:50%}[dir=rtl] .md-top{margin-right:50%}.md-top{background-color:var(--md-default-bg-color);border-radius:1.6rem;box-shadow:var(--md-shadow-z2);color:var(--md-default-fg-color--light);display:block;font-size:.7rem;outline:none;padding:.4rem .8rem;position:fixed;top:3.2rem;transform:translate(-50%);transition:color 125ms,background-color 125ms,transform 125ms cubic-bezier(.4,0,.2,1),opacity 125ms;z-index:2}@media print{.md-top{display:none}}[dir=rtl] .md-top{transform:translate(50%)}.md-top[hidden]{opacity:0;pointer-events:none;transform:translate(-50%,.2rem);transition-duration:0ms}[dir=rtl] .md-top[hidden]{transform:translate(50%,.2rem)}.md-top:-webkit-any(:focus,:hover){background-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-top:-moz-any(:focus,:hover){background-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-top:is(:focus,:hover){background-color:var(--md-accent-fg-color);color:var(--md-accent-bg-color)}.md-top svg{display:inline-block;vertical-align:-.5em}@-webkit-keyframes hoverfix{0%{pointer-events:none}}@keyframes hoverfix{0%{pointer-events:none}}:root{--md-version-icon:url('data:image/svg+xml;charset=utf-8,')}.md-version{flex-shrink:0;font-size:.8rem;height:2.4rem}[dir=ltr] .md-version__current{margin-left:1.4rem;margin-right:.4rem}[dir=rtl] .md-version__current{margin-left:.4rem;margin-right:1.4rem}.md-version__current{color:inherit;cursor:pointer;outline:none;position:relative;top:.05rem}[dir=ltr] .md-version__current:after{margin-left:.4rem}[dir=rtl] .md-version__current:after{margin-right:.4rem}.md-version__current:after{background-color:currentcolor;content:"";display:inline-block;height:.6rem;-webkit-mask-image:var(--md-version-icon);mask-image:var(--md-version-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;width:.4rem}.md-version__list{background-color:var(--md-default-bg-color);border-radius:.1rem;box-shadow:var(--md-shadow-z2);color:var(--md-default-fg-color);list-style-type:none;margin:.2rem .8rem;max-height:0;opacity:0;overflow:auto;padding:0;position:absolute;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;top:.15rem;transition:max-height 0ms .5s,opacity .25s .25s;z-index:3}.md-version:-webkit-any(:focus-within,:hover) .md-version__list{max-height:10rem;opacity:1;-webkit-transition:max-height 0ms,opacity .25s;transition:max-height 0ms,opacity .25s}.md-version:-moz-any(:focus-within,:hover) .md-version__list{max-height:10rem;opacity:1;-moz-transition:max-height 0ms,opacity .25s;transition:max-height 0ms,opacity .25s}.md-version:is(:focus-within,:hover) .md-version__list{max-height:10rem;opacity:1;transition:max-height 0ms,opacity .25s}@media (pointer:coarse){.md-version:hover .md-version__list{-webkit-animation:hoverfix .25s forwards;animation:hoverfix .25s forwards}.md-version:focus-within .md-version__list{-webkit-animation:none;animation:none}}.md-version__item{line-height:1.8rem}[dir=ltr] .md-version__link{padding-left:.6rem;padding-right:1.2rem}[dir=rtl] .md-version__link{padding-left:1.2rem;padding-right:.6rem}.md-version__link{cursor:pointer;display:block;outline:none;scroll-snap-align:start;transition:color .25s,background-color .25s;white-space:nowrap;width:100%}.md-version__link:-webkit-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-version__link:-moz-any(:focus,:hover){color:var(--md-accent-fg-color)}.md-version__link:is(:focus,:hover){color:var(--md-accent-fg-color)}.md-version__link:focus{background-color:var(--md-default-fg-color--lightest)}:root{--md-admonition-icon--note:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--abstract:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--info:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--tip:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--success:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--question:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--warning:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--failure:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--danger:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--bug:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--example:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--quote:url('data:image/svg+xml;charset=utf-8,')}.md-typeset :-webkit-any(.admonition,details){background-color:var(--md-admonition-bg-color);border:0 solid #448aff;border-radius:.1rem;box-shadow:var(--md-shadow-z1);color:var(--md-admonition-fg-color);display:flow-root;font-size:.64rem;margin:1.5625em 0;padding:0 .6rem;page-break-inside:avoid}.md-typeset :-moz-any(.admonition,details){background-color:var(--md-admonition-bg-color);border:0 solid #448aff;border-radius:.1rem;box-shadow:var(--md-shadow-z1);color:var(--md-admonition-fg-color);display:flow-root;font-size:.64rem;margin:1.5625em 0;padding:0 .6rem;page-break-inside:avoid}[dir=ltr] .md-typeset :-webkit-any(.admonition,details){border-left-width:.2rem}[dir=ltr] .md-typeset :-moz-any(.admonition,details){border-left-width:.2rem}[dir=ltr] .md-typeset :is(.admonition,details){border-left-width:.2rem}[dir=rtl] .md-typeset :-webkit-any(.admonition,details){border-right-width:.2rem}[dir=rtl] .md-typeset :-moz-any(.admonition,details){border-right-width:.2rem}[dir=rtl] .md-typeset :is(.admonition,details){border-right-width:.2rem}.md-typeset :is(.admonition,details){background-color:var(--md-admonition-bg-color);border:0 solid #448aff;border-radius:.1rem;box-shadow:var(--md-shadow-z1);color:var(--md-admonition-fg-color);display:flow-root;font-size:.64rem;margin:1.5625em 0;padding:0 .6rem;page-break-inside:avoid}@media print{.md-typeset :-webkit-any(.admonition,details){box-shadow:none}.md-typeset :-moz-any(.admonition,details){box-shadow:none}.md-typeset :is(.admonition,details){box-shadow:none}}.md-typeset :-webkit-any(.admonition,details)>*{box-sizing:border-box}.md-typeset :-moz-any(.admonition,details)>*{box-sizing:border-box}.md-typeset :is(.admonition,details)>*{box-sizing:border-box}.md-typeset :-webkit-any(.admonition,details) :-webkit-any(.admonition,details){margin-bottom:1em;margin-top:1em}.md-typeset :-moz-any(.admonition,details) :-moz-any(.admonition,details){margin-bottom:1em;margin-top:1em}.md-typeset :is(.admonition,details) :is(.admonition,details){margin-bottom:1em;margin-top:1em}.md-typeset :-webkit-any(.admonition,details) .md-typeset__scrollwrap{margin:1em -.6rem}.md-typeset :-moz-any(.admonition,details) .md-typeset__scrollwrap{margin:1em -.6rem}.md-typeset :is(.admonition,details) .md-typeset__scrollwrap{margin:1em -.6rem}.md-typeset :-webkit-any(.admonition,details) .md-typeset__table{padding:0 .6rem}.md-typeset :-moz-any(.admonition,details) .md-typeset__table{padding:0 .6rem}.md-typeset :is(.admonition,details) .md-typeset__table{padding:0 .6rem}.md-typeset :-webkit-any(.admonition,details)>.tabbed-set:only-child{margin-top:0}.md-typeset :-moz-any(.admonition,details)>.tabbed-set:only-child{margin-top:0}.md-typeset :is(.admonition,details)>.tabbed-set:only-child{margin-top:0}html .md-typeset :-webkit-any(.admonition,details)>:last-child{margin-bottom:.6rem}html .md-typeset :-moz-any(.admonition,details)>:last-child{margin-bottom:.6rem}html .md-typeset :is(.admonition,details)>:last-child{margin-bottom:.6rem}.md-typeset :-webkit-any(.admonition-title,summary){background-color:rgba(68,138,255,.1);border:none;font-weight:700;margin-bottom:0;margin-top:0;padding-bottom:.4rem;padding-top:.4rem;position:relative}.md-typeset :-moz-any(.admonition-title,summary){background-color:rgba(68,138,255,.1);border:none;font-weight:700;margin-bottom:0;margin-top:0;padding-bottom:.4rem;padding-top:.4rem;position:relative}[dir=ltr] .md-typeset :-webkit-any(.admonition-title,summary){margin-left:-.8rem;margin-right:-.6rem}[dir=ltr] .md-typeset :-moz-any(.admonition-title,summary){margin-left:-.8rem;margin-right:-.6rem}[dir=ltr] .md-typeset :is(.admonition-title,summary){margin-left:-.8rem;margin-right:-.6rem}[dir=rtl] .md-typeset :-webkit-any(.admonition-title,summary){margin-left:-.6rem;margin-right:-.8rem}[dir=rtl] .md-typeset :-moz-any(.admonition-title,summary){margin-left:-.6rem;margin-right:-.8rem}[dir=rtl] .md-typeset :is(.admonition-title,summary){margin-left:-.6rem;margin-right:-.8rem}[dir=ltr] .md-typeset :-webkit-any(.admonition-title,summary){padding-left:2.2rem;padding-right:.6rem}[dir=ltr] .md-typeset :-moz-any(.admonition-title,summary){padding-left:2.2rem;padding-right:.6rem}[dir=ltr] .md-typeset :is(.admonition-title,summary){padding-left:2.2rem;padding-right:.6rem}[dir=rtl] .md-typeset :-webkit-any(.admonition-title,summary){padding-left:.6rem;padding-right:2.2rem}[dir=rtl] .md-typeset :-moz-any(.admonition-title,summary){padding-left:.6rem;padding-right:2.2rem}[dir=rtl] .md-typeset :is(.admonition-title,summary){padding-left:.6rem;padding-right:2.2rem}[dir=ltr] .md-typeset :-webkit-any(.admonition-title,summary){border-left-width:.2rem}[dir=ltr] .md-typeset :-moz-any(.admonition-title,summary){border-left-width:.2rem}[dir=ltr] .md-typeset :is(.admonition-title,summary){border-left-width:.2rem}[dir=rtl] .md-typeset :-webkit-any(.admonition-title,summary){border-right-width:.2rem}[dir=rtl] .md-typeset :-moz-any(.admonition-title,summary){border-right-width:.2rem}[dir=rtl] .md-typeset :is(.admonition-title,summary){border-right-width:.2rem}[dir=ltr] .md-typeset :-webkit-any(.admonition-title,summary){border-top-left-radius:.1rem}[dir=ltr] .md-typeset :-moz-any(.admonition-title,summary){border-top-left-radius:.1rem}[dir=ltr] .md-typeset :is(.admonition-title,summary){border-top-left-radius:.1rem}[dir=rtl] .md-typeset :-webkit-any(.admonition-title,summary){border-top-right-radius:.1rem}[dir=rtl] .md-typeset :-moz-any(.admonition-title,summary){border-top-right-radius:.1rem}[dir=rtl] .md-typeset :is(.admonition-title,summary){border-top-right-radius:.1rem}[dir=ltr] .md-typeset :-webkit-any(.admonition-title,summary){border-top-right-radius:.1rem}[dir=ltr] .md-typeset :-moz-any(.admonition-title,summary){border-top-right-radius:.1rem}[dir=ltr] .md-typeset :is(.admonition-title,summary){border-top-right-radius:.1rem}[dir=rtl] .md-typeset :-webkit-any(.admonition-title,summary){border-top-left-radius:.1rem}[dir=rtl] .md-typeset :-moz-any(.admonition-title,summary){border-top-left-radius:.1rem}[dir=rtl] .md-typeset :is(.admonition-title,summary){border-top-left-radius:.1rem}.md-typeset :is(.admonition-title,summary){background-color:rgba(68,138,255,.1);border:none;font-weight:700;margin-bottom:0;margin-top:0;padding-bottom:.4rem;padding-top:.4rem;position:relative}html .md-typeset :-webkit-any(.admonition-title,summary):last-child{margin-bottom:0}html .md-typeset :-moz-any(.admonition-title,summary):last-child{margin-bottom:0}html .md-typeset :is(.admonition-title,summary):last-child{margin-bottom:0}.md-typeset :-webkit-any(.admonition-title,summary):before{background-color:#448aff;content:"";height:1rem;-webkit-mask-image:var(--md-admonition-icon--note);mask-image:var(--md-admonition-icon--note);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;position:absolute;top:.625em;width:1rem}.md-typeset :-moz-any(.admonition-title,summary):before{background-color:#448aff;content:"";height:1rem;mask-image:var(--md-admonition-icon--note);mask-repeat:no-repeat;mask-size:contain;position:absolute;top:.625em;width:1rem}[dir=ltr] .md-typeset :-webkit-any(.admonition-title,summary):before{left:.8rem}[dir=ltr] .md-typeset :-moz-any(.admonition-title,summary):before{left:.8rem}[dir=ltr] .md-typeset :is(.admonition-title,summary):before{left:.8rem}[dir=rtl] .md-typeset :-webkit-any(.admonition-title,summary):before{right:.8rem}[dir=rtl] .md-typeset :-moz-any(.admonition-title,summary):before{right:.8rem}[dir=rtl] .md-typeset :is(.admonition-title,summary):before{right:.8rem}.md-typeset :is(.admonition-title,summary):before{background-color:#448aff;content:"";height:1rem;-webkit-mask-image:var(--md-admonition-icon--note);mask-image:var(--md-admonition-icon--note);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;position:absolute;top:.625em;width:1rem}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.note){border-color:#448aff}.md-typeset :-moz-any(.admonition,details):-moz-any(.note){border-color:#448aff}.md-typeset :is(.admonition,details):is(.note){border-color:#448aff}.md-typeset :-webkit-any(.note)>:-webkit-any(.admonition-title,summary){background-color:rgba(68,138,255,.1)}.md-typeset :-moz-any(.note)>:-moz-any(.admonition-title,summary){background-color:rgba(68,138,255,.1)}.md-typeset :is(.note)>:is(.admonition-title,summary){background-color:rgba(68,138,255,.1)}.md-typeset :-webkit-any(.note)>:-webkit-any(.admonition-title,summary):before{background-color:#448aff;-webkit-mask-image:var(--md-admonition-icon--note);mask-image:var(--md-admonition-icon--note);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.note)>:-moz-any(.admonition-title,summary):before{background-color:#448aff;mask-image:var(--md-admonition-icon--note);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.note)>:is(.admonition-title,summary):before{background-color:#448aff;-webkit-mask-image:var(--md-admonition-icon--note);mask-image:var(--md-admonition-icon--note);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.abstract,.summary,.tldr){border-color:#00b0ff}.md-typeset :-moz-any(.admonition,details):-moz-any(.abstract,.summary,.tldr){border-color:#00b0ff}.md-typeset :is(.admonition,details):is(.abstract,.summary,.tldr){border-color:#00b0ff}.md-typeset :-webkit-any(.abstract,.summary,.tldr)>:-webkit-any(.admonition-title,summary){background-color:rgba(0,176,255,.1)}.md-typeset :-moz-any(.abstract,.summary,.tldr)>:-moz-any(.admonition-title,summary){background-color:rgba(0,176,255,.1)}.md-typeset :is(.abstract,.summary,.tldr)>:is(.admonition-title,summary){background-color:rgba(0,176,255,.1)}.md-typeset :-webkit-any(.abstract,.summary,.tldr)>:-webkit-any(.admonition-title,summary):before{background-color:#00b0ff;-webkit-mask-image:var(--md-admonition-icon--abstract);mask-image:var(--md-admonition-icon--abstract);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.abstract,.summary,.tldr)>:-moz-any(.admonition-title,summary):before{background-color:#00b0ff;mask-image:var(--md-admonition-icon--abstract);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.abstract,.summary,.tldr)>:is(.admonition-title,summary):before{background-color:#00b0ff;-webkit-mask-image:var(--md-admonition-icon--abstract);mask-image:var(--md-admonition-icon--abstract);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.info,.todo){border-color:#00b8d4}.md-typeset :-moz-any(.admonition,details):-moz-any(.info,.todo){border-color:#00b8d4}.md-typeset :is(.admonition,details):is(.info,.todo){border-color:#00b8d4}.md-typeset :-webkit-any(.info,.todo)>:-webkit-any(.admonition-title,summary){background-color:rgba(0,184,212,.1)}.md-typeset :-moz-any(.info,.todo)>:-moz-any(.admonition-title,summary){background-color:rgba(0,184,212,.1)}.md-typeset :is(.info,.todo)>:is(.admonition-title,summary){background-color:rgba(0,184,212,.1)}.md-typeset :-webkit-any(.info,.todo)>:-webkit-any(.admonition-title,summary):before{background-color:#00b8d4;-webkit-mask-image:var(--md-admonition-icon--info);mask-image:var(--md-admonition-icon--info);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.info,.todo)>:-moz-any(.admonition-title,summary):before{background-color:#00b8d4;mask-image:var(--md-admonition-icon--info);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.info,.todo)>:is(.admonition-title,summary):before{background-color:#00b8d4;-webkit-mask-image:var(--md-admonition-icon--info);mask-image:var(--md-admonition-icon--info);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.tip,.hint,.important){border-color:#00bfa5}.md-typeset :-moz-any(.admonition,details):-moz-any(.tip,.hint,.important){border-color:#00bfa5}.md-typeset :is(.admonition,details):is(.tip,.hint,.important){border-color:#00bfa5}.md-typeset :-webkit-any(.tip,.hint,.important)>:-webkit-any(.admonition-title,summary){background-color:rgba(0,191,165,.1)}.md-typeset :-moz-any(.tip,.hint,.important)>:-moz-any(.admonition-title,summary){background-color:rgba(0,191,165,.1)}.md-typeset :is(.tip,.hint,.important)>:is(.admonition-title,summary){background-color:rgba(0,191,165,.1)}.md-typeset :-webkit-any(.tip,.hint,.important)>:-webkit-any(.admonition-title,summary):before{background-color:#00bfa5;-webkit-mask-image:var(--md-admonition-icon--tip);mask-image:var(--md-admonition-icon--tip);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.tip,.hint,.important)>:-moz-any(.admonition-title,summary):before{background-color:#00bfa5;mask-image:var(--md-admonition-icon--tip);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.tip,.hint,.important)>:is(.admonition-title,summary):before{background-color:#00bfa5;-webkit-mask-image:var(--md-admonition-icon--tip);mask-image:var(--md-admonition-icon--tip);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.success,.check,.done){border-color:#00c853}.md-typeset :-moz-any(.admonition,details):-moz-any(.success,.check,.done){border-color:#00c853}.md-typeset :is(.admonition,details):is(.success,.check,.done){border-color:#00c853}.md-typeset :-webkit-any(.success,.check,.done)>:-webkit-any(.admonition-title,summary){background-color:rgba(0,200,83,.1)}.md-typeset :-moz-any(.success,.check,.done)>:-moz-any(.admonition-title,summary){background-color:rgba(0,200,83,.1)}.md-typeset :is(.success,.check,.done)>:is(.admonition-title,summary){background-color:rgba(0,200,83,.1)}.md-typeset :-webkit-any(.success,.check,.done)>:-webkit-any(.admonition-title,summary):before{background-color:#00c853;-webkit-mask-image:var(--md-admonition-icon--success);mask-image:var(--md-admonition-icon--success);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.success,.check,.done)>:-moz-any(.admonition-title,summary):before{background-color:#00c853;mask-image:var(--md-admonition-icon--success);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.success,.check,.done)>:is(.admonition-title,summary):before{background-color:#00c853;-webkit-mask-image:var(--md-admonition-icon--success);mask-image:var(--md-admonition-icon--success);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.question,.help,.faq){border-color:#64dd17}.md-typeset :-moz-any(.admonition,details):-moz-any(.question,.help,.faq){border-color:#64dd17}.md-typeset :is(.admonition,details):is(.question,.help,.faq){border-color:#64dd17}.md-typeset :-webkit-any(.question,.help,.faq)>:-webkit-any(.admonition-title,summary){background-color:rgba(100,221,23,.1)}.md-typeset :-moz-any(.question,.help,.faq)>:-moz-any(.admonition-title,summary){background-color:rgba(100,221,23,.1)}.md-typeset :is(.question,.help,.faq)>:is(.admonition-title,summary){background-color:rgba(100,221,23,.1)}.md-typeset :-webkit-any(.question,.help,.faq)>:-webkit-any(.admonition-title,summary):before{background-color:#64dd17;-webkit-mask-image:var(--md-admonition-icon--question);mask-image:var(--md-admonition-icon--question);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.question,.help,.faq)>:-moz-any(.admonition-title,summary):before{background-color:#64dd17;mask-image:var(--md-admonition-icon--question);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.question,.help,.faq)>:is(.admonition-title,summary):before{background-color:#64dd17;-webkit-mask-image:var(--md-admonition-icon--question);mask-image:var(--md-admonition-icon--question);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.warning,.caution,.attention){border-color:#ff9100}.md-typeset :-moz-any(.admonition,details):-moz-any(.warning,.caution,.attention){border-color:#ff9100}.md-typeset :is(.admonition,details):is(.warning,.caution,.attention){border-color:#ff9100}.md-typeset :-webkit-any(.warning,.caution,.attention)>:-webkit-any(.admonition-title,summary){background-color:rgba(255,145,0,.1)}.md-typeset :-moz-any(.warning,.caution,.attention)>:-moz-any(.admonition-title,summary){background-color:rgba(255,145,0,.1)}.md-typeset :is(.warning,.caution,.attention)>:is(.admonition-title,summary){background-color:rgba(255,145,0,.1)}.md-typeset :-webkit-any(.warning,.caution,.attention)>:-webkit-any(.admonition-title,summary):before{background-color:#ff9100;-webkit-mask-image:var(--md-admonition-icon--warning);mask-image:var(--md-admonition-icon--warning);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.warning,.caution,.attention)>:-moz-any(.admonition-title,summary):before{background-color:#ff9100;mask-image:var(--md-admonition-icon--warning);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.warning,.caution,.attention)>:is(.admonition-title,summary):before{background-color:#ff9100;-webkit-mask-image:var(--md-admonition-icon--warning);mask-image:var(--md-admonition-icon--warning);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.failure,.fail,.missing){border-color:#ff5252}.md-typeset :-moz-any(.admonition,details):-moz-any(.failure,.fail,.missing){border-color:#ff5252}.md-typeset :is(.admonition,details):is(.failure,.fail,.missing){border-color:#ff5252}.md-typeset :-webkit-any(.failure,.fail,.missing)>:-webkit-any(.admonition-title,summary){background-color:rgba(255,82,82,.1)}.md-typeset :-moz-any(.failure,.fail,.missing)>:-moz-any(.admonition-title,summary){background-color:rgba(255,82,82,.1)}.md-typeset :is(.failure,.fail,.missing)>:is(.admonition-title,summary){background-color:rgba(255,82,82,.1)}.md-typeset :-webkit-any(.failure,.fail,.missing)>:-webkit-any(.admonition-title,summary):before{background-color:#ff5252;-webkit-mask-image:var(--md-admonition-icon--failure);mask-image:var(--md-admonition-icon--failure);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.failure,.fail,.missing)>:-moz-any(.admonition-title,summary):before{background-color:#ff5252;mask-image:var(--md-admonition-icon--failure);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.failure,.fail,.missing)>:is(.admonition-title,summary):before{background-color:#ff5252;-webkit-mask-image:var(--md-admonition-icon--failure);mask-image:var(--md-admonition-icon--failure);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.danger,.error){border-color:#ff1744}.md-typeset :-moz-any(.admonition,details):-moz-any(.danger,.error){border-color:#ff1744}.md-typeset :is(.admonition,details):is(.danger,.error){border-color:#ff1744}.md-typeset :-webkit-any(.danger,.error)>:-webkit-any(.admonition-title,summary){background-color:rgba(255,23,68,.1)}.md-typeset :-moz-any(.danger,.error)>:-moz-any(.admonition-title,summary){background-color:rgba(255,23,68,.1)}.md-typeset :is(.danger,.error)>:is(.admonition-title,summary){background-color:rgba(255,23,68,.1)}.md-typeset :-webkit-any(.danger,.error)>:-webkit-any(.admonition-title,summary):before{background-color:#ff1744;-webkit-mask-image:var(--md-admonition-icon--danger);mask-image:var(--md-admonition-icon--danger);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.danger,.error)>:-moz-any(.admonition-title,summary):before{background-color:#ff1744;mask-image:var(--md-admonition-icon--danger);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.danger,.error)>:is(.admonition-title,summary):before{background-color:#ff1744;-webkit-mask-image:var(--md-admonition-icon--danger);mask-image:var(--md-admonition-icon--danger);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.bug){border-color:#f50057}.md-typeset :-moz-any(.admonition,details):-moz-any(.bug){border-color:#f50057}.md-typeset :is(.admonition,details):is(.bug){border-color:#f50057}.md-typeset :-webkit-any(.bug)>:-webkit-any(.admonition-title,summary){background-color:rgba(245,0,87,.1)}.md-typeset :-moz-any(.bug)>:-moz-any(.admonition-title,summary){background-color:rgba(245,0,87,.1)}.md-typeset :is(.bug)>:is(.admonition-title,summary){background-color:rgba(245,0,87,.1)}.md-typeset :-webkit-any(.bug)>:-webkit-any(.admonition-title,summary):before{background-color:#f50057;-webkit-mask-image:var(--md-admonition-icon--bug);mask-image:var(--md-admonition-icon--bug);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.bug)>:-moz-any(.admonition-title,summary):before{background-color:#f50057;mask-image:var(--md-admonition-icon--bug);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.bug)>:is(.admonition-title,summary):before{background-color:#f50057;-webkit-mask-image:var(--md-admonition-icon--bug);mask-image:var(--md-admonition-icon--bug);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.example){border-color:#7c4dff}.md-typeset :-moz-any(.admonition,details):-moz-any(.example){border-color:#7c4dff}.md-typeset :is(.admonition,details):is(.example){border-color:#7c4dff}.md-typeset :-webkit-any(.example)>:-webkit-any(.admonition-title,summary){background-color:rgba(124,77,255,.1)}.md-typeset :-moz-any(.example)>:-moz-any(.admonition-title,summary){background-color:rgba(124,77,255,.1)}.md-typeset :is(.example)>:is(.admonition-title,summary){background-color:rgba(124,77,255,.1)}.md-typeset :-webkit-any(.example)>:-webkit-any(.admonition-title,summary):before{background-color:#7c4dff;-webkit-mask-image:var(--md-admonition-icon--example);mask-image:var(--md-admonition-icon--example);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.example)>:-moz-any(.admonition-title,summary):before{background-color:#7c4dff;mask-image:var(--md-admonition-icon--example);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.example)>:is(.admonition-title,summary):before{background-color:#7c4dff;-webkit-mask-image:var(--md-admonition-icon--example);mask-image:var(--md-admonition-icon--example);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-webkit-any(.admonition,details):-webkit-any(.quote,.cite){border-color:#9e9e9e}.md-typeset :-moz-any(.admonition,details):-moz-any(.quote,.cite){border-color:#9e9e9e}.md-typeset :is(.admonition,details):is(.quote,.cite){border-color:#9e9e9e}.md-typeset :-webkit-any(.quote,.cite)>:-webkit-any(.admonition-title,summary){background-color:hsla(0,0%,62%,.1)}.md-typeset :-moz-any(.quote,.cite)>:-moz-any(.admonition-title,summary){background-color:hsla(0,0%,62%,.1)}.md-typeset :is(.quote,.cite)>:is(.admonition-title,summary){background-color:hsla(0,0%,62%,.1)}.md-typeset :-webkit-any(.quote,.cite)>:-webkit-any(.admonition-title,summary):before{background-color:#9e9e9e;-webkit-mask-image:var(--md-admonition-icon--quote);mask-image:var(--md-admonition-icon--quote);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}.md-typeset :-moz-any(.quote,.cite)>:-moz-any(.admonition-title,summary):before{background-color:#9e9e9e;mask-image:var(--md-admonition-icon--quote);mask-repeat:no-repeat;mask-size:contain}.md-typeset :is(.quote,.cite)>:is(.admonition-title,summary):before{background-color:#9e9e9e;-webkit-mask-image:var(--md-admonition-icon--quote);mask-image:var(--md-admonition-icon--quote);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}:root{--md-footnotes-icon:url('data:image/svg+xml;charset=utf-8,')}.md-typeset .footnote{color:var(--md-default-fg-color--light);font-size:.64rem}[dir=ltr] .md-typeset .footnote>ol{margin-left:0}[dir=rtl] .md-typeset .footnote>ol{margin-right:0}.md-typeset .footnote>ol>li{transition:color 125ms}.md-typeset .footnote>ol>li:target{color:var(--md-default-fg-color)}.md-typeset .footnote>ol>li:focus-within .footnote-backref{opacity:1;transform:translateX(0);transition:none}.md-typeset .footnote>ol>li:-webkit-any(:hover,:target) .footnote-backref{opacity:1;transform:translateX(0)}.md-typeset .footnote>ol>li:-moz-any(:hover,:target) .footnote-backref{opacity:1;transform:translateX(0)}.md-typeset .footnote>ol>li:is(:hover,:target) .footnote-backref{opacity:1;transform:translateX(0)}.md-typeset .footnote>ol>li>:first-child{margin-top:0}.md-typeset .footnote-ref{font-size:.75em;font-weight:700}html .md-typeset .footnote-ref{outline-offset:.1rem}.md-typeset [id^="fnref:"]:target>.footnote-ref{outline:auto}.md-typeset .footnote-backref{color:var(--md-typeset-a-color);display:inline-block;font-size:0;opacity:0;transform:translateX(.25rem);transition:color .25s,transform .25s .25s,opacity 125ms .25s;vertical-align:text-bottom}@media print{.md-typeset .footnote-backref{color:var(--md-typeset-a-color);opacity:1;transform:translateX(0)}}[dir=rtl] .md-typeset .footnote-backref{transform:translateX(-.25rem)}.md-typeset .footnote-backref:hover{color:var(--md-accent-fg-color)}.md-typeset .footnote-backref:before{background-color:currentcolor;content:"";display:inline-block;height:.8rem;-webkit-mask-image:var(--md-footnotes-icon);mask-image:var(--md-footnotes-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:.8rem}[dir=rtl] .md-typeset .footnote-backref:before svg{transform:scaleX(-1)}[dir=ltr] .md-typeset .headerlink{margin-left:.5rem}[dir=rtl] .md-typeset .headerlink{margin-right:.5rem}.md-typeset .headerlink{color:var(--md-default-fg-color--lighter);display:inline-block;opacity:0;transition:color .25s,opacity 125ms}@media print{.md-typeset .headerlink{display:none}}.md-typeset .headerlink:focus,.md-typeset :-webkit-any(:hover,:target)>.headerlink{opacity:1;-webkit-transition:color .25s,opacity 125ms;transition:color .25s,opacity 125ms}.md-typeset .headerlink:focus,.md-typeset :-moz-any(:hover,:target)>.headerlink{opacity:1;-moz-transition:color .25s,opacity 125ms;transition:color .25s,opacity 125ms}.md-typeset .headerlink:focus,.md-typeset :is(:hover,:target)>.headerlink{opacity:1;transition:color .25s,opacity 125ms}.md-typeset .headerlink:-webkit-any(:focus,:hover),.md-typeset :target>.headerlink{color:var(--md-accent-fg-color)}.md-typeset .headerlink:-moz-any(:focus,:hover),.md-typeset :target>.headerlink{color:var(--md-accent-fg-color)}.md-typeset .headerlink:is(:focus,:hover),.md-typeset :target>.headerlink{color:var(--md-accent-fg-color)}.md-typeset :target{--md-scroll-margin:3.6rem;--md-scroll-offset:0rem;scroll-margin-top:calc(var(--md-scroll-margin) - var(--md-scroll-offset))}@media screen and (min-width:76.25em){.md-header--lifted~.md-container .md-typeset :target{--md-scroll-margin:6rem}}.md-typeset :-webkit-any(h1,h2,h3):target{--md-scroll-offset:0.2rem}.md-typeset :-moz-any(h1,h2,h3):target{--md-scroll-offset:0.2rem}.md-typeset :is(h1,h2,h3):target{--md-scroll-offset:0.2rem}.md-typeset h4:target{--md-scroll-offset:0.15rem}.md-typeset div.arithmatex{overflow:auto}@media screen and (max-width:44.9375em){.md-typeset div.arithmatex{margin:0 -.8rem}}.md-typeset div.arithmatex>*{margin-left:auto!important;margin-right:auto!important;padding:0 .8rem;touch-action:auto;width:-webkit-min-content;width:-moz-min-content;width:min-content}.md-typeset div.arithmatex>* mjx-container{margin:0!important}.md-typeset :-webkit-any(del,ins,.comment).critic{-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset :-moz-any(del,ins,.comment).critic{box-decoration-break:clone}.md-typeset :is(del,ins,.comment).critic{-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:var(--md-typeset-del-color)}.md-typeset ins.critic{background-color:var(--md-typeset-ins-color)}.md-typeset .critic.comment{color:var(--md-code-hl-comment-color)}.md-typeset .critic.comment:before{content:"/* "}.md-typeset .critic.comment:after{content:" */"}.md-typeset .critic.block{box-shadow:none;display:block;margin:1em 0;overflow:auto;padding-left:.8rem;padding-right:.8rem}.md-typeset .critic.block>:first-child{margin-top:.5em}.md-typeset .critic.block>:last-child{margin-bottom:.5em}:root{--md-details-icon:url('data:image/svg+xml;charset=utf-8,')}.md-typeset details{display:flow-root;overflow:visible;padding-top:0}.md-typeset details[open]>summary:after{transform:rotate(90deg)}.md-typeset details:not([open]){box-shadow:none;padding-bottom:0}.md-typeset details:not([open])>summary{border-radius:.1rem}[dir=ltr] .md-typeset summary{padding-right:1.8rem}[dir=rtl] .md-typeset summary{padding-left:1.8rem}[dir=ltr] .md-typeset summary{border-top-left-radius:.1rem}[dir=ltr] .md-typeset summary,[dir=rtl] .md-typeset summary{border-top-right-radius:.1rem}[dir=rtl] .md-typeset summary{border-top-left-radius:.1rem}.md-typeset summary{cursor:pointer;display:block;min-height:1rem}.md-typeset summary.focus-visible{outline-color:var(--md-accent-fg-color);outline-offset:.2rem}.md-typeset summary:not(.focus-visible){-webkit-tap-highlight-color:transparent;outline:none}[dir=ltr] .md-typeset summary:after{right:.4rem}[dir=rtl] .md-typeset summary:after{left:.4rem}.md-typeset summary:after{background-color:currentcolor;content:"";height:1rem;-webkit-mask-image:var(--md-details-icon);mask-image:var(--md-details-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;position:absolute;top:.625em;transform:rotate(0deg);transition:transform .25s;width:1rem}[dir=rtl] .md-typeset summary:after{transform:rotate(180deg)}.md-typeset summary::marker{display:none}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset :-webkit-any(.emojione,.twemoji,.gemoji){display:inline-flex;height:1.125em;vertical-align:text-top}.md-typeset :-moz-any(.emojione,.twemoji,.gemoji){display:inline-flex;height:1.125em;vertical-align:text-top}.md-typeset :is(.emojione,.twemoji,.gemoji){display:inline-flex;height:1.125em;vertical-align:text-top}.md-typeset :-webkit-any(.emojione,.twemoji,.gemoji) svg{fill:currentcolor;max-height:100%;width:1.125em}.md-typeset :-moz-any(.emojione,.twemoji,.gemoji) svg{fill:currentcolor;max-height:100%;width:1.125em}.md-typeset :is(.emojione,.twemoji,.gemoji) svg{fill:currentcolor;max-height:100%;width:1.125em}.highlight :-webkit-any(.o,.ow){color:var(--md-code-hl-operator-color)}.highlight :-moz-any(.o,.ow){color:var(--md-code-hl-operator-color)}.highlight :is(.o,.ow){color:var(--md-code-hl-operator-color)}.highlight .p{color:var(--md-code-hl-punctuation-color)}.highlight :-webkit-any(.cpf,.l,.s,.sb,.sc,.s2,.si,.s1,.ss){color:var(--md-code-hl-string-color)}.highlight :-moz-any(.cpf,.l,.s,.sb,.sc,.s2,.si,.s1,.ss){color:var(--md-code-hl-string-color)}.highlight :is(.cpf,.l,.s,.sb,.sc,.s2,.si,.s1,.ss){color:var(--md-code-hl-string-color)}.highlight :-webkit-any(.cp,.se,.sh,.sr,.sx){color:var(--md-code-hl-special-color)}.highlight :-moz-any(.cp,.se,.sh,.sr,.sx){color:var(--md-code-hl-special-color)}.highlight :is(.cp,.se,.sh,.sr,.sx){color:var(--md-code-hl-special-color)}.highlight :-webkit-any(.m,.mb,.mf,.mh,.mi,.il,.mo){color:var(--md-code-hl-number-color)}.highlight :-moz-any(.m,.mb,.mf,.mh,.mi,.il,.mo){color:var(--md-code-hl-number-color)}.highlight :is(.m,.mb,.mf,.mh,.mi,.il,.mo){color:var(--md-code-hl-number-color)}.highlight :-webkit-any(.k,.kd,.kn,.kp,.kr,.kt){color:var(--md-code-hl-keyword-color)}.highlight :-moz-any(.k,.kd,.kn,.kp,.kr,.kt){color:var(--md-code-hl-keyword-color)}.highlight :is(.k,.kd,.kn,.kp,.kr,.kt){color:var(--md-code-hl-keyword-color)}.highlight :-webkit-any(.kc,.n){color:var(--md-code-hl-name-color)}.highlight :-moz-any(.kc,.n){color:var(--md-code-hl-name-color)}.highlight :is(.kc,.n){color:var(--md-code-hl-name-color)}.highlight :-webkit-any(.no,.nb,.bp){color:var(--md-code-hl-constant-color)}.highlight :-moz-any(.no,.nb,.bp){color:var(--md-code-hl-constant-color)}.highlight :is(.no,.nb,.bp){color:var(--md-code-hl-constant-color)}.highlight :-webkit-any(.nc,.ne,.nf,.nn){color:var(--md-code-hl-function-color)}.highlight :-moz-any(.nc,.ne,.nf,.nn){color:var(--md-code-hl-function-color)}.highlight :is(.nc,.ne,.nf,.nn){color:var(--md-code-hl-function-color)}.highlight :-webkit-any(.nd,.ni,.nl,.nt){color:var(--md-code-hl-keyword-color)}.highlight :-moz-any(.nd,.ni,.nl,.nt){color:var(--md-code-hl-keyword-color)}.highlight :is(.nd,.ni,.nl,.nt){color:var(--md-code-hl-keyword-color)}.highlight :-webkit-any(.c,.cm,.c1,.ch,.cs,.sd){color:var(--md-code-hl-comment-color)}.highlight :-moz-any(.c,.cm,.c1,.ch,.cs,.sd){color:var(--md-code-hl-comment-color)}.highlight :is(.c,.cm,.c1,.ch,.cs,.sd){color:var(--md-code-hl-comment-color)}.highlight :-webkit-any(.na,.nv,.vc,.vg,.vi){color:var(--md-code-hl-variable-color)}.highlight :-moz-any(.na,.nv,.vc,.vg,.vi){color:var(--md-code-hl-variable-color)}.highlight :is(.na,.nv,.vc,.vg,.vi){color:var(--md-code-hl-variable-color)}.highlight :-webkit-any(.ge,.gr,.gh,.go,.gp,.gs,.gu,.gt){color:var(--md-code-hl-generic-color)}.highlight :-moz-any(.ge,.gr,.gh,.go,.gp,.gs,.gu,.gt){color:var(--md-code-hl-generic-color)}.highlight :is(.ge,.gr,.gh,.go,.gp,.gs,.gu,.gt){color:var(--md-code-hl-generic-color)}.highlight :-webkit-any(.gd,.gi){border-radius:.1rem;margin:0 -.125em;padding:0 .125em}.highlight :-moz-any(.gd,.gi){border-radius:.1rem;margin:0 -.125em;padding:0 .125em}.highlight :is(.gd,.gi){border-radius:.1rem;margin:0 -.125em;padding:0 .125em}.highlight .gd{background-color:var(--md-typeset-del-color)}.highlight .gi{background-color:var(--md-typeset-ins-color)}.highlight .hll{background-color:var(--md-code-hl-color);display:block;margin:0 -1.1764705882em;padding:0 1.1764705882em}.highlight span.filename{background-color:var(--md-code-bg-color);border-bottom:.05rem solid var(--md-default-fg-color--lightest);border-top-left-radius:.1rem;border-top-right-radius:.1rem;display:flow-root;font-size:.85em;font-weight:700;margin-top:1em;padding:.6617647059em 1.1764705882em;position:relative}.highlight span.filename+pre{margin-top:0}.highlight span.filename+pre>code{border-top-left-radius:0;border-top-right-radius:0}.highlight [data-linenos]:before{background-color:var(--md-code-bg-color);box-shadow:-.05rem 0 var(--md-default-fg-color--lightest) inset;color:var(--md-default-fg-color--light);content:attr(data-linenos);float:left;left:-1.1764705882em;margin-left:-1.1764705882em;margin-right:1.1764705882em;padding-left:1.1764705882em;position:-webkit-sticky;position:sticky;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:3}.highlight code a[id]{position:absolute;visibility:hidden}.highlight code[data-md-copying] .hll{display:contents}.highlight code[data-md-copying] .md-annotation{display:none}.highlighttable{display:flow-root}.highlighttable :-webkit-any(tbody,td){display:block;padding:0}.highlighttable :-moz-any(tbody,td){display:block;padding:0}.highlighttable :is(tbody,td){display:block;padding:0}.highlighttable tr{display:flex}.highlighttable pre{margin:0}.highlighttable th.filename{flex-grow:1;padding:0;text-align:left}.highlighttable th.filename span.filename{margin-top:0}.highlighttable .linenos{background-color:var(--md-code-bg-color);border-bottom-left-radius:.1rem;border-top-left-radius:.1rem;font-size:.85em;padding:.7720588235em 0 .7720588235em 1.1764705882em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.highlighttable .linenodiv{box-shadow:-.05rem 0 var(--md-default-fg-color--lightest) inset;padding-right:.5882352941em}.highlighttable .linenodiv pre{color:var(--md-default-fg-color--light);text-align:right}.highlighttable .code{flex:1;min-width:0}.linenodiv a{color:inherit}.md-typeset .highlighttable{direction:ltr;margin:1em 0}.md-typeset .highlighttable>tbody>tr>.code>div>pre>code{border-bottom-left-radius:0;border-top-left-radius:0}.md-typeset .highlight+.result{border:.05rem solid var(--md-code-bg-color);border-bottom-left-radius:.1rem;border-bottom-right-radius:.1rem;border-top-width:.1rem;margin-top:-1.125em;overflow:visible;padding:0 1em}.md-typeset .highlight+.result:after{clear:both;content:"";display:block}@media screen and (max-width:44.9375em){.md-content__inner>.highlight{margin:1em -.8rem}.md-content__inner>.highlight>.filename,.md-content__inner>.highlight>.highlighttable>tbody>tr>.code>div>pre>code,.md-content__inner>.highlight>.highlighttable>tbody>tr>.filename span.filename,.md-content__inner>.highlight>.highlighttable>tbody>tr>.linenos,.md-content__inner>.highlight>pre>code{border-radius:0}.md-content__inner>.highlight+.result{border-left-width:0;border-radius:0;border-right-width:0;margin-left:-.8rem;margin-right:-.8rem}}.md-typeset .keys kbd:-webkit-any(:before,:after){-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;color:inherit;margin:0;position:relative}.md-typeset .keys kbd:-moz-any(:before,:after){-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;color:inherit;margin:0;position:relative}.md-typeset .keys kbd:is(:before,:after){-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;color:inherit;margin:0;position:relative}.md-typeset .keys span{color:var(--md-default-fg-color--light);padding:0 .2em}.md-typeset .keys .key-alt:before,.md-typeset .keys .key-left-alt:before,.md-typeset .keys .key-right-alt:before{content:"⎇";padding-right:.4em}.md-typeset .keys .key-command:before,.md-typeset .keys .key-left-command:before,.md-typeset .keys .key-right-command:before{content:"⌘";padding-right:.4em}.md-typeset .keys .key-control:before,.md-typeset .keys .key-left-control:before,.md-typeset .keys .key-right-control:before{content:"⌃";padding-right:.4em}.md-typeset .keys .key-left-meta:before,.md-typeset .keys .key-meta:before,.md-typeset .keys .key-right-meta:before{content:"◆";padding-right:.4em}.md-typeset .keys .key-left-option:before,.md-typeset .keys .key-option:before,.md-typeset .keys .key-right-option:before{content:"⌥";padding-right:.4em}.md-typeset .keys .key-left-shift:before,.md-typeset .keys .key-right-shift:before,.md-typeset .keys .key-shift:before{content:"⇧";padding-right:.4em}.md-typeset .keys .key-left-super:before,.md-typeset .keys .key-right-super:before,.md-typeset .keys .key-super:before{content:"❖";padding-right:.4em}.md-typeset .keys .key-left-windows:before,.md-typeset .keys .key-right-windows:before,.md-typeset .keys .key-windows:before{content:"⊞";padding-right:.4em}.md-typeset .keys .key-arrow-down:before{content:"↓";padding-right:.4em}.md-typeset .keys .key-arrow-left:before{content:"←";padding-right:.4em}.md-typeset .keys .key-arrow-right:before{content:"→";padding-right:.4em}.md-typeset .keys .key-arrow-up:before{content:"↑";padding-right:.4em}.md-typeset .keys .key-backspace:before{content:"⌫";padding-right:.4em}.md-typeset .keys .key-backtab:before{content:"⇤";padding-right:.4em}.md-typeset .keys .key-caps-lock:before{content:"⇪";padding-right:.4em}.md-typeset .keys .key-clear:before{content:"⌧";padding-right:.4em}.md-typeset .keys .key-context-menu:before{content:"☰";padding-right:.4em}.md-typeset .keys .key-delete:before{content:"⌦";padding-right:.4em}.md-typeset .keys .key-eject:before{content:"⏏";padding-right:.4em}.md-typeset .keys .key-end:before{content:"⤓";padding-right:.4em}.md-typeset .keys .key-escape:before{content:"⎋";padding-right:.4em}.md-typeset .keys .key-home:before{content:"⤒";padding-right:.4em}.md-typeset .keys .key-insert:before{content:"⎀";padding-right:.4em}.md-typeset .keys .key-page-down:before{content:"⇟";padding-right:.4em}.md-typeset .keys .key-page-up:before{content:"⇞";padding-right:.4em}.md-typeset .keys .key-print-screen:before{content:"⎙";padding-right:.4em}.md-typeset .keys .key-tab:after{content:"⇥";padding-left:.4em}.md-typeset .keys .key-num-enter:after{content:"⌤";padding-left:.4em}.md-typeset .keys .key-enter:after{content:"⏎";padding-left:.4em}:root{--md-tabbed-icon--prev:url('data:image/svg+xml;charset=utf-8,');--md-tabbed-icon--next:url('data:image/svg+xml;charset=utf-8,')}.md-typeset .tabbed-set{border-radius:.1rem;display:flex;flex-flow:column wrap;margin:1em 0;position:relative}.md-typeset .tabbed-set>input{height:0;opacity:0;position:absolute;width:0}.md-typeset .tabbed-set>input:target{--md-scroll-offset:0.625em}.md-typeset .tabbed-labels{-ms-overflow-style:none;box-shadow:0 -.05rem var(--md-default-fg-color--lightest) inset;display:flex;max-width:100%;overflow:auto;scrollbar-width:none}@media print{.md-typeset .tabbed-labels{display:contents}}@media screen{.js .md-typeset .tabbed-labels{position:relative}.js .md-typeset .tabbed-labels:before{background:var(--md-accent-fg-color);bottom:0;content:"";display:block;height:2px;left:0;position:absolute;transform:translateX(var(--md-indicator-x));transition:width 225ms,transform .25s;transition-timing-function:cubic-bezier(.4,0,.2,1);width:var(--md-indicator-width)}}.md-typeset .tabbed-labels::-webkit-scrollbar{display:none}.md-typeset .tabbed-labels>label{border-bottom:.1rem solid transparent;border-radius:.1rem .1rem 0 0;color:var(--md-default-fg-color--light);cursor:pointer;flex-shrink:0;font-size:.64rem;font-weight:700;padding:.78125em 1.25em .625em;scroll-margin-inline-start:1rem;transition:background-color .25s,color .25s;white-space:nowrap;width:auto}@media print{.md-typeset .tabbed-labels>label:first-child{order:1}.md-typeset .tabbed-labels>label:nth-child(2){order:2}.md-typeset .tabbed-labels>label:nth-child(3){order:3}.md-typeset .tabbed-labels>label:nth-child(4){order:4}.md-typeset .tabbed-labels>label:nth-child(5){order:5}.md-typeset .tabbed-labels>label:nth-child(6){order:6}.md-typeset .tabbed-labels>label:nth-child(7){order:7}.md-typeset .tabbed-labels>label:nth-child(8){order:8}.md-typeset .tabbed-labels>label:nth-child(9){order:9}.md-typeset .tabbed-labels>label:nth-child(10){order:10}.md-typeset .tabbed-labels>label:nth-child(11){order:11}.md-typeset .tabbed-labels>label:nth-child(12){order:12}.md-typeset .tabbed-labels>label:nth-child(13){order:13}.md-typeset .tabbed-labels>label:nth-child(14){order:14}.md-typeset .tabbed-labels>label:nth-child(15){order:15}.md-typeset .tabbed-labels>label:nth-child(16){order:16}.md-typeset .tabbed-labels>label:nth-child(17){order:17}.md-typeset .tabbed-labels>label:nth-child(18){order:18}.md-typeset .tabbed-labels>label:nth-child(19){order:19}.md-typeset .tabbed-labels>label:nth-child(20){order:20}}.md-typeset .tabbed-labels>label:hover{color:var(--md-accent-fg-color)}.md-typeset .tabbed-content{width:100%}@media print{.md-typeset .tabbed-content{display:contents}}.md-typeset .tabbed-block{display:none}@media print{.md-typeset .tabbed-block{display:block}.md-typeset .tabbed-block:first-child{order:1}.md-typeset .tabbed-block:nth-child(2){order:2}.md-typeset .tabbed-block:nth-child(3){order:3}.md-typeset .tabbed-block:nth-child(4){order:4}.md-typeset .tabbed-block:nth-child(5){order:5}.md-typeset .tabbed-block:nth-child(6){order:6}.md-typeset .tabbed-block:nth-child(7){order:7}.md-typeset .tabbed-block:nth-child(8){order:8}.md-typeset .tabbed-block:nth-child(9){order:9}.md-typeset .tabbed-block:nth-child(10){order:10}.md-typeset .tabbed-block:nth-child(11){order:11}.md-typeset .tabbed-block:nth-child(12){order:12}.md-typeset .tabbed-block:nth-child(13){order:13}.md-typeset .tabbed-block:nth-child(14){order:14}.md-typeset .tabbed-block:nth-child(15){order:15}.md-typeset .tabbed-block:nth-child(16){order:16}.md-typeset .tabbed-block:nth-child(17){order:17}.md-typeset .tabbed-block:nth-child(18){order:18}.md-typeset .tabbed-block:nth-child(19){order:19}.md-typeset .tabbed-block:nth-child(20){order:20}}.md-typeset .tabbed-block>.highlight:first-child>pre,.md-typeset .tabbed-block>pre:first-child{margin:0}.md-typeset .tabbed-block>.highlight:first-child>pre>code,.md-typeset .tabbed-block>pre:first-child>code{border-top-left-radius:0;border-top-right-radius:0}.md-typeset .tabbed-block>.highlight:first-child>.filename{border-top-left-radius:0;border-top-right-radius:0;margin:0}.md-typeset .tabbed-block>.highlight:first-child>.highlighttable{margin:0}.md-typeset .tabbed-block>.highlight:first-child>.highlighttable>tbody>tr>.filename span.filename,.md-typeset .tabbed-block>.highlight:first-child>.highlighttable>tbody>tr>.linenos{border-top-left-radius:0;border-top-right-radius:0;margin:0}.md-typeset .tabbed-block>.highlight:first-child>.highlighttable>tbody>tr>.code>div>pre>code{border-top-left-radius:0;border-top-right-radius:0}.md-typeset .tabbed-block>.highlight:first-child+.result{margin-top:-.125em}.md-typeset .tabbed-block>.tabbed-set{margin:0}.md-typeset .tabbed-button{align-self:center;border-radius:100%;color:var(--md-default-fg-color--light);cursor:pointer;display:block;height:.9rem;margin-top:.1rem;pointer-events:auto;transition:background-color .25s;width:.9rem}.md-typeset .tabbed-button:hover{background-color:var(--md-accent-fg-color--transparent);color:var(--md-accent-fg-color)}.md-typeset .tabbed-button:after{background-color:currentcolor;content:"";display:block;height:100%;-webkit-mask-image:var(--md-tabbed-icon--prev);mask-image:var(--md-tabbed-icon--prev);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;transition:background-color .25s,transform .25s;width:100%}.md-typeset .tabbed-control{background:linear-gradient(to right,var(--md-default-bg-color) 60%,transparent);display:flex;height:1.9rem;justify-content:start;pointer-events:none;position:absolute;transition:opacity 125ms;width:1.2rem}[dir=rtl] .md-typeset .tabbed-control{transform:rotate(180deg)}.md-typeset .tabbed-control[hidden]{opacity:0}.md-typeset .tabbed-control--next{background:linear-gradient(to left,var(--md-default-bg-color) 60%,transparent);justify-content:end;right:0}.md-typeset .tabbed-control--next .tabbed-button:after{-webkit-mask-image:var(--md-tabbed-icon--next);mask-image:var(--md-tabbed-icon--next)}@media screen and (max-width:44.9375em){[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels{padding-left:.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels{padding-right:.8rem}.md-content__inner>.tabbed-set .tabbed-labels{margin:0 -.8rem;max-width:100vw;scroll-padding-inline-start:.8rem}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels:after{padding-right:.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels:after{padding-left:.8rem}.md-content__inner>.tabbed-set .tabbed-labels:after{content:""}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{margin-left:-.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{margin-right:-.8rem}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{padding-left:.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{padding-right:.8rem}.md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--prev{width:2rem}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{margin-right:-.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{margin-left:-.8rem}[dir=ltr] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{padding-right:.8rem}[dir=rtl] .md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{padding-left:.8rem}.md-content__inner>.tabbed-set .tabbed-labels~.tabbed-control--next{width:2rem}}@media screen{.md-typeset .tabbed-set>input:first-child:checked~.tabbed-labels>:first-child,.md-typeset .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),.md-typeset .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),.md-typeset .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),.md-typeset .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),.md-typeset .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),.md-typeset .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),.md-typeset .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),.md-typeset .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),.md-typeset .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),.md-typeset .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),.md-typeset .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),.md-typeset .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20),.md-typeset .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),.md-typeset .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),.md-typeset .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),.md-typeset .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),.md-typeset .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),.md-typeset .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),.md-typeset .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9){color:var(--md-accent-fg-color)}.md-typeset .no-js .tabbed-set>input:first-child:checked~.tabbed-labels>:first-child,.md-typeset .no-js .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),.md-typeset .no-js .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),.md-typeset .no-js .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),.md-typeset .no-js .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),.md-typeset .no-js .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),.md-typeset .no-js .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),.md-typeset .no-js .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),.md-typeset .no-js .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),.md-typeset .no-js .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),.md-typeset .no-js .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),.md-typeset .no-js .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),.md-typeset .no-js .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20),.md-typeset .no-js .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),.md-typeset .no-js .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),.md-typeset .no-js .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),.md-typeset .no-js .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),.md-typeset .no-js .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),.md-typeset .no-js .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),.md-typeset .no-js .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),.no-js .md-typeset .tabbed-set>input:first-child:checked~.tabbed-labels>:first-child,.no-js .md-typeset .tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),.no-js .md-typeset .tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),.no-js .md-typeset .tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),.no-js .md-typeset .tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),.no-js .md-typeset .tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),.no-js .md-typeset .tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),.no-js .md-typeset .tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),.no-js .md-typeset .tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),.no-js .md-typeset .tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),.no-js .md-typeset .tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),.no-js .md-typeset .tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),.no-js .md-typeset .tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20),.no-js .md-typeset .tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),.no-js .md-typeset .tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),.no-js .md-typeset .tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),.no-js .md-typeset .tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),.no-js .md-typeset .tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),.no-js .md-typeset .tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),.no-js .md-typeset .tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9){border-color:var(--md-accent-fg-color)}}.md-typeset .tabbed-set>input:first-child.focus-visible~.tabbed-labels>:first-child,.md-typeset .tabbed-set>input:nth-child(10).focus-visible~.tabbed-labels>:nth-child(10),.md-typeset .tabbed-set>input:nth-child(11).focus-visible~.tabbed-labels>:nth-child(11),.md-typeset .tabbed-set>input:nth-child(12).focus-visible~.tabbed-labels>:nth-child(12),.md-typeset .tabbed-set>input:nth-child(13).focus-visible~.tabbed-labels>:nth-child(13),.md-typeset .tabbed-set>input:nth-child(14).focus-visible~.tabbed-labels>:nth-child(14),.md-typeset .tabbed-set>input:nth-child(15).focus-visible~.tabbed-labels>:nth-child(15),.md-typeset .tabbed-set>input:nth-child(16).focus-visible~.tabbed-labels>:nth-child(16),.md-typeset .tabbed-set>input:nth-child(17).focus-visible~.tabbed-labels>:nth-child(17),.md-typeset .tabbed-set>input:nth-child(18).focus-visible~.tabbed-labels>:nth-child(18),.md-typeset .tabbed-set>input:nth-child(19).focus-visible~.tabbed-labels>:nth-child(19),.md-typeset .tabbed-set>input:nth-child(2).focus-visible~.tabbed-labels>:nth-child(2),.md-typeset .tabbed-set>input:nth-child(20).focus-visible~.tabbed-labels>:nth-child(20),.md-typeset .tabbed-set>input:nth-child(3).focus-visible~.tabbed-labels>:nth-child(3),.md-typeset .tabbed-set>input:nth-child(4).focus-visible~.tabbed-labels>:nth-child(4),.md-typeset .tabbed-set>input:nth-child(5).focus-visible~.tabbed-labels>:nth-child(5),.md-typeset .tabbed-set>input:nth-child(6).focus-visible~.tabbed-labels>:nth-child(6),.md-typeset .tabbed-set>input:nth-child(7).focus-visible~.tabbed-labels>:nth-child(7),.md-typeset .tabbed-set>input:nth-child(8).focus-visible~.tabbed-labels>:nth-child(8),.md-typeset .tabbed-set>input:nth-child(9).focus-visible~.tabbed-labels>:nth-child(9){background-color:var(--md-accent-fg-color--transparent)}.md-typeset .tabbed-set>input:first-child:checked~.tabbed-content>:first-child,.md-typeset .tabbed-set>input:nth-child(10):checked~.tabbed-content>:nth-child(10),.md-typeset .tabbed-set>input:nth-child(11):checked~.tabbed-content>:nth-child(11),.md-typeset .tabbed-set>input:nth-child(12):checked~.tabbed-content>:nth-child(12),.md-typeset .tabbed-set>input:nth-child(13):checked~.tabbed-content>:nth-child(13),.md-typeset .tabbed-set>input:nth-child(14):checked~.tabbed-content>:nth-child(14),.md-typeset .tabbed-set>input:nth-child(15):checked~.tabbed-content>:nth-child(15),.md-typeset .tabbed-set>input:nth-child(16):checked~.tabbed-content>:nth-child(16),.md-typeset .tabbed-set>input:nth-child(17):checked~.tabbed-content>:nth-child(17),.md-typeset .tabbed-set>input:nth-child(18):checked~.tabbed-content>:nth-child(18),.md-typeset .tabbed-set>input:nth-child(19):checked~.tabbed-content>:nth-child(19),.md-typeset .tabbed-set>input:nth-child(2):checked~.tabbed-content>:nth-child(2),.md-typeset .tabbed-set>input:nth-child(20):checked~.tabbed-content>:nth-child(20),.md-typeset .tabbed-set>input:nth-child(3):checked~.tabbed-content>:nth-child(3),.md-typeset .tabbed-set>input:nth-child(4):checked~.tabbed-content>:nth-child(4),.md-typeset .tabbed-set>input:nth-child(5):checked~.tabbed-content>:nth-child(5),.md-typeset .tabbed-set>input:nth-child(6):checked~.tabbed-content>:nth-child(6),.md-typeset .tabbed-set>input:nth-child(7):checked~.tabbed-content>:nth-child(7),.md-typeset .tabbed-set>input:nth-child(8):checked~.tabbed-content>:nth-child(8),.md-typeset .tabbed-set>input:nth-child(9):checked~.tabbed-content>:nth-child(9){display:block}:root{--md-tasklist-icon:url('data:image/svg+xml;charset=utf-8,');--md-tasklist-icon--checked:url('data:image/svg+xml;charset=utf-8,')}.md-typeset .task-list-item{list-style-type:none;position:relative}[dir=ltr] .md-typeset .task-list-item [type=checkbox]{left:-2em}[dir=rtl] .md-typeset .task-list-item [type=checkbox]{right:-2em}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}[dir=ltr] .md-typeset .task-list-indicator:before{left:-1.5em}[dir=rtl] .md-typeset .task-list-indicator:before{right:-1.5em}.md-typeset .task-list-indicator:before{background-color:var(--md-default-fg-color--lightest);content:"";height:1.25em;-webkit-mask-image:var(--md-tasklist-icon);mask-image:var(--md-tasklist-icon);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;position:absolute;top:.15em;width:1.25em}.md-typeset [type=checkbox]:checked+.task-list-indicator:before{background-color:#00e676;-webkit-mask-image:var(--md-tasklist-icon--checked);mask-image:var(--md-tasklist-icon--checked)}:root>*{--md-mermaid-font-family:var(--md-text-font-family),sans-serif;--md-mermaid-edge-color:var(--md-code-fg-color);--md-mermaid-node-bg-color:var(--md-accent-fg-color--transparent);--md-mermaid-node-fg-color:var(--md-accent-fg-color);--md-mermaid-label-bg-color:var(--md-default-bg-color);--md-mermaid-label-fg-color:var(--md-code-fg-color)}.mermaid{line-height:normal;margin:1em 0}@media screen and (min-width:45em){[dir=ltr] .md-typeset .inline{margin-right:.8rem}[dir=rtl] .md-typeset .inline{margin-left:.8rem}.md-typeset .inline{float:left;margin-bottom:.8rem;margin-top:0;width:11.7rem}[dir=rtl] .md-typeset .inline{float:right}[dir=ltr] .md-typeset .inline.end{margin-left:.8rem;margin-right:0}[dir=rtl] .md-typeset .inline.end{margin-left:0;margin-right:.8rem}.md-typeset .inline.end{float:right}[dir=rtl] .md-typeset .inline.end{float:left}} \ No newline at end of file diff --git a/assets/stylesheets/main.1d29e8d0.min.css.map b/assets/stylesheets/main.1d29e8d0.min.css.map new file mode 100644 index 00000000..cddba767 --- /dev/null +++ b/assets/stylesheets/main.1d29e8d0.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["src/assets/stylesheets/main/extensions/pymdownx/_keys.scss","../../../src/assets/stylesheets/main.scss","src/assets/stylesheets/main/_resets.scss","src/assets/stylesheets/main/_colors.scss","src/assets/stylesheets/main/_icons.scss","src/assets/stylesheets/main/_typeset.scss","src/assets/stylesheets/utilities/_break.scss","src/assets/stylesheets/main/layout/_banner.scss","src/assets/stylesheets/main/layout/_base.scss","src/assets/stylesheets/main/layout/_clipboard.scss","src/assets/stylesheets/main/layout/_content.scss","src/assets/stylesheets/main/layout/_dialog.scss","src/assets/stylesheets/main/layout/_footer.scss","src/assets/stylesheets/main/layout/_form.scss","src/assets/stylesheets/main/layout/_header.scss","src/assets/stylesheets/main/layout/_nav.scss","src/assets/stylesheets/main/layout/_search.scss","src/assets/stylesheets/main/layout/_select.scss","src/assets/stylesheets/main/layout/_sidebar.scss","src/assets/stylesheets/main/layout/_source.scss","src/assets/stylesheets/main/layout/_tabs.scss","src/assets/stylesheets/main/layout/_tag.scss","src/assets/stylesheets/main/layout/_tooltip.scss","src/assets/stylesheets/main/layout/_top.scss","src/assets/stylesheets/main/layout/_version.scss","src/assets/stylesheets/main/extensions/markdown/_admonition.scss","node_modules/material-design-color/material-color.scss","src/assets/stylesheets/main/extensions/markdown/_footnotes.scss","src/assets/stylesheets/main/extensions/markdown/_toc.scss","src/assets/stylesheets/main/extensions/pymdownx/_arithmatex.scss","src/assets/stylesheets/main/extensions/pymdownx/_critic.scss","src/assets/stylesheets/main/extensions/pymdownx/_details.scss","src/assets/stylesheets/main/extensions/pymdownx/_emoji.scss","src/assets/stylesheets/main/extensions/pymdownx/_highlight.scss","src/assets/stylesheets/main/extensions/pymdownx/_tabbed.scss","src/assets/stylesheets/main/extensions/pymdownx/_tasklist.scss","src/assets/stylesheets/main/integrations/_mermaid.scss","src/assets/stylesheets/main/_modifiers.scss"],"names":[],"mappings":"AAgGM,gBC+vGN,CCn0GA,KAEE,6BAAA,CAAA,0BAAA,CAAA,yBAAA,CAAA,qBAAA,CADA,qBDzBF,CC8BA,iBAGE,kBD3BF,CC8BE,gCANF,iBAOI,yBDzBF,CACF,CC6BA,KACE,QD1BF,CC8BA,qBAIE,uCD3BF,CC+BA,EACE,aAAA,CACA,oBD5BF,CCgCA,GAME,QAAA,CAJA,kBAAA,CADA,aAAA,CAEA,aAAA,CAEA,gBAAA,CADA,SD3BF,CCiCA,MACE,aD9BF,CCkCA,QAEE,eD/BF,CCmCA,IACE,iBDhCF,CCoCA,MACE,uBAAA,CACA,gBDjCF,CCqCA,MAEE,eAAA,CACA,kBDlCF,CCsCA,OAKE,sBAAA,CACA,QAAA,CAFA,mBAAA,CADA,iBAAA,CAFA,QAAA,CACA,SD/BF,CCuCA,MACE,QAAA,CACA,YDpCF,CErCA,qCAGE,qCAAA,CACA,4CAAA,CACA,8CAAA,CACA,+CAAA,CACA,0BAAA,CACA,+CAAA,CACA,iDAAA,CACA,mDAAA,CAGA,6BAAA,CACA,oCAAA,CACA,mCAAA,CACA,0BAAA,CACA,+CAAA,CAGA,4BAAA,CACA,qDAAA,CACA,yBAAA,CACA,8CAAA,CAGA,0BAAA,CACA,0BAAA,CAGA,qCAAA,CACA,iCAAA,CACA,kCAAA,CACA,mCAAA,CACA,mCAAA,CACA,kCAAA,CACA,iCAAA,CACA,+CAAA,CACA,6DAAA,CACA,gEAAA,CACA,4DAAA,CACA,4DAAA,CACA,6DAAA,CAGA,6CAAA,CAGA,+CAAA,CAGA,0CAAA,CAGA,0CAAA,CACA,2CAAA,CAGA,8BAAA,CACA,kCAAA,CACA,qCAAA,CAGA,wCAAA,CAGA,mDAAA,CACA,mDAAA,CAGA,yBAAA,CACA,8CAAA,CACA,gDAAA,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,8BAIE,iBpCo3HJ,CoCx3HE,oBACE,UAAA,CAIA,mBAAA,CAFA,YAAA,CADA,apCs3HJ,CoCh3HI,8BACE,WpCk3HN,CoC92HI,kCAEE,iBAAA,CAAA,cpCg3HN,CoCl3HI,kCAEE,aAAA,CAAA,kBpCg3HN,CoCl3HI,wBACE,WpCi3HN,CoC72HM,kCACE,UpC+2HR,CACF","file":"main.css"} \ No newline at end of file diff --git a/assets/stylesheets/palette.cbb835fc.min.css b/assets/stylesheets/palette.cbb835fc.min.css new file mode 100644 index 00000000..30f9264c --- /dev/null +++ b/assets/stylesheets/palette.cbb835fc.min.css @@ -0,0 +1 @@ +@media screen{[data-md-color-scheme=slate]{--md-hue:232;--md-default-fg-color:hsla(var(--md-hue),75%,95%,1);--md-default-fg-color--light:hsla(var(--md-hue),75%,90%,0.62);--md-default-fg-color--lighter:hsla(var(--md-hue),75%,90%,0.32);--md-default-fg-color--lightest:hsla(var(--md-hue),75%,90%,0.12);--md-default-bg-color:hsla(var(--md-hue),15%,21%,1);--md-default-bg-color--light:hsla(var(--md-hue),15%,21%,0.54);--md-default-bg-color--lighter:hsla(var(--md-hue),15%,21%,0.26);--md-default-bg-color--lightest:hsla(var(--md-hue),15%,21%,0.07);--md-code-fg-color:hsla(var(--md-hue),18%,86%,1);--md-code-bg-color:hsla(var(--md-hue),15%,15%,1);--md-code-hl-color:rgba(66,135,255,.15);--md-code-hl-number-color:#e6695b;--md-code-hl-special-color:#f06090;--md-code-hl-function-color:#c973d9;--md-code-hl-constant-color:#9383e2;--md-code-hl-keyword-color:#6791e0;--md-code-hl-string-color:#2fb170;--md-code-hl-name-color:var(--md-code-fg-color);--md-code-hl-operator-color:var(--md-default-fg-color--light);--md-code-hl-punctuation-color:var(--md-default-fg-color--light);--md-code-hl-comment-color:var(--md-default-fg-color--light);--md-code-hl-generic-color:var(--md-default-fg-color--light);--md-code-hl-variable-color:var(--md-default-fg-color--light);--md-typeset-color:var(--md-default-fg-color);--md-typeset-a-color:var(--md-primary-fg-color);--md-typeset-mark-color:rgba(66,135,255,.3);--md-typeset-kbd-color:hsla(var(--md-hue),15%,94%,0.12);--md-typeset-kbd-accent-color:hsla(var(--md-hue),15%,94%,0.2);--md-typeset-kbd-border-color:hsla(var(--md-hue),15%,14%,1);--md-typeset-table-color:hsla(var(--md-hue),75%,95%,0.12);--md-admonition-fg-color:var(--md-default-fg-color);--md-admonition-bg-color:var(--md-default-bg-color);--md-footer-bg-color:hsla(var(--md-hue),15%,12%,0.87);--md-footer-bg-color--dark:hsla(var(--md-hue),15%,10%,1);--md-shadow-z1:0 0.2rem 0.5rem rgba(0,0,0,.2),0 0 0.05rem rgba(0,0,0,.1);--md-shadow-z2:0 0.2rem 0.5rem rgba(0,0,0,.3),0 0 0.05rem rgba(0,0,0,.25);--md-shadow-z3:0 0.2rem 0.5rem rgba(0,0,0,.4),0 0 0.05rem rgba(0,0,0,.35)}[data-md-color-scheme=slate] img[src$="#gh-light-mode-only"],[data-md-color-scheme=slate] img[src$="#only-light"]{display:none}[data-md-color-scheme=slate] img[src$="#gh-dark-mode-only"],[data-md-color-scheme=slate] img[src$="#only-dark"]{display:initial}[data-md-color-scheme=slate][data-md-color-primary=pink]{--md-typeset-a-color:#ed5487}[data-md-color-scheme=slate][data-md-color-primary=purple]{--md-typeset-a-color:#bd78c9}[data-md-color-scheme=slate][data-md-color-primary=deep-purple]{--md-typeset-a-color:#a682e3}[data-md-color-scheme=slate][data-md-color-primary=indigo]{--md-typeset-a-color:#6c91d5}[data-md-color-scheme=slate][data-md-color-primary=teal]{--md-typeset-a-color:#00ccb8}[data-md-color-scheme=slate][data-md-color-primary=green]{--md-typeset-a-color:#71c174}[data-md-color-scheme=slate][data-md-color-primary=deep-orange]{--md-typeset-a-color:#ff9575}[data-md-color-scheme=slate][data-md-color-primary=brown]{--md-typeset-a-color:#c7846b}[data-md-color-scheme=slate][data-md-color-primary=black],[data-md-color-scheme=slate][data-md-color-primary=blue-grey],[data-md-color-scheme=slate][data-md-color-primary=grey],[data-md-color-scheme=slate][data-md-color-primary=white]{--md-typeset-a-color:#6c91d5}[data-md-color-switching] *,[data-md-color-switching] :after,[data-md-color-switching] :before{transition-duration:0ms!important}}[data-md-color-accent=red]{--md-accent-fg-color:#ff1947;--md-accent-fg-color--transparent:rgba(255,25,71,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=pink]{--md-accent-fg-color:#f50056;--md-accent-fg-color--transparent:rgba(245,0,86,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=purple]{--md-accent-fg-color:#df41fb;--md-accent-fg-color--transparent:rgba(223,65,251,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=deep-purple]{--md-accent-fg-color:#7c4dff;--md-accent-fg-color--transparent:rgba(124,77,255,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=indigo]{--md-accent-fg-color:#526cfe;--md-accent-fg-color--transparent:rgba(82,108,254,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=blue]{--md-accent-fg-color:#4287ff;--md-accent-fg-color--transparent:rgba(66,135,255,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=light-blue]{--md-accent-fg-color:#0091eb;--md-accent-fg-color--transparent:rgba(0,145,235,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=cyan]{--md-accent-fg-color:#00bad6;--md-accent-fg-color--transparent:rgba(0,186,214,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=teal]{--md-accent-fg-color:#00bda4;--md-accent-fg-color--transparent:rgba(0,189,164,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=green]{--md-accent-fg-color:#00c753;--md-accent-fg-color--transparent:rgba(0,199,83,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=light-green]{--md-accent-fg-color:#63de17;--md-accent-fg-color--transparent:rgba(99,222,23,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-accent=lime]{--md-accent-fg-color:#b0eb00;--md-accent-fg-color--transparent:rgba(176,235,0,.1);--md-accent-bg-color:rgba(0,0,0,.87);--md-accent-bg-color--light:rgba(0,0,0,.54)}[data-md-color-accent=yellow]{--md-accent-fg-color:#ffd500;--md-accent-fg-color--transparent:rgba(255,213,0,.1);--md-accent-bg-color:rgba(0,0,0,.87);--md-accent-bg-color--light:rgba(0,0,0,.54)}[data-md-color-accent=amber]{--md-accent-fg-color:#fa0;--md-accent-fg-color--transparent:rgba(255,170,0,.1);--md-accent-bg-color:rgba(0,0,0,.87);--md-accent-bg-color--light:rgba(0,0,0,.54)}[data-md-color-accent=orange]{--md-accent-fg-color:#ff9100;--md-accent-fg-color--transparent:rgba(255,145,0,.1);--md-accent-bg-color:rgba(0,0,0,.87);--md-accent-bg-color--light:rgba(0,0,0,.54)}[data-md-color-accent=deep-orange]{--md-accent-fg-color:#ff6e42;--md-accent-fg-color--transparent:rgba(255,110,66,.1);--md-accent-bg-color:#fff;--md-accent-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=red]{--md-primary-fg-color:#ef5552;--md-primary-fg-color--light:#e57171;--md-primary-fg-color--dark:#e53734;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=pink]{--md-primary-fg-color:#e92063;--md-primary-fg-color--light:#ec417a;--md-primary-fg-color--dark:#c3185d;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=purple]{--md-primary-fg-color:#ab47bd;--md-primary-fg-color--light:#bb69c9;--md-primary-fg-color--dark:#8c24a8;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=deep-purple]{--md-primary-fg-color:#7e56c2;--md-primary-fg-color--light:#9574cd;--md-primary-fg-color--dark:#673ab6;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=indigo]{--md-primary-fg-color:#4051b5;--md-primary-fg-color--light:#5d6cc0;--md-primary-fg-color--dark:#303fa1;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=blue]{--md-primary-fg-color:#2094f3;--md-primary-fg-color--light:#42a5f5;--md-primary-fg-color--dark:#1975d2;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=light-blue]{--md-primary-fg-color:#02a6f2;--md-primary-fg-color--light:#28b5f6;--md-primary-fg-color--dark:#0287cf;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=cyan]{--md-primary-fg-color:#00bdd6;--md-primary-fg-color--light:#25c5da;--md-primary-fg-color--dark:#0097a8;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=teal]{--md-primary-fg-color:#009485;--md-primary-fg-color--light:#26a699;--md-primary-fg-color--dark:#007a6c;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=green]{--md-primary-fg-color:#4cae4f;--md-primary-fg-color--light:#68bb6c;--md-primary-fg-color--dark:#398e3d;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=light-green]{--md-primary-fg-color:#8bc34b;--md-primary-fg-color--light:#9ccc66;--md-primary-fg-color--dark:#689f38;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=lime]{--md-primary-fg-color:#cbdc38;--md-primary-fg-color--light:#d3e156;--md-primary-fg-color--dark:#b0b52c;--md-primary-bg-color:rgba(0,0,0,.87);--md-primary-bg-color--light:rgba(0,0,0,.54)}[data-md-color-primary=yellow]{--md-primary-fg-color:#ffec3d;--md-primary-fg-color--light:#ffee57;--md-primary-fg-color--dark:#fbc02d;--md-primary-bg-color:rgba(0,0,0,.87);--md-primary-bg-color--light:rgba(0,0,0,.54)}[data-md-color-primary=amber]{--md-primary-fg-color:#ffc105;--md-primary-fg-color--light:#ffc929;--md-primary-fg-color--dark:#ffa200;--md-primary-bg-color:rgba(0,0,0,.87);--md-primary-bg-color--light:rgba(0,0,0,.54)}[data-md-color-primary=orange]{--md-primary-fg-color:#ffa724;--md-primary-fg-color--light:#ffa724;--md-primary-fg-color--dark:#fa8900;--md-primary-bg-color:rgba(0,0,0,.87);--md-primary-bg-color--light:rgba(0,0,0,.54)}[data-md-color-primary=deep-orange]{--md-primary-fg-color:#ff6e42;--md-primary-fg-color--light:#ff8a66;--md-primary-fg-color--dark:#f4511f;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=brown]{--md-primary-fg-color:#795649;--md-primary-fg-color--light:#8d6e62;--md-primary-fg-color--dark:#5d4037;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7)}[data-md-color-primary=grey]{--md-primary-fg-color:#757575;--md-primary-fg-color--light:#9e9e9e;--md-primary-fg-color--dark:#616161;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7);--md-typeset-a-color:#4051b5}[data-md-color-primary=blue-grey]{--md-primary-fg-color:#546d78;--md-primary-fg-color--light:#607c8a;--md-primary-fg-color--dark:#455a63;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7);--md-typeset-a-color:#4051b5}[data-md-color-primary=light-green]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#72ad2e}[data-md-color-primary=lime]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#8b990a}[data-md-color-primary=yellow]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#b8a500}[data-md-color-primary=amber]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#d19d00}[data-md-color-primary=orange]:not([data-md-color-scheme=slate]){--md-typeset-a-color:#e68a00}[data-md-color-primary=white]{--md-primary-fg-color:#fff;--md-primary-fg-color--light:hsla(0,0%,100%,.7);--md-primary-fg-color--dark:rgba(0,0,0,.07);--md-primary-bg-color:rgba(0,0,0,.87);--md-primary-bg-color--light:rgba(0,0,0,.54);--md-typeset-a-color:#4051b5}@media screen and (min-width:60em){[data-md-color-primary=white] .md-search__form{background-color:rgba(0,0,0,.07)}[data-md-color-primary=white] .md-search__form:hover{background-color:rgba(0,0,0,.32)}[data-md-color-primary=white] .md-search__input+.md-search__icon{color:rgba(0,0,0,.87)}}@media screen and (min-width:76.25em){[data-md-color-primary=white] .md-tabs{border-bottom:.05rem solid rgba(0,0,0,.07)}}[data-md-color-primary=black]{--md-primary-fg-color:#000;--md-primary-fg-color--light:rgba(0,0,0,.54);--md-primary-fg-color--dark:#000;--md-primary-bg-color:#fff;--md-primary-bg-color--light:hsla(0,0%,100%,.7);--md-typeset-a-color:#4051b5}[data-md-color-primary=black] .md-header{background-color:#000}@media screen and (max-width:59.9375em){[data-md-color-primary=black] .md-nav__source{background-color:rgba(0,0,0,.87)}}@media screen and (min-width:60em){[data-md-color-primary=black] .md-search__form{background-color:hsla(0,0%,100%,.12)}[data-md-color-primary=black] .md-search__form:hover{background-color:hsla(0,0%,100%,.3)}}@media screen and (max-width:76.1875em){html [data-md-color-primary=black] .md-nav--primary .md-nav__title[for=__drawer]{background-color:#000}}@media screen and (min-width:76.25em){[data-md-color-primary=black] .md-tabs{background-color:#000}} \ No newline at end of file diff --git a/assets/stylesheets/palette.cbb835fc.min.css.map b/assets/stylesheets/palette.cbb835fc.min.css.map new file mode 100644 index 00000000..96e380c8 --- /dev/null +++ b/assets/stylesheets/palette.cbb835fc.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["src/assets/stylesheets/palette/_scheme.scss","../../../src/assets/stylesheets/palette.scss","src/assets/stylesheets/palette/_accent.scss","src/assets/stylesheets/palette/_primary.scss","src/assets/stylesheets/utilities/_break.scss"],"names":[],"mappings":"AA2BA,cAGE,6BAKE,YAAA,CAGA,mDAAA,CACA,6DAAA,CACA,+DAAA,CACA,gEAAA,CACA,mDAAA,CACA,6DAAA,CACA,+DAAA,CACA,gEAAA,CAGA,gDAAA,CACA,gDAAA,CAGA,uCAAA,CACA,iCAAA,CACA,kCAAA,CACA,mCAAA,CACA,mCAAA,CACA,kCAAA,CACA,iCAAA,CACA,+CAAA,CACA,6DAAA,CACA,gEAAA,CACA,4DAAA,CACA,4DAAA,CACA,6DAAA,CAGA,6CAAA,CAGA,+CAAA,CAGA,2CAAA,CAGA,uDAAA,CACA,6DAAA,CACA,2DAAA,CAGA,yDAAA,CAGA,mDAAA,CACA,mDAAA,CAGA,qDAAA,CACA,wDAAA,CAGA,wEAAA,CAKA,yEAAA,CAKA,yECxDF,CD6DE,kHAEE,YC3DJ,CD+DE,gHAEE,eC7DJ,CDoFE,yDACE,4BClFJ,CDiFE,2DACE,4BC/EJ,CD8EE,gEACE,4BC5EJ,CD2EE,2DACE,4BCzEJ,CDwEE,yDACE,4BCtEJ,CDqEE,0DACE,4BCnEJ,CDkEE,gEACE,4BChEJ,CD+DE,0DACE,4BC7DJ,CD4DE,2OACE,4BCjDJ,CDwDA,+FAGE,iCCtDF,CACF,CCjDE,2BACE,4BAAA,CACA,oDAAA,CAOE,yBAAA,CACA,8CD6CN,CCvDE,4BACE,4BAAA,CACA,mDAAA,CAOE,yBAAA,CACA,8CDoDN,CC9DE,8BACE,4BAAA,CACA,qDAAA,CAOE,yBAAA,CACA,8CD2DN,CCrEE,mCACE,4BAAA,CACA,qDAAA,CAOE,yBAAA,CACA,8CDkEN,CC5EE,8BACE,4BAAA,CACA,qDA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,CG9MI,wCDxDA,8CACE,gCFyQJ,CACF,CGtOI,mCD5BA,+CACE,oCFqQJ,CElQI,qDACE,mCFoQN,CACF,CG3NI,wCDjCA,iFACE,qBF+PJ,CACF,CGnPI,sCDLA,uCACE,qBF2PJ,CACF","file":"palette.css"} \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 00000000..a37c3ff0 --- /dev/null +++ b/index.html @@ -0,0 +1,1123 @@ + + + + + + + + + + + + + + + + Notatki z języków + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + +
    +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + + +
    +
    + + + + + + + + +

    Mały zbiór notatek

    +

    Ta strona to jest mój osobisty zbiór różnych notatek.

    +

    Jej repozytorium znajduje się tutaj, zachęcam do PR-ów (zwłaszcza jak znajdziecie jakieś błędy)

    + + +
    + +
    +
    + +
    + + + +
    +
    +
    +
    + + + + + + + + \ No newline at end of file diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 00000000..44799291 --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Ma\u0142y zbi\u00f3r notatek Ta strona to jest m\u00f3j osobisty zbi\u00f3r r\u00f3\u017cnych notatek. Jej repozytorium znajduje si\u0119 tutaj , zach\u0119cam do PR-\u00f3w (zw\u0142aszcza jak znajdziecie jakie\u015b b\u0142\u0119dy)","title":"Ma\u0142y zbi\u00f3r notatek"},{"location":"#may-zbior-notatek","text":"Ta strona to jest m\u00f3j osobisty zbi\u00f3r r\u00f3\u017cnych notatek. Jej repozytorium znajduje si\u0119 tutaj , zach\u0119cam do PR-\u00f3w (zw\u0142aszcza jak znajdziecie jakie\u015b b\u0142\u0119dy)","title":"Ma\u0142y zbi\u00f3r notatek"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/0_podstawowe%20regu%C5%82y/","text":"Regu\u0142y wytwarzania oprogramowania i inne skr\u00f3towce Najwa\u017cniejsze zasady, kt\u00f3rymi trzeba si\u0119 kierowa\u0107 Bardzo dobry artyku\u0142 o tym link","title":"Regu\u0142y wytwarzania oprogramowania i inne skr\u00f3towce"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/0_podstawowe%20regu%C5%82y/#reguy-wytwarzania-oprogramowania-i-inne-skrotowce","text":"","title":"Regu\u0142y wytwarzania oprogramowania i inne skr\u00f3towce"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/0_podstawowe%20regu%C5%82y/#najwazniejsze-zasady-ktorymi-trzeba-sie-kierowac","text":"Bardzo dobry artyku\u0142 o tym link","title":"Najwa\u017cniejsze zasady, kt\u00f3rymi trzeba si\u0119 kierowa\u0107"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/architektura_i_paradygmaty/","text":"Paradygmaty i regu\u0142y Programowanie obiektowe Regu\u0142y Kompozycja zamiast dziedziczenia Composition over Inheritance - jest to zasada m\u00f3wi\u0105ca, \u017ce na og\u00f3\u0142 powinni\u015bmy preferowa\u0107 zastosowanie kompozycji (czyli zawieranie klas implementuj\u0105cych dane interfejsy dostarczaj\u0105ce po\u017c\u0105dane funkcjonalno\u015bci) zamiast dziedziczenia. Kompozycja w przeciwie\u0144stwie do dziedziczenia pozwala na uzyskanie du\u017co wi\u0119kszej elastyczno\u015bci, poniewa\u017c wykorzystywane przez nas klasy nie s\u0105 tak \u015bci\u015ble ze sob\u0105 powi\u0105zane, jak mia\u0142oby to miejsce w wypadku dziedziczenia. Kompozycja pozwala chocia\u017cby na wstrzykiwanie zale\u017cno\u015bci . Jedn\u0105 z oznak elastyczno\u015bci jest to, \u017ce mo\u017cemy mie\u0107 r\u00f3\u017cne kombinacje zachowa\u0144 dla danych klas. //TODO opisz wstrzykiwanie zale\u017cno\u015bci Programowanie aspektowe Inne materia\u0142y Banda czworga - https://brasil.cel.agh.edu.pl/~09sbfraczek/wzorce-projektowe-wstep,1,57.html","title":"Paradygmaty i regu\u0142y"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/architektura_i_paradygmaty/#paradygmaty-i-reguy","text":"","title":"Paradygmaty i regu\u0142y"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/architektura_i_paradygmaty/#programowanie-obiektowe","text":"","title":"Programowanie obiektowe"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/architektura_i_paradygmaty/#reguy","text":"","title":"Regu\u0142y"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/architektura_i_paradygmaty/#kompozycja-zamiast-dziedziczenia","text":"Composition over Inheritance - jest to zasada m\u00f3wi\u0105ca, \u017ce na og\u00f3\u0142 powinni\u015bmy preferowa\u0107 zastosowanie kompozycji (czyli zawieranie klas implementuj\u0105cych dane interfejsy dostarczaj\u0105ce po\u017c\u0105dane funkcjonalno\u015bci) zamiast dziedziczenia. Kompozycja w przeciwie\u0144stwie do dziedziczenia pozwala na uzyskanie du\u017co wi\u0119kszej elastyczno\u015bci, poniewa\u017c wykorzystywane przez nas klasy nie s\u0105 tak \u015bci\u015ble ze sob\u0105 powi\u0105zane, jak mia\u0142oby to miejsce w wypadku dziedziczenia. Kompozycja pozwala chocia\u017cby na wstrzykiwanie zale\u017cno\u015bci . Jedn\u0105 z oznak elastyczno\u015bci jest to, \u017ce mo\u017cemy mie\u0107 r\u00f3\u017cne kombinacje zachowa\u0144 dla danych klas. //TODO opisz wstrzykiwanie zale\u017cno\u015bci","title":"Kompozycja zamiast dziedziczenia"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/architektura_i_paradygmaty/#programowanie-aspektowe","text":"","title":"Programowanie aspektowe"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/architektura_i_paradygmaty/#inne-materiay","text":"Banda czworga - https://brasil.cel.agh.edu.pl/~09sbfraczek/wzorce-projektowe-wstep,1,57.html","title":"Inne materia\u0142y"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/refaktoryzacja/","text":"Refaktoryzacja Refactoring to zmiany w kodzie poprawiaj\u0105ce czytelno\u015b\u0107, zmieniaj\u0105ce struktur\u0119 kodu, ale nie zmieniaj\u0105ce funkcjonalno\u015bci. Jego celem jest potrzeba zrozumienia naszego kodu. Je\u015bli chcemy Prawo demeter - prawo wielu kropek... Je\u017celi w nazwie metody jest i lub lub to znaczy, \u017ce mamy \u017ale opisan\u0105 nazw\u0119 - powinny by\u0107 one bardziej abstrakcyjne i nie opisywa\u0107 s\u0142ownie tego co jest pod spodem. Przydatne narz\u0119dzia sonar (albo sonarcloud) pozwala bada\u0107 jako\u015b\u0107 kodu","title":"Refaktoryzacja"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/refaktoryzacja/#refaktoryzacja","text":"Refactoring to zmiany w kodzie poprawiaj\u0105ce czytelno\u015b\u0107, zmieniaj\u0105ce struktur\u0119 kodu, ale nie zmieniaj\u0105ce funkcjonalno\u015bci. Jego celem jest potrzeba zrozumienia naszego kodu. Je\u015bli chcemy Prawo demeter - prawo wielu kropek... Je\u017celi w nazwie metody jest i lub lub to znaczy, \u017ce mamy \u017ale opisan\u0105 nazw\u0119 - powinny by\u0107 one bardziej abstrakcyjne i nie opisywa\u0107 s\u0142ownie tego co jest pod spodem.","title":"Refaktoryzacja"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/refaktoryzacja/#przydatne-narzedzia","text":"sonar (albo sonarcloud) pozwala bada\u0107 jako\u015b\u0107 kodu","title":"Przydatne narz\u0119dzia"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/uml/","text":"UML - Unified Modelling Language Jest to uniwersalny j\u0119zyk do modelowania system\u00f3w i nie tylko. Istnieje wiele typ\u00f3w diagram\u00f3w UML. Takie jak: Diagram klas - pozwala na \u0142atwe opisanie system\u00f3w obiektowych Diagram komponent\u00f3w - pokazuje fizyczne elementy systemu oraz interakcje mi\u0119dzy nimi Diagram stan\u00f3w - opisuje stany obiektu i przej\u015bcia mi\u0119dzy nimi Diagram aktywno\u015bci (czynno\u015bci) - podobny do diagramu stan\u00f3w, z t\u0105 r\u00f3\u017cnic\u0105, \u017ce opisuje wiele obiekt\u00f3w Diagram przypadk\u00f3w u\u017cycia (use case) - pokazuje aktor\u00f3w oraz przypadki u\u017cycia systemu ... Diagram klas Przedstawienie klas oraz zale\u017cno\u015bci i relacji mi\u0119dzy nimi. Wikipedia Poszczeg\u00f3lne klasy maj\u0105 wyr\u00f3\u017cnion\u0105 nazw\u0119 oraz atrybuty takie jak: metody (funkcje) w\u0142a\u015bciwo\u015bci pola (zmienne) Mo\u017cemy je pokazwa\u0107 jako sama nazwa, opcjonalnie wzbogacona o typ, argumenty i inne cechy. Dozwolone s\u0105 tylko typy bazowe ( integer , real , char , string , etc.) bez klas. Og\u00f3lnny schemat: [visibility] Name [: Type] [=initial value] Mo\u017cemy tak\u017ce okre\u015bla\u0107 widoczno\u015b\u0107 atrybut\u00f3w + dla public \u2013 publiczny, dost\u0119p globalny # dla protected \u2013 chroniony, dost\u0119p dla pochodnych klasy (wynikaj\u0105cych z generalizacji) \u2212 dla private \u2013 prywatny, dost\u0119pny tylko w obr\u0119bie klasy (przy atrybucie statycznym) lub obiektu (przy atrybucie zwyk\u0142ym) ~ dla package \u2013 pakiet, dost\u0119pny w obr\u0119bie danego pakietu, projektu. Zale\u017cno\u015bci pomi\u0119dzy klasami Zale\u017cno\u015bci pomi\u0119dzy poszczeg\u00f3lnymi klasami opisujemy za pomoc\u0105 zwi\u0105zk\u00f3w (powi\u0105za\u0144) Zale\u017cno\u015b\u0107 (ang. dependency) \u2013 najs\u0142abszy zwi\u0105zek znaczeniowy mi\u0119dzy klasami, gdy jedna z klas u\u017cywa innej. Na diagramie klas oznaczana -------> przerywan\u0105 lini\u0105 zako\u0144czon\u0105 strza\u0142k\u0105 wskazuj\u0105c\u0105 kierunek zale\u017cno\u015bci Asocjacja (ang. association) wskazuje na silniejsze powi\u0105zanie pomi\u0119dzy obiektami danych klas (np. firma zatrudnia pracownik\u00f3w). Na diagramie asocjacj\u0119 oznacza si\u0119 za pomoc\u0105 linii. Nazwy cech (np. zatrudniony, zatrudniaj\u0105cy) wraz z krotno\u015bci\u0105 umieszcza si\u0119 w punkcie docelowym asocjacji. Nazw\u0119 asocjacji podaje si\u0119 po\u015brodku (np. zatrudnia). Generalizacja lub dziedziczenie - wype\u0142niona strza\u0142ka wskazuje na klas\u0119 bazow\u0105 wzgl\u0119dem pochodnej Agregacja (ang. aggregation) reprezentuje zwi\u0105zek typu ca\u0142o\u015b\u0107-cz\u0119\u015b\u0107, czyli jaka\u015b wi\u0119ksza ca\u0142o\u015b\u0107 jest rozbita na elementy. Oznacza to, \u017ce elementy cz\u0119\u015bciowe mog\u0105 nale\u017ce\u0107 do wi\u0119kszej ca\u0142o\u015bci, jednak r\u00f3wnie\u017c mog\u0105 istnie\u0107 bez niej (np. ko\u0142a i samoch\u00f3d). Kompozycja (ang. composition), jest silniejsz\u0105 form\u0105 agregacji. W zwi\u0105zku kompozycji, cz\u0119\u015bci nale\u017c\u0105 tylko do jednej ca\u0142o\u015bci, a ich okres \u017cycia jest wsp\u00f3lny \u2014 razem z ca\u0142o\u015bci\u0105 niszczone s\u0105 r\u00f3wnie\u017c cz\u0119\u015bci. W du\u017cej mierze jest to kwestia umowna, zale\u017cna od danego systemu. W wypadku asocjacji mo\u017cemy tak\u017ce okre\u015bli\u0107 krotno\u015b\u0107 zale\u017cno\u015bci 0 brak instancji (rzadkie) 0..1 Zero albo jedna 1 , 1..1 dok\u0142adnie jedna 0..* , * Zero albo wi\u0119cej instancji 1..* Jedna, albo wi\u0119cej Niekt\u00f3re asocjacje same w sobie mog\u0105 by\u0107 reprezentowane poprzez klasy. Np w wypadkach, gdy musza przechowywa\u0107 wi\u0119cej w\u0142asnych danych. S\u0105 to klasy asocjacyjne ( Link classes ) // TODO UML, a obiekty (wyk\u0142ad 05 i 04 z LTP na UPV) oraz przyk\u0142adowe analizy Diagram przypadk\u00f3w u\u017cycia (Use case) Wikipedia Jest on wykorzystywany do opisywania w jaki spos\u00f3b powinien dzia\u0142a\u0107 nasz system i jakie powinien posiada\u0107 funkcjonalno\u015bci. Jest on bardzo pomocny przy definiowaniu wymaga\u0144 funkcjonalnych. Wyr\u00f3\u017cniamy na nich: aktor\u00f3w - opisuj\u0105ce uczestnik\u00f3w systemu oraz ich role. Aktorem osobowym mo\u017ce by\u0107 osoba, zesp\u00f3\u0142, dzia\u0142, instytucja, organizacja, zrzeszenie organizacji lub organizacja wirtualna. Nazwy aktor\u00f3w osobowych cz\u0119sto pokryte s\u0105 z nazwami funkcji jakie pe\u0142ni\u0105 w organizacji, projekcie lub przedsi\u0119wzi\u0119ciu b\u0105d\u017a nazw\u0105 stanowiska jakie piastuj\u0105. Natomiast aktorem bezosobowym mo\u017ce by\u0107 system zewn\u0119trzny (podsystemy, bazy danych), urz\u0105dzenie lub czas (UWAGA Sam system nigdy nie jest aktorem) przypadki u\u017cycia - opisuj\u0105 ci\u0105gi akcji i ich warianty. Na og\u00f3\u0142 jeden przypadek u\u017cycia opisuje jedn\u0105 funkcjonalno\u015b\u0107. zwi\u0105zki - opisuj\u0105 relacje pomi\u0119dzy elementami //TODO opisa\u0107 dok\u0142adniej relacj\u0119 mi\u0119dzy aktorami a przypadkami, np dlaczego kupuj\u0105cy i przedaj\u0105cy mog\u0105 si\u0119 \u0142\u0105czy\u0107 z jendym przypadkiem o nazwi sprzedaj ksi\u0105\u017ck\u0119. Przypadki u\u017cycia Poszczeg\u00f3lne przypadki u\u017cycia cz\u0119\u015bto opisuje si\u0119 tak\u017ce za pomoc\u0105 tabelek. Use Case Actors Summary Preconditions Postconditions Includes Extends Inherits from Flow of events Actor System Przyk\u0142adowa wype\u0142niona tabelka Poszczeg\u00f3lne przypadki u\u017cycia mog\u0105 wchodzi\u0107 w zwi\u0105zki nie tylko z aktorami, lecz tak\u017ce z innymi przypadkami u\u017cycia. Relacja include - przypadek A zawiera przypadek B, kiedy ka\u017cde wykonanie A wymaga, aby\u015bmy wykonali tak\u017ce B. Aby kogo\u015b usun\u0105\u0107 z bazy danych musimy go najpierw wyszuka\u0107. Relacja extend - przypadek B rozszerza przypadek A, kiedy podczas wykonywania A w pewnych przypadkach mo\u017cemy (ale nie musimy) wykona\u0107 B. Mo\u017cemy mie\u0107 tak\u017ce typow\u0105 relacj\u0119 dziedziczenia. (podobnie jak u aktor\u00f3w) Opracowywanie diagramu Podczas prac nad diagramem mo\u017cemy przyj\u0105\u0107 dwa sposoby podej\u015bcia do tematu. Top Down , czyli Szukamy aktor\u00f3w -> Szukamy przypadk\u00f3w -> Uszczeg\u00f3\u0142aiwamy Bottom up Tworzymy scenariusze -> Generalizujemy -> Organizujemy wszystko w diagram Podczas prac nad diagramem warto rozwazy\u0107 kto, dlaczego i jak b\u0119dzie u\u017cywa\u0107 naszego systemu. Pomo\u017ce nam to znale\u017a\u0107 aktor\u00f3w. Ka\u017cda grupa lub osoba mo\u017ce by\u0107 znaleziona jednej z poni\u017cszych kategorii: Kto b\u0119dzie u\u017cywa\u0142 systemu? Kto b\u0119dzie instalowa\u0142 system? Kto b\u0119dzie utrzymywa\u0142 system? Kto wy\u0142\u0105czy system? Jakie inne systemy b\u0119d\u0105 si\u0119 z nim komunikowa\u0107? Kto otrzymuje informacje? Kto dostarcza informacji? Jak ju\u017c znajdziemy naszych aktor\u00f3w warto si\u0119 zastanowi\u0107 nad ich przypadkami u\u017cycia. Warto tutaj zwr\u00f3ci\u0107 uwag\u0119 na pytania takie jak: Jakie zadania wymagane s\u0105 od aktor\u00f3w z systemu? Czy aktor b\u0119dzie m\u00f3g\u0142 tworzy\u0107, przechowywa\u0107, zmienia\u0107 lub usuwa\u0107 informacje z systemu? Czy aktor b\u0119dzie informowa\u0142 system o zmianach zachodz\u0105cych na zewn\u0105trz? Czy ka\u017cdy aktor b\u0119dzie informowany o zmianach stanu systemu? Diagram aktywno\u015bci //TODO Diagram stan\u00f3w //TODO","title":"UML - Unified Modelling Language"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/uml/#uml-unified-modelling-language","text":"Jest to uniwersalny j\u0119zyk do modelowania system\u00f3w i nie tylko. Istnieje wiele typ\u00f3w diagram\u00f3w UML. Takie jak: Diagram klas - pozwala na \u0142atwe opisanie system\u00f3w obiektowych Diagram komponent\u00f3w - pokazuje fizyczne elementy systemu oraz interakcje mi\u0119dzy nimi Diagram stan\u00f3w - opisuje stany obiektu i przej\u015bcia mi\u0119dzy nimi Diagram aktywno\u015bci (czynno\u015bci) - podobny do diagramu stan\u00f3w, z t\u0105 r\u00f3\u017cnic\u0105, \u017ce opisuje wiele obiekt\u00f3w Diagram przypadk\u00f3w u\u017cycia (use case) - pokazuje aktor\u00f3w oraz przypadki u\u017cycia systemu ...","title":"UML - Unified Modelling Language"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/uml/#diagram-klas","text":"Przedstawienie klas oraz zale\u017cno\u015bci i relacji mi\u0119dzy nimi. Wikipedia Poszczeg\u00f3lne klasy maj\u0105 wyr\u00f3\u017cnion\u0105 nazw\u0119 oraz atrybuty takie jak: metody (funkcje) w\u0142a\u015bciwo\u015bci pola (zmienne) Mo\u017cemy je pokazwa\u0107 jako sama nazwa, opcjonalnie wzbogacona o typ, argumenty i inne cechy. Dozwolone s\u0105 tylko typy bazowe ( integer , real , char , string , etc.) bez klas. Og\u00f3lnny schemat: [visibility] Name [: Type] [=initial value] Mo\u017cemy tak\u017ce okre\u015bla\u0107 widoczno\u015b\u0107 atrybut\u00f3w + dla public \u2013 publiczny, dost\u0119p globalny # dla protected \u2013 chroniony, dost\u0119p dla pochodnych klasy (wynikaj\u0105cych z generalizacji) \u2212 dla private \u2013 prywatny, dost\u0119pny tylko w obr\u0119bie klasy (przy atrybucie statycznym) lub obiektu (przy atrybucie zwyk\u0142ym) ~ dla package \u2013 pakiet, dost\u0119pny w obr\u0119bie danego pakietu, projektu.","title":"Diagram klas"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/uml/#zaleznosci-pomiedzy-klasami","text":"Zale\u017cno\u015bci pomi\u0119dzy poszczeg\u00f3lnymi klasami opisujemy za pomoc\u0105 zwi\u0105zk\u00f3w (powi\u0105za\u0144) Zale\u017cno\u015b\u0107 (ang. dependency) \u2013 najs\u0142abszy zwi\u0105zek znaczeniowy mi\u0119dzy klasami, gdy jedna z klas u\u017cywa innej. Na diagramie klas oznaczana -------> przerywan\u0105 lini\u0105 zako\u0144czon\u0105 strza\u0142k\u0105 wskazuj\u0105c\u0105 kierunek zale\u017cno\u015bci Asocjacja (ang. association) wskazuje na silniejsze powi\u0105zanie pomi\u0119dzy obiektami danych klas (np. firma zatrudnia pracownik\u00f3w). Na diagramie asocjacj\u0119 oznacza si\u0119 za pomoc\u0105 linii. Nazwy cech (np. zatrudniony, zatrudniaj\u0105cy) wraz z krotno\u015bci\u0105 umieszcza si\u0119 w punkcie docelowym asocjacji. Nazw\u0119 asocjacji podaje si\u0119 po\u015brodku (np. zatrudnia). Generalizacja lub dziedziczenie - wype\u0142niona strza\u0142ka wskazuje na klas\u0119 bazow\u0105 wzgl\u0119dem pochodnej Agregacja (ang. aggregation) reprezentuje zwi\u0105zek typu ca\u0142o\u015b\u0107-cz\u0119\u015b\u0107, czyli jaka\u015b wi\u0119ksza ca\u0142o\u015b\u0107 jest rozbita na elementy. Oznacza to, \u017ce elementy cz\u0119\u015bciowe mog\u0105 nale\u017ce\u0107 do wi\u0119kszej ca\u0142o\u015bci, jednak r\u00f3wnie\u017c mog\u0105 istnie\u0107 bez niej (np. ko\u0142a i samoch\u00f3d). Kompozycja (ang. composition), jest silniejsz\u0105 form\u0105 agregacji. W zwi\u0105zku kompozycji, cz\u0119\u015bci nale\u017c\u0105 tylko do jednej ca\u0142o\u015bci, a ich okres \u017cycia jest wsp\u00f3lny \u2014 razem z ca\u0142o\u015bci\u0105 niszczone s\u0105 r\u00f3wnie\u017c cz\u0119\u015bci. W du\u017cej mierze jest to kwestia umowna, zale\u017cna od danego systemu. W wypadku asocjacji mo\u017cemy tak\u017ce okre\u015bli\u0107 krotno\u015b\u0107 zale\u017cno\u015bci 0 brak instancji (rzadkie) 0..1 Zero albo jedna 1 , 1..1 dok\u0142adnie jedna 0..* , * Zero albo wi\u0119cej instancji 1..* Jedna, albo wi\u0119cej Niekt\u00f3re asocjacje same w sobie mog\u0105 by\u0107 reprezentowane poprzez klasy. Np w wypadkach, gdy musza przechowywa\u0107 wi\u0119cej w\u0142asnych danych. S\u0105 to klasy asocjacyjne ( Link classes ) // TODO UML, a obiekty (wyk\u0142ad 05 i 04 z LTP na UPV) oraz przyk\u0142adowe analizy","title":"Zale\u017cno\u015bci pomi\u0119dzy klasami"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/uml/#diagram-przypadkow-uzycia-use-case","text":"Wikipedia Jest on wykorzystywany do opisywania w jaki spos\u00f3b powinien dzia\u0142a\u0107 nasz system i jakie powinien posiada\u0107 funkcjonalno\u015bci. Jest on bardzo pomocny przy definiowaniu wymaga\u0144 funkcjonalnych. Wyr\u00f3\u017cniamy na nich: aktor\u00f3w - opisuj\u0105ce uczestnik\u00f3w systemu oraz ich role. Aktorem osobowym mo\u017ce by\u0107 osoba, zesp\u00f3\u0142, dzia\u0142, instytucja, organizacja, zrzeszenie organizacji lub organizacja wirtualna. Nazwy aktor\u00f3w osobowych cz\u0119sto pokryte s\u0105 z nazwami funkcji jakie pe\u0142ni\u0105 w organizacji, projekcie lub przedsi\u0119wzi\u0119ciu b\u0105d\u017a nazw\u0105 stanowiska jakie piastuj\u0105. Natomiast aktorem bezosobowym mo\u017ce by\u0107 system zewn\u0119trzny (podsystemy, bazy danych), urz\u0105dzenie lub czas (UWAGA Sam system nigdy nie jest aktorem) przypadki u\u017cycia - opisuj\u0105 ci\u0105gi akcji i ich warianty. Na og\u00f3\u0142 jeden przypadek u\u017cycia opisuje jedn\u0105 funkcjonalno\u015b\u0107. zwi\u0105zki - opisuj\u0105 relacje pomi\u0119dzy elementami //TODO opisa\u0107 dok\u0142adniej relacj\u0119 mi\u0119dzy aktorami a przypadkami, np dlaczego kupuj\u0105cy i przedaj\u0105cy mog\u0105 si\u0119 \u0142\u0105czy\u0107 z jendym przypadkiem o nazwi sprzedaj ksi\u0105\u017ck\u0119.","title":"Diagram przypadk\u00f3w u\u017cycia (Use case)"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/uml/#przypadki-uzycia","text":"Poszczeg\u00f3lne przypadki u\u017cycia cz\u0119\u015bto opisuje si\u0119 tak\u017ce za pomoc\u0105 tabelek. Use Case Actors Summary Preconditions Postconditions Includes Extends Inherits from Flow of events Actor System Przyk\u0142adowa wype\u0142niona tabelka Poszczeg\u00f3lne przypadki u\u017cycia mog\u0105 wchodzi\u0107 w zwi\u0105zki nie tylko z aktorami, lecz tak\u017ce z innymi przypadkami u\u017cycia. Relacja include - przypadek A zawiera przypadek B, kiedy ka\u017cde wykonanie A wymaga, aby\u015bmy wykonali tak\u017ce B. Aby kogo\u015b usun\u0105\u0107 z bazy danych musimy go najpierw wyszuka\u0107. Relacja extend - przypadek B rozszerza przypadek A, kiedy podczas wykonywania A w pewnych przypadkach mo\u017cemy (ale nie musimy) wykona\u0107 B. Mo\u017cemy mie\u0107 tak\u017ce typow\u0105 relacj\u0119 dziedziczenia. (podobnie jak u aktor\u00f3w)","title":"Przypadki u\u017cycia"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/uml/#opracowywanie-diagramu","text":"Podczas prac nad diagramem mo\u017cemy przyj\u0105\u0107 dwa sposoby podej\u015bcia do tematu. Top Down , czyli Szukamy aktor\u00f3w -> Szukamy przypadk\u00f3w -> Uszczeg\u00f3\u0142aiwamy Bottom up Tworzymy scenariusze -> Generalizujemy -> Organizujemy wszystko w diagram Podczas prac nad diagramem warto rozwazy\u0107 kto, dlaczego i jak b\u0119dzie u\u017cywa\u0107 naszego systemu. Pomo\u017ce nam to znale\u017a\u0107 aktor\u00f3w. Ka\u017cda grupa lub osoba mo\u017ce by\u0107 znaleziona jednej z poni\u017cszych kategorii: Kto b\u0119dzie u\u017cywa\u0142 systemu? Kto b\u0119dzie instalowa\u0142 system? Kto b\u0119dzie utrzymywa\u0142 system? Kto wy\u0142\u0105czy system? Jakie inne systemy b\u0119d\u0105 si\u0119 z nim komunikowa\u0107? Kto otrzymuje informacje? Kto dostarcza informacji? Jak ju\u017c znajdziemy naszych aktor\u00f3w warto si\u0119 zastanowi\u0107 nad ich przypadkami u\u017cycia. Warto tutaj zwr\u00f3ci\u0107 uwag\u0119 na pytania takie jak: Jakie zadania wymagane s\u0105 od aktor\u00f3w z systemu? Czy aktor b\u0119dzie m\u00f3g\u0142 tworzy\u0107, przechowywa\u0107, zmienia\u0107 lub usuwa\u0107 informacje z systemu? Czy aktor b\u0119dzie informowa\u0142 system o zmianach zachodz\u0105cych na zewn\u0105trz? Czy ka\u017cdy aktor b\u0119dzie informowany o zmianach stanu systemu?","title":"Opracowywanie diagramu"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/uml/#diagram-aktywnosci","text":"//TODO","title":"Diagram aktywno\u015bci"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/uml/#diagram-stanow","text":"//TODO","title":"Diagram stan\u00f3w"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/","text":"mermaid.initialize({startOnLoad:true}); Wzorce projektowe Podstawowe \u017ar\u00f3d\u0142a: Wikipedia oraz Refactoring Guru Wzorce projektowe dzielimy na 3 kategorie: kreacyjne - wzorce u\u017cywane do generowania obiekt\u00f3w z okre\u015blonymi zachowaniami strukturalne - opisuj\u0105 struktury z powi\u0105zanych ze sob\u0105 obiekt\u00f3w behawioralne - opisuj\u0105 zachowania oraz zadania poszczeg\u00f3lnych obiekt\u00f3w Wzorce kreacyjne Singleton U\u017cywany, kiedy chcemy mie\u0107 tylko jedn\u0105 instancj\u0119 danej klasy w ca\u0142ym programie. Zdaniem wielu jest to do\u015b\u0107 kontrowersyjny wzorzec ( wiki ), cz\u0119sto traktowany jako antywzorzec. Ma on takie wady jak: \u0141amie zasad\u0119 jednej odpowiedzialno\u015bci \u0141amie zasad\u0119 otwarte-zamkni\u0119te pogarsza elastyczno\u015b\u0107 utrudnia testowanie classDiagram class Singleton{ -instance -Singleton() +getInstance() } # jest wiele sposob\u00f3w implementacji class Singleton _instance = None def __new__ ( cls , * args , ** kwargs ): if cls . _instance is None : cls . _instance = super () . __new__ ( cls , * args , ** kwargs ) return cls . _instance Prototyp Jest on wykorzystywany wtedy, kiedy chcemy upro\u015bci\u0107 sobie tworzenie nowych instancji danej klasy bazuj\u0105c na ju\u017c istniej\u0105cym obiekcie. Np kiedy mamy jaki\u015b plik konfiguracyjny, kt\u00f3ry musimy tylko lekko zmodyfikowa\u0107 na nasze potrzeby. W wielu wypadkach klonowanie obiektu z zewn\u0105trz nie jest mo\u017cliwe (np z powodu prywatnych parametr\u00f3w). W takiej sytuacji warto wykorzysta\u0107 interfejs dostarczaj\u0105cy metod\u0119 clone() . Takie podej\u015bcie jest u\u017cyteczne kiedy chcemy, aby nasz kod by\u0142 niezale\u017cny ok konkretnych klas obiekt\u00f3w, z kt\u00f3re chcemy skopiowa\u0107. Strukturalne Adapter Proxy Fasada Jest to wzorzec maj\u0105cy na celu uproszczenie korzystania ze skomplikowanego systemu poprzez dostaczenie uproszczonego interfejsu dostarczaj\u0105cego tylko te funkcjonalno\u015bci, kt\u00f3re s\u0105 nam naprawd\u0119 potrzebne. Behawioralne nieposortowane TODO Wstrzykiwanie zale\u017cno\u015bci Zamiast tworzy\u0107 obiekty w klasie przekazujemy jej zale\u017cne klasy. inicjalizacja nie nast\u0119puje w naszych klasach z logik\u0105 biznesow\u0105 (PKI wyk\u0142ad 8 30 min to by\u0142o omwione) Obserwator MVC - porz\u0105dnie om\u00f3wione","title":"Wzorce projektowe"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#wzorce-projektowe","text":"Podstawowe \u017ar\u00f3d\u0142a: Wikipedia oraz Refactoring Guru Wzorce projektowe dzielimy na 3 kategorie: kreacyjne - wzorce u\u017cywane do generowania obiekt\u00f3w z okre\u015blonymi zachowaniami strukturalne - opisuj\u0105 struktury z powi\u0105zanych ze sob\u0105 obiekt\u00f3w behawioralne - opisuj\u0105 zachowania oraz zadania poszczeg\u00f3lnych obiekt\u00f3w","title":"Wzorce projektowe"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#wzorce-kreacyjne","text":"","title":"Wzorce kreacyjne"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#singleton","text":"U\u017cywany, kiedy chcemy mie\u0107 tylko jedn\u0105 instancj\u0119 danej klasy w ca\u0142ym programie. Zdaniem wielu jest to do\u015b\u0107 kontrowersyjny wzorzec ( wiki ), cz\u0119sto traktowany jako antywzorzec. Ma on takie wady jak: \u0141amie zasad\u0119 jednej odpowiedzialno\u015bci \u0141amie zasad\u0119 otwarte-zamkni\u0119te pogarsza elastyczno\u015b\u0107 utrudnia testowanie classDiagram class Singleton{ -instance -Singleton() +getInstance() } # jest wiele sposob\u00f3w implementacji class Singleton _instance = None def __new__ ( cls , * args , ** kwargs ): if cls . _instance is None : cls . _instance = super () . __new__ ( cls , * args , ** kwargs ) return cls . _instance","title":"Singleton"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#prototyp","text":"Jest on wykorzystywany wtedy, kiedy chcemy upro\u015bci\u0107 sobie tworzenie nowych instancji danej klasy bazuj\u0105c na ju\u017c istniej\u0105cym obiekcie. Np kiedy mamy jaki\u015b plik konfiguracyjny, kt\u00f3ry musimy tylko lekko zmodyfikowa\u0107 na nasze potrzeby. W wielu wypadkach klonowanie obiektu z zewn\u0105trz nie jest mo\u017cliwe (np z powodu prywatnych parametr\u00f3w). W takiej sytuacji warto wykorzysta\u0107 interfejs dostarczaj\u0105cy metod\u0119 clone() . Takie podej\u015bcie jest u\u017cyteczne kiedy chcemy, aby nasz kod by\u0142 niezale\u017cny ok konkretnych klas obiekt\u00f3w, z kt\u00f3re chcemy skopiowa\u0107.","title":"Prototyp"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#strukturalne","text":"","title":"Strukturalne"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#adapter","text":"","title":"Adapter"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#proxy","text":"","title":"Proxy"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#fasada","text":"Jest to wzorzec maj\u0105cy na celu uproszczenie korzystania ze skomplikowanego systemu poprzez dostaczenie uproszczonego interfejsu dostarczaj\u0105cego tylko te funkcjonalno\u015bci, kt\u00f3re s\u0105 nam naprawd\u0119 potrzebne.","title":"Fasada"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#behawioralne","text":"","title":"Behawioralne"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#nieposortowane-todo","text":"","title":"nieposortowane TODO"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#wstrzykiwanie-zaleznosci","text":"Zamiast tworzy\u0107 obiekty w klasie przekazujemy jej zale\u017cne klasy. inicjalizacja nie nast\u0119puje w naszych klasach z logik\u0105 biznesow\u0105 (PKI wyk\u0142ad 8 30 min to by\u0142o omwione)","title":"Wstrzykiwanie zale\u017cno\u015bci"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#obserwator","text":"","title":"Obserwator"},{"location":"Architektura%F0%9F%8F%97%EF%B8%8F/wzorce_projektowe/#mvc-porzadnie-omowione","text":"","title":"MVC - porz\u0105dnie om\u00f3wione"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/","text":"ANSIC C (i nie tylko) Notatki dotycz\u0105ce j\u0119zyka C (oraz bardziej niskopoziomowych aspekt\u00f3w C++) Kompilacja Najpopularniejszym kompilatorem jest gcc gcc [ -options ] [ source_files ] [ object_files ] -o output_file Podstawowe flagi Flaga Opis -c Preprocessing, compilation, assembly producing a binary object file (.o) -S Preprocessing and compilation producing an assembly language file -E Preprocessing only sending the output to the standard output (terminal) -o plik nazwa pliku wyj\u015bciowego -Isciezka \u015acie\u017cka dla plik\u00f3w nag\u0142\u00f3wkowych (bez spacji, np -I/usr/lib ) -lNAZWA Biblioteka do kt\u00f3rej mamy linkowa\u0107 program, m\u00f3wimy kompilatorowi do jakich bibliotek linkujemy program, np -lm linkuje do biblioteki lib m .so -v Verbose gcc opisuje kroki kompilacji Na og\u00f3\u0142 po prostu kompilujesz w jednej fazie gcc -o executable programik.c Zmienne Nazwa Rozmiar Czym jest int 32b Liczba ca\u0142kowita float 32b Liczba zmiennoprzecinkowa double 64b Dok\u0142adniejszy float char 1B =8b Jednobajtowe liczby ca\u0142kowite 0-255, u\u017cywane tak\u017ce (g\u0142\u00f3wnie) do przechowywania znak\u00f3w bool 1(true) lub 0(false) logika (wymaga stdbool.h ) void - Typ pusty int Sposoby zapisu liczb: zwyk\u0142y: 2, 456, 42 itp. \u00f3semkowy 010 (8) 015 (13) 0100 (64) szesnastkowy 0x12 (18) 0xF (15) float Sposoby zapisu liczb: zwyk\u0142y: 2.43, 456, 3.14 itp. naukowy(wyk\u0142adniczy) 6e10 (6*1010) 1.5e2 (150) char Zapis: zwyk\u0142y: char letter1 = 'a'; jako kod ASCII: char letter2=97; 97 to a w kodzie ASCII *putchar(char)-wypisuje char/tablice char\u00f3w a po niej daje enter Specyfikatory signed -liczba b\u0119dzie tak\u017ce mog\u0142a by\u0107 ujemna unsigned -liczba b\u0119dzie nieujemna Short i long s\u0105 wskaz\u00f3wkami dla kompilatora, by zarezerwowa\u0142 dla danego typu mniej/wi\u0119cej pami\u0119ci np.: signed char a ; /*zmienna a przyjmuje warto\u015bci od -128 do 127*/ unsigned char b ; /*zmienna b przyjmuje warto\u015bci od 0 do 255*/ signed int i = 0 ; // to samo co: int i = 0; Wska\u017aniki-zmienne przechowuj\u0105ce adres zmiennej int * px ; //tworzymy zmienn\u0105 przechowuj\u0105c\u0105 wska\u017anik prowadz\u0105cy do int - a ; int x = 7 ; & x //zwraca adres zmiennej * px ; //we\u017a warto\u015b\u0107 znajduj\u0105c\u0105 si\u0119 pod danym adresem Wska\u017aniki i const int j = 3 ; int \u2217 const pj2 = & j ; ++ ( \u2217 pj2 ) ; //tylko to si\u0119 da int j = 3 ; const int \u2217 const pj3 = & j ; //++pj3 ; // nie da sie \u2212 const //++(\u2217pj3 ) ; // nie da sie \u2212 const //pj3 = &i ; // nie da sie \u2212 const printf ( \" const : %d \\n \" , \u2217 pj3 ) Podsumowuj\u0105c: int * zmienny_wzkaznik_zmienny_int ; int const * zmienny_wzkaznik_staly_int ; int * const staly_wzkaznik_zmienny_int ; int const * const staly_wzkaznik_staly_int ; //Inaczej: const char * const stringTable [] = { \"Hello\" , \"World\" , \"This\" , \"Is\" , \"A\" , \"Table\" , \"Of\" , \"Strings\" }; stringTable [ 0 ] = \"abc\" ; //Niedozwolone stringTable [ 0 ][ 0 ] = 'a' ; //Niedozwolone char * const stringTable2 [] = { \"Hello\" , \"World\" , \"This\" , \"Is\" , \"A\" , \"Table\" , \"Of\" , \"Strings\" }; stringTable2 [ 0 ] = \"abc\" ; //Niedozwolone stringTable2 [ 0 ][ 0 ] = 'a' ; //Dozwolone Tablice i alokowanie pami\u0119ci Definiowanie tablic int tab [ 2 ]; tab [ 0 ] = 32 ; tab [ 1 ] = 3 ; int tab [] = { 32 , 3 }; int tab [ 2 ][ 3 ] = { { 2 , 3 , 5 }, { 1 , 3 , 4 }}; ////definiowanie tablicy int tab [ 2 ][ 3 ] = { { 4 }, { 5 }}; /////reszta to zera int tab [ 2 ][ 2 ] = { 1 , 2 , 3 , 4 }; int tab [ 2 ][ 2 ] = { 1 , 2 , 3 }; //reszta to zera int niePoKol [ 12 ] = { 1 , 2 , [ 5 ] = 3 , 4 }; //reszta to zera lub dla tablic znak\u00f3w char slowo [] = \u201d Ala \u201d ; //(od C99 mamy tablice VLA) int liczbaEl = 4 ; int tablica [ liczbaEl ]; int sum2dArr ( int liWierszy , int liKolumn , int vla [ liWierszy ][ likolumn ]) ; Tablica a wska\u017anik - w praktyce zmienna trzymaj\u0105ca tablic\u0119 jest wska\u017anikiem na jej pierwszy element char tab [] = \" Ala \" ; // Zmienna tab zawiera wska\u017anik do // pierwszego elementu tablicy printf ( \u201e % c \u201d , tab + 2 ) //wydrukuje a Tablice dynamiczne+ Dynamiczna Alokacja pami\u0119ci malloc ( rozmiar_w_bajtach ); \u2013 zwraca wska\u017anik do zaalokowanego xobszaru lub NULL (gdy zbraknie pami\u0119ci albo innym b\u0142\u0119dzie). xPrzydzielona pami\u0119\u0107 ma nieokre\u015blon\u0105 zawarto\u015b\u0107 calloc ( ile_el, rozmiar_elementu ); \u2013 to samo co malloc, tyle, \u017ce xprzydzielona pami\u0119\u0107 zainicjowana zerami free ( wsk_zwrocony_przez_malloc_lub_calloc ); \u2013 zwalnia pami\u0119\u0107, xNULL mo\u017ce by\u0107 jej argumentem Przyk\u0142adowa tablica puts ( \"Ile int-\u00f3w?\" ); int tabSize = 0 ; scanf ( \"%d\" , & tabSize ); int * tab = malloc ( tabSize \u2217 sizeof ( int )); if ( ! tab ){ fputs ( \"Brak pamieci \\n \" , stderr ); return 1 ; } Dynamiczna tablica prostok\u0105tna -znamy szeroko\u015b\u0107 przed deklaracj\u0105 int SZER = 5 ; int wys = 4 ; int ( \u2217 pTab ) [ SZER ] ; pTab = sprAlokPam ( malloc ( wys \u2217 sizeof \u2217 pTab )); Dynamiczna tablica prostok\u0105tna, nie znamy ani wysoko\u015bci ani szeroko\u015bci int szer = 5 ; int wys = 4 ; int \u2217\u2217 tabl = sprAlokPam ( malloc ( wys \u2217 sizeof ( int \u2217 ))); for ( int j = 0 ; j < wys ; ++ j ) tabl [ j ] = sprAlokPam ( malloc ( szer \u2217 sizeof ( int ))); for ( int j = 0 ; j < wys ; ++ j ) ///zwalnianie free ( tabl [ j ]); free ( tabl ); Dynamiczna tablica prostok\u0105tna int szer = 5 ; int wys = 4 ; int \u2217\u2217 tabl = sprAlokPam ( malloc ( wys \u2217 sizeof ( int \u2217 ))); for ( int j = 0 ; j < wys ; ++ j ) tabl [ j ] = sprAlokPam ( malloc ( szer \u2217 sizeof ( int ))); Struktury struct struktura { int zmienna ; bool prawda = true ; //mo\u017cemy je od razu definiowa\u0107 char literka ; ///itp. tu mog\u0105 by\u0107 tablice, zmienne, inne struktury }; typedef struct { int p1 , p2 ; } Struktura ; int main () { Struktura s = { 0 , 0 }; Struktura \\ * wsk = & s ; wsk -> p1 = 2 ; wsk -> p2 = 3 ; return 0 ; } *W strukturach nie dzia\u0142aj\u0105 tablice VLA **typedef struct struktura st; pomaga skr\u00f3ci\u0107 zapis i od teraz definiuj\u0105c struktur\u0119 zapisujemy tylko st Typ wyliczeniowy - Enum Ka\u017cdy element wyliczenia jest widziany jako sta\u0142a Z kolejnymi elementami skojarzono kolejne liczby typu int (licz\u0105c od 0) enum Miesiace { STY , LUT , MAR , KW , MAJ , CZER , LIP , SIER , WRZ , PAZ , LIST , GR }; Mo\u017cna przypisa\u0107 konkretn\u0105 warto\u015b\u0107, pozosta\u0142e elementy to kolejne liczby enum Miesiace { STY = 1 , LUT , MAR , KW , MAJ , CZER , LIP , SIER , WRZ , PAZ , LIST , GR }; Ka\u017cdemu elementowi mo\u017cna przypisa\u0107 liczb\u0119, dopuszczalne s\u0105 nawet powt\u00f3rzenia enum ZnakiSpecj { DZWONEK = \u2019\\ b \u2019 , TAB = \u2019\\ t \u2019 , NOW_LINIA = \u2019\\ n \u2019 }; Logika Operatory 1 i 0 lub true i false dla typ\u00f3w logicznych takich jak bool (jako, \u017ce czyste C nie ma zmiennych typu bool to dla wygody mo\u017cna za\u0142\u0105czy\u0107 sobie biblioteke #include ) Podstawowe operatory: x||y lub x&&y oraz !x negacja a==b czy r\u00f3wne a!=b czy r\u00f3\u017cne a>=b , a>b Por\u00f3wnania zwracaj\u0105 stany logiczne (np dla int a,b) Warto\u015b\u0107 boola mo\u017cna dodawa\u0107 do zmiennych liczbowych typu int (ale polecam unika\u0107 takich zabaw) bool x = true ; x ++ ; //x nadal jest r\u00f3wne 1 Warunkowe if ( warunek ) { //kod je\u015bli tak } else { //kod je\u015bli nie } switcha mo\u017cna wykorzystywa\u0107 gdy chcemy unikn\u0105\u0107 tworzenia tzw \"drabinki\" if-\u00f3w. Na og\u00f3\u0142 jest u\u017cywamy, gdy chcemy sprawdzi\u0107 warto\u015b\u0107 enuma. switch ( jaka\u015b_zmienna ) { case warto\u015b\u01071 : //kod break ; case warto\u015b\u01072 : //kod break ; default : /* Optional */ //kod je\u015bli nic z powy\u017cszych nie pasuje } P\u0119tle Sterowanie przebiegiem p\u0119tli break \u2013 przerwanie dzia\u0142ania p\u0119tli continue \u2013 rozpocz\u0119cie kolejnego obiegu p\u0119tli Nadmierne stosowanie instrukcji steruj\u0105cych break, continue jest z\u0142\u0105 praktyk\u0105 programistyczn\u0105 while ( warunek ){ //nasze polecenia } //wykonuje si\u0119 dop\u00f3ki warunek jest spe\u0142niony do { //kod } while ( warunek ) //warunek jest sprawdzany dopiero po pierwszym obrocie //for(deklaracja zm ;warunek trwania; co ma si\u0119 dzia\u0107 po obrocie p\u0119tli){ for ( int i = 0 ; i < 5 ; i ++ ){ //b\u0119dzie 5 obrot\u00f3w p\u0119tli dla 01234 } include typedef unsigned char uchar ; typedef unsigned short ushort ; enum Miesiace{STY=1 ,LUT,MAR,KW, MAJ,CZER,LIP ,SIER ,WRZ, PAZ, LIST,GR}; const uchar dlMies[13]={0 ,31 ,29 ,31 ,30 ,31 ,30 ,31 ,31 ,30 ,31 ,30 ,31};//dlugosc miesi\u0105ca extern inline bool rokPrzest(const ushort r ) ; inline stosuje si\u0119 do kr\u00f3tkich, prostych funkcji aby unikn\u0105\u0107 kosztownego mechanizmu wo\u0142ania funkcji. Bez extern w C nie skompiluje si\u0119. assert(true) nic nie robi, assert(false) ko\u0144czy dzia\u0142anie programu. Asercje stosuje si\u0119 do debugowania, lub do sprawdzania czy spe\u0142nione s\u0105 za\u0142o\u017cenia projektant\u00f3w funkcji Inne Funkcje Liczby losowe rand() - zwraca liczb\u0119 z zakresu 0-RAND_MAX, losowane warto\u015bci zale\u017c\u0105 od funkcji: srand(ziarno) (nie wo\u0142a si\u0119 przed ka\u017cdym rand, wo\u0142a si\u0119 tylko przed pierwszym losowaniem!)-ustala ziarno losowania dla funkcji rand cz\u0119sto wewn\u0105trz podaje si\u0119 time(NULL) -je\u017celi tego nie zrobimy to za ka\u017cdym razem program wygeneruje to samo Lista s\u0142\u00f3w kluczowych C11 Lista s\u0142\u00f3w kluczowych j\u0119zyka C : auto, double, int, struct, break, else, long, switch, case, enum, register, typedef, char, extern, return, union, const, float, short, unsigned, continue, for, signed, void, default, goto, sizeof, volatile, do, if, static, while,_Bool, _Imaginary, restrict,_Complex, inline, _Alignas,_Generic, _Thread_local,_Alignof, Noreturn, _Atomic,_Static_assert \u0179r\u00f3d\u0142a je\u017celi potrzeba dodatkowych informacji: https://pl.wikibooks.org/wiki/C/Zmienne https://codeforwin.org/2015/05/list-of-all - format-specifiers-in-c-programming.html https://pl.wikibooks.org/wiki/C/scanf poj\u0119cia?: stdout wyk\u0142ady pozosta\u0142e 5,6,7 Budowa programu W ka\u017cdym programie punktem pocz\u0105tkowym jest funkcja main Przyjmuje ona argumenty: argc - liczba argument\u00f3w przekazanych do programu argv - tablica ze stringami argument\u00f3w A zwraca ona int-a b\u0119d\u0105cego kodem wyj\u015bcia (0-sukces) #include int main ( int argc , char * argv []) { //program } Funkcje Argumenty funkcji Zmienna liczba argument\u00f3w (Variadic) W C i C++ funkcje na og\u00f3\u0142 przyjmuj\u0105 \u015bci\u015ble okre\u015blon\u0105 liczb\u0119 argument\u00f3w, ale mo\u017cliwe jest tak\u017ce zdefiniowanie funkcji przyjmuj\u0105cej zmienn\u0105 liczb\u0119 argument\u00f3w. (Tak jak printf() ). Oznaczamy to za pomoc\u0105 wielokropka ... int fun ( int i , char c , ...){} Za\u015b aby dosta\u0107 si\u0119 do warto\u015bci przekazanych dalej nale\u017cy u\u017cy\u0107 makr va_arg , va_copy , va_end , va_start . Dokumentacja #include /* printf */ #include /* va_list, va_start, va_arg, va_end */ int FindMax ( int n , ...) { int i , val , largest ; va_list vl ; va_start ( vl , n ); //zaczynamy prac\u0119 ze zmiennymi largest = va_arg ( vl , int ); for ( i = 1 ; i < n ; i ++ ) { val = va_arg ( vl , int ); largest = ( largest > val ) ? largest : val ; } va_end ( vl ); return largest ; } va_list - Przed uzyskaniem dost\u0119pu do dowolnych argument\u00f3w zmiennych nale\u017cy ustanowi\u0107 znacznik listy jako zmienn\u0105 typu va_list va_start - wywo\u0142ujemy jak zaczymany prac\u0119. Drugim argumentem jest ostatni znany argument. (to co znajduje si\u0119 przed ... ) va_end - musimy je wywo\u0142a\u0107 jak ju\u017c zako\u0144czymy prac\u0119 ze zmiennymi va_arg - pozwala pobra\u0107 warto\u015b\u0107 typ zmienna=va_arg(lista_va,typ) va_copy (od C++11) -Tworzy kopi\u0119 listy argument\u00f3w w bie\u017c\u0105cym stanie W C++ mo\u017cliwe jest jednak nieco bezpieczniejsze obchodzenie si\u0119 z tymi argumentami. Od C++11 pojawi\u0142y si\u0119 templatki Cppreference packs i prostsze docsy template < typename T > T adder ( T v ) { return v ; } template < typename T , typename ... Args > T adder ( T first , Args ... args ) { return first + adder ( args ...); } adder ( 1 , 4 , 56 , 7 ); Biblioteka standardowa Pisanie/czytanie Cla C standardow\u0105 bibliotek\u0105 jest stdio.h #include int main (){ //printf( [, ] ) printf ( \" \\n Podaj liczbe: \" ); //scanf( , ) int num ; scanf ( \"%d\" , & num ); }; W kontrolnych ci\u0105gach znak\u00f3w wykorzystujemy specyfikatory formatu z tabelki poni\u017cej Tabelka z typami format\u00f3w Format Description Supported data types %c Character char,unsigned char %d Signed Integer short ,unsigned short ,int ,long %e or %E Scientific notation of float values float,double %f Floating point float %g or %G Similar as %e or %E Float, double %hi Signed Integer(Short) short %hu Unsigned Integer(Short) unsigned short %i Signed Integer short, unsigned short, int,long %l or %ld or %li Signed Integer long %lf Floating point double %Lf Floating point long double %lu Unsigned integer unsigned int unsigned long %lli, %lld Signed Integer long long %llu Unsigned Integer unsigned long long %o Octal representation of Integer. short, unsigned short, int, unsigned int, long %p Address of pointer to void *, (wska\u017anik) void * %s String char * %u Unsigned Integer unsigned int unsigned long %x or %X Hexadecimal representation of Unsigned Integer short, unsigned short, int, unsigned int, long %n Prints nothing %% Prints % character Znaki specjalne Znak Znaczenie/akcja \\n Nowa linia (ASCII 010) \\t Tabulacja pozioma (ASCII 009) \\v Tabulacja pionowa \\f Nowa strona \\r Powr\u00f3t kursora (ASCII 013) \\\\ Znak \\ (ASCII 092) \\\" Znak \" (ASCII 034) Preprocesor Preprocesor jest to program, kt\u00f3ry analizuje plik \u017ar\u00f3d\u0142owy (programu, biblioteki) w poszukiwaniu wszystkich wyra\u017ce\u0144 zaczynaj\u0105cych si\u0119 od \"#\". Na podstawie tych instrukcji generuje on kod w \"czystym\" j\u0119zyku C/C++, kt\u00f3ry dopiero potem jest analizowany przez kompilator Link do artyku\u0142u #define : S\u0142u\u017cy do definiowania makr, kt\u00f3re s\u0105 zast\u0119powane przez okre\u015blone fragmenty kodu podczas procesu preprocesowania. #include : S\u0142u\u017cy do importowania plik\u00f3w nag\u0142\u00f3wkowych do kodu \u017ar\u00f3d\u0142owego. Pliki nag\u0142\u00f3wkowe zawieraj\u0105 definicje funkcji, zmiennych i innych element\u00f3w, kt\u00f3re s\u0105 u\u017cywane w kodzie \u017ar\u00f3d\u0142owym. #ifdef / #ifndef : S\u0142u\u017c\u0105 do sprawdzenia, czy dana makrodefinicja zosta\u0142a zdefiniowana lub nie. Je\u015bli warunek jest spe\u0142niony, to preprocesor wykonuje okre\u015blony fragment kodu. #if / #else / #endif : S\u0142u\u017c\u0105 do warunkowego wykonywania fragment\u00f3w kodu. Je\u015bli warunek jest spe\u0142niony, to preprocesor wykonuje pierwszy fragment kodu, w przeciwnym razie wykonuje drugi fragment kodu. #pragma : S\u0142u\u017cy do okre\u015blenia specjalnych instrukcji dla kompilatora. Mo\u017ce by\u0107 u\u017cywana do ustawienia opcji kompilacji lub do w\u0142\u0105czania/wy\u0142\u0105czania okre\u015blonych funkcji. //TODO przyk\u0142ady Define // TODO przyk\u0142ady funkcji wo\u0142anych przez makra #define PRINT_STDERR() StreamPrinter(stderr, __LINE__, __FILE__) //TODO kopiuj obrazki o oryginalnych notatek // TODO opisz const dla const int* var vs int const *var","title":"ANSIC C (i nie tylko)"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#ansic-c-i-nie-tylko","text":"Notatki dotycz\u0105ce j\u0119zyka C (oraz bardziej niskopoziomowych aspekt\u00f3w C++)","title":"ANSIC C (i nie tylko)"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#kompilacja","text":"Najpopularniejszym kompilatorem jest gcc gcc [ -options ] [ source_files ] [ object_files ] -o output_file Podstawowe flagi Flaga Opis -c Preprocessing, compilation, assembly producing a binary object file (.o) -S Preprocessing and compilation producing an assembly language file -E Preprocessing only sending the output to the standard output (terminal) -o plik nazwa pliku wyj\u015bciowego -Isciezka \u015acie\u017cka dla plik\u00f3w nag\u0142\u00f3wkowych (bez spacji, np -I/usr/lib ) -lNAZWA Biblioteka do kt\u00f3rej mamy linkowa\u0107 program, m\u00f3wimy kompilatorowi do jakich bibliotek linkujemy program, np -lm linkuje do biblioteki lib m .so -v Verbose gcc opisuje kroki kompilacji Na og\u00f3\u0142 po prostu kompilujesz w jednej fazie gcc -o executable programik.c","title":"Kompilacja"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#zmienne","text":"Nazwa Rozmiar Czym jest int 32b Liczba ca\u0142kowita float 32b Liczba zmiennoprzecinkowa double 64b Dok\u0142adniejszy float char 1B =8b Jednobajtowe liczby ca\u0142kowite 0-255, u\u017cywane tak\u017ce (g\u0142\u00f3wnie) do przechowywania znak\u00f3w bool 1(true) lub 0(false) logika (wymaga stdbool.h ) void - Typ pusty int Sposoby zapisu liczb: zwyk\u0142y: 2, 456, 42 itp. \u00f3semkowy 010 (8) 015 (13) 0100 (64) szesnastkowy 0x12 (18) 0xF (15) float Sposoby zapisu liczb: zwyk\u0142y: 2.43, 456, 3.14 itp. naukowy(wyk\u0142adniczy) 6e10 (6*1010) 1.5e2 (150) char Zapis: zwyk\u0142y: char letter1 = 'a'; jako kod ASCII: char letter2=97; 97 to a w kodzie ASCII *putchar(char)-wypisuje char/tablice char\u00f3w a po niej daje enter","title":"Zmienne"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#specyfikatory","text":"signed -liczba b\u0119dzie tak\u017ce mog\u0142a by\u0107 ujemna unsigned -liczba b\u0119dzie nieujemna Short i long s\u0105 wskaz\u00f3wkami dla kompilatora, by zarezerwowa\u0142 dla danego typu mniej/wi\u0119cej pami\u0119ci np.: signed char a ; /*zmienna a przyjmuje warto\u015bci od -128 do 127*/ unsigned char b ; /*zmienna b przyjmuje warto\u015bci od 0 do 255*/ signed int i = 0 ; // to samo co: int i = 0;","title":"Specyfikatory"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#wskazniki-zmienne-przechowujace-adres-zmiennej","text":"int * px ; //tworzymy zmienn\u0105 przechowuj\u0105c\u0105 wska\u017anik prowadz\u0105cy do int - a ; int x = 7 ; & x //zwraca adres zmiennej * px ; //we\u017a warto\u015b\u0107 znajduj\u0105c\u0105 si\u0119 pod danym adresem Wska\u017aniki i const int j = 3 ; int \u2217 const pj2 = & j ; ++ ( \u2217 pj2 ) ; //tylko to si\u0119 da int j = 3 ; const int \u2217 const pj3 = & j ; //++pj3 ; // nie da sie \u2212 const //++(\u2217pj3 ) ; // nie da sie \u2212 const //pj3 = &i ; // nie da sie \u2212 const printf ( \" const : %d \\n \" , \u2217 pj3 ) Podsumowuj\u0105c: int * zmienny_wzkaznik_zmienny_int ; int const * zmienny_wzkaznik_staly_int ; int * const staly_wzkaznik_zmienny_int ; int const * const staly_wzkaznik_staly_int ; //Inaczej: const char * const stringTable [] = { \"Hello\" , \"World\" , \"This\" , \"Is\" , \"A\" , \"Table\" , \"Of\" , \"Strings\" }; stringTable [ 0 ] = \"abc\" ; //Niedozwolone stringTable [ 0 ][ 0 ] = 'a' ; //Niedozwolone char * const stringTable2 [] = { \"Hello\" , \"World\" , \"This\" , \"Is\" , \"A\" , \"Table\" , \"Of\" , \"Strings\" }; stringTable2 [ 0 ] = \"abc\" ; //Niedozwolone stringTable2 [ 0 ][ 0 ] = 'a' ; //Dozwolone","title":"Wska\u017aniki-zmienne przechowuj\u0105ce adres zmiennej"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#tablice-i-alokowanie-pamieci","text":"Definiowanie tablic int tab [ 2 ]; tab [ 0 ] = 32 ; tab [ 1 ] = 3 ; int tab [] = { 32 , 3 }; int tab [ 2 ][ 3 ] = { { 2 , 3 , 5 }, { 1 , 3 , 4 }}; ////definiowanie tablicy int tab [ 2 ][ 3 ] = { { 4 }, { 5 }}; /////reszta to zera int tab [ 2 ][ 2 ] = { 1 , 2 , 3 , 4 }; int tab [ 2 ][ 2 ] = { 1 , 2 , 3 }; //reszta to zera int niePoKol [ 12 ] = { 1 , 2 , [ 5 ] = 3 , 4 }; //reszta to zera lub dla tablic znak\u00f3w char slowo [] = \u201d Ala \u201d ; //(od C99 mamy tablice VLA) int liczbaEl = 4 ; int tablica [ liczbaEl ]; int sum2dArr ( int liWierszy , int liKolumn , int vla [ liWierszy ][ likolumn ]) ; Tablica a wska\u017anik - w praktyce zmienna trzymaj\u0105ca tablic\u0119 jest wska\u017anikiem na jej pierwszy element char tab [] = \" Ala \" ; // Zmienna tab zawiera wska\u017anik do // pierwszego elementu tablicy printf ( \u201e % c \u201d , tab + 2 ) //wydrukuje a","title":"Tablice i alokowanie pami\u0119ci"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#tablice-dynamiczne-dynamiczna-alokacja-pamieci","text":"malloc ( rozmiar_w_bajtach ); \u2013 zwraca wska\u017anik do zaalokowanego xobszaru lub NULL (gdy zbraknie pami\u0119ci albo innym b\u0142\u0119dzie). xPrzydzielona pami\u0119\u0107 ma nieokre\u015blon\u0105 zawarto\u015b\u0107 calloc ( ile_el, rozmiar_elementu ); \u2013 to samo co malloc, tyle, \u017ce xprzydzielona pami\u0119\u0107 zainicjowana zerami free ( wsk_zwrocony_przez_malloc_lub_calloc ); \u2013 zwalnia pami\u0119\u0107, xNULL mo\u017ce by\u0107 jej argumentem Przyk\u0142adowa tablica puts ( \"Ile int-\u00f3w?\" ); int tabSize = 0 ; scanf ( \"%d\" , & tabSize ); int * tab = malloc ( tabSize \u2217 sizeof ( int )); if ( ! tab ){ fputs ( \"Brak pamieci \\n \" , stderr ); return 1 ; } Dynamiczna tablica prostok\u0105tna -znamy szeroko\u015b\u0107 przed deklaracj\u0105 int SZER = 5 ; int wys = 4 ; int ( \u2217 pTab ) [ SZER ] ; pTab = sprAlokPam ( malloc ( wys \u2217 sizeof \u2217 pTab )); Dynamiczna tablica prostok\u0105tna, nie znamy ani wysoko\u015bci ani szeroko\u015bci int szer = 5 ; int wys = 4 ; int \u2217\u2217 tabl = sprAlokPam ( malloc ( wys \u2217 sizeof ( int \u2217 ))); for ( int j = 0 ; j < wys ; ++ j ) tabl [ j ] = sprAlokPam ( malloc ( szer \u2217 sizeof ( int ))); for ( int j = 0 ; j < wys ; ++ j ) ///zwalnianie free ( tabl [ j ]); free ( tabl ); Dynamiczna tablica prostok\u0105tna int szer = 5 ; int wys = 4 ; int \u2217\u2217 tabl = sprAlokPam ( malloc ( wys \u2217 sizeof ( int \u2217 ))); for ( int j = 0 ; j < wys ; ++ j ) tabl [ j ] = sprAlokPam ( malloc ( szer \u2217 sizeof ( int )));","title":"Tablice dynamiczne+ Dynamiczna Alokacja pami\u0119ci"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#struktury","text":"struct struktura { int zmienna ; bool prawda = true ; //mo\u017cemy je od razu definiowa\u0107 char literka ; ///itp. tu mog\u0105 by\u0107 tablice, zmienne, inne struktury }; typedef struct { int p1 , p2 ; } Struktura ; int main () { Struktura s = { 0 , 0 }; Struktura \\ * wsk = & s ; wsk -> p1 = 2 ; wsk -> p2 = 3 ; return 0 ; } *W strukturach nie dzia\u0142aj\u0105 tablice VLA **typedef struct struktura st; pomaga skr\u00f3ci\u0107 zapis i od teraz definiuj\u0105c struktur\u0119 zapisujemy tylko st","title":"Struktury"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#typ-wyliczeniowy-enum","text":"Ka\u017cdy element wyliczenia jest widziany jako sta\u0142a Z kolejnymi elementami skojarzono kolejne liczby typu int (licz\u0105c od 0) enum Miesiace { STY , LUT , MAR , KW , MAJ , CZER , LIP , SIER , WRZ , PAZ , LIST , GR }; Mo\u017cna przypisa\u0107 konkretn\u0105 warto\u015b\u0107, pozosta\u0142e elementy to kolejne liczby enum Miesiace { STY = 1 , LUT , MAR , KW , MAJ , CZER , LIP , SIER , WRZ , PAZ , LIST , GR }; Ka\u017cdemu elementowi mo\u017cna przypisa\u0107 liczb\u0119, dopuszczalne s\u0105 nawet powt\u00f3rzenia enum ZnakiSpecj { DZWONEK = \u2019\\ b \u2019 , TAB = \u2019\\ t \u2019 , NOW_LINIA = \u2019\\ n \u2019 };","title":"Typ wyliczeniowy - Enum"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#logika","text":"","title":"Logika"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#operatory","text":"1 i 0 lub true i false dla typ\u00f3w logicznych takich jak bool (jako, \u017ce czyste C nie ma zmiennych typu bool to dla wygody mo\u017cna za\u0142\u0105czy\u0107 sobie biblioteke #include ) Podstawowe operatory: x||y lub x&&y oraz !x negacja a==b czy r\u00f3wne a!=b czy r\u00f3\u017cne a>=b , a>b Por\u00f3wnania zwracaj\u0105 stany logiczne (np dla int a,b) Warto\u015b\u0107 boola mo\u017cna dodawa\u0107 do zmiennych liczbowych typu int (ale polecam unika\u0107 takich zabaw) bool x = true ; x ++ ; //x nadal jest r\u00f3wne 1","title":"Operatory"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#warunkowe","text":"if ( warunek ) { //kod je\u015bli tak } else { //kod je\u015bli nie } switcha mo\u017cna wykorzystywa\u0107 gdy chcemy unikn\u0105\u0107 tworzenia tzw \"drabinki\" if-\u00f3w. Na og\u00f3\u0142 jest u\u017cywamy, gdy chcemy sprawdzi\u0107 warto\u015b\u0107 enuma. switch ( jaka\u015b_zmienna ) { case warto\u015b\u01071 : //kod break ; case warto\u015b\u01072 : //kod break ; default : /* Optional */ //kod je\u015bli nic z powy\u017cszych nie pasuje }","title":"Warunkowe"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#petle","text":"Sterowanie przebiegiem p\u0119tli break \u2013 przerwanie dzia\u0142ania p\u0119tli continue \u2013 rozpocz\u0119cie kolejnego obiegu p\u0119tli Nadmierne stosowanie instrukcji steruj\u0105cych break, continue jest z\u0142\u0105 praktyk\u0105 programistyczn\u0105 while ( warunek ){ //nasze polecenia } //wykonuje si\u0119 dop\u00f3ki warunek jest spe\u0142niony do { //kod } while ( warunek ) //warunek jest sprawdzany dopiero po pierwszym obrocie //for(deklaracja zm ;warunek trwania; co ma si\u0119 dzia\u0107 po obrocie p\u0119tli){ for ( int i = 0 ; i < 5 ; i ++ ){ //b\u0119dzie 5 obrot\u00f3w p\u0119tli dla 01234 }","title":"P\u0119tle"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#include","text":"typedef unsigned char uchar ; typedef unsigned short ushort ; enum Miesiace{STY=1 ,LUT,MAR,KW, MAJ,CZER,LIP ,SIER ,WRZ, PAZ, LIST,GR}; const uchar dlMies[13]={0 ,31 ,29 ,31 ,30 ,31 ,30 ,31 ,31 ,30 ,31 ,30 ,31};//dlugosc miesi\u0105ca extern inline bool rokPrzest(const ushort r ) ; inline stosuje si\u0119 do kr\u00f3tkich, prostych funkcji aby unikn\u0105\u0107 kosztownego mechanizmu wo\u0142ania funkcji. Bez extern w C nie skompiluje si\u0119. assert(true) nic nie robi, assert(false) ko\u0144czy dzia\u0142anie programu. Asercje stosuje si\u0119 do debugowania, lub do sprawdzania czy spe\u0142nione s\u0105 za\u0142o\u017cenia projektant\u00f3w funkcji Inne Funkcje Liczby losowe rand() - zwraca liczb\u0119 z zakresu 0-RAND_MAX, losowane warto\u015bci zale\u017c\u0105 od funkcji: srand(ziarno) (nie wo\u0142a si\u0119 przed ka\u017cdym rand, wo\u0142a si\u0119 tylko przed pierwszym losowaniem!)-ustala ziarno losowania dla funkcji rand cz\u0119sto wewn\u0105trz podaje si\u0119 time(NULL) -je\u017celi tego nie zrobimy to za ka\u017cdym razem program wygeneruje to samo Lista s\u0142\u00f3w kluczowych C11 Lista s\u0142\u00f3w kluczowych j\u0119zyka C : auto, double, int, struct, break, else, long, switch, case, enum, register, typedef, char, extern, return, union, const, float, short, unsigned, continue, for, signed, void, default, goto, sizeof, volatile, do, if, static, while,_Bool, _Imaginary, restrict,_Complex, inline, _Alignas,_Generic, _Thread_local,_Alignof, Noreturn, _Atomic,_Static_assert \u0179r\u00f3d\u0142a je\u017celi potrzeba dodatkowych informacji: https://pl.wikibooks.org/wiki/C/Zmienne https://codeforwin.org/2015/05/list-of-all - format-specifiers-in-c-programming.html https://pl.wikibooks.org/wiki/C/scanf poj\u0119cia?: stdout wyk\u0142ady pozosta\u0142e 5,6,7","title":"include"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#budowa-programu","text":"W ka\u017cdym programie punktem pocz\u0105tkowym jest funkcja main Przyjmuje ona argumenty: argc - liczba argument\u00f3w przekazanych do programu argv - tablica ze stringami argument\u00f3w A zwraca ona int-a b\u0119d\u0105cego kodem wyj\u015bcia (0-sukces) #include int main ( int argc , char * argv []) { //program }","title":"Budowa programu"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#funkcje","text":"","title":"Funkcje"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#argumenty-funkcji","text":"","title":"Argumenty funkcji"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#zmienna-liczba-argumentow-variadic","text":"W C i C++ funkcje na og\u00f3\u0142 przyjmuj\u0105 \u015bci\u015ble okre\u015blon\u0105 liczb\u0119 argument\u00f3w, ale mo\u017cliwe jest tak\u017ce zdefiniowanie funkcji przyjmuj\u0105cej zmienn\u0105 liczb\u0119 argument\u00f3w. (Tak jak printf() ). Oznaczamy to za pomoc\u0105 wielokropka ... int fun ( int i , char c , ...){} Za\u015b aby dosta\u0107 si\u0119 do warto\u015bci przekazanych dalej nale\u017cy u\u017cy\u0107 makr va_arg , va_copy , va_end , va_start . Dokumentacja #include /* printf */ #include /* va_list, va_start, va_arg, va_end */ int FindMax ( int n , ...) { int i , val , largest ; va_list vl ; va_start ( vl , n ); //zaczynamy prac\u0119 ze zmiennymi largest = va_arg ( vl , int ); for ( i = 1 ; i < n ; i ++ ) { val = va_arg ( vl , int ); largest = ( largest > val ) ? largest : val ; } va_end ( vl ); return largest ; } va_list - Przed uzyskaniem dost\u0119pu do dowolnych argument\u00f3w zmiennych nale\u017cy ustanowi\u0107 znacznik listy jako zmienn\u0105 typu va_list va_start - wywo\u0142ujemy jak zaczymany prac\u0119. Drugim argumentem jest ostatni znany argument. (to co znajduje si\u0119 przed ... ) va_end - musimy je wywo\u0142a\u0107 jak ju\u017c zako\u0144czymy prac\u0119 ze zmiennymi va_arg - pozwala pobra\u0107 warto\u015b\u0107 typ zmienna=va_arg(lista_va,typ) va_copy (od C++11) -Tworzy kopi\u0119 listy argument\u00f3w w bie\u017c\u0105cym stanie W C++ mo\u017cliwe jest jednak nieco bezpieczniejsze obchodzenie si\u0119 z tymi argumentami. Od C++11 pojawi\u0142y si\u0119 templatki Cppreference packs i prostsze docsy template < typename T > T adder ( T v ) { return v ; } template < typename T , typename ... Args > T adder ( T first , Args ... args ) { return first + adder ( args ...); } adder ( 1 , 4 , 56 , 7 );","title":"Zmienna liczba argument\u00f3w (Variadic)"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#biblioteka-standardowa","text":"","title":"Biblioteka standardowa"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#pisanieczytanie","text":"Cla C standardow\u0105 bibliotek\u0105 jest stdio.h #include int main (){ //printf( [, ] ) printf ( \" \\n Podaj liczbe: \" ); //scanf( , ) int num ; scanf ( \"%d\" , & num ); }; W kontrolnych ci\u0105gach znak\u00f3w wykorzystujemy specyfikatory formatu z tabelki poni\u017cej Tabelka z typami format\u00f3w Format Description Supported data types %c Character char,unsigned char %d Signed Integer short ,unsigned short ,int ,long %e or %E Scientific notation of float values float,double %f Floating point float %g or %G Similar as %e or %E Float, double %hi Signed Integer(Short) short %hu Unsigned Integer(Short) unsigned short %i Signed Integer short, unsigned short, int,long %l or %ld or %li Signed Integer long %lf Floating point double %Lf Floating point long double %lu Unsigned integer unsigned int unsigned long %lli, %lld Signed Integer long long %llu Unsigned Integer unsigned long long %o Octal representation of Integer. short, unsigned short, int, unsigned int, long %p Address of pointer to void *, (wska\u017anik) void * %s String char * %u Unsigned Integer unsigned int unsigned long %x or %X Hexadecimal representation of Unsigned Integer short, unsigned short, int, unsigned int, long %n Prints nothing %% Prints % character Znaki specjalne Znak Znaczenie/akcja \\n Nowa linia (ASCII 010) \\t Tabulacja pozioma (ASCII 009) \\v Tabulacja pionowa \\f Nowa strona \\r Powr\u00f3t kursora (ASCII 013) \\\\ Znak \\ (ASCII 092) \\\" Znak \" (ASCII 034)","title":"Pisanie/czytanie"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#preprocesor","text":"Preprocesor jest to program, kt\u00f3ry analizuje plik \u017ar\u00f3d\u0142owy (programu, biblioteki) w poszukiwaniu wszystkich wyra\u017ce\u0144 zaczynaj\u0105cych si\u0119 od \"#\". Na podstawie tych instrukcji generuje on kod w \"czystym\" j\u0119zyku C/C++, kt\u00f3ry dopiero potem jest analizowany przez kompilator Link do artyku\u0142u #define : S\u0142u\u017cy do definiowania makr, kt\u00f3re s\u0105 zast\u0119powane przez okre\u015blone fragmenty kodu podczas procesu preprocesowania. #include : S\u0142u\u017cy do importowania plik\u00f3w nag\u0142\u00f3wkowych do kodu \u017ar\u00f3d\u0142owego. Pliki nag\u0142\u00f3wkowe zawieraj\u0105 definicje funkcji, zmiennych i innych element\u00f3w, kt\u00f3re s\u0105 u\u017cywane w kodzie \u017ar\u00f3d\u0142owym. #ifdef / #ifndef : S\u0142u\u017c\u0105 do sprawdzenia, czy dana makrodefinicja zosta\u0142a zdefiniowana lub nie. Je\u015bli warunek jest spe\u0142niony, to preprocesor wykonuje okre\u015blony fragment kodu. #if / #else / #endif : S\u0142u\u017c\u0105 do warunkowego wykonywania fragment\u00f3w kodu. Je\u015bli warunek jest spe\u0142niony, to preprocesor wykonuje pierwszy fragment kodu, w przeciwnym razie wykonuje drugi fragment kodu. #pragma : S\u0142u\u017cy do okre\u015blenia specjalnych instrukcji dla kompilatora. Mo\u017ce by\u0107 u\u017cywana do ustawienia opcji kompilacji lub do w\u0142\u0105czania/wy\u0142\u0105czania okre\u015blonych funkcji. //TODO przyk\u0142ady","title":"Preprocesor"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/0_C/#define","text":"// TODO przyk\u0142ady funkcji wo\u0142anych przez makra #define PRINT_STDERR() StreamPrinter(stderr, __LINE__, __FILE__) //TODO kopiuj obrazki o oryginalnych notatek // TODO opisz const dla const int* var vs int const *var","title":"Define"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/","text":"Zbi\u00f3r informacji o C++ Oficjalna dokumentacja i zalecenia: ISO CPP GUIDELINES Elementy j\u0119zyka i jego mechanizmy Zarz\u0105dzanie pami\u0119ci\u0105 new i delete Zarz\u0105dzanie pami\u0119ci\u0105 w C++ jest podobne do zarz\u0105dzania w C . Jednak jest oparta o s\u0142owa kluczowe new i delete . (NIGDY nie mieszajmy tych dw\u00f3ch sposob\u00f3w) artyku\u0142 new s\u0142u\u017cy do tworzenia nowych obiekt\u00f3w i alokowania pami\u0119ci dla nich, natomiast delete s\u0142u\u017cy do zwalniania zarezerwowanej wcze\u015bniej pami\u0119ci. Przyk\u0142ad u\u017cycia s\u0142owa kluczowego new: int * p = new int ; // alokuje pami\u0119\u0107 dla zmiennej typu int * p = 5 ; // przypisuje warto\u015b\u0107 5 do zmiennej delete p ; // zwalnia pami\u0119\u0107 zarezerwowan\u0105 dla zmiennej p Mo\u017cliwe jest tak\u017ce u\u017cycie s\u0142owa kluczowego new do tworzenia tablic dynamicznych: int * tab = new int [ 10 ]; // alokuje pami\u0119\u0107 dla tablicy 10-elementowej tab [ 0 ] = 5 ; // przypisuje warto\u015b\u0107 5 do pierwszego elementu tablicy delete [] tab ; // zwalnia pami\u0119\u0107 zarezerwowan\u0105 dla tablicy tab P\u0119tle Typy p\u0119tli: Podstawowa p\u0119tla for for ( int i = 0 ; i < 5 ; ++ i ) p\u0119tla while int j = 0 ; while ( j < 10 ) { // r\u00f3b co\u015b ++ j ; } p\u0119tla do-while int k = 0 ; do { // Wykonuj przynajmniej raz, potem sprawdzaj warunek ++ k ; } while ( k < 3 ); range-based for - jest to zalecana metoda dla zbior\u00f3w iterowalnych std :: vector < int > numbers = { 1 , 2 , 3 , 4 , 5 }; for ( int num : numbers ) { // Iteracja po elementach kontenera } W wypadku bardziej z\u0142o\u017conych obiekt\u00f3w mo\u017cna u\u017cy\u0107 te\u017c referencji for ( auto && element : lista ) mo\u017ce by\u0107 te\u017c u\u017cywany do rozpakowywania link for ( auto && [ first , second ] : mymap ) Funkcje Lambdy Sk\u0142adnia lambdy: [] - Tu podajemy list\u0119 przechwytywania [x] - przechwytuje obiekt x (tylko odczyt) [&x] - przechwytuje obiekt x (odczyt i zapis) [=] - dowolny obiekt ze scope'a do odczytu [&] - dowolny obiekt ze scope'a do odczytu i zapisu () - argumenty, jakie ma przyjmowa\u0107 wyra\u017cenie lambda. (Opcjonalne) atrybuty wyra\u017cenia lambda, z mo\u017cliwych atrybut\u00f3w w tym momencie najistotniejszy jest mutable, kt\u00f3ry sprawia \u017ce zmienne przechwycone przez warto\u015b\u0107 mog\u0105 by\u0107 modyfikowane wewn\u0105trz cia\u0142a wyra\u017cenia. (Opcjonalne) -> T - typ zwracany (Opcjonalne) {} - cia\u0142o wyra\u017cenia //Najprostsza mo\u017cliwa lambda [] { }(); []( int a ) -> float { if ( a < 0 ) return 0 ; return a * 0.5f ; } Przekazywanie argument\u00f3w do funkcji W C++ istniej\u0105 r\u00f3\u017cne sposoby na przekazywanie argument\u00f3w do funkcji. poprzez kopi\u0119 - w domy\u015blnym wypadku do naszej funkcji przekazywana jest kopia naszego obiektu. O ile to nie jest problem przy liczbach to przy wi\u0119kszych obiektach to to mo\u017ce by\u0107 ju\u017c problem. poprzez wska\u017anik - jest to opcja zalecana bardziej przy kodzie napisanym w czystym C, czy te\u017c w wypadku, gdy chcemy sobie zastrzec mo\u017cliwo\u015b\u0107 przekazania pustego wska\u017anika. poprzez referencj\u0119 - jest to spos\u00f3b zbli\u017cony do wska\u017anika, do funkcji przekazujemy referencj\u0119 do naszego obiektu. class Klasa { private : /* data */ public : Klasa ( /* args */ ) { std :: cout << \"Wo\u0142anie konstruktora \\n \" ; } Klasa ( const Klasa & other ) { std :: cout << \"Wo\u0142anie konstruktora kopiuj\u0105cego \\n \" ; } }; void funkcja_zwykla ( Klasa k ) {} void funkcja_pointer ( Klasa * k ) {} void funkcja_referencja ( Klasa & k ) {} int main () { Klasa k = Klasa (); std :: cout << \"funkcja_zwykla: \\n \" ; funkcja_zwykla ( k ); std :: cout << \"funkcja_pointer: \\n \" ; funkcja_pointer ( & k ); std :: cout << \"funkcja_referencja: \\n \" ; funkcja_referencja ( k ); } program wypisze: Wo\u0142anie konstruktora funkcja_zwykla: Wo\u0142anie konstruktora kopiuj\u0105cego funkcja_pointer: funkcja_referencja: W wypadku przekazywania poprzez referencj\u0119 lub wska\u017anik nale\u017cy pami\u0119ta\u0107 o tym, \u017ce zmiany obiektu, kt\u00f3re mia\u0142y miejsce wewn\u0105trz funkcji b\u0119d\u0105 nadal widoczne z zewn\u0105trz, poniewa\u017c operujemy tam na tej samej instancji obiektu. Aby unikn\u0105\u0107 takich problem\u00f3w warto przekazywa\u0107 te argumenty jako const , albo zastanowi\u0107 si\u0119, czy jednak kopia nie b\u0119dzie lepsza. Klasy Funkcje wirtualne s\u0105 oznaczane za pomoc\u0105 s\u0142owa kluczowego virtual . class Base { public : virtual void print () { cout << \"Base Function\" << endl ; } }; class Derived : public Base { public : void print () { cout << \"Derived Function\" << endl ; } }; int main () { Derived derived1 ; // pointer of Base type that points to derived1 Base * base1 = & derived1 ; // calls member function of Derived class base1 -> print (); return 0 ; } Podczas pracy z funkcjami wirtualnymi dobr\u0105 praktyk\u0105 jest korzystanie ze specyfikatora override . Dzi\u0119ki jego u\u017cyciu w klasie potomnej b\u0119dziemy mie\u0107 pewno\u015b\u0107, \u017ce ta funkcja w klasie bazowej jest wirtualna. struct A { virtual void foo (); void bar (); virtual ~ A (); }; // member functions definitions of struct A: void A::foo () { std :: cout << \"A::foo(); \\n \" ; } A ::~ A () { std :: cout << \"A::~A(); \\n \" ; } struct B : A { // void foo() const override; // Error: B::foo does not override A::foo // (signature mismatch) void foo () override ; // OK: B::foo overrides A::foo // void bar() override; // Error: A::bar is not virtual ~ B () override ; // OK: `override` can also be applied to virtual // special member functions, e.g. destructors }; Templatki Pozwalaj\u0105 kompilatorowi na \u0142atw\u0105 autogeneracj\u0119 kodu. Templatka metody template < class myType > myType GetMax ( myType a , myType b ) { return ( a > b ? a : b ); } Templatka klasy template < class T > class mypair { T values [ 2 ]; public : mypair ( T first , T second ) { values [ 0 ] = first ; values [ 1 ] = second ; } }; Specjalizacje templatek - pozwalaj\u0105 na \u0142atwe doprecyzowanie implementacji dla pewnych \u015bci\u0107le okre\u015blonych typ\u00f3w. template < class T > class mycontainer { ... }; template <> class mycontainer < char > { ... }; Typy cast\u00f3w (operator\u00f3w rzutowania) U\u017cywaj\u0105c tych operator\u00f3w na og\u00f3\u0142 powinno si\u0119 operowa\u0107 na wska\u017anikach (albo referencjach) static_cast(wyrazenie) - wykorzystywany do konwersji danych w zmiennych r\u00f3\u017cnych typ\u00f3w (np pomi\u0119dzy typami reprezentuj\u0105cymi liczby), jest on wykonywany w trakcie kompilacji. dynamic_cast(wyrazenie) - s\u0142u\u017cy do przekszta\u0142cania typ\u00f3w klas pomi\u0119dzy klasami kt\u00f3re po sobie dziedzicz\u0105. W wypadku niepowodzenia zwraca null Wyr\u00f3\u017cniamy: Downcasting - kastujemy klas\u0119 bazow\u0105 na potomn\u0105 Upcasting - gdy chcemy uzyska\u0107 instancj\u0119 klasy bazowej reinterpret_cast(wyrazenie) - dzia\u0142a podobnie do dynamic casta, ale nie zwraca nulla, zaleca si\u0119 u\u017cywanie tylko kiedy dobrze wiesz co robisz. const_cast(wyrazenie) - pozwala zmieni\u0107 sta\u0142\u0105 na zmienn\u0105 i na odwr\u00f3t na og\u00f3\u0142 jego u\u017cywanie nie jest zalecane const double liczbaPI = 3.14 ; const double * wskDoStalej = & liczbaPI ; double * wskaznik = const_cast < double *> ( wskDoStalej ); //przypisujemy dane ze sta\u0142ej do zwyk\u0142ego wska\u017anika cout << * wskaznik << endl ; //wypisze 3.14 * wskaznik = 43 ; // *wskDoStalej = 43; ERROR cout << * wskaznik << endl ; //wypisze 3.14 Biblioteki W\u0105tki Jest wiele sposob\u00f3w na w\u0105tki, ale najprostszym do u\u017cycia jest std::thread #include // Start thread t1 std :: thread t1 ( callable ); // Wait for t1 to finish t1 . join (); // t1 has finished do other stuff //Wywo\u0142anie dla metody w klasie std :: thread t2 ( & Klasa :: moja_metoda , & instancja_klasy , argument1 , argument2 , argument3 ); t2 . join (); Inne S\u0142owa kluczowe explicit TODO Nowe standardy C++17 Artyku\u0142 C++20 Pe\u0142na lista z om\u00f3wieniem Do zrobienia TODO: std::move, lvalue i rvalue, &&, og\u00f3lnie o klasach i dziedziczeniu, explicit C- czyli co musi by\u0107 kompilowane jako czyste C, typy smart pointer\u00f3w. //TODO VOLATILE https://en.cppreference.com/w/cpp/language/cv //TODO C++ contracts https://www.modernescpp.com/index.php/c-core-guidelines-a-detour-to-contracts (similar to java JML, or Dafny for C#)","title":"Zbi\u00f3r informacji o C++"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#zbior-informacji-o-c","text":"Oficjalna dokumentacja i zalecenia: ISO CPP GUIDELINES","title":"Zbi\u00f3r informacji o C++"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#elementy-jezyka-i-jego-mechanizmy","text":"","title":"Elementy j\u0119zyka i jego mechanizmy"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#zarzadzanie-pamiecia-new-i-delete","text":"Zarz\u0105dzanie pami\u0119ci\u0105 w C++ jest podobne do zarz\u0105dzania w C . Jednak jest oparta o s\u0142owa kluczowe new i delete . (NIGDY nie mieszajmy tych dw\u00f3ch sposob\u00f3w) artyku\u0142 new s\u0142u\u017cy do tworzenia nowych obiekt\u00f3w i alokowania pami\u0119ci dla nich, natomiast delete s\u0142u\u017cy do zwalniania zarezerwowanej wcze\u015bniej pami\u0119ci. Przyk\u0142ad u\u017cycia s\u0142owa kluczowego new: int * p = new int ; // alokuje pami\u0119\u0107 dla zmiennej typu int * p = 5 ; // przypisuje warto\u015b\u0107 5 do zmiennej delete p ; // zwalnia pami\u0119\u0107 zarezerwowan\u0105 dla zmiennej p Mo\u017cliwe jest tak\u017ce u\u017cycie s\u0142owa kluczowego new do tworzenia tablic dynamicznych: int * tab = new int [ 10 ]; // alokuje pami\u0119\u0107 dla tablicy 10-elementowej tab [ 0 ] = 5 ; // przypisuje warto\u015b\u0107 5 do pierwszego elementu tablicy delete [] tab ; // zwalnia pami\u0119\u0107 zarezerwowan\u0105 dla tablicy tab","title":"Zarz\u0105dzanie pami\u0119ci\u0105 new i delete"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#petle","text":"Typy p\u0119tli: Podstawowa p\u0119tla for for ( int i = 0 ; i < 5 ; ++ i ) p\u0119tla while int j = 0 ; while ( j < 10 ) { // r\u00f3b co\u015b ++ j ; } p\u0119tla do-while int k = 0 ; do { // Wykonuj przynajmniej raz, potem sprawdzaj warunek ++ k ; } while ( k < 3 ); range-based for - jest to zalecana metoda dla zbior\u00f3w iterowalnych std :: vector < int > numbers = { 1 , 2 , 3 , 4 , 5 }; for ( int num : numbers ) { // Iteracja po elementach kontenera } W wypadku bardziej z\u0142o\u017conych obiekt\u00f3w mo\u017cna u\u017cy\u0107 te\u017c referencji for ( auto && element : lista ) mo\u017ce by\u0107 te\u017c u\u017cywany do rozpakowywania link for ( auto && [ first , second ] : mymap )","title":"P\u0119tle"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#funkcje","text":"","title":"Funkcje"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#lambdy","text":"Sk\u0142adnia lambdy: [] - Tu podajemy list\u0119 przechwytywania [x] - przechwytuje obiekt x (tylko odczyt) [&x] - przechwytuje obiekt x (odczyt i zapis) [=] - dowolny obiekt ze scope'a do odczytu [&] - dowolny obiekt ze scope'a do odczytu i zapisu () - argumenty, jakie ma przyjmowa\u0107 wyra\u017cenie lambda. (Opcjonalne) atrybuty wyra\u017cenia lambda, z mo\u017cliwych atrybut\u00f3w w tym momencie najistotniejszy jest mutable, kt\u00f3ry sprawia \u017ce zmienne przechwycone przez warto\u015b\u0107 mog\u0105 by\u0107 modyfikowane wewn\u0105trz cia\u0142a wyra\u017cenia. (Opcjonalne) -> T - typ zwracany (Opcjonalne) {} - cia\u0142o wyra\u017cenia //Najprostsza mo\u017cliwa lambda [] { }(); []( int a ) -> float { if ( a < 0 ) return 0 ; return a * 0.5f ; }","title":"Lambdy"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#przekazywanie-argumentow-do-funkcji","text":"W C++ istniej\u0105 r\u00f3\u017cne sposoby na przekazywanie argument\u00f3w do funkcji. poprzez kopi\u0119 - w domy\u015blnym wypadku do naszej funkcji przekazywana jest kopia naszego obiektu. O ile to nie jest problem przy liczbach to przy wi\u0119kszych obiektach to to mo\u017ce by\u0107 ju\u017c problem. poprzez wska\u017anik - jest to opcja zalecana bardziej przy kodzie napisanym w czystym C, czy te\u017c w wypadku, gdy chcemy sobie zastrzec mo\u017cliwo\u015b\u0107 przekazania pustego wska\u017anika. poprzez referencj\u0119 - jest to spos\u00f3b zbli\u017cony do wska\u017anika, do funkcji przekazujemy referencj\u0119 do naszego obiektu. class Klasa { private : /* data */ public : Klasa ( /* args */ ) { std :: cout << \"Wo\u0142anie konstruktora \\n \" ; } Klasa ( const Klasa & other ) { std :: cout << \"Wo\u0142anie konstruktora kopiuj\u0105cego \\n \" ; } }; void funkcja_zwykla ( Klasa k ) {} void funkcja_pointer ( Klasa * k ) {} void funkcja_referencja ( Klasa & k ) {} int main () { Klasa k = Klasa (); std :: cout << \"funkcja_zwykla: \\n \" ; funkcja_zwykla ( k ); std :: cout << \"funkcja_pointer: \\n \" ; funkcja_pointer ( & k ); std :: cout << \"funkcja_referencja: \\n \" ; funkcja_referencja ( k ); } program wypisze: Wo\u0142anie konstruktora funkcja_zwykla: Wo\u0142anie konstruktora kopiuj\u0105cego funkcja_pointer: funkcja_referencja: W wypadku przekazywania poprzez referencj\u0119 lub wska\u017anik nale\u017cy pami\u0119ta\u0107 o tym, \u017ce zmiany obiektu, kt\u00f3re mia\u0142y miejsce wewn\u0105trz funkcji b\u0119d\u0105 nadal widoczne z zewn\u0105trz, poniewa\u017c operujemy tam na tej samej instancji obiektu. Aby unikn\u0105\u0107 takich problem\u00f3w warto przekazywa\u0107 te argumenty jako const , albo zastanowi\u0107 si\u0119, czy jednak kopia nie b\u0119dzie lepsza.","title":"Przekazywanie argument\u00f3w do funkcji"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#klasy","text":"","title":"Klasy"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#funkcje-wirtualne","text":"s\u0105 oznaczane za pomoc\u0105 s\u0142owa kluczowego virtual . class Base { public : virtual void print () { cout << \"Base Function\" << endl ; } }; class Derived : public Base { public : void print () { cout << \"Derived Function\" << endl ; } }; int main () { Derived derived1 ; // pointer of Base type that points to derived1 Base * base1 = & derived1 ; // calls member function of Derived class base1 -> print (); return 0 ; } Podczas pracy z funkcjami wirtualnymi dobr\u0105 praktyk\u0105 jest korzystanie ze specyfikatora override . Dzi\u0119ki jego u\u017cyciu w klasie potomnej b\u0119dziemy mie\u0107 pewno\u015b\u0107, \u017ce ta funkcja w klasie bazowej jest wirtualna. struct A { virtual void foo (); void bar (); virtual ~ A (); }; // member functions definitions of struct A: void A::foo () { std :: cout << \"A::foo(); \\n \" ; } A ::~ A () { std :: cout << \"A::~A(); \\n \" ; } struct B : A { // void foo() const override; // Error: B::foo does not override A::foo // (signature mismatch) void foo () override ; // OK: B::foo overrides A::foo // void bar() override; // Error: A::bar is not virtual ~ B () override ; // OK: `override` can also be applied to virtual // special member functions, e.g. destructors };","title":"Funkcje wirtualne"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#templatki","text":"Pozwalaj\u0105 kompilatorowi na \u0142atw\u0105 autogeneracj\u0119 kodu. Templatka metody template < class myType > myType GetMax ( myType a , myType b ) { return ( a > b ? a : b ); } Templatka klasy template < class T > class mypair { T values [ 2 ]; public : mypair ( T first , T second ) { values [ 0 ] = first ; values [ 1 ] = second ; } }; Specjalizacje templatek - pozwalaj\u0105 na \u0142atwe doprecyzowanie implementacji dla pewnych \u015bci\u0107le okre\u015blonych typ\u00f3w. template < class T > class mycontainer { ... }; template <> class mycontainer < char > { ... };","title":"Templatki"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#typy-castow-operatorow-rzutowania","text":"U\u017cywaj\u0105c tych operator\u00f3w na og\u00f3\u0142 powinno si\u0119 operowa\u0107 na wska\u017anikach (albo referencjach) static_cast(wyrazenie) - wykorzystywany do konwersji danych w zmiennych r\u00f3\u017cnych typ\u00f3w (np pomi\u0119dzy typami reprezentuj\u0105cymi liczby), jest on wykonywany w trakcie kompilacji. dynamic_cast(wyrazenie) - s\u0142u\u017cy do przekszta\u0142cania typ\u00f3w klas pomi\u0119dzy klasami kt\u00f3re po sobie dziedzicz\u0105. W wypadku niepowodzenia zwraca null Wyr\u00f3\u017cniamy: Downcasting - kastujemy klas\u0119 bazow\u0105 na potomn\u0105 Upcasting - gdy chcemy uzyska\u0107 instancj\u0119 klasy bazowej reinterpret_cast(wyrazenie) - dzia\u0142a podobnie do dynamic casta, ale nie zwraca nulla, zaleca si\u0119 u\u017cywanie tylko kiedy dobrze wiesz co robisz. const_cast(wyrazenie) - pozwala zmieni\u0107 sta\u0142\u0105 na zmienn\u0105 i na odwr\u00f3t na og\u00f3\u0142 jego u\u017cywanie nie jest zalecane const double liczbaPI = 3.14 ; const double * wskDoStalej = & liczbaPI ; double * wskaznik = const_cast < double *> ( wskDoStalej ); //przypisujemy dane ze sta\u0142ej do zwyk\u0142ego wska\u017anika cout << * wskaznik << endl ; //wypisze 3.14 * wskaznik = 43 ; // *wskDoStalej = 43; ERROR cout << * wskaznik << endl ; //wypisze 3.14","title":"Typy cast\u00f3w (operator\u00f3w rzutowania)"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#biblioteki","text":"","title":"Biblioteki"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#watki","text":"Jest wiele sposob\u00f3w na w\u0105tki, ale najprostszym do u\u017cycia jest std::thread #include // Start thread t1 std :: thread t1 ( callable ); // Wait for t1 to finish t1 . join (); // t1 has finished do other stuff //Wywo\u0142anie dla metody w klasie std :: thread t2 ( & Klasa :: moja_metoda , & instancja_klasy , argument1 , argument2 , argument3 ); t2 . join ();","title":"W\u0105tki"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#inne-sowa-kluczowe","text":"explicit TODO","title":"Inne S\u0142owa kluczowe"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#nowe-standardy","text":"","title":"Nowe standardy"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#c17","text":"Artyku\u0142","title":"C++17"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#c20","text":"Pe\u0142na lista z om\u00f3wieniem","title":"C++20"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/1_cpp/#do-zrobienia","text":"TODO: std::move, lvalue i rvalue, &&, og\u00f3lnie o klasach i dziedziczeniu, explicit C- czyli co musi by\u0107 kompilowane jako czyste C, typy smart pointer\u00f3w. //TODO VOLATILE https://en.cppreference.com/w/cpp/language/cv //TODO C++ contracts https://www.modernescpp.com/index.php/c-core-guidelines-a-detour-to-contracts (similar to java JML, or Dafny for C#)","title":"Do zrobienia"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/2_gdb/","text":"Praca z GDB Kompilacja z flagami debugowymi W wypadku najprostszych aplikacji kompilowanych za pomoc\u0105 gcc g++ wystarczy dodanie flagi -g gcc -g hello.c Uruchomienie aplikacji za pomoc\u0105 GDB Aby uruchomi\u0107 aplikacj\u0119 z pomoc\u0105 debugera wystarczy wpisa\u0107: gdb a.out Wtedy uruchamiamy nasz program w trybie terminalowym. Praca ze zrzucon\u0105 pami\u0119ci\u0105 (coredump) Przygotowania Do stworzenia zrzutu cz\u0119sto nale\u017cy zwi\u0119kszy\u0107 ilo\u015b\u0107 dozwolonej ilo\u015bci pami\u0119ci: ulimit -c unlimited Kompilujemy nasz program z flagami debugowymi: - Cmake - cmake .. -DCMAKE_BUILD_TYPE=Debug && cmake --build . - make - TODO Zbieranie stosu Na og\u00f3\u0142 zrzuty ze stosu s\u0105 pzechowywane w folderze /var/crash s\u0105 to pliki z rozszerzeniem .crash Np _usr_share_teams_teams.1000.crash = \"http://127.0.0.1:5000/\"; // let url2 = \"https://httpbin.org/post\"; // xhr.open(\"POST\", url, true); // xhr.setRequestHeader(\"Content-Type\", \"application/json\"); // xhr.onreadystatechange = function () { // console.log(\"Jest git\"); // console.log(this.responseText); // }; // var data = JSON.stringify({ name: \"xxx\", code: \"xx=12\" }); // xhr.send(data); Analiza (w terminalu) Uruchomienie gdb ./plik/wykonywalny ./plik/zrzutu/core backtrace / bt full - pokazywanie stanu stosu","title":"Praca z GDB"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/2_gdb/#praca-z-gdb","text":"","title":"Praca z GDB"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/2_gdb/#kompilacja-z-flagami-debugowymi","text":"W wypadku najprostszych aplikacji kompilowanych za pomoc\u0105 gcc g++ wystarczy dodanie flagi -g gcc -g hello.c","title":"Kompilacja z flagami debugowymi"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/2_gdb/#uruchomienie-aplikacji-za-pomoca-gdb","text":"Aby uruchomi\u0107 aplikacj\u0119 z pomoc\u0105 debugera wystarczy wpisa\u0107: gdb a.out Wtedy uruchamiamy nasz program w trybie terminalowym.","title":"Uruchomienie aplikacji za pomoc\u0105 GDB"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/2_gdb/#praca-ze-zrzucona-pamiecia-coredump","text":"","title":"Praca ze zrzucon\u0105 pami\u0119ci\u0105 (coredump)"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/2_gdb/#przygotowania","text":"Do stworzenia zrzutu cz\u0119sto nale\u017cy zwi\u0119kszy\u0107 ilo\u015b\u0107 dozwolonej ilo\u015bci pami\u0119ci: ulimit -c unlimited Kompilujemy nasz program z flagami debugowymi: - Cmake - cmake .. -DCMAKE_BUILD_TYPE=Debug && cmake --build . - make - TODO","title":"Przygotowania"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/2_gdb/#zbieranie-stosu","text":"Na og\u00f3\u0142 zrzuty ze stosu s\u0105 pzechowywane w folderze /var/crash s\u0105 to pliki z rozszerzeniem .crash Np _usr_share_teams_teams.1000.crash = \"http://127.0.0.1:5000/\"; // let url2 = \"https://httpbin.org/post\"; // xhr.open(\"POST\", url, true); // xhr.setRequestHeader(\"Content-Type\", \"application/json\"); // xhr.onreadystatechange = function () { // console.log(\"Jest git\"); // console.log(this.responseText); // }; // var data = JSON.stringify({ name: \"xxx\", code: \"xx=12\" }); // xhr.send(data);","title":"Zbieranie stosu"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/2_gdb/#analiza-w-terminalu","text":"Uruchomienie gdb ./plik/wykonywalny ./plik/zrzutu/core backtrace / bt full - pokazywanie stanu stosu","title":"Analiza (w terminalu)"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/","text":"Programming with OpenMP OpenMP is an open, multi-platform API specification for easy parallel programming in Fortran, C and C++. Main website OpenMP programming is mainly based on compiler directives. #pragma omp [clause [...]] For function usage you have to include omp.h #include ... iam = omp_get_thread_num (); Simple usage example void daxpy ( int n , double a , double * x , double * y , double * z ) { int i ; #pragma omp parallel for //the loop below will be executed on multiple cores for ( i = 0 ; i < n ; i ++ ) z [ i ] = a * x [ i ] + y [ i ]; } Compile it with gcc -fopenmp prg-omp.c Loop iterations are shared among threads. All the variables are shared except loop variable i , which is private. Cmake //TODO Threads management Link do docs Managing threads numbers omp_set_num_threads ( x ); omp_get_num_threads (); // returns the number of threads omp_get_thread_num (); // returns the identifier of the thread (starting from 0, main thread is always 0) We can also use env variable OMP_NUM_THREADS OMP_NUM_THREADS = 10 app Scheduling schedule(type[,chunk]) //TODO S2 - slajd 24 Loop Parallelization General usage #pragma omp parallel for [clause [...]] for ( index = first ; test_expr ; increment_expr ) { // loop body } NOTE - inside of loop we can't use break continue etc (//TODO check this sentence) Thank to clause we may define variables scope, way of obtaining results etc. Clauses: private -each thread has a different replica shared - each threads can read and write reduction - used when neither private or shared can be used firstprivate, lastprivate default - forces to specify scope of all of variables By default all of variables are shared with following exceptions: Index variable of the parallelized loop Local variables of the called subroutines (except if they are declared static) Automatic variables declared inside the loop sum = 0 ; //for sum shared we have races for private we won't get any result #pragma omp parallel for reduction(+:sum) for ( i = 0 ; i < n ; i ++ ) { sum = sum + x [ i ] * x [ i ]; } Reduction - allows easy aggregation of results reduction (operator : list) Available operators: + , * , - , & , | , \u02c6 , && , || , max , min firstprivate, lastprivate - in general private variables have undefined value during the first execution and after execution firstprivate initializes to the value of selected variable the begining of the block. #include #include int main ( void ) { int i = 10 ; #pragma omp parallel firstprivate(i) { //in case of regular private variable we would get random values printf ( \"thread %d: i = %d \\n \" , omp_get_thread_num (), i ); i = 1000 ; } printf ( \"i = %d \\n \" , i ); return 0 ; } lastprivate the value of the variable after the block is the one of the \u201clast\u201d iteration of the loop alpha = 5.0 ; #pragma omp parallel for firstprivate(alpha) lastprivate(i) for ( i = 0 ; i < n ; i ++ ) { z [ i ] = alpha * x [ i ]; } k = i ; /* i has value n*/ if clause - runs loop in pararell only if the expression is true (because of the overhead linked with initializing threads) #pragma omp parallel for if(n>5000) for ( i = 0 ; i < n ; i ++ ) z [ i ] = a * x [ i ] + y [ i ]; Parallel Regions Pragma parallel executes block of code in replicated threads. #pragma omp parallel [clause [clause ...]] { // block } Example #pragma omp parallel private(myid) { myid = omp_get_thread_num (); printf ( \"I am thread %d \\n \" , myid ); } They are used for sharing work in a bit different manner. Each thread works on a part of the data structure, or Each thread performs a different operation Possible mechanisms for worksharing: Based on the thread identifier #pragma omp parallel private(myid) { nthreads = omp_get_num_threads (); myid = omp_get_thread_num (); dowork ( myid , nthreads ); } Parallel task queue int get_next_task () { static int index = 0 ; int result ; #pragma omp critical { if ( index == MAXIDX ) result = -1 ; else { index ++ ; result = index ; } } return result ; } ... int myindex ; #pragma omp parallel private(myindex) { myindex = get_next_task (); while ( myindex > -1 ) { process_task ( myindex ); myindex = get_next_task (); } } Using OpenMP specific constructs - thank to them programmer doesn't have to worry about splitting workload. Types: for construct to split iterations of loops Sections to distinguish different parts of the code Code to be executed by a single thread Worksharing constructs The for construct #pragma omp parallel { ... #pragma omp for for ( i = 1 ; i < n ; i ++ ) b [ i ] = ( a [ i ] + a [ i -1 ]) / 2.0 ; } The loop iterations are not replicated but shared among the threads parallel and for directives can be combined in one. Loop Construct - nowait nowait Clause - removes implicit barrier after for loop void a8 ( int n , int m , float * a , float * b , float * y , float * z ) { int i ; #pragma omp parallel { #pragma omp for nowait for ( i = 1 ; i < n ; i ++ ) b [ i ] = ( a [ i ] + a [ i -1 ]) / 2.0 ; //loop below can start execution before the one above will finish #pragma omp for for ( i = 0 ; i < m ; i ++ ) y [ i ] = sqrt ( z [ i ]); } } sections Construct represents pliece of code, which can be split into small independent sections Individually they represent little work, or Each fragment is inherently sequential It can also be combined with parallel #pragma omp parallel sections { #pragma omp section Xaxis (); #pragma omp section Yaxis (); #pragma omp section Zaxis (); } A thread may execute more than one section Clauses: private, first/lastprivate, reduction, nowait single and master Construct Code fragments that must be executed by a single thread #pragma omp parallel { // we will see info about starting and ending work1 // only once #pragma omp single printf ( \"work1 starts \\n \" ); //Other threads will wait until \"work1 starts\" will be printed work1 (); #pragma omp single printf ( \"work1 ends \\n \" ); #pragma omp single nowait printf ( \"work1 ended in all of the threads, work2 started \\n \" ); work2 (); } master Directive Differences with single: It does not require all threads to reach this construction There is no implicit barrier (other threads simply skip this code) #pragma omp parallel { #pragma omp master printf ( \"Begin work \\n \" ); #pragma omp for for ( i = 0 ; i < n ; i ++ ) calc1 (); //this will be launched after finishing loop above #pragma omp master printf ( \"Work finished \\n \" ); } Some allowed clauses: private, firstprivate, nowait Synchronization The main point of synchronization is avoiding race conditions. The most basic way of avoiding this is mutual exclusion. (directive critical , atomic or locks - _lock routines). critical directive #pragma omp critical [(Name)] Allows execution of critical section by only one thread at once cur_max = -100000 ; #pragma omp parallel for for ( i = 0 ; i < n ; i ++ ) { #pragma omp critical if ( a [ i ] > cur_max ) { cur_max = a [ i ]; } } When a thread reaches the if block (the critical section), it waits until no other thread is executing it at the same time. Code above is not optimal, because entering critical section costs, and we can limit it cur_max = -100000 ; #pragma omp parallel for for ( i = 0 ; i < n ; i ++ ) { if ( a [ i ] > cur_max ) { #pragma omp critical if ( a [ i ] > cur_max ) cur_max = a [ i ]; } } We can also use named critical sections cur_max = -100000 ; cur_min = 100000 ; #pragma omp parallel for for ( i = 0 ; i < n ; i ++ ) { if ( a [ i ] > cur_max ) { #pragma omp critical (maxlock) if ( a [ i ] > cur_max ) cur_max = a [ i ]; } if ( a [ i ] < cur_min ) { #pragma omp critical (minlock) if ( a [ i ] < cur_min ) cur_min = a [ i ]; } } atomic directive It is much more efficient than critical section, but supports only very simple operations. #pragma omp atomic x < binop >= exp where can be +, *, -, /, %, &, |, ^, <<, >> #pragma omp parallel for shared(x, index, n) for ( i = 0 ; i < n ; i ++ ) { #pragma omp atomic x [ index [ i ]] += work1 ( i ); } barrier directive When reaching a barrier, threads wait for the rest to arrive #pragma omp parallel private(index) { index = generate_next_index (); while ( index > 0 ) { add_index ( index ); index = generate_next_index (); } #pragma omp barrier index = get_next_index (); while ( index > 0 ) { process_index ( index ); index = get_next_index (); } } ordered directive Ensures, that portions of code in the loops are executed in the original sequential order #pragma omp parallel for ordered for ( i = 0 ; i < n ; i ++ ) { a [ i ] = ... /* complex computation */ #pragma omp ordered fprintf ( fd , \"%d %g \\n \" , i , a [ i ]); } Only one ordered section is allowed per iteration //TODO ask about this \u2757 // std::cout << \"xx\"","title":"Programming with OpenMP"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#programming-with-openmp","text":"OpenMP is an open, multi-platform API specification for easy parallel programming in Fortran, C and C++. Main website OpenMP programming is mainly based on compiler directives. #pragma omp [clause [...]] For function usage you have to include omp.h #include ... iam = omp_get_thread_num (); Simple usage example void daxpy ( int n , double a , double * x , double * y , double * z ) { int i ; #pragma omp parallel for //the loop below will be executed on multiple cores for ( i = 0 ; i < n ; i ++ ) z [ i ] = a * x [ i ] + y [ i ]; } Compile it with gcc -fopenmp prg-omp.c Loop iterations are shared among threads. All the variables are shared except loop variable i , which is private.","title":"Programming with OpenMP"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#cmake","text":"//TODO","title":"Cmake"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#threads-management","text":"Link do docs Managing threads numbers omp_set_num_threads ( x ); omp_get_num_threads (); // returns the number of threads omp_get_thread_num (); // returns the identifier of the thread (starting from 0, main thread is always 0) We can also use env variable OMP_NUM_THREADS OMP_NUM_THREADS = 10 app","title":"Threads management"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#scheduling","text":"schedule(type[,chunk]) //TODO S2 - slajd 24","title":"Scheduling"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#loop-parallelization","text":"General usage #pragma omp parallel for [clause [...]] for ( index = first ; test_expr ; increment_expr ) { // loop body } NOTE - inside of loop we can't use break continue etc (//TODO check this sentence) Thank to clause we may define variables scope, way of obtaining results etc. Clauses: private -each thread has a different replica shared - each threads can read and write reduction - used when neither private or shared can be used firstprivate, lastprivate default - forces to specify scope of all of variables By default all of variables are shared with following exceptions: Index variable of the parallelized loop Local variables of the called subroutines (except if they are declared static) Automatic variables declared inside the loop sum = 0 ; //for sum shared we have races for private we won't get any result #pragma omp parallel for reduction(+:sum) for ( i = 0 ; i < n ; i ++ ) { sum = sum + x [ i ] * x [ i ]; } Reduction - allows easy aggregation of results reduction (operator : list) Available operators: + , * , - , & , | , \u02c6 , && , || , max , min firstprivate, lastprivate - in general private variables have undefined value during the first execution and after execution firstprivate initializes to the value of selected variable the begining of the block. #include #include int main ( void ) { int i = 10 ; #pragma omp parallel firstprivate(i) { //in case of regular private variable we would get random values printf ( \"thread %d: i = %d \\n \" , omp_get_thread_num (), i ); i = 1000 ; } printf ( \"i = %d \\n \" , i ); return 0 ; } lastprivate the value of the variable after the block is the one of the \u201clast\u201d iteration of the loop alpha = 5.0 ; #pragma omp parallel for firstprivate(alpha) lastprivate(i) for ( i = 0 ; i < n ; i ++ ) { z [ i ] = alpha * x [ i ]; } k = i ; /* i has value n*/ if clause - runs loop in pararell only if the expression is true (because of the overhead linked with initializing threads) #pragma omp parallel for if(n>5000) for ( i = 0 ; i < n ; i ++ ) z [ i ] = a * x [ i ] + y [ i ];","title":"Loop Parallelization"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#parallel-regions","text":"Pragma parallel executes block of code in replicated threads. #pragma omp parallel [clause [clause ...]] { // block } Example #pragma omp parallel private(myid) { myid = omp_get_thread_num (); printf ( \"I am thread %d \\n \" , myid ); } They are used for sharing work in a bit different manner. Each thread works on a part of the data structure, or Each thread performs a different operation Possible mechanisms for worksharing: Based on the thread identifier #pragma omp parallel private(myid) { nthreads = omp_get_num_threads (); myid = omp_get_thread_num (); dowork ( myid , nthreads ); } Parallel task queue int get_next_task () { static int index = 0 ; int result ; #pragma omp critical { if ( index == MAXIDX ) result = -1 ; else { index ++ ; result = index ; } } return result ; } ... int myindex ; #pragma omp parallel private(myindex) { myindex = get_next_task (); while ( myindex > -1 ) { process_task ( myindex ); myindex = get_next_task (); } } Using OpenMP specific constructs - thank to them programmer doesn't have to worry about splitting workload. Types: for construct to split iterations of loops Sections to distinguish different parts of the code Code to be executed by a single thread","title":"Parallel Regions"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#worksharing-constructs","text":"","title":"Worksharing constructs"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#the-for-construct","text":"#pragma omp parallel { ... #pragma omp for for ( i = 1 ; i < n ; i ++ ) b [ i ] = ( a [ i ] + a [ i -1 ]) / 2.0 ; } The loop iterations are not replicated but shared among the threads parallel and for directives can be combined in one.","title":"The for construct"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#loop-construct-nowait","text":"nowait Clause - removes implicit barrier after for loop void a8 ( int n , int m , float * a , float * b , float * y , float * z ) { int i ; #pragma omp parallel { #pragma omp for nowait for ( i = 1 ; i < n ; i ++ ) b [ i ] = ( a [ i ] + a [ i -1 ]) / 2.0 ; //loop below can start execution before the one above will finish #pragma omp for for ( i = 0 ; i < m ; i ++ ) y [ i ] = sqrt ( z [ i ]); } }","title":"Loop Construct - nowait"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#sections-construct","text":"represents pliece of code, which can be split into small independent sections Individually they represent little work, or Each fragment is inherently sequential It can also be combined with parallel #pragma omp parallel sections { #pragma omp section Xaxis (); #pragma omp section Yaxis (); #pragma omp section Zaxis (); } A thread may execute more than one section Clauses: private, first/lastprivate, reduction, nowait","title":"sections Construct"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#single-and-master-construct","text":"Code fragments that must be executed by a single thread #pragma omp parallel { // we will see info about starting and ending work1 // only once #pragma omp single printf ( \"work1 starts \\n \" ); //Other threads will wait until \"work1 starts\" will be printed work1 (); #pragma omp single printf ( \"work1 ends \\n \" ); #pragma omp single nowait printf ( \"work1 ended in all of the threads, work2 started \\n \" ); work2 (); } master Directive Differences with single: It does not require all threads to reach this construction There is no implicit barrier (other threads simply skip this code) #pragma omp parallel { #pragma omp master printf ( \"Begin work \\n \" ); #pragma omp for for ( i = 0 ; i < n ; i ++ ) calc1 (); //this will be launched after finishing loop above #pragma omp master printf ( \"Work finished \\n \" ); } Some allowed clauses: private, firstprivate, nowait","title":"single and master Construct"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#synchronization","text":"The main point of synchronization is avoiding race conditions. The most basic way of avoiding this is mutual exclusion. (directive critical , atomic or locks - _lock routines).","title":"Synchronization"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#critical-directive","text":"#pragma omp critical [(Name)] Allows execution of critical section by only one thread at once cur_max = -100000 ; #pragma omp parallel for for ( i = 0 ; i < n ; i ++ ) { #pragma omp critical if ( a [ i ] > cur_max ) { cur_max = a [ i ]; } } When a thread reaches the if block (the critical section), it waits until no other thread is executing it at the same time. Code above is not optimal, because entering critical section costs, and we can limit it cur_max = -100000 ; #pragma omp parallel for for ( i = 0 ; i < n ; i ++ ) { if ( a [ i ] > cur_max ) { #pragma omp critical if ( a [ i ] > cur_max ) cur_max = a [ i ]; } } We can also use named critical sections cur_max = -100000 ; cur_min = 100000 ; #pragma omp parallel for for ( i = 0 ; i < n ; i ++ ) { if ( a [ i ] > cur_max ) { #pragma omp critical (maxlock) if ( a [ i ] > cur_max ) cur_max = a [ i ]; } if ( a [ i ] < cur_min ) { #pragma omp critical (minlock) if ( a [ i ] < cur_min ) cur_min = a [ i ]; } }","title":"critical directive"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#atomic-directive","text":"It is much more efficient than critical section, but supports only very simple operations. #pragma omp atomic x < binop >= exp where can be +, *, -, /, %, &, |, ^, <<, >> #pragma omp parallel for shared(x, index, n) for ( i = 0 ; i < n ; i ++ ) { #pragma omp atomic x [ index [ i ]] += work1 ( i ); }","title":"atomic directive"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#barrier-directive","text":"When reaching a barrier, threads wait for the rest to arrive #pragma omp parallel private(index) { index = generate_next_index (); while ( index > 0 ) { add_index ( index ); index = generate_next_index (); } #pragma omp barrier index = get_next_index (); while ( index > 0 ) { process_index ( index ); index = get_next_index (); } }","title":"barrier directive"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/5_openMP/#ordered-directive","text":"Ensures, that portions of code in the loops are executed in the original sequential order #pragma omp parallel for ordered for ( i = 0 ; i < n ; i ++ ) { a [ i ] = ... /* complex computation */ #pragma omp ordered fprintf ( fd , \"%d %g \\n \" , i , a [ i ]); } Only one ordered section is allowed per iteration //TODO ask about this \u2757 // std::cout << \"xx\"","title":"ordered directive"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/","text":"Cmake Na podstawie: https://cmake.org/cmake/help/latest/guide/tutorial/index.html Inny tutorial: Cmake in 15 min Podstawy Mamy tu minimalny przyk\u0142ad #na pocz\u0105tku zawsze okre\u015blamy min wersj\u0119 CMake'a cmake_minimum_required ( VERSION 3.10 ) # set the project name project ( Tutorial ) # Tworzymy tylko jeden plik wyj\u015bciowy `Tutorial` ze skompilowanego pliku tutorial.cxx add_executable ( Tutorial tutorial.cxx ) Budowanie #warto stworzy\u0107 sobie nowy folder i w nim budowa\u0107 mkdir build ; cd build cmake SCIEZKA_DO_FOLDERU_GLOWNEGO # zwykle do folderu z plikiem CMakeLists.txt cmake --build . #mo\u017cna tu te\u017c u\u017cy\u0107 po prostu make (Linux) Inne u\u017cyteczne komendy cmake --build . --target help # wypisanie cel\u00f3w w ramach projektu cmake --build . --target # budowanie danego celu Konfigurowalne pliki nag\u0142\u00f3wkowe Za pomoc\u0105 CMake'a mo\u017cemy generowa\u0107 pliki nag\u0142\u00f3wkowe zawieraj\u0105ce zmienne oraz parametry zawarte w plikach CMake. Przyk\u0142adowo mo\u017cemy w ten spos\u00f3b zapisywa\u0107 wersj\u0119 naszego programu. cmake_minimum_required ( VERSION 3.10 ) # set the project name and version project ( Tutorial VERSION 1.0 ) # opisujemy tu na podstawie czego ma by\u0107 wygenerowany nasz plik nag\u0142\u00f3wkowy configure_file ( TutorialConfig.h.in TutorialConfig.h ) # Skoro utworzony zostanie plik TutorialConfig.h to warto doda\u0107 \u015bcie\u017ck\u0119 na kr\u00f3rej si\u0119 znajduje do listy \u015bcie\u017cek w kt\u00f3rych b\u0119d\u0105 szukane pliki target_include_directories ( Tutorial PUBLIC \"${PROJECT_BINARY_DIR}\" ) Zawarto\u015b\u0107 pliku TutorialConfig.h.in // the configured options and settings for Tutorial #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@ Okre\u015blenie wymaganej wersji C++ # specify the C++ standard set ( CMAKE_CXX_STANDARD 11 ) set ( CMAKE_CXX_STANDARD_REQUIRED True ) Biblioteki Tworzenie w\u0142asnych Podobnie jak programy, za pomoc\u0105 cmake'a mo\u017cemy definiowa\u0107 te\u017c biblioteki W wypadku prostych bibliotek wewn\u0105trz naszych preojekt\u00f3w wystarczy jednolinijkowy plik CMakeLists.txt w ich folderze. # Dodaj bibliotek\u0119 o nazwie MathFunctions zawieraj\u0105c\u0105 plik mysqrt.cxx add_library ( MathFunctions mysqrt.cxx ) (Ta biblioteka znajduje si\u0119 w folderze MathFunctions w g\u0142\u00f3wnym folderze projektu. W folderze tym mamy jeszcze plik nag\u0142\u00f3wkowy MathFunctions.h ) Linkowanie bibliotek # add the MathFunctions library add_subdirectory ( MathFunctions ) # add the executable add_executable ( Tutorial tutorial.cxx ) # Musimy podlinkowa\u0107 wszystkie biblioteki u\u017cywane przez plik Tutorial target_link_libraries ( Tutorial PUBLIC MathFunctions ) # add the binary tree to the search path for include files # so that we will find TutorialConfig.h target_include_directories ( Tutorial PUBLIC \"${PROJECT_BINARY_DIR}\" \"${PROJECT_SOURCE_DIR}/MathFunctions\" ) Logika Zmienne Zmienne s\u0105 definiowane podczas przypisywania im warto\u015bci. listy # Dodanie elementu do listy list ( APPEND EXTRA_LIBS MathFunctions ) # Dodanie element\u00f3w do listy regexem (warto tu pami\u0119ta\u0107, \u017ce domy\u015blnie te # te \u015bcie\u017cki s\u0105 globalne, wi\u0119c aby je potem z\u0142apa\u0107 regexem trzeba za\u0142\u00f3\u017cy\u0107, \u017ce zaczynaj\u0105 si\u0119 od / file ( GLOB TARGET_SRC \"src/*.cpp\" ) # Usuwanie elementu z listy list ( REMOVE_ITEM TARGET_SRC \"/*main.cpp\" ) Aby zmienna zosta\u0142a podmieniona przez generator na jej zawarto\u015b\u0107 musi by\u0107 ona umieszczona w klamrach, bez nich po prostu przekazujemy stringa. message ( HEADERS ) #>>> [cmake] HEADERS message ( ${ HEADERS } ) #>>> [cmake] /include/plik.hpp /inlude/plik2.hpp TODO-uporz\u0105dkowa\u0107 ten punkt Opcje S\u0105 to parametry dla buildu, kt\u00f3re b\u0119d\u0105 potem tak\u017ce widoczne w narz\u0119dziach z GUI dla CMake. option ( USE_MYMATH \"Use tutorial provided math implementation\" ON ) Ta opcja b\u0119dzie widoczna z domy\u015bln\u0105 warto\u015bci\u0105 ON IF-y W CMake'u mo\u017cemy tworzy\u0107 ca\u0142e wyra\u017cenia warunkowe za pomoc\u0105 wcze\u015bniej predefiniowanych amiennych. if ( USE_MYMATH ) add_subdirectory ( MathFunctions ) list ( APPEND EXTRA_LIBS MathFunctions ) list ( APPEND EXTRA_INCLUDES \"${PROJECT_SOURCE_DIR}/MathFunctions\" ) endif () # add the executable add_executable ( Tutorial tutorial.cxx ) target_link_libraries ( Tutorial PUBLIC ${ EXTRA_LIBS } ) # add the binary tree to the search path for include files # so that we will find TutorialConfig.h target_include_directories ( Tutorial PUBLIC \"${PROJECT_BINARY_DIR}\" ${ EXTRA_INCLUDES } ) Pliki Szukanie i dodawanie plik\u00f3w #prosty spos\u00f3b na wczytanie wszystkich plik\u00f3w z danego folderu do zmiennej file ( GLOB_RECURSE SOURCES ${ CMAKE_SOURCE_DIR } \"src/*\" ) Domy\u015blne \u015bcie\u017cki w CMake CMAKE_SOURCE_DIR TODO Instalacja dokumentacja Lepsze wsparcie dla IDE Poni\u017csza komenda wygeneruje przy budowie plik compile_commands.json , kt\u00f3ry mo\u017ce by\u0107 potem u\u017cywane przez IDE. set ( CMAKE_EXPORT_COMPILE_COMMANDS ON ) Np aby VScode u\u017cy\u0142 tego pliku nale\u017cy go poda\u0107 w ustawieniach: \"configurations\" : [ { \"name\" : \"Mac\" , \"intelliSenseMode\" : \"clang-x64\" , \"includePath\" : [ \"${myDefaultIncludePath}\" , \"/another/path\" ], \"macFrameworkPath\" : [ \"/System/Library/Frameworks\" ], \"defines\" : [ \"FOO\" , \"BAR=100\" ], \"forcedInclude\" : [ \"${workspaceFolder}/include/config.h\" ], \"compilerPath\" : \"/usr/bin/clang\" , \"cStandard\" : \"c11\" , \"cppStandard\" : \"c++17\" , \"compileCommands\" : \"/path/to/compile_commands.json\" , \"browse\" : { \"path\" : [ \"${workspaceFolder}\" ], \"limitSymbolsToIncludedHeaders\" : true , \"databaseFilename\" : \"\" } } ],","title":"Cmake"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#cmake","text":"Na podstawie: https://cmake.org/cmake/help/latest/guide/tutorial/index.html Inny tutorial: Cmake in 15 min","title":"Cmake"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#podstawy","text":"Mamy tu minimalny przyk\u0142ad #na pocz\u0105tku zawsze okre\u015blamy min wersj\u0119 CMake'a cmake_minimum_required ( VERSION 3.10 ) # set the project name project ( Tutorial ) # Tworzymy tylko jeden plik wyj\u015bciowy `Tutorial` ze skompilowanego pliku tutorial.cxx add_executable ( Tutorial tutorial.cxx )","title":"Podstawy"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#budowanie","text":"#warto stworzy\u0107 sobie nowy folder i w nim budowa\u0107 mkdir build ; cd build cmake SCIEZKA_DO_FOLDERU_GLOWNEGO # zwykle do folderu z plikiem CMakeLists.txt cmake --build . #mo\u017cna tu te\u017c u\u017cy\u0107 po prostu make (Linux) Inne u\u017cyteczne komendy cmake --build . --target help # wypisanie cel\u00f3w w ramach projektu cmake --build . --target # budowanie danego celu","title":"Budowanie"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#konfigurowalne-pliki-nagowkowe","text":"Za pomoc\u0105 CMake'a mo\u017cemy generowa\u0107 pliki nag\u0142\u00f3wkowe zawieraj\u0105ce zmienne oraz parametry zawarte w plikach CMake. Przyk\u0142adowo mo\u017cemy w ten spos\u00f3b zapisywa\u0107 wersj\u0119 naszego programu. cmake_minimum_required ( VERSION 3.10 ) # set the project name and version project ( Tutorial VERSION 1.0 ) # opisujemy tu na podstawie czego ma by\u0107 wygenerowany nasz plik nag\u0142\u00f3wkowy configure_file ( TutorialConfig.h.in TutorialConfig.h ) # Skoro utworzony zostanie plik TutorialConfig.h to warto doda\u0107 \u015bcie\u017ck\u0119 na kr\u00f3rej si\u0119 znajduje do listy \u015bcie\u017cek w kt\u00f3rych b\u0119d\u0105 szukane pliki target_include_directories ( Tutorial PUBLIC \"${PROJECT_BINARY_DIR}\" ) Zawarto\u015b\u0107 pliku TutorialConfig.h.in // the configured options and settings for Tutorial #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@ #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@","title":"Konfigurowalne pliki nag\u0142\u00f3wkowe"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#okreslenie-wymaganej-wersji-c","text":"# specify the C++ standard set ( CMAKE_CXX_STANDARD 11 ) set ( CMAKE_CXX_STANDARD_REQUIRED True )","title":"Okre\u015blenie wymaganej wersji C++"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#biblioteki","text":"","title":"Biblioteki"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#tworzenie-wasnych","text":"Podobnie jak programy, za pomoc\u0105 cmake'a mo\u017cemy definiowa\u0107 te\u017c biblioteki W wypadku prostych bibliotek wewn\u0105trz naszych preojekt\u00f3w wystarczy jednolinijkowy plik CMakeLists.txt w ich folderze. # Dodaj bibliotek\u0119 o nazwie MathFunctions zawieraj\u0105c\u0105 plik mysqrt.cxx add_library ( MathFunctions mysqrt.cxx ) (Ta biblioteka znajduje si\u0119 w folderze MathFunctions w g\u0142\u00f3wnym folderze projektu. W folderze tym mamy jeszcze plik nag\u0142\u00f3wkowy MathFunctions.h )","title":"Tworzenie w\u0142asnych"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#linkowanie-bibliotek","text":"# add the MathFunctions library add_subdirectory ( MathFunctions ) # add the executable add_executable ( Tutorial tutorial.cxx ) # Musimy podlinkowa\u0107 wszystkie biblioteki u\u017cywane przez plik Tutorial target_link_libraries ( Tutorial PUBLIC MathFunctions ) # add the binary tree to the search path for include files # so that we will find TutorialConfig.h target_include_directories ( Tutorial PUBLIC \"${PROJECT_BINARY_DIR}\" \"${PROJECT_SOURCE_DIR}/MathFunctions\" )","title":"Linkowanie bibliotek"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#logika","text":"","title":"Logika"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#zmienne","text":"Zmienne s\u0105 definiowane podczas przypisywania im warto\u015bci. listy # Dodanie elementu do listy list ( APPEND EXTRA_LIBS MathFunctions ) # Dodanie element\u00f3w do listy regexem (warto tu pami\u0119ta\u0107, \u017ce domy\u015blnie te # te \u015bcie\u017cki s\u0105 globalne, wi\u0119c aby je potem z\u0142apa\u0107 regexem trzeba za\u0142\u00f3\u017cy\u0107, \u017ce zaczynaj\u0105 si\u0119 od / file ( GLOB TARGET_SRC \"src/*.cpp\" ) # Usuwanie elementu z listy list ( REMOVE_ITEM TARGET_SRC \"/*main.cpp\" ) Aby zmienna zosta\u0142a podmieniona przez generator na jej zawarto\u015b\u0107 musi by\u0107 ona umieszczona w klamrach, bez nich po prostu przekazujemy stringa. message ( HEADERS ) #>>> [cmake] HEADERS message ( ${ HEADERS } ) #>>> [cmake] /include/plik.hpp /inlude/plik2.hpp TODO-uporz\u0105dkowa\u0107 ten punkt","title":"Zmienne"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#opcje","text":"S\u0105 to parametry dla buildu, kt\u00f3re b\u0119d\u0105 potem tak\u017ce widoczne w narz\u0119dziach z GUI dla CMake. option ( USE_MYMATH \"Use tutorial provided math implementation\" ON ) Ta opcja b\u0119dzie widoczna z domy\u015bln\u0105 warto\u015bci\u0105 ON","title":"Opcje"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#if-y","text":"W CMake'u mo\u017cemy tworzy\u0107 ca\u0142e wyra\u017cenia warunkowe za pomoc\u0105 wcze\u015bniej predefiniowanych amiennych. if ( USE_MYMATH ) add_subdirectory ( MathFunctions ) list ( APPEND EXTRA_LIBS MathFunctions ) list ( APPEND EXTRA_INCLUDES \"${PROJECT_SOURCE_DIR}/MathFunctions\" ) endif () # add the executable add_executable ( Tutorial tutorial.cxx ) target_link_libraries ( Tutorial PUBLIC ${ EXTRA_LIBS } ) # add the binary tree to the search path for include files # so that we will find TutorialConfig.h target_include_directories ( Tutorial PUBLIC \"${PROJECT_BINARY_DIR}\" ${ EXTRA_INCLUDES } )","title":"IF-y"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#pliki","text":"","title":"Pliki"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#szukanie-i-dodawanie-plikow","text":"#prosty spos\u00f3b na wczytanie wszystkich plik\u00f3w z danego folderu do zmiennej file ( GLOB_RECURSE SOURCES ${ CMAKE_SOURCE_DIR } \"src/*\" )","title":"Szukanie i dodawanie plik\u00f3w"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#domyslne-sciezki-w-cmake","text":"CMAKE_SOURCE_DIR TODO","title":"Domy\u015blne \u015bcie\u017cki w CMake"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#instalacja","text":"dokumentacja","title":"Instalacja"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/Cmake/#lepsze-wsparcie-dla-ide","text":"Poni\u017csza komenda wygeneruje przy budowie plik compile_commands.json , kt\u00f3ry mo\u017ce by\u0107 potem u\u017cywane przez IDE. set ( CMAKE_EXPORT_COMPILE_COMMANDS ON ) Np aby VScode u\u017cy\u0142 tego pliku nale\u017cy go poda\u0107 w ustawieniach: \"configurations\" : [ { \"name\" : \"Mac\" , \"intelliSenseMode\" : \"clang-x64\" , \"includePath\" : [ \"${myDefaultIncludePath}\" , \"/another/path\" ], \"macFrameworkPath\" : [ \"/System/Library/Frameworks\" ], \"defines\" : [ \"FOO\" , \"BAR=100\" ], \"forcedInclude\" : [ \"${workspaceFolder}/include/config.h\" ], \"compilerPath\" : \"/usr/bin/clang\" , \"cStandard\" : \"c11\" , \"cppStandard\" : \"c++17\" , \"compileCommands\" : \"/path/to/compile_commands.json\" , \"browse\" : { \"path\" : [ \"${workspaceFolder}\" ], \"limitSymbolsToIncludedHeaders\" : true , \"databaseFilename\" : \"\" } } ],","title":"Lepsze wsparcie dla IDE"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/dokumentowanie_kodu/","text":"Dokumentowanie kodu - Doxygen Z pomoc\u0105 doxygena mo\u017cna \u0142atwo udokumentowa\u0107 kod z jego poziomu w spos\u00f3b zar\u00f3wno \u0142atwy do odczytania w surowym kodzie, jak i umo\u017cliwiaj\u0105cy automatyczne generowanie dokumentacji i podpowiadanie opis\u00f3w funkcji w r\u00f3\u017cnych IDE. Jest on poza tym do\u015b\u0107 uniwersalny, wspiera j\u0119zyki takie jak: C++ Java C# Python etc. Syntax O ile sam wygl\u0105d blok\u00f3w doxygenowych w r\u00f3\u017cnych j\u0119zykach mo\u017ce nieco si\u0119 r\u00f3\u017cni\u0107 to komendy (znaczniki) pozostaj\u0105 takie same. Oficjalna dokumentacja Pe\u0142na lista komend instrukcja2 J\u0119zyk C++ /** * @brief kr\u00f3tki opis funkcji * * D\u0142u\u017cszy opis * * @param argument1 - opis argumentu, do czego s\u0142u\u017cy * @exception opis rzucanego wyj\u0105tku * @return opis tego co jest zwracane */ int fun ( const int & argument1 ); /** * @brief Klasa b\u0119d\u0105ca przyk\u0142adem * */ class A { private : int var1 ; //!< Kr\u00f3tki opis int var2 ; ///< D\u0142u\u017cszy ///< opis public : A ( /* args */ ); }; Python ## @package pyexample # Documentation for this module. # # More details. ## Documentation for a function. # # More details. def func (): pass ## Documentation for a class. # # More details. class PyClass : ## The constructor. def __init__ ( self ): self . _memVar = 0 ; ## Documentation for a method. # @param self The object pointer. def PyMethod ( self ): pass ## A class variable. classVar = 0 ; ## @var _memVar # a member variable Generowanie dokumentacji TODO Gnerowanie diagram\u00f3w klas TODO","title":"Dokumentowanie kodu - Doxygen"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/dokumentowanie_kodu/#dokumentowanie-kodu-doxygen","text":"Z pomoc\u0105 doxygena mo\u017cna \u0142atwo udokumentowa\u0107 kod z jego poziomu w spos\u00f3b zar\u00f3wno \u0142atwy do odczytania w surowym kodzie, jak i umo\u017cliwiaj\u0105cy automatyczne generowanie dokumentacji i podpowiadanie opis\u00f3w funkcji w r\u00f3\u017cnych IDE. Jest on poza tym do\u015b\u0107 uniwersalny, wspiera j\u0119zyki takie jak: C++ Java C# Python etc.","title":"Dokumentowanie kodu - Doxygen"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/dokumentowanie_kodu/#syntax","text":"O ile sam wygl\u0105d blok\u00f3w doxygenowych w r\u00f3\u017cnych j\u0119zykach mo\u017ce nieco si\u0119 r\u00f3\u017cni\u0107 to komendy (znaczniki) pozostaj\u0105 takie same. Oficjalna dokumentacja Pe\u0142na lista komend instrukcja2 J\u0119zyk C++ /** * @brief kr\u00f3tki opis funkcji * * D\u0142u\u017cszy opis * * @param argument1 - opis argumentu, do czego s\u0142u\u017cy * @exception opis rzucanego wyj\u0105tku * @return opis tego co jest zwracane */ int fun ( const int & argument1 ); /** * @brief Klasa b\u0119d\u0105ca przyk\u0142adem * */ class A { private : int var1 ; //!< Kr\u00f3tki opis int var2 ; ///< D\u0142u\u017cszy ///< opis public : A ( /* args */ ); }; Python ## @package pyexample # Documentation for this module. # # More details. ## Documentation for a function. # # More details. def func (): pass ## Documentation for a class. # # More details. class PyClass : ## The constructor. def __init__ ( self ): self . _memVar = 0 ; ## Documentation for a method. # @param self The object pointer. def PyMethod ( self ): pass ## A class variable. classVar = 0 ; ## @var _memVar # a member variable","title":"Syntax"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/dokumentowanie_kodu/#generowanie-dokumentacji","text":"TODO","title":"Generowanie dokumentacji"},{"location":"C%20i%20C%2B%2B%20%F0%9F%87%A8/dokumentowanie_kodu/#gnerowanie-diagramow-klas","text":"TODO","title":"Gnerowanie diagram\u00f3w klas"},{"location":"Inne/haskell/","text":"Haskell \u03bb Jest to statycznie typowany, g\u0142\u00f3wnie deklaratywny, czysto funkcyjny j\u0119zyk programowania. Jego najpopularniejszym kompilatorem jest GHC (Glasgow Haskell Compiler). Podczas programowania korzystamy z wyra\u017ce\u0144 (opisuj\u0105cych co\u015b) a nie z instrukcji (m\u00f3wi\u0105cych co ma by\u0107 zrobione). Jedn\u0105 z najwa\u017cniejszych w\u0142a\u015bciwo\u015bci tego j\u0119zyka jest to, \u017ce funkcje zawsze zwracaj\u0105 t\u0105 sam\u0105 warto\u015b\u0107 dla tych samych argument\u00f3w wej\u015bciowych. (nie ma \u017cadnych zmiennych globalnych, statycznych ani innych rzeczy, kt\u00f3re mog\u0142yby wp\u0142ywa\u0107 na wynik). Zmienne Wi\u0119kszo\u015b\u0107 przydatnych rzeczy jest w dokumentacji Char - znak isAlpha , isAlphaNum , isDigit , isLower , isUpper :: Char -> Bool toLower , toUpper :: Char -> Char putChar :: Char -> IO () String - type String = [Char] Num , Int , Float - liczba div , mod () krotka fst - zwraca pierwszy element snd - zwraca drugi element Bool Operatory [] - lista (patrz Operacje na listach) Do zdefiniowania zmiennej mo\u017cemy u\u017cy\u0107 s\u0142owa kluczowego let let x = 4 in x * x Int <-> Char konwersja pomi\u0119dzy tymi typami jest mo\u017cliwa ord \u2018 b \u2019 > 98 chr 98 > \u2018 b \u2019 Typy Poza wbudowanymi typami zmiennych mo\u017cemy definiowa\u0107 w\u0142asne Synonymous types - u\u017cywaj\u0105 ju\u017c istniej\u0105cych typ\u00f3w u\u017cywamy tu s\u0142owa kluczowego type type Name = String type Position = String type Age = Int type Course = Int type Point = ( Float , Float ) type Path = [ Point ] Algebraic types - typy algebraiczne s\u0105 typami z\u0142o\u017conymi zdefiniowanymi przez u\u017cytkownika. U\u017cywamy tu s\u0142owa kluczowego data data Person = Student Age Name Course | Professor Name Position | Director Name namePerson :: Person -> Name namePerson ( Student e n c ) = n namePerson ( Professor n c ) = n namePerson ( Director n ) = n stud1 = Student 21 \"Marian\" 12 Tutaj s\u0142owa Student, Professor, Director s\u0142u\u017c\u0105 do okre\u015blenia typu danej struktury. (data constructor symbols) Wykorzystuj\u0105c same symbole konstruktor\u00f3w mo\u017cemy tworzy\u0107 enumy data Day = Mon | Tue | Wed | Thu | Fri | Sat | Sun Functional types - buduj\u0105 i opisuj\u0105 funkcje type MyType = ( Int -> Int ) fib :: MyType Przyk\u0142ady: not to warto\u015b\u0107 typu Bool -> Bool (2 +) ma typ Int -> Int map daje (a -> b) -> [a] -> [b] (przyjmuje funkcj\u0119 robi\u0105z\u0105 z a b oraz tablic\u0119 a z potem zwraca tablic\u0119 b) Operator -> zwija si\u0119 z prawej strony Tzn a -> b -> c jest r\u00f3wnoznaczne z a -> (b -> c) a nie (a -> b) -> c Nale\u017cy jednocze\u015bnie pami\u0119ta\u0107, \u017ce funkcje zwijaj\u0105 si\u0119 od prawej f a b to ekwiwalent (f a) b a nie f (a b) Czyli $ not not false da nam error Operacje Funkcje s\u0105 wywo\u0142ywane poprzez podanie ich nazwy oraz argument\u00f3w sort [ 42 , 13 , 22 ] > [ 13 , 22 , 42 ] :: ( Num a , Ord a ) => [ a ] Listy Tworzenie i dodawanie Aby doda\u0107 element do listy u\u017cywamy : 'a' : [] > \"a\" :: [ Char ] Tutaj do pustej listy dodali\u015bmy liter\u0119 a dzi\u0119ki czemu dostali\u015bmy stringa. Do tworzenia list mo\u017cemy te\u017c u\u017cywa\u0107 automatycznego generowania Przyk\u0142ady: [2..10] is [2,3,4,5,6,7,8,9,10] [1..] is [1,2,3,4,... [1,3..10] is [1,3,5,7,9] [\u2019a\u2019..\u2019e\u2019] is \u201cabcde\u201d Lub mechanizmu List comprehension [wyra\u017cenie przyjmuj\u0105ce zmienne | generator, filtry, generator, filtry, ...] Na przyk\u0142ad [ x * x | x <- [ 1 .. 5 ], odd x ] > [ 1 , 9 , 25 ] repeat niesko\u0144czone listy Prelude > repeat 3 [ 3 , 3 , 3 , 3 , 3 ... ] Operacje Pobieranie - poni\u017cej Inne - operator ++ -- \u0141\u0105czenie list Prelude > [ 3 , 4 ] ++ [ 5 ] [ 3 , 4 , 5 ] -- Indeksowane elementy Prelude > [ 45 , 43 , 12 , 54 ] !! 2 12 -- branie x element\u00f3w z listy Prelude > take 3 ( repeat 1 ) [ 1 , 1 , 1 ] -- usuwanie elementu z listy Prelude > Funkcje dla list Funkcja zip \u0142\u0105czy dwie listy w list\u0119 krotek zip [ 1 , 2 ] [ \"a\" , \"b\" ] > [ ( 1 , \"a\" ), ( 2 , \"b\" )] > length [ 1 , 2 , 3 ] 3 filter (a -> Bool) -> [a] -> [a] - przefiltrowuje wybran\u0105 list\u0119, otrzymujemy tylko elementy dla kt\u00f3rych nasza funkcja zwraca True > filter even [ 1 , 2 , 4 , 5 , 32 ] [ 2 , 4 , 32 ] map :: (a -> b) -> [a] -> [b] - aplikuje wybran\u0105 funkcj\u0119 na wszystkie elementy wybranej listy i zwraca list\u0119 wynik\u00f3w > map square [ 9 , 3 ] [ 81 , 9 ] > map ( < 3 ) [ 1 , 2 , 3 ] [ True , True , False ] foldr :: (a -> b -> b) -> b -> [a] -> b - funkcja, kt\u00f3ra pozwala \u0142\u0105czy\u0107 warto\u015bci w tablicy. Podajemy jej argumenty: funkcja pierwszy element typu docelowego lista suma = foldr ( + ) 0 iloczyn = foldr ( * ) 1 Funkcje FUnkcje s\u0105 podstawot\u0105 cz\u0119\u015bci\u0105 j\u0119zyka. Mog\u0105 by\u0107 przekazywane jako argumenty, lub modyfikowane i cz\u0119\u015bciowo aplikowane (partial application) partial applications: ( + ) :: Int -> Int -> Int $ ( 2 + ) 5 7 add_2 :: ( Int -> Int ) add_2 = ( 2 + ) $ add_2 5 7 Definiowanie Funkcja sk\u0142ada si\u0119 z opcjonalnego opisu typ\u00f3w nazwaFun :: Typ -> Typ -> Typ... Oraz samej definicji, tutaj mamy 2 warianty: addRange :: Int -> Int -> Int addRange x y | x == y = x | x < y = x + addRange ( x + 1 ) y | otherwise = y + addRange ( y + 1 ) x oraz numCbetw2 :: Char -> Char -> Int numCbetw2 c1 c2 = let x = ord c2 - ord c1 in if abs x == 0 then abs 0 else abs x - 1 TODO Argumenty przekazywane do funkcji mog\u0105 mie\u0107 form\u0119 listy (\u0142\u0105czonej strza\u0142kami -> ) lub krotek (el1,el2,...) . \u0141\u0105czenie funkcji Wykorzystuj\u0105c kropk\u0119 . mo\u017cemy \u0142\u0105czy\u0107 funkcje w ci\u0105gi ( sum . map square . filter even ) [ 1 .. 10 ] Powy\u017cszy kod zwr\u00f3ci nam sum\u0119 kwadrat\u00f3w liczb parzystych dla liczb z zakresu 1-10. Modu\u0142y Modu\u0142y s\u0105 odpowiednikami paczek/bibliotek dla innych j\u0119zyk\u00f3w. Aby go w\u0142\u0105czy\u0107 nale\u017cy go zaimportowa\u0107 import MojModul -- jest to plik MojModul Przy tworzeniu nowego modu\u0142u od razu zaznaczamy jakie inne modu\u0142y improstujemy module ModuleNameX where import ModuleNameY Przy plikach w folderach u\u017cywamy kropek. Np je\u015bli w folderze A/B/C mamy plik EjemImport.hs to importujemy go tak: import A.B.C.EjemImport Eksportowanie - przy definiowaniu modu\u0142u mo\u017cemy zaznaczy\u0107 co chcemy z niego eksportowa\u0107. -- Tutaj wida\u0107 \u017ce eksportujemy tylko 2 funkcje module Geometry2D ( areaSquare , perimeterSquare ) where areaRectangle :: Float -> Float -> Float areaRectangle base height = base * height perimeterRectangle :: Float -> Float -> Float perimeterRectangle base height = 2 * ( base + height ) areaSquare :: Float -> Float areaSquare side = areaRectangle side side perimeterSquare :: Float -> Float perimeterSquare side = perimeterRectangle side side W wypadku, gdy wyst\u0119puje kolizja nazw mo\u017cemy u\u017cy\u0107 s\u0142owa kluczowego qualified module NormalizeAll where import qualified NormalizeSpaces import qualified NormalizeCase as NC normalizeAll :: String -> String normalizeAll = NormalizeSpaces . normalize . NC . normalize","title":"Haskell \u03bb"},{"location":"Inne/haskell/#haskell","text":"Jest to statycznie typowany, g\u0142\u00f3wnie deklaratywny, czysto funkcyjny j\u0119zyk programowania. Jego najpopularniejszym kompilatorem jest GHC (Glasgow Haskell Compiler). Podczas programowania korzystamy z wyra\u017ce\u0144 (opisuj\u0105cych co\u015b) a nie z instrukcji (m\u00f3wi\u0105cych co ma by\u0107 zrobione). Jedn\u0105 z najwa\u017cniejszych w\u0142a\u015bciwo\u015bci tego j\u0119zyka jest to, \u017ce funkcje zawsze zwracaj\u0105 t\u0105 sam\u0105 warto\u015b\u0107 dla tych samych argument\u00f3w wej\u015bciowych. (nie ma \u017cadnych zmiennych globalnych, statycznych ani innych rzeczy, kt\u00f3re mog\u0142yby wp\u0142ywa\u0107 na wynik).","title":"Haskell \u03bb"},{"location":"Inne/haskell/#zmienne","text":"Wi\u0119kszo\u015b\u0107 przydatnych rzeczy jest w dokumentacji Char - znak isAlpha , isAlphaNum , isDigit , isLower , isUpper :: Char -> Bool toLower , toUpper :: Char -> Char putChar :: Char -> IO () String - type String = [Char] Num , Int , Float - liczba div , mod () krotka fst - zwraca pierwszy element snd - zwraca drugi element Bool Operatory [] - lista (patrz Operacje na listach) Do zdefiniowania zmiennej mo\u017cemy u\u017cy\u0107 s\u0142owa kluczowego let let x = 4 in x * x Int <-> Char konwersja pomi\u0119dzy tymi typami jest mo\u017cliwa ord \u2018 b \u2019 > 98 chr 98 > \u2018 b \u2019","title":"Zmienne"},{"location":"Inne/haskell/#typy","text":"Poza wbudowanymi typami zmiennych mo\u017cemy definiowa\u0107 w\u0142asne Synonymous types - u\u017cywaj\u0105 ju\u017c istniej\u0105cych typ\u00f3w u\u017cywamy tu s\u0142owa kluczowego type type Name = String type Position = String type Age = Int type Course = Int type Point = ( Float , Float ) type Path = [ Point ] Algebraic types - typy algebraiczne s\u0105 typami z\u0142o\u017conymi zdefiniowanymi przez u\u017cytkownika. U\u017cywamy tu s\u0142owa kluczowego data data Person = Student Age Name Course | Professor Name Position | Director Name namePerson :: Person -> Name namePerson ( Student e n c ) = n namePerson ( Professor n c ) = n namePerson ( Director n ) = n stud1 = Student 21 \"Marian\" 12 Tutaj s\u0142owa Student, Professor, Director s\u0142u\u017c\u0105 do okre\u015blenia typu danej struktury. (data constructor symbols) Wykorzystuj\u0105c same symbole konstruktor\u00f3w mo\u017cemy tworzy\u0107 enumy data Day = Mon | Tue | Wed | Thu | Fri | Sat | Sun Functional types - buduj\u0105 i opisuj\u0105 funkcje type MyType = ( Int -> Int ) fib :: MyType Przyk\u0142ady: not to warto\u015b\u0107 typu Bool -> Bool (2 +) ma typ Int -> Int map daje (a -> b) -> [a] -> [b] (przyjmuje funkcj\u0119 robi\u0105z\u0105 z a b oraz tablic\u0119 a z potem zwraca tablic\u0119 b) Operator -> zwija si\u0119 z prawej strony Tzn a -> b -> c jest r\u00f3wnoznaczne z a -> (b -> c) a nie (a -> b) -> c Nale\u017cy jednocze\u015bnie pami\u0119ta\u0107, \u017ce funkcje zwijaj\u0105 si\u0119 od prawej f a b to ekwiwalent (f a) b a nie f (a b) Czyli $ not not false da nam error","title":"Typy"},{"location":"Inne/haskell/#operacje","text":"Funkcje s\u0105 wywo\u0142ywane poprzez podanie ich nazwy oraz argument\u00f3w sort [ 42 , 13 , 22 ] > [ 13 , 22 , 42 ] :: ( Num a , Ord a ) => [ a ]","title":"Operacje"},{"location":"Inne/haskell/#listy","text":"","title":"Listy"},{"location":"Inne/haskell/#tworzenie-i-dodawanie","text":"Aby doda\u0107 element do listy u\u017cywamy : 'a' : [] > \"a\" :: [ Char ] Tutaj do pustej listy dodali\u015bmy liter\u0119 a dzi\u0119ki czemu dostali\u015bmy stringa. Do tworzenia list mo\u017cemy te\u017c u\u017cywa\u0107 automatycznego generowania Przyk\u0142ady: [2..10] is [2,3,4,5,6,7,8,9,10] [1..] is [1,2,3,4,... [1,3..10] is [1,3,5,7,9] [\u2019a\u2019..\u2019e\u2019] is \u201cabcde\u201d Lub mechanizmu List comprehension [wyra\u017cenie przyjmuj\u0105ce zmienne | generator, filtry, generator, filtry, ...] Na przyk\u0142ad [ x * x | x <- [ 1 .. 5 ], odd x ] > [ 1 , 9 , 25 ] repeat niesko\u0144czone listy Prelude > repeat 3 [ 3 , 3 , 3 , 3 , 3 ... ]","title":"Tworzenie i dodawanie"},{"location":"Inne/haskell/#operacje_1","text":"Pobieranie - poni\u017cej Inne - operator ++ -- \u0141\u0105czenie list Prelude > [ 3 , 4 ] ++ [ 5 ] [ 3 , 4 , 5 ] -- Indeksowane elementy Prelude > [ 45 , 43 , 12 , 54 ] !! 2 12 -- branie x element\u00f3w z listy Prelude > take 3 ( repeat 1 ) [ 1 , 1 , 1 ] -- usuwanie elementu z listy Prelude >","title":"Operacje"},{"location":"Inne/haskell/#funkcje-dla-list","text":"Funkcja zip \u0142\u0105czy dwie listy w list\u0119 krotek zip [ 1 , 2 ] [ \"a\" , \"b\" ] > [ ( 1 , \"a\" ), ( 2 , \"b\" )] > length [ 1 , 2 , 3 ] 3 filter (a -> Bool) -> [a] -> [a] - przefiltrowuje wybran\u0105 list\u0119, otrzymujemy tylko elementy dla kt\u00f3rych nasza funkcja zwraca True > filter even [ 1 , 2 , 4 , 5 , 32 ] [ 2 , 4 , 32 ] map :: (a -> b) -> [a] -> [b] - aplikuje wybran\u0105 funkcj\u0119 na wszystkie elementy wybranej listy i zwraca list\u0119 wynik\u00f3w > map square [ 9 , 3 ] [ 81 , 9 ] > map ( < 3 ) [ 1 , 2 , 3 ] [ True , True , False ] foldr :: (a -> b -> b) -> b -> [a] -> b - funkcja, kt\u00f3ra pozwala \u0142\u0105czy\u0107 warto\u015bci w tablicy. Podajemy jej argumenty: funkcja pierwszy element typu docelowego lista suma = foldr ( + ) 0 iloczyn = foldr ( * ) 1","title":"Funkcje dla list"},{"location":"Inne/haskell/#funkcje","text":"FUnkcje s\u0105 podstawot\u0105 cz\u0119\u015bci\u0105 j\u0119zyka. Mog\u0105 by\u0107 przekazywane jako argumenty, lub modyfikowane i cz\u0119\u015bciowo aplikowane (partial application) partial applications: ( + ) :: Int -> Int -> Int $ ( 2 + ) 5 7 add_2 :: ( Int -> Int ) add_2 = ( 2 + ) $ add_2 5 7","title":"Funkcje"},{"location":"Inne/haskell/#definiowanie","text":"Funkcja sk\u0142ada si\u0119 z opcjonalnego opisu typ\u00f3w nazwaFun :: Typ -> Typ -> Typ... Oraz samej definicji, tutaj mamy 2 warianty: addRange :: Int -> Int -> Int addRange x y | x == y = x | x < y = x + addRange ( x + 1 ) y | otherwise = y + addRange ( y + 1 ) x oraz numCbetw2 :: Char -> Char -> Int numCbetw2 c1 c2 = let x = ord c2 - ord c1 in if abs x == 0 then abs 0 else abs x - 1 TODO Argumenty przekazywane do funkcji mog\u0105 mie\u0107 form\u0119 listy (\u0142\u0105czonej strza\u0142kami -> ) lub krotek (el1,el2,...) .","title":"Definiowanie"},{"location":"Inne/haskell/#aczenie-funkcji","text":"Wykorzystuj\u0105c kropk\u0119 . mo\u017cemy \u0142\u0105czy\u0107 funkcje w ci\u0105gi ( sum . map square . filter even ) [ 1 .. 10 ] Powy\u017cszy kod zwr\u00f3ci nam sum\u0119 kwadrat\u00f3w liczb parzystych dla liczb z zakresu 1-10.","title":"\u0141\u0105czenie funkcji"},{"location":"Inne/haskell/#moduy","text":"Modu\u0142y s\u0105 odpowiednikami paczek/bibliotek dla innych j\u0119zyk\u00f3w. Aby go w\u0142\u0105czy\u0107 nale\u017cy go zaimportowa\u0107 import MojModul -- jest to plik MojModul Przy tworzeniu nowego modu\u0142u od razu zaznaczamy jakie inne modu\u0142y improstujemy module ModuleNameX where import ModuleNameY Przy plikach w folderach u\u017cywamy kropek. Np je\u015bli w folderze A/B/C mamy plik EjemImport.hs to importujemy go tak: import A.B.C.EjemImport Eksportowanie - przy definiowaniu modu\u0142u mo\u017cemy zaznaczy\u0107 co chcemy z niego eksportowa\u0107. -- Tutaj wida\u0107 \u017ce eksportujemy tylko 2 funkcje module Geometry2D ( areaSquare , perimeterSquare ) where areaRectangle :: Float -> Float -> Float areaRectangle base height = base * height perimeterRectangle :: Float -> Float -> Float perimeterRectangle base height = 2 * ( base + height ) areaSquare :: Float -> Float areaSquare side = areaRectangle side side perimeterSquare :: Float -> Float perimeterSquare side = perimeterRectangle side side W wypadku, gdy wyst\u0119puje kolizja nazw mo\u017cemy u\u017cy\u0107 s\u0142owa kluczowego qualified module NormalizeAll where import qualified NormalizeSpaces import qualified NormalizeCase as NC normalizeAll :: String -> String normalizeAll = NormalizeSpaces . normalize . NC . normalize","title":"Modu\u0142y"},{"location":"Java%E2%98%95/java_podstawy/","text":"Java podstawy Narz\u0119dzia jshell \u2013 interpretator interaktywny ?jak importowa\u0107 w nim w\u0142asne pakiety? jlink \u2013 generacja modu\u0142u aplikacji HelloWorld w javie public class HelloWorldApp { public static void main ( String [] args ) { System . out . println ( \"Hello world from Java!\" ); } } Wszystko jest tu klas\u0105, nasza apka te\u017c. Je\u017celi chcemy, aby jaka\u015b klasa zacz\u0119\u0142a co\u015b robi\u0107 przy jej samodzielnym uruchomieniu to dodajemy funkcj\u0119: public static void main(String[] args) Pakiety W jednym pliku .java mo\u017cna zdefiniowa\u0107 wiele klas, ale tylko jedna z nich mo\u017ce bypubliczna i jej nazwa musi odpowiada\u0107 nazwie pliku. Ka\u017cda klasa nale\u017cy do jakiego\u015b pakietu. Je\u015bli w pliku z kodem \u017ar\u00f3d\u0142owym klasy nie wyst\u0119puje na pocz\u0105tku deklaracja przynale\u017cno\u015bci tej klasy do konkretnego pakietu, w\u00f3wczas klasa ta b\u0119dzie nale\u017ce\u0107 do domy\u015blnego pakietu. Klasy nale\u017c\u0105ce do tego samego pakietu mog\u0105 odwo\u0142ywa\u0107 si\u0119 do siebie bez konieczno\u015bci stosowania nazw kwalifikowanych (bez przedrostka) Konwencja nazewnicza dla nazw pakiet\u00f3w: nazwa_firmy.nazwa_pakietu. import java.applet.Applet ; public class App extends Applet { ////kod } //LUB public class App extends java . applet . Applet { ////kod } Klasa System jest zawarta w java.lang, importowanym automatycznie Typy danych Wbudowane \u2013 okre\u015blone przez tw\u00f3rc\u00f3w j\u0119zyka \u2013 typy proste (albo: typy dla warto\u015bci, value-type): zmienne tych typ\u00f3w zawieraj\u0105 warto\u015bci tych\u017ce typ\u00f3w \u2013 typy referencyjne: zmienne tych typ\u00f3w zawieraj\u0105 odniesienie do tablicy lub obiektu, kt\u00f3ry reprezentuj\u0105 Definiowane przez programist\u0119 \u2013 klasy \u2013 typy wyliczeniowe (enumeration) Java ma statyczne typowanie tzn, \u017ce raz zdefiniowana zmienna nie zmienia swojego typu (jak np. w pythonie) Wbudowane typy proste ca\u0142kowitoliczbowe, kodowane U2 byte jednobajtowy short dwubajtowy int czterobajtowy long o\u015bmiobajtowy zmiennoprzecinkowe, kodowane IEEE 754 float czterobajtowy double o\u015bmiobajtowy inne char dwubajtowy, kodowany Unicode (utf-16) boolean warto\u015b\u0107 logiczna true lub false do javy 11 mo\u017cna stosowa\u0107 identyfikator typu wywnioskowanego: var s = \"test\"; Sta\u0142e Litera\u0142y \u2013 sta\u0142e bez nazwy, o typie wynikaj\u0105cym ze sposobu zapisu litera\u0142u, np. 78, 8864L, 37.266, 37.266D, 37.266F, \u2019c\u2019, true, null int long double double float char boolean oraz \u0142a\u0144cuchy znak\u00f3w, typu String: \"ala ma kota\" Sta\u0142e symboliczne \u2013 sta\u0142e opatrzone nazw\u0105 i jawn\u0105 deklaracj\u0105 typu final typ NAZWA_STA\u0141EJ = warto\u015b\u0107 ; //np. final float PI = 3.14 ; Lokaln\u0105 sta\u0142\u0105 symboliczn\u0105 mo\u017cna zainicjowa\u0107 p\u00f3\u017aniej \u2013 najpierw wyst\u0105pi sama deklaracja, a p\u00f3\u017aniej przypisanie pierwszej (i ostatecznej) warto\u015bci. final int STA\u0141A_CZYSTA ; // Definicja sta\u0142ej /**/ STA\u0141A_CZYSTA = 0 ; // Inicjalizacja sta\u0142ej Typ wyliczeniowy enum Season { WINTER , SPRING , SUMMER , FALL } \u2013 kompilator sprawdza zgodno\u015b\u0107 typu \u2013 mo\u017ce by\u0107 u\u017cyty w instrukcji switch Season anything = Season . WINTER ; switch ( anything ){ case SUMMER : System . out . println ( \"Lato\" ); //\u2026 } Referencja Referencja to zmienna, kt\u00f3rej warto\u015bci\u0105 jest adres. Typy referencyjne: tablice, klasy, interfejsy. Zmienna referencyjna odnosi si\u0119 do miejsca pami\u0119ci, w kt\u00f3rym pomieszczono dan\u0105 lub wektor danych reprezentowanych t\u0105 zmienn\u0105. Java nie zna typu wska\u017anikowego, tzn. jawnego korzystania z adres\u00f3w. Konwencje nazewnicze dla nazw zmiennych i klas nazwa zmiennej rozpoczyna si\u0119 ma\u0142\u0105 liter\u0105, nazwa klasy rozpoczyna si\u0119 wielk\u0105 liter\u0105, kolejne s\u0142owa w nazwie rozpoczyna si\u0119 wielk\u0105 liter\u0105, np. isVisible, znak podkre\u015blenia (_) jest wprawdzie poprawny w nazwie, ale powinien by\u0107 u\u017cywany jedynie w nazwach sta\u0142ych. Cykl \u017cycia obiektu Utworzenie zmiennej typu referencji do obiektu ( typ nazwa; ) Dla typu klasy lub interfejsu zmienna przechowuje adres do obiektu klasy \u2013 nie jest on dost\u0119pny bezpo\u015brednio, lecz stanowi referencj\u0119. Do momentu przypisania jej adresu ma ona warto\u015b\u0107 zerow\u0105 (null). Utworzenie obiektu ( new alokuje obszar pami\u0119ci) nazwa=new typ(argumenty) Operator new zwraca referencj\u0119 do nowo utworzonego obiektu. Inicjalizacja -wywo\u0142anie konstruktora U\u017cywanie Usuwanie obiektu - \"Garbage Collector\" \u015brodowisko samodzielnie usuwa obiekt, je\u017celi wykryje, \u017ce ju\u017c wi\u0119cej nie b\u0119dzie u\u017cywane w programie, wywo\u0142uje si\u0119 on samoczynnie co jaki\u015b czas, ale mo\u017cna to zrobi\u0107 r\u0119cznie System.gc() Ewentualne wykonanie metody finalize() dziedziczona po klasie Obiect- pozwala wykona\u0107 dodatkowe czynno\u015bci zwi\u0105zane z usuwaniem obiektu Operatory Operator \u2013 funkcja podana w notacji operatorowej - z 1, 2 lub 3 argumentami (operandami). 1-argumentowe operatory mog\u0105 by\u0107 przedrostkowe i przyrostkowe: operator operand // notacja przedrostkowa operand operator // notacja przyrostkowa przedrostkowe i przyrostkowe ++ i -- 2-argumentowe operatory wyst\u0119puj\u0105 pomi\u0119dzy swoimi operandami: operand1 operator operand2 Dzia\u0142ania matematyczne + , - , * , / , % Por\u00f3wnania > , >= , == , <= , < , != Tylko dla warto\u015bci logicznych: && , & \"and\" || , | \"or\" ! negacja ^ op1 ^ op2 true, gdy op1 i op2 maj\u0105 r\u00f3\u017cne warto\u015bci Przesuni\u0119cia >> np op1>>op2 przesu\u0144 op1 w prawo o op2 bit\u00f3w << np op1<>> op1>>>op2 przesu\u0144 op1 w prawo o op2 bit\u00f3w, zast\u0119puj\u0105c bit znaku zerem Bitowe logiczne & op1 & op2 iloczyn bitowy op1 i op2 | op1 | op2 suma bitowa op1 i op2 ^ op1 ^ op2 bitowa r\u00f3\u017cnica symetryczna op1 i op2 ~ ~op bitowa negacja op Przypisania op1=op2 *= , += , -= , |= , %= itp... 3-argumentowy operator (jedyny w Javie): operand1 ? operand2 : operand3 op1?op2:op3 gdy op1 jest \u201etrue\u201d, zwraca op2, w przeciwnym razie zwraca op3 Inne typ[] / typ[liczba] deklaracja tablicy op[liczba] pobranie elementu z tablicy (typ)op konwersja wyra\u017cenia op do typu typ net op1 utowrzenie obiektu lub tablicy op1 instanceof op2 zwraca \u201etrue\u201d, gdy obiekt op1 jest instancj\u0105 klasy op2 Za wyj\u0105tkiem operatora + u\u017cywanego te\u017c do \u0142\u0105czenia napis\u00f3w, operatory arytmetyczne s\u0105 przeznaczone tylko dla operand\u00f3w liczbowych. Kolekcje Kolekcja to obiekt: zawieraj\u0105cy wiele element\u00f3w (teoretycznie dowolna liczba, nieokre\u015blona zawczasu), udost\u0119pniaj\u0105cy operacje wstawiania, przegl\u0105dania, usuwania. stosowany do magazynowania, przetwarzania i transmisji danych. Biblioteka kolekcji w Javie: Interfejsy \u2013 definiuj\u0105ce zachowanie kolekcji, Implementacje interfejs\u00f3w (na r\u00f3\u017cne sposoby), Algorytmy \u2013 typowe operacje na kolekcjach r\u00f3\u017cnego rodzaju Kolekcje w Javie zosta\u0142y umieszczone w java.util. Mimo, \u017ce w java.util wyst\u0119puje interfejs Collection, nie wszystkie kolekcje go implementuj\u0105 czy dziedzicz\u0105. Dlatego terminu kolekcja u\u017cywamy w szerszym sensie. Kolekcje a typy uog\u00f3lnione: Wersje podstawowe \u2013 nieparametryzowane typem przechowywanych danych \u2013 np. List.insert(Object o) Wersje parametryzowane typem \u2013 np. List.insert(MojTyp o) Klasy parametryzowane typem - przyk\u0142ad public class CircularBuffer < T > { private T [] buffer ; private int head = 0 , tail = 0 ; public CircularBuffer () { buffer = ( T [] ) new Object [ 10 ] ; } public void add ( T f ) { if ( head == tail - 1 ) // nadpisanie tail = ++ tail % buffer . length ; buffer [ head ++] = f ; head = head % buffer . length ; } public T get () { int adjTail = tail > head ? tail - buffer . length : tail ; if ( adjTail < head ) { T t = buffer [ tail ++] ; tail = tail % buffer . length ; return t ; } else { throw new Error (); } } } Pos\u0142uguj\u0105c si\u0119 interfejsami, mo\u017cemy tworzy\u0107 algorytmy operuj\u0105ce na kolekcjach niezale\u017cnie od sposobu, w jaki zaimplementowano kolekcj\u0119 (programowanie abstrakcyjne) S\u0105 2 niezale\u017cne hierarchie: \u201ew\u0142a\u015bciwych kolekcji\u201d oraz wykazy asocjacyjne, czyli kolekcje par {klucz,warto\u015b\u0107}. Opr\u00f3cz tego dysponujemy obiektami do przegl\u0105dania kolekcji: jednokierunkowym (Iterator) i dwukierunkowym (ListIterator). Kolekcje mo\u017cna r\u00f3wnie\u017c przegl\u0105da\u0107, korzystaj\u0105c z obiekt\u00f3w funkcyjnych w po\u0142\u0105czeniu z metod\u0105 forEach(). Podstawowe zale\u017cno\u015bci pomi\u0119dzy interfejsami kolekcji: Collection okre\u015bla zachowanie najog\u00f3lniejszego zbioru obiekt\u00f3w,mog\u0105cego zawiera\u0107 obiekty identyczne Set \u201erozszerza\u201d Collection: nie dopuszcza duplikat\u00f3w List rozszerza Collection, dopuszczaj\u0105c indeksowanie przez pozycj\u0119 obiektu Map definiuje funkcjonalno\u015bci podobne do Collection, ale nie jest z nim spokrewniony Metody interfejs\u00f3w Collection i Iterator : Metody \u201ejednostkowe\u201d add, contains, remove Metody zbiorcze addAll, containsAll, removeAll, retainAll (dla teorii zbior\u00f3w r\u00f3\u017cnica zbior\u00f3w iloczyn itp.) Inne clear, isEmpty, size, toArray iterator \u2013 produkuje nowy iterator (na pocz\u0105tku na nic nie wskazuje, jest przed pierwszym elementem) hasNext next - przeskakuje dalej i zwraca kolejny element (wskazywa\u0142 pierwszy, po przeskoku zwraca drugi itd.) remove \u2013 usuwa ostatnio \u201eprzeskoczony\u201d element forEach(), Spliterator \u2013 do iterowania r\u00f3wnoleg\u0142ego (pojedynczego lub w blokach) Interfejs Map : get(key) containsKey(key) containsValue(value) Parametryzacja np: Map Standardowe algorytmy: klasa Collections \u2022 sort \u2013 sortowanie listy \u2022 binarySearch \u2013 przeszukiwanie metod\u0105 bisekcji \u2022 shuffle \u2013 tasowanie element\u00f3w \u2022 reverse \u2013 odwr\u00f3cenie kolejno\u015bci element\u00f3w \u2022 rotate \u2013 przesuni\u0119cie element\u00f3w \u2022 fill \u2013 nadanie wszystkim elementom takiej samej warto\u015bci \u2022 copy, swap, addAll (typowe dzia\u0142ania pomocnicze) \u2022 binarySearch \u2013 wyszukiwanie w li\u015bcie \u2022 frequency \u2013 zliczanie wyst\u0105pie\u0144 \u2022 disjoint \u2013 test roz\u0142\u0105czno\u015bci \u2022 min, max \u2013 szukanie ekstrem\u00f3w Uporz\u0105dkowanie element\u00f3w kolekcji Mamy dwa sposoby porz\u0105dkowania kolekcji obiekt\u00f3w: Interfejs Comparable zapewnia automatyczny naturalny porz\u0105dek dla klas go implementuj\u0105cych. W interfejsie deklarowana jest metoda compareTo(obj) Interfejs Comparator umo\u017cliwia programi\u015bcie wyznaczenie w\u0142asnego sposobu porz\u0105dkowania obiekt\u00f3w. Implementacje Biblioteczne kolekcji W\u0142a\u015bciwo\u015bci: Implementuj\u0105 wszystkie opcjonalne operacje Mamy gwarancj\u0119, \u017ce nie wyst\u0105pi UnsupportedOperationException Nie s\u0105 synchronizowane Mamy gwarancj\u0119, \u017ce przy wsp\u00f3\u0142bie\u017cnej modyfikacji i przegl\u0105daniu wyst\u0105pi ConcurrentModificationException S\u0105 serializowalne i posiadaj\u0105 metod\u0119 clone() . HashSet \u2013 funkcja skr\u00f3tu indeksuje miejsce w tablicy, gdzie znajduje si\u0119 element; je\u015bli skr\u00f3t si\u0119 powiela, tworzona jest lista element\u00f3w. \u015aredni czas dost\u0119pu do elementu praktycznie sta\u0142y. Tablica mo\u017ce zmienia\u0107 sw\u00f3j rozmiar. LinkedHashSet \u2013 j.w. ale zapami\u0119tuje kolejno\u015b\u0107 dodania element\u00f3w do zbioru; minimalnie wolniejsza. TreeSet \u2013 elementy przechowywane w posortowanym i wywa\u017conym drzewie binarnym (wymaga okre\u015blenia relacji wi\u0119kszo\u015bci na elementach) ArrayList \u2013 zapewnia sta\u0142y czas wykonywania operacji size, isEmpty, get, set, iterator i listIterator oraz sta\u0142y czas operacji add. LinkedList \u2013 implementacja wykorzystuj\u0105ca listy dwukierunkowe. W zwi\u0105zku z tym realizacja dost\u0119pu do element\u00f3w tej kolekcji za pomoc\u0105 indeks\u00f3w jest nieefektywna. Natomiast mo\u017ce by\u0107 szybsza od ArrayList w przypadku cz\u0119stego usuwania i wstawiania element\u00f3w. Ponadto implementuje interfejsy Queue i Deque, wi\u0119c nadaje do implementowania stos\u00f3w i kolejek. LinkedList zawiera min. operacje addFirst, getFirst, removeFirst, addLast, getLast, removeLast. Instrukcje steruj\u0105ce (p\u0119tle i warunki) while ( wyra\u017cenie ) { instrukcje } // Wykonuj p\u0119tl\u0119 gdy wyra\u017cenie jest prawdziwe do { instrukcje } while ( wyra\u017cenie ); // Sprawdzenie warunku nast\u0119puje po zako\u0144czeniu p\u0119tli for ( inicjalizacja ; warunek ; inkrementacja ) { instrukcje } // Wszystkie trzy wyra\u017cenia s\u0105 opcjonalne; mo\u017ce by\u0107: for(;;) for ( typ zm_lokalna : ref_obiekt_iterowany_lub_tablica ) { instrukcje } if ( wyra\u017cenie ) { instrukcje } else { instrukcje } switch ( zmienna ) { case warto\u015b\u01071 : instrukcje ; break ; case warto\u015b\u01072 : instrukcje ; break ; \u2026 default : instrukcje ; break ; } S\u0142owa kluczowe: break bez etykiety \u2013 ko\u0144czy wykonywanie aktualnej wewn\u0119trznej instrukcji steruj\u0105cej switch, for, while, do-while instrukcja break z etykiet\u0105 \u2013 ko\u0144czy wykonywanie zewn\u0119trznego switch, for, while, do-while o danej etykiecie: break etykieta_instrukcji; continue ko\u0144czy bie\u017c\u0105c\u0105 iteracj\u0119 wewn\u0119trznej p\u0119tli continue z etykiet\u0105 -analogicznie return \u2013 powr\u00f3t z wykonywanej metody Klasa Definicja klasys k\u0142ada si\u0119 z nag\u0142\u00f3wka definicji klasy class nazwa_klasy (obligatoryjnie) specyfikacje: dost\u0119pu i dziedziczenia (opcjonalnie) bloku definicji klasy Specyfikacje domy\u015blne klasy: niepubliczna (istniej\u0105 restrykcje dost\u0119pu) nieabstrakcyjna (mo\u017cna tworzy\u0107 obiekty tej klasy) niefinalna (mo\u017ce mie\u0107 klasy pochodne) dziedziczy niejawnie po klasie Object nie implementuje niejawnie \u017cadnych interfejs\u00f3w Specyfikacje dodatkowe (niedomy\u015blne) klasy: public \u2013 klasa jest dost\u0119pna dla wszystkich klas (domy\u015blnie: tylko dla klas z tego samego pakietu) abstract \u2013 nie mo\u017cna tworzy\u0107 obiekt\u00f3w tej klasy final \u2013 nie mo\u017cna dziedziczy\u0107 z tej klasy extends klasa_bazowa \u2013 deklaruje dziedziczenie po klasie bazowej implements interfejs1, interfejs2 \u2013 deklaruje implementowanie jednego lub wi\u0119cej interfejs\u00f3w Blok definicji klasy \u2013 ograniczony par\u0105 nawias\u00f3w klamrowych, zawiera deklaracje wszystkich zmiennych sk\u0142adowych - p\u00f3l (w tym obiekt\u00f3w i p\u00f3l statycznych) deklaracje i definicje wszystkich funkcji sk\u0142adowych - metod (w tym metod wywo\u0142ywanych na rzecz obiektu lub metod statycznych) ewentualnie, definicje jednego lub wi\u0119cej konstruktor\u00f3w Konstruktory Nazwy konstruktor\u00f3w s\u0105 takie same jak nazwa konstruowanej klasy. Wywo\u0142ania konstruktor\u00f3w: new Stack(); new Stack(123); Odpowiednikiem destrukotr\u00f3w jest metoda finalize() Je\u015bli w klasie nie zdefiniowano \u017cadnego konstruktora, tworzony jest automatycznie domy\u015blny konstruktor (pusty) Klasy dziedzicz\u0105ce korzystaj\u0105 z konstruktora pustego, je\u017celi go nie ma to nale\u017cy samodzielnie wywo\u0142a\u0107 inny Konstruktory \u2013 specyfikacja dost\u0119pu private - \u017cadna inna klasa nie mo\u017ce bezpo\u015brednio u\u017cy\u0107 takiego konstruktora do tworzenia obiekt\u00f3w danej klasy protected \u2013 obiekty mog\u0105 by\u0107 tworzone przez klasy pochodne danej klasy i klasy nale\u017c\u0105ce do tego samego pakietu public - ka\u017cda klasa mo\u017ce tworzy\u0107 obiekty danej klasy brak specyfikatora dost\u0119pu - ka\u017cda klasa z tego samego pakietu mo\u017ce tworzy\u0107 obiekty danej klasy Pola klasy Specyfikatory private , public , protected , (package) \u2013 specyfikacja dost\u0119pu static \u2013 deklaracja pola statycznego (przynale\u017cnego do klasy, a nie \u2013 jej obiekt\u00f3w) final \u2013 deklaracja pola sta\u0142ego transient \u2013 specyfikacja pola, kt\u00f3re nie powinno podlega\u0107 serializacji volatile \u2013 specyfikacja pola ulotnego, niepodlegaj\u0105cego optymalizacji: przypisanie zmiennej warto\u015bci odbywa si\u0119 zawsze w pami\u0119ci (wsp\u00f3\u0142dzielonej przez w\u0105tki), a nie w rejestrze procesora, wi\u0119c jest od razu widoczne dla wsp\u00f3\u0142bie\u017cnych w\u0105tk\u00f3w Dost\u0119p do p\u00f3l Specyfikator Dost\u0119pu Klasa Podklasa z tego samego pakietu Podklasy z innego pakietu Wszystkie klasy private \u2714\ufe0f protected \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f public \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f (package) \u2714\ufe0f \u2714\ufe0f *Tylko przy odwo\u0142aniu niejawnym do p\u00f3l klasy bazowej Pole i metoda jednej klasy mog\u0105 nosi\u0107 tak\u0105 sam\u0105 nazw\u0119: public class CircularBuffer { private float [] buffer ; // pole buffer private float [] buffer (); // metoda buffer } Inicjalizacja Sk\u0142adowe zwyk\u0142e i statyczne mog\u0105 by\u0107 inicjalizowane w miejscu deklaracji. Np.: public class StaticInit { static int MAX_LINES = 1000 ; int maxLines = 300 ; } Ograniczenia inicjalizowania w miejscu deklaracji: wykonywana tyko operatorem przypisania. tylko wyra\u017ceniem, kt\u00f3re nie deklaruje, \u017ce mo\u017ce zg\u0142osi\u0107 wyj\u0105tek. wyst\u0105pienie wyj\u0105tku w wyra\u017ceniu ko\u0144czy program. W ka\u017cdym innym przypadku trzeba u\u017cy\u0107 bloku statycznej inicjalizacji lub konstruktora. public class StaticInit { static int MAX_LINES ; static { //Przyk\u0142ad dla bloku inicjalizacji try { MAX_LINES = Integer . parseInt ( new java . util . Properties (). getProperty ( \"maxLinesLimit\" )); } catch ( Exception e ){ // obs\u0142uga wyj\u0105tku } } } Liczba blok\u00f3w statycznej inicjalizacji w programie jest dowolna (wykonywane wg ich kolejno\u015bci wyst\u0105pienia w kodzie \u017ar\u00f3d\u0142owym). Metody Deklaracja metody \u2013 specyfikacja poziomu dost\u0119pu typu wyniku nazwy listy argument\u00f3w formalnych (typy proste lub referencje do obiekt\u00f3w) public Object push(Object item) Wszystkie mo\u017cliwe elementy nag\u0142\u00f3wka definicji metody (w ich kolejno\u015bci) poziom dost\u0119pu - public , protected , package , private static - deklaruje metod\u0119 jako statyczn\u0105 abstract \u2013 metoda nie posiada definicji, jej klasa musi by\u0107 abstrakcyjna final - nie mo\u017ce by\u0107 nadpisana przez metody klas pochodnych native - metoda rodzima, napisana w innym j\u0119zyku programowania synchronized \u2013 mo\u017ce by\u0107 jednocze\u015bnie wykonywana (na rzecz konkretnego obiektu) tylko przez jeden w\u0105tek typ wyniku OBOWI\u0104ZKOWE nazwa metody OBOWI\u0104ZKOWE lista parametr\u00f3w (w nawiasach) OBOWI\u0104ZKOWE throws wyj\u0105tki - lista wyj\u0105tk\u00f3w zg\u0142aszanych przez metod\u0119 Wynik metody Mo\u017cna zwr\u00f3ci\u0107 nic - void return; zmienn\u0105 np int return 10; obiekt (referencja) np. return new String(); Metody przeci\u0105\u017cone r\u00f3\u017cni\u0105 si\u0119 liczb\u0105 lub typem parametr\u00f3w Metoda nadpisana (polimorficzna) ma t\u0119 sam\u0105 sygnatur\u0119, co metoda w klasie bazowej. Nie mo\u017ce rozszerza\u0107 zbioru zg\u0142aszanych wyj\u0105tk\u00f3w. Odwo\u0142ania w metodach this -odwo\u0142anie do obiektu, na rzecz kt\u00f3rego wykonywana jest metoda super - odwo\u0142anie do \"nadobiektu\", okre\u015blonego przez klas\u0119 bazow\u0105 Dziedziczenie Mo\u017cna dziedziczy\u0107 (extends) tylko z jednej klasy Wszystkie obiekty dziedzicz\u0105 (niejawnie, obowi\u0105zkowo, po\u015brednio lub bezpo\u015brednio) z klasy java.lang.Object Klasa pochodna dziedziczy wszystkie sk\u0142adowe, kt\u00f3re s\u0105 dost\u0119pne dla niej i kt\u00f3rych sama nie przes\u0142ania (pola) lub nie nadpisuje (metody) Konstruktor\u00f3w nie dziedziczy si\u0119 Nadpisana metoda mo\u017ce deklarowa\u0107 zg\u0142aszanie tylko podzbioru wyj\u0105tk\u00f3w zg\u0142aszanych przez metod\u0119 dziedziczon\u0105. Specyfikator dost\u0119pu do metody nadpisanej mo\u017ce zezwoli\u0107 na wi\u0119kszy dost\u0119p ni\u017c metoda dziedziczona ale nie na mniejszy. Np. metoda chroniona (protected) w klasie bazowej mo\u017ce zosta\u0107 upubliczniona, ale nie \"uprywatniona\" Metody klasy bazowej, kt\u00f3rych nie mo\u017cna nadpisa\u0107 w klasie pochodnej: metoda zadeklarowana jako final w klasie bazowej metoda statyczna (mo\u017cna jedynie ukry\u0107 metod\u0119 statyczn\u0105 dziedziczon\u0105 przez jej ponowne zadeklarowanie) Metody klasy bazowej, kt\u00f3re musz\u0105 zosta\u0107 nadpisane w klasie pochodnej: metody zadeklarowane jako abstrakcyjne w klasie bazowej wszystkie metody bazowej klasy abstrakcyjnej Dziedziczenie po java.lang.Object Metody klasy Object, kt\u00f3re mog\u0105 by\u0107 nadpisane: clone equals, hashCode - por\u00f3wnywanie obiekt\u00f3w finalize - destruktor toString - zamienia obiekt w klas\u0119 String pozwalaj\u0105c na \"tekstowy wydruk\" zawarto\u015bci za pomoc\u0105 System.out.println Metody final (nie mog\u0105 by\u0107 nadpisane): getClass -Metoda zwraca reprezentacj\u0119 \"run-time\" klasy obiektu w postaci obiektu typu Class. Mo\u017cna dowiedzie\u0107 si\u0119 z niego o nazwie klasy, jej klasie bazowej i interfejsach, kt\u00f3re implementuje klasa void PrintClassName ( Object obj ) { System . out . println ( \"Klasa obiektu to \" + obj . getClass (). getName ()); } Object createNewInstanceOf ( Object obj ) { return obj . getClass (). newInstance (); //Nowa instancja tego samego obiektu } notify notifyAll wait Interfejs Interfejs \u2013 typ referencyjny, zawieraj\u0105cy deklaracje metod, implementacje domy\u015blne metod, pola sta\u0142e, metody statyczne, interfejsy i klasy [ modyfikatory ] interface NazwaInterfejsu [ extends Interfejs1 , \u2026 ] { // cia\u0142o interfejsu } Interfejs jest domy\u015blnie publiczny i obowi\u0105zkowo abstrakcyjny Metody interfejsu \u2013 domy\u015blnie publiczne ; albo abstrakcyjne, albo domy\u015blne, albo statyczne Pola interfejsu \u2013 domy\u015blnie publiczne , statyczne i finalne. Przyk\u0142ad interface A { int i = 2 ;} interface B { void foo ();} interface C extends A , B { int i = 3 ; //przes\u0142oni to i z interfejsu A } class D implements C { void foo (){ System . out . println ( i );} } implementacje domy\u015blne i statyczne metod public interface Addressable { String getStreet (); String getCity (); default String getFullAddress () { return getStreet () + \", \" + getCity (); } static void foo (){ System . out . println ( \"foo\" ); } Umo\u017cliwiaj\u0105 zdefiniowanie metod, kt\u00f3rych dzia\u0142anie jest niezale\u017cne od potencjalnych sposob\u00f3w implementacji interfejsu. Metody domy\u015blne mog\u0105 by\u0107 nadpisywane w klasach implementuj\u0105cych interfejs. Wyj\u0105tki Java wymaga, aby metody obs\u0142ugiwa\u0142y lub specyfikowa\u0142y wszystkie sprawdzalne wyj\u0105tki, kt\u00f3re mog\u0105 wyst\u0105pi\u0107 podczas wykonania programu. Wyj\u0105tki, kt\u00f3re s\u0105 powodowane przez z\u0142\u0105 logik\u0119 samego programu (np. b\u0142\u0119dy arytmetyczne lub b\u0142\u0119dy dost\u0119pu do pami\u0119ci danych programu), nie s\u0105 sprawdzane przez kompilator. Nie ma wymogu ich obs\u0142ugi lub deklarowania ich wyst\u0105pienia. Np. s\u0105 nimi: wyj\u0105tki arytmetyczne (np. dzielenie przez zero), wyj\u0105tki wskaza\u0144 (np. pr\u00f3ba odwo\u0142ania do obiektu poprzez zerow\u0105 referencj\u0119, pr\u00f3ba rzutowania na obiekt niew\u0142a\u015bciwej klasy), wyj\u0105tki indeksowania (np. odwo\u0142anie do elementu tablicy poprzez z\u0142y indeks). Wyrzucenie wyj\u0105tku: throw obiekt Obs\u0142uga: try { instrukcje // tu mo\u017ce wyst\u0105pi\u0107 throw } catch ( typ_wyj\u0105tku | inny_typ nazwa ) { // obs\u0142uga wyj\u0105tk\u00f3w dw\u00f3ch typ\u00f3w instrukcje } finally { // wykonywana zawsze niezale\u017cnie od zaistnienia wyj\u0105tku instrukcje } Jako wyj\u0105tek mo\u017ce by\u0107 zg\u0142oszony jedynie obiekt klasy Throwable lub klasy pochodnej od Throwable. W innym razie wyst\u0105pi b\u0142\u0105d kompilacji Hierarchia klas wyj\u0105tk\u00f3w Error . B\u0142\u0105d dynamicznej konsolidacji programu lub inny \"ci\u0119\u017cki\" b\u0142\u0105d w JVM. Programy nie powinny obs\u0142ugiwa\u0107 ani zg\u0142asza\u0107 takich wyj\u0105tk\u00f3w. (b\u0142\u0105d w maszynie albo np brak pami\u0119ci itp.) Exception . Jest to klasa bazowa wyj\u0105tk\u00f3w w programach Javy. S\u0105 ju\u017c liczne klasy pochodne tej klasy, np. IllegalAccessException, NegativeArraySizeException. RuntimeException . Specjalna klasa pochodna od Exception, kt\u00f3ra dotyczy wyj\u0105tk\u00f3w niesprawdzalnych, zg\u0142aszanych przez Runtime (\u015brodowisko czasu wykonania programu). np dzielenie przez 0 Delegowanie wyj\u0105tk\u00f3w \"w g\u00f3r\u0119\" public class Example3 { public static void notMainYet ( String [] args ) throws IOException { try ( BufferedReader br = new BufferedReader ( new FileReader ( \"/testing.txt\" ))) { String line ; while (( line = br . readLine ()) != null ) { System . out . println ( line ); } } } try { notMainYet ( null ); } catch ( IOException e ){ e . getSuppressed (); // zwraca tablic\u0119 wyj\u0105tk\u00f3w powsta\u0142ych przy zwalnianiu zasob\u00f3w } Kompilator automatycznie generuje niejawny blok finally z kodem bezpiecznie zamykaj\u0105cym zasoby. Modu\u0142 Modu\u0142 grupuje powi\u0105zane ze sob\u0105 pakiety, okre\u015blaj\u0105c, kt\u00f3re z nich zostan\u0105 udost\u0119pnione oraz to jakie pakiety i modu\u0142y s\u0105 jemu potrzebne. Budowa: Katalog bazowy (root direcotry) modu\u0142u nazwany tak samo jak nazwa modu\u0142u. deskryptor modu\u0142u module-info.java -zawiera opis modu\u0142u module com . mycompany . factories { exports com . mycompany . interfaces ; //exports opisuje kt\u00f3re paczki maj\u0105 by\u0107 dost\u0119pne w pozosta\u0142ych modu\u0142ach exports com . mycompany . factories ; requires modulename ; //requires opisujeod jakich modu\u0142\u00f3w zale\u017cy ten modu\u0142 } exports and exports\u2026to. An exports module directive specifies one of the module\u2019s packages whose public types (and their nested public and protected types) should be accessible to code in all other modules. An exports\u2026to directive enables you to specify in a comma-separated list precisely which module\u2019s or modules\u2019 code can access the exported package\u2014this is known as a qualified export. uses. A uses module directive specifies a service used by this module\u2014making the module a service consumer. A service is an object of a class that implements the interface or extends the abstract class specified in the uses directive. provides\u2026with. A provides\u2026with module directive specifies that a module provides a service implementation\u2014making the module a service provider. The provides part of the directive specifies an interface or abstract class listed in a module\u2019s uses directive and the with part of the directive specifies the name of the service provider class that implements the interface or extends the abstract class. //TODO javac --module-source-path . -d out -m com.mycompany.factories import com.mycompany.interfaces.* ; import com.mycompany.factories.* ; public class Test { public static void main ( String args [] ){ RestClientInterface i = RestClientFactory (). makeClient ( null , null ); String [] query = { \"key?2389fg38\" , \"loc:21.1,50.9\" }; i . runQuery ( query ); } } Kompilacja: javac --module-path out --add-modules com.mycompany.factories Test.java Uruchomienie: java --module-path out --add-modules com.mycompany.factories Test //TODO Beans + Swing (w3 i w4 w6) Programowanie wsp\u00f3\u0142bie\u017cne Uruchomienie nowego w\u0105tku \u2013 zadanie do wykonania przez nowy w\u0105tek zdefiniowane w metodzie run() S\u0105 2 sposoby: Klasa implementuj\u0105ca Runnable public class MyRunnable implements Runnable { public void run () { System . out . println ( \"Hello from a thread!\" ); } public static void main ( String args [] ) { ( new Thread ( new MyRunnable ())). start (); } } Klasa dziedzicz\u0105ca po Thread public class HelloThread extends Thread { public void run () { System . out . println ( \"Hello from a thread!\" ); } public static void main ( String args [] ) { ( new HelloThread ()). start (); } } Diagram stan\u00f3w w\u0105tku class MyThread extends Thread { public void run (){ \u2026 }} Przyczyny blokowania w\u0105tk\u00f3w III public class Test3 { public static void main ( String args [] ) { Thread p = new Producent (); p . setDaemon ( true ); p . start (); try { p . join (); //join-oczekiwanie } catch ( InterruptedException e ) { e . printStackTrace (); } } } IV s\u0142owo kluczowe synchronized sprawia, \u017ce dane obiekty /metody nie mog\u0105 by\u0107 u\u017cywane dednocze\u015bnie przez kilka w\u0105tk\u00f3w i je\u017celi jeden w\u0105tek w\u0142a\u015bnie korzysta z takiego obiektu to wszystkie pozosta\u0142e musz\u0105 poczeka\u0107 class Schowek { int wartosc = - 1 ;} class Producent [ \u2026 ] Schowek schowek ; Producent ( Schowek s ) { schowek = s }; public void run [ \u2026 ] System . out . print ( \" p\" + i ); synchronized ( schowek ) { schowek . wartosc = i ; } [ \u2026 ] class Konsument [ \u2026 ] public void run () { try { for ( int i = 0 ; i < 6 ; i ++ ) { int w ; synchronized ( schowek ) { w = schowek . wartosc ; } System . out . print ( \" k\" + w ); sleep (( long )( Math . random () * 3000 )); } } [ \u2026 ] public static void main ( String args [] ) { Schowek s = new Schowek (); Thread p = new Producent ( s ); Thread k = new Konsument ( s ); [ \u2026 ] V Tak jak ma to miejsce w monitorach class Schowek [ \u2026 ] boolean jestZapelniony = false ; [ \u2026 ] class Producent [ \u2026 ] synchronized ( schowek ) { while ( schowek . jestZapelniony ) schowek . wait (); schowek . wartosc = i ; schowek . jestZapelniony = true ; schowek . notifyAll (); } [ \u2026 ] class Konsument [ \u2026 ] synchronized ( schowek ) { while ( ! schowek . jestZapelniony ) schowek . wait (); w = schowek . wartosc ; schowek . jestZapelniony = false ; schowek . notifyAll (); } Przy takim schemacie dzia\u0142ania nale\u017cy zawsze: Sprawdza\u0107 zmienn\u0105 warunkow\u0105 w schemacie while(warunek) wait() [\u2026] notify/All() Pami\u0119ta\u0107 o nadaniu zmiennej warunkowej odpowiedniej warto\u015bci (unikanie zakleszcze\u0144) Obs\u0142ugiwa\u0107 monitor po zaj\u0119ciu zamka (IllegalStateException) java.util.concurrent.locks.* Obiekty u\u0142atwiaj\u0105ce synchronizacj\u0119 w\u0105tk\u00f3w - Po\u0142\u0105czenie funkcjonalno\u015bci zamka i monitora w jednym obiekcie, implementuj\u0105cym interfejs Lock U\u0142atwienie podzia\u0142u i obs\u0142ugi w\u0105tk\u00f3w oczekuj\u0105cych na zas\u00f3b ze zr\u00f3\u017cnicowanymi warunkami wznowienia \u2013 obiekt Condition Dodatkowe mo\u017cliwo\u015bci, w zale\u017cno\u015bci od implementacji \u2013 np. wyb\u00f3r strategii aktywacji w\u0105tk\u00f3w wznawianych do wykonania ( ReentrantLock ) void schowaj ( int i ) [ \u2026 ] zamek . lock (); while ( ! warunek_zapisu ) zapis . await (); [ \u2026 ] // zapis do bufora odczyt . signal (); [ \u2026 ] finally { zamek . unlock ();} void schowaj ( int i ) [ \u2026 ] zamek . lock (); while ( ! warunek_zapisu ) zapis . await (); [ \u2026 ] // zapis do bufora odczyt . signal (); [ \u2026 ] finally { zamek . unlock ();} //TODO fork/join Sie\u0107 Dwa podstawowe rodzaje protoko\u0142\u00f3w oparte na IP: \u25aa TCP \u2013 Transmission Control Protocol \u2013 po\u0142\u0105czeniowy kontroluje poprawno\u015b\u0107 przes\u0142anych danych, dostosowuje si\u0119 do przepustowo\u015bci \u0142\u0105cza, wymagaj\u0105c informacji zwrotnej od odbiorcy \u25aa UDP \u2013 User Datagram Protocol \u2013 bezpo\u0142\u0105czeniowy ca\u0142e sterowanie transmisj\u0105 pozostawione u\u017cytkownikowi, mo\u017cliwo\u015b\u0107 transmisji rozg\u0142oszeniowej Pakiet java.net zawiera podstawowe klasy zwi\u0105zane z komunikacj\u0105 sieciow\u0105: URL, socket i pochodne, itp TCP - przyk\u0142adowy serwer: import ... public class MyHttpServer { public static void main ( String [] args ) throws Exception { ServerSocket sSocket = new ServerSocket ( 1777 ); while ( true ) { Socket newSocket = sSocket . accept (); //zawiesza w oczekiwaniu na po\u0142\u0105czenie OutputStream os = newSocket . getOutputStream (); StringBuffer sb = new StringBuffer (); sb . append ( \"HTTPServer works!\" ); byte [] byteArray = sb . toString (). getBytes (); os . write ( \"HTTP/1.0 200 OK\\n\" . getBytes ()); os . write ( new String ( \"Content-Length: \" + byteArray . length + \"\\n\" ). getBytes ()); os . write ( \"Content-Type: text/html\\n\\n\" . getBytes ()); os . write ( byteArray ); os . flush (); os . close (); br . close (); newSocket . close (); } } } http://www.java2s.com/Code/Java/Network-Protocol/BufferedReaderforServerSocket.htm RMI - Remote Method Invocation Pozwala odnosi\u0107 si\u0119 poprzez referencj\u0119 do obiekt\u00f3w na innych maszynach Hello world of RMI \u2013 wywo\u0142anie zwrotne Klient udost\u0119pnia us\u0142ug\u0119: public interface Callback extends Remote { public void callback () throws RemoteException ; } public static class CallbackImpl extends UnicastRemoteObject implements Callback { protected CallbackImpl () throws RemoteException { super (); } public void callback (){ System . out . println ( \"Hello from the callback\" ); } } Serwer definiuje now\u0105 us\u0142ug\u0119 (asynchroniczn\u0105): public void hello ( Object o ) throws RemoteException { (( Client . Callback ) o ). callback (); } Wywo\u0142anie u klienta: worker . hello ( UnicastRemoteObject . toStub ( new CallbackImpl ())); Java Messaging System (JMS) Komunikacja pomi\u0119dzy wieloma JVM \u2013 typowe zadania: \u25aa kolejka komunikat\u00f3w (z buforowaniem) \u25aa transmisja rozg\u0142oszeniowa do wybranych odbiorc\u00f3w \u25aa filtrowanie komunikat\u00f3w w transmisji rozg\u0142oszeniowej \u25aa synchroniczne i asynchroniczne modele komunikacji \u25aa zarz\u0105dzanie trwa\u0142o\u015bci\u0105 i wa\u017cno\u015bci\u0105 komunikat\u00f3w (data wa\u017cno\u015bci, priorytet, przechowywanie, gdy nie ma odbiorcy) \u25aa gwarancja dostarczenia \u25aa grupowanie serii komunikat\u00f3w w niepodzieln\u0105 transakcj\u0119 \u25aa r\u00f3wnie\u017c: komunikacja z komponentami stworzonymi w innych j\u0119zykach //TODO jms Atrybuty Systemowe S\u0105 to dane na temat \u015brodowiska takie jak: nazwa komputera nazwa u\u017cytkownika katalog roboczy identyfikator systemu operacyjnego itp Atrybuty przechowywane w postaci par: (nazwa,warto\u015b\u0107). Ustawiane na trzy sposoby: \u0142adowane przez klas\u0119 java.util.Properties \u2013 na spos\u00f3b trwa\u0142y mi\u0119dzy uruchomieniami maszyny wirtualnej poprzez argumenty wiersza polece\u0144 \u2013 na czas wykonania aplikacji -Dnazwa=warto\u015b\u0107 poprzez parametry apletu \u2013 na czas wykonania apletu Metody klasy Properties: contains(Object value) , containsKey(Object key) \u2013 sprawdzaj\u0105, czy obiekt zawiera dan\u0105 warto\u015b\u0107 b\u0105d\u017a nazw\u0119 atrybutu (podawane jako String) getProperty(String key) , getProperty(String key, String default) \u2013zwraca warto\u015b\u0107 danego atrybutu / warto\u015b\u0107 domy\u015bln\u0105 je\u015bli atrybut nie istnieje setProperty(String key, String value) \u2013 zapisuje warto\u015b\u0107 atrybutu list(PrintStream s) , list(PrintWriter w) \u2013 zapisuje wszystkie w\u0142asno\u015bci do strumienia elements() , keys() \u2013 zwraca iteratory warto\u015bci i nazw atrybut\u00f3w load(From)/store(ToXML) \u2013 umo\u017cliwia pobranie/zapis atrybut\u00f3w (w formacie XML) Za\u0142adowanie atrybut\u00f3w przy starcie Properties p = new Properties (); FileInputStream is = new FileInputStream ( \"my.properties\" ); p . load ( is ); is . close (); Odczyt/wykorzystanie/modyfikacja atrybut\u00f3w podczas pracy programu Zapami\u0119tanie (zmodyfikowanych) atrybut\u00f3w przy wyj\u015bciu z programu FileOutputStream os = new FileOutputStream ( \"my.properties\" ); p . store ( os , \"---No Comment---\" ); os . close (); Nazwa atrybutu Opis file.separator separator nazw plik\u00f3w i katalog\u00f3w java.class.path \u015bcie\u017cka przeszukiwania klas Javy java.class.version wersja biblioteki systemowej Javy java.home katalog, w kt\u00f3rym zainstalowano Jav\u0119 java.vendor nazwa producenta u\u017cywanego JRE java.vendor.url adres www producenta u\u017cywanego JRE java.version wersja Javy line.separator separator wierszy tj. znak nowego wiersza os.arch architektura sprz\u0119towa syst. operacyjnego os.name nazwa systemu operacyjnego os.version wersja systemu operacyjnego path.separator separator wpis\u00f3w na \u015bcie\u017cce (set) user.dir katalog roboczy user.home katalog domowy u\u017cytkownika user.name nazwa u\u017cytkownika uruchamiaj\u0105cego JRE Runtime Wi\u0119kszo\u015b\u0107 potrzeb aplikacji dost\u0119pu do systemu obs\u0142uguje klasa System. W rzadkich przypadkach aplikacja mo\u017ce odwo\u0142a\u0107 si\u0119 bezpo\u015brednio do \u015brodowiska czasu wykonania, reprezentowanego przez jeden obiekt klasy java.lang.Runtime, b\u0119d\u0105cy sprz\u0119giem aplikacji ze \u015brodowiskiem wykonania VM w systemie operacyjnym. public static Runtime getRuntime (); //zwraca akt. obiekt Runtime Obiekt Runtime umo\u017cliwia m.in. \u2022 wykonanie programu funkcj\u0105 systemow\u0105 exec \u2022 pobranie informacji o liczbie dost\u0119pnych procesor\u00f3w, pami\u0119ci operacyjnej \u2022 zlecenie za\u0142adowania biblioteki dynamicznej \u2022 bezwarunkowe zatrzymanie maszyny wirtualnej //TODO wy\u017cej te\u017c s\u0105 todo","title":"Java podstawy"},{"location":"Java%E2%98%95/java_podstawy/#java-podstawy","text":"","title":"Java podstawy"},{"location":"Java%E2%98%95/java_podstawy/#narzedzia","text":"jshell \u2013 interpretator interaktywny ?jak importowa\u0107 w nim w\u0142asne pakiety? jlink \u2013 generacja modu\u0142u aplikacji","title":"Narz\u0119dzia"},{"location":"Java%E2%98%95/java_podstawy/#helloworld-w-javie","text":"public class HelloWorldApp { public static void main ( String [] args ) { System . out . println ( \"Hello world from Java!\" ); } } Wszystko jest tu klas\u0105, nasza apka te\u017c. Je\u017celi chcemy, aby jaka\u015b klasa zacz\u0119\u0142a co\u015b robi\u0107 przy jej samodzielnym uruchomieniu to dodajemy funkcj\u0119: public static void main(String[] args)","title":"HelloWorld w javie"},{"location":"Java%E2%98%95/java_podstawy/#pakiety","text":"W jednym pliku .java mo\u017cna zdefiniowa\u0107 wiele klas, ale tylko jedna z nich mo\u017ce bypubliczna i jej nazwa musi odpowiada\u0107 nazwie pliku. Ka\u017cda klasa nale\u017cy do jakiego\u015b pakietu. Je\u015bli w pliku z kodem \u017ar\u00f3d\u0142owym klasy nie wyst\u0119puje na pocz\u0105tku deklaracja przynale\u017cno\u015bci tej klasy do konkretnego pakietu, w\u00f3wczas klasa ta b\u0119dzie nale\u017ce\u0107 do domy\u015blnego pakietu. Klasy nale\u017c\u0105ce do tego samego pakietu mog\u0105 odwo\u0142ywa\u0107 si\u0119 do siebie bez konieczno\u015bci stosowania nazw kwalifikowanych (bez przedrostka) Konwencja nazewnicza dla nazw pakiet\u00f3w: nazwa_firmy.nazwa_pakietu. import java.applet.Applet ; public class App extends Applet { ////kod } //LUB public class App extends java . applet . Applet { ////kod } Klasa System jest zawarta w java.lang, importowanym automatycznie","title":"Pakiety"},{"location":"Java%E2%98%95/java_podstawy/#typy-danych","text":"Wbudowane \u2013 okre\u015blone przez tw\u00f3rc\u00f3w j\u0119zyka \u2013 typy proste (albo: typy dla warto\u015bci, value-type): zmienne tych typ\u00f3w zawieraj\u0105 warto\u015bci tych\u017ce typ\u00f3w \u2013 typy referencyjne: zmienne tych typ\u00f3w zawieraj\u0105 odniesienie do tablicy lub obiektu, kt\u00f3ry reprezentuj\u0105 Definiowane przez programist\u0119 \u2013 klasy \u2013 typy wyliczeniowe (enumeration) Java ma statyczne typowanie tzn, \u017ce raz zdefiniowana zmienna nie zmienia swojego typu (jak np. w pythonie) Wbudowane typy proste ca\u0142kowitoliczbowe, kodowane U2 byte jednobajtowy short dwubajtowy int czterobajtowy long o\u015bmiobajtowy zmiennoprzecinkowe, kodowane IEEE 754 float czterobajtowy double o\u015bmiobajtowy inne char dwubajtowy, kodowany Unicode (utf-16) boolean warto\u015b\u0107 logiczna true lub false do javy 11 mo\u017cna stosowa\u0107 identyfikator typu wywnioskowanego: var s = \"test\";","title":"Typy danych"},{"location":"Java%E2%98%95/java_podstawy/#stae","text":"Litera\u0142y \u2013 sta\u0142e bez nazwy, o typie wynikaj\u0105cym ze sposobu zapisu litera\u0142u, np. 78, 8864L, 37.266, 37.266D, 37.266F, \u2019c\u2019, true, null int long double double float char boolean oraz \u0142a\u0144cuchy znak\u00f3w, typu String: \"ala ma kota\" Sta\u0142e symboliczne \u2013 sta\u0142e opatrzone nazw\u0105 i jawn\u0105 deklaracj\u0105 typu final typ NAZWA_STA\u0141EJ = warto\u015b\u0107 ; //np. final float PI = 3.14 ; Lokaln\u0105 sta\u0142\u0105 symboliczn\u0105 mo\u017cna zainicjowa\u0107 p\u00f3\u017aniej \u2013 najpierw wyst\u0105pi sama deklaracja, a p\u00f3\u017aniej przypisanie pierwszej (i ostatecznej) warto\u015bci. final int STA\u0141A_CZYSTA ; // Definicja sta\u0142ej /**/ STA\u0141A_CZYSTA = 0 ; // Inicjalizacja sta\u0142ej","title":"Sta\u0142e"},{"location":"Java%E2%98%95/java_podstawy/#typ-wyliczeniowy","text":"enum Season { WINTER , SPRING , SUMMER , FALL } \u2013 kompilator sprawdza zgodno\u015b\u0107 typu \u2013 mo\u017ce by\u0107 u\u017cyty w instrukcji switch Season anything = Season . WINTER ; switch ( anything ){ case SUMMER : System . out . println ( \"Lato\" ); //\u2026 }","title":"Typ wyliczeniowy"},{"location":"Java%E2%98%95/java_podstawy/#referencja","text":"Referencja to zmienna, kt\u00f3rej warto\u015bci\u0105 jest adres. Typy referencyjne: tablice, klasy, interfejsy. Zmienna referencyjna odnosi si\u0119 do miejsca pami\u0119ci, w kt\u00f3rym pomieszczono dan\u0105 lub wektor danych reprezentowanych t\u0105 zmienn\u0105. Java nie zna typu wska\u017anikowego, tzn. jawnego korzystania z adres\u00f3w.","title":"Referencja"},{"location":"Java%E2%98%95/java_podstawy/#konwencje-nazewnicze-dla-nazw-zmiennych-i-klas","text":"nazwa zmiennej rozpoczyna si\u0119 ma\u0142\u0105 liter\u0105, nazwa klasy rozpoczyna si\u0119 wielk\u0105 liter\u0105, kolejne s\u0142owa w nazwie rozpoczyna si\u0119 wielk\u0105 liter\u0105, np. isVisible, znak podkre\u015blenia (_) jest wprawdzie poprawny w nazwie, ale powinien by\u0107 u\u017cywany jedynie w nazwach sta\u0142ych.","title":"Konwencje nazewnicze dla nazw zmiennych i klas"},{"location":"Java%E2%98%95/java_podstawy/#cykl-zycia-obiektu","text":"Utworzenie zmiennej typu referencji do obiektu ( typ nazwa; ) Dla typu klasy lub interfejsu zmienna przechowuje adres do obiektu klasy \u2013 nie jest on dost\u0119pny bezpo\u015brednio, lecz stanowi referencj\u0119. Do momentu przypisania jej adresu ma ona warto\u015b\u0107 zerow\u0105 (null). Utworzenie obiektu ( new alokuje obszar pami\u0119ci) nazwa=new typ(argumenty) Operator new zwraca referencj\u0119 do nowo utworzonego obiektu. Inicjalizacja -wywo\u0142anie konstruktora U\u017cywanie Usuwanie obiektu - \"Garbage Collector\" \u015brodowisko samodzielnie usuwa obiekt, je\u017celi wykryje, \u017ce ju\u017c wi\u0119cej nie b\u0119dzie u\u017cywane w programie, wywo\u0142uje si\u0119 on samoczynnie co jaki\u015b czas, ale mo\u017cna to zrobi\u0107 r\u0119cznie System.gc() Ewentualne wykonanie metody finalize() dziedziczona po klasie Obiect- pozwala wykona\u0107 dodatkowe czynno\u015bci zwi\u0105zane z usuwaniem obiektu","title":"Cykl \u017cycia obiektu"},{"location":"Java%E2%98%95/java_podstawy/#operatory","text":"Operator \u2013 funkcja podana w notacji operatorowej - z 1, 2 lub 3 argumentami (operandami). 1-argumentowe operatory mog\u0105 by\u0107 przedrostkowe i przyrostkowe: operator operand // notacja przedrostkowa operand operator // notacja przyrostkowa przedrostkowe i przyrostkowe ++ i -- 2-argumentowe operatory wyst\u0119puj\u0105 pomi\u0119dzy swoimi operandami: operand1 operator operand2 Dzia\u0142ania matematyczne + , - , * , / , % Por\u00f3wnania > , >= , == , <= , < , != Tylko dla warto\u015bci logicznych: && , & \"and\" || , | \"or\" ! negacja ^ op1 ^ op2 true, gdy op1 i op2 maj\u0105 r\u00f3\u017cne warto\u015bci Przesuni\u0119cia >> np op1>>op2 przesu\u0144 op1 w prawo o op2 bit\u00f3w << np op1<>> op1>>>op2 przesu\u0144 op1 w prawo o op2 bit\u00f3w, zast\u0119puj\u0105c bit znaku zerem Bitowe logiczne & op1 & op2 iloczyn bitowy op1 i op2 | op1 | op2 suma bitowa op1 i op2 ^ op1 ^ op2 bitowa r\u00f3\u017cnica symetryczna op1 i op2 ~ ~op bitowa negacja op Przypisania op1=op2 *= , += , -= , |= , %= itp... 3-argumentowy operator (jedyny w Javie): operand1 ? operand2 : operand3 op1?op2:op3 gdy op1 jest \u201etrue\u201d, zwraca op2, w przeciwnym razie zwraca op3 Inne typ[] / typ[liczba] deklaracja tablicy op[liczba] pobranie elementu z tablicy (typ)op konwersja wyra\u017cenia op do typu typ net op1 utowrzenie obiektu lub tablicy op1 instanceof op2 zwraca \u201etrue\u201d, gdy obiekt op1 jest instancj\u0105 klasy op2 Za wyj\u0105tkiem operatora + u\u017cywanego te\u017c do \u0142\u0105czenia napis\u00f3w, operatory arytmetyczne s\u0105 przeznaczone tylko dla operand\u00f3w liczbowych.","title":"Operatory"},{"location":"Java%E2%98%95/java_podstawy/#kolekcje","text":"Kolekcja to obiekt: zawieraj\u0105cy wiele element\u00f3w (teoretycznie dowolna liczba, nieokre\u015blona zawczasu), udost\u0119pniaj\u0105cy operacje wstawiania, przegl\u0105dania, usuwania. stosowany do magazynowania, przetwarzania i transmisji danych. Biblioteka kolekcji w Javie: Interfejsy \u2013 definiuj\u0105ce zachowanie kolekcji, Implementacje interfejs\u00f3w (na r\u00f3\u017cne sposoby), Algorytmy \u2013 typowe operacje na kolekcjach r\u00f3\u017cnego rodzaju Kolekcje w Javie zosta\u0142y umieszczone w java.util. Mimo, \u017ce w java.util wyst\u0119puje interfejs Collection, nie wszystkie kolekcje go implementuj\u0105 czy dziedzicz\u0105. Dlatego terminu kolekcja u\u017cywamy w szerszym sensie. Kolekcje a typy uog\u00f3lnione: Wersje podstawowe \u2013 nieparametryzowane typem przechowywanych danych \u2013 np. List.insert(Object o) Wersje parametryzowane typem \u2013 np. List.insert(MojTyp o) Klasy parametryzowane typem - przyk\u0142ad public class CircularBuffer < T > { private T [] buffer ; private int head = 0 , tail = 0 ; public CircularBuffer () { buffer = ( T [] ) new Object [ 10 ] ; } public void add ( T f ) { if ( head == tail - 1 ) // nadpisanie tail = ++ tail % buffer . length ; buffer [ head ++] = f ; head = head % buffer . length ; } public T get () { int adjTail = tail > head ? tail - buffer . length : tail ; if ( adjTail < head ) { T t = buffer [ tail ++] ; tail = tail % buffer . length ; return t ; } else { throw new Error (); } } } Pos\u0142uguj\u0105c si\u0119 interfejsami, mo\u017cemy tworzy\u0107 algorytmy operuj\u0105ce na kolekcjach niezale\u017cnie od sposobu, w jaki zaimplementowano kolekcj\u0119 (programowanie abstrakcyjne) S\u0105 2 niezale\u017cne hierarchie: \u201ew\u0142a\u015bciwych kolekcji\u201d oraz wykazy asocjacyjne, czyli kolekcje par {klucz,warto\u015b\u0107}. Opr\u00f3cz tego dysponujemy obiektami do przegl\u0105dania kolekcji: jednokierunkowym (Iterator) i dwukierunkowym (ListIterator). Kolekcje mo\u017cna r\u00f3wnie\u017c przegl\u0105da\u0107, korzystaj\u0105c z obiekt\u00f3w funkcyjnych w po\u0142\u0105czeniu z metod\u0105 forEach(). Podstawowe zale\u017cno\u015bci pomi\u0119dzy interfejsami kolekcji: Collection okre\u015bla zachowanie najog\u00f3lniejszego zbioru obiekt\u00f3w,mog\u0105cego zawiera\u0107 obiekty identyczne Set \u201erozszerza\u201d Collection: nie dopuszcza duplikat\u00f3w List rozszerza Collection, dopuszczaj\u0105c indeksowanie przez pozycj\u0119 obiektu Map definiuje funkcjonalno\u015bci podobne do Collection, ale nie jest z nim spokrewniony","title":"Kolekcje"},{"location":"Java%E2%98%95/java_podstawy/#metody-interfejsow","text":"Collection i Iterator : Metody \u201ejednostkowe\u201d add, contains, remove Metody zbiorcze addAll, containsAll, removeAll, retainAll (dla teorii zbior\u00f3w r\u00f3\u017cnica zbior\u00f3w iloczyn itp.) Inne clear, isEmpty, size, toArray iterator \u2013 produkuje nowy iterator (na pocz\u0105tku na nic nie wskazuje, jest przed pierwszym elementem) hasNext next - przeskakuje dalej i zwraca kolejny element (wskazywa\u0142 pierwszy, po przeskoku zwraca drugi itd.) remove \u2013 usuwa ostatnio \u201eprzeskoczony\u201d element forEach(), Spliterator \u2013 do iterowania r\u00f3wnoleg\u0142ego (pojedynczego lub w blokach) Interfejs Map : get(key) containsKey(key) containsValue(value) Parametryzacja np: Map Standardowe algorytmy: klasa Collections \u2022 sort \u2013 sortowanie listy \u2022 binarySearch \u2013 przeszukiwanie metod\u0105 bisekcji \u2022 shuffle \u2013 tasowanie element\u00f3w \u2022 reverse \u2013 odwr\u00f3cenie kolejno\u015bci element\u00f3w \u2022 rotate \u2013 przesuni\u0119cie element\u00f3w \u2022 fill \u2013 nadanie wszystkim elementom takiej samej warto\u015bci \u2022 copy, swap, addAll (typowe dzia\u0142ania pomocnicze) \u2022 binarySearch \u2013 wyszukiwanie w li\u015bcie \u2022 frequency \u2013 zliczanie wyst\u0105pie\u0144 \u2022 disjoint \u2013 test roz\u0142\u0105czno\u015bci \u2022 min, max \u2013 szukanie ekstrem\u00f3w","title":"Metody interfejs\u00f3w"},{"location":"Java%E2%98%95/java_podstawy/#uporzadkowanie-elementow-kolekcji","text":"Mamy dwa sposoby porz\u0105dkowania kolekcji obiekt\u00f3w: Interfejs Comparable zapewnia automatyczny naturalny porz\u0105dek dla klas go implementuj\u0105cych. W interfejsie deklarowana jest metoda compareTo(obj) Interfejs Comparator umo\u017cliwia programi\u015bcie wyznaczenie w\u0142asnego sposobu porz\u0105dkowania obiekt\u00f3w.","title":"Uporz\u0105dkowanie element\u00f3w kolekcji"},{"location":"Java%E2%98%95/java_podstawy/#implementacje-biblioteczne-kolekcji","text":"W\u0142a\u015bciwo\u015bci: Implementuj\u0105 wszystkie opcjonalne operacje Mamy gwarancj\u0119, \u017ce nie wyst\u0105pi UnsupportedOperationException Nie s\u0105 synchronizowane Mamy gwarancj\u0119, \u017ce przy wsp\u00f3\u0142bie\u017cnej modyfikacji i przegl\u0105daniu wyst\u0105pi ConcurrentModificationException S\u0105 serializowalne i posiadaj\u0105 metod\u0119 clone() . HashSet \u2013 funkcja skr\u00f3tu indeksuje miejsce w tablicy, gdzie znajduje si\u0119 element; je\u015bli skr\u00f3t si\u0119 powiela, tworzona jest lista element\u00f3w. \u015aredni czas dost\u0119pu do elementu praktycznie sta\u0142y. Tablica mo\u017ce zmienia\u0107 sw\u00f3j rozmiar. LinkedHashSet \u2013 j.w. ale zapami\u0119tuje kolejno\u015b\u0107 dodania element\u00f3w do zbioru; minimalnie wolniejsza. TreeSet \u2013 elementy przechowywane w posortowanym i wywa\u017conym drzewie binarnym (wymaga okre\u015blenia relacji wi\u0119kszo\u015bci na elementach) ArrayList \u2013 zapewnia sta\u0142y czas wykonywania operacji size, isEmpty, get, set, iterator i listIterator oraz sta\u0142y czas operacji add. LinkedList \u2013 implementacja wykorzystuj\u0105ca listy dwukierunkowe. W zwi\u0105zku z tym realizacja dost\u0119pu do element\u00f3w tej kolekcji za pomoc\u0105 indeks\u00f3w jest nieefektywna. Natomiast mo\u017ce by\u0107 szybsza od ArrayList w przypadku cz\u0119stego usuwania i wstawiania element\u00f3w. Ponadto implementuje interfejsy Queue i Deque, wi\u0119c nadaje do implementowania stos\u00f3w i kolejek. LinkedList zawiera min. operacje addFirst, getFirst, removeFirst, addLast, getLast, removeLast.","title":"Implementacje Biblioteczne kolekcji"},{"location":"Java%E2%98%95/java_podstawy/#instrukcje-sterujace-petle-i-warunki","text":"while ( wyra\u017cenie ) { instrukcje } // Wykonuj p\u0119tl\u0119 gdy wyra\u017cenie jest prawdziwe do { instrukcje } while ( wyra\u017cenie ); // Sprawdzenie warunku nast\u0119puje po zako\u0144czeniu p\u0119tli for ( inicjalizacja ; warunek ; inkrementacja ) { instrukcje } // Wszystkie trzy wyra\u017cenia s\u0105 opcjonalne; mo\u017ce by\u0107: for(;;) for ( typ zm_lokalna : ref_obiekt_iterowany_lub_tablica ) { instrukcje } if ( wyra\u017cenie ) { instrukcje } else { instrukcje } switch ( zmienna ) { case warto\u015b\u01071 : instrukcje ; break ; case warto\u015b\u01072 : instrukcje ; break ; \u2026 default : instrukcje ; break ; } S\u0142owa kluczowe: break bez etykiety \u2013 ko\u0144czy wykonywanie aktualnej wewn\u0119trznej instrukcji steruj\u0105cej switch, for, while, do-while instrukcja break z etykiet\u0105 \u2013 ko\u0144czy wykonywanie zewn\u0119trznego switch, for, while, do-while o danej etykiecie: break etykieta_instrukcji; continue ko\u0144czy bie\u017c\u0105c\u0105 iteracj\u0119 wewn\u0119trznej p\u0119tli continue z etykiet\u0105 -analogicznie return \u2013 powr\u00f3t z wykonywanej metody","title":"Instrukcje steruj\u0105ce (p\u0119tle i warunki)"},{"location":"Java%E2%98%95/java_podstawy/#klasa","text":"Definicja klasys k\u0142ada si\u0119 z nag\u0142\u00f3wka definicji klasy class nazwa_klasy (obligatoryjnie) specyfikacje: dost\u0119pu i dziedziczenia (opcjonalnie) bloku definicji klasy Specyfikacje domy\u015blne klasy: niepubliczna (istniej\u0105 restrykcje dost\u0119pu) nieabstrakcyjna (mo\u017cna tworzy\u0107 obiekty tej klasy) niefinalna (mo\u017ce mie\u0107 klasy pochodne) dziedziczy niejawnie po klasie Object nie implementuje niejawnie \u017cadnych interfejs\u00f3w Specyfikacje dodatkowe (niedomy\u015blne) klasy: public \u2013 klasa jest dost\u0119pna dla wszystkich klas (domy\u015blnie: tylko dla klas z tego samego pakietu) abstract \u2013 nie mo\u017cna tworzy\u0107 obiekt\u00f3w tej klasy final \u2013 nie mo\u017cna dziedziczy\u0107 z tej klasy extends klasa_bazowa \u2013 deklaruje dziedziczenie po klasie bazowej implements interfejs1, interfejs2 \u2013 deklaruje implementowanie jednego lub wi\u0119cej interfejs\u00f3w Blok definicji klasy \u2013 ograniczony par\u0105 nawias\u00f3w klamrowych, zawiera deklaracje wszystkich zmiennych sk\u0142adowych - p\u00f3l (w tym obiekt\u00f3w i p\u00f3l statycznych) deklaracje i definicje wszystkich funkcji sk\u0142adowych - metod (w tym metod wywo\u0142ywanych na rzecz obiektu lub metod statycznych) ewentualnie, definicje jednego lub wi\u0119cej konstruktor\u00f3w Konstruktory Nazwy konstruktor\u00f3w s\u0105 takie same jak nazwa konstruowanej klasy. Wywo\u0142ania konstruktor\u00f3w: new Stack(); new Stack(123); Odpowiednikiem destrukotr\u00f3w jest metoda finalize() Je\u015bli w klasie nie zdefiniowano \u017cadnego konstruktora, tworzony jest automatycznie domy\u015blny konstruktor (pusty) Klasy dziedzicz\u0105ce korzystaj\u0105 z konstruktora pustego, je\u017celi go nie ma to nale\u017cy samodzielnie wywo\u0142a\u0107 inny Konstruktory \u2013 specyfikacja dost\u0119pu private - \u017cadna inna klasa nie mo\u017ce bezpo\u015brednio u\u017cy\u0107 takiego konstruktora do tworzenia obiekt\u00f3w danej klasy protected \u2013 obiekty mog\u0105 by\u0107 tworzone przez klasy pochodne danej klasy i klasy nale\u017c\u0105ce do tego samego pakietu public - ka\u017cda klasa mo\u017ce tworzy\u0107 obiekty danej klasy brak specyfikatora dost\u0119pu - ka\u017cda klasa z tego samego pakietu mo\u017ce tworzy\u0107 obiekty danej klasy","title":"Klasa"},{"location":"Java%E2%98%95/java_podstawy/#pola-klasy","text":"Specyfikatory private , public , protected , (package) \u2013 specyfikacja dost\u0119pu static \u2013 deklaracja pola statycznego (przynale\u017cnego do klasy, a nie \u2013 jej obiekt\u00f3w) final \u2013 deklaracja pola sta\u0142ego transient \u2013 specyfikacja pola, kt\u00f3re nie powinno podlega\u0107 serializacji volatile \u2013 specyfikacja pola ulotnego, niepodlegaj\u0105cego optymalizacji: przypisanie zmiennej warto\u015bci odbywa si\u0119 zawsze w pami\u0119ci (wsp\u00f3\u0142dzielonej przez w\u0105tki), a nie w rejestrze procesora, wi\u0119c jest od razu widoczne dla wsp\u00f3\u0142bie\u017cnych w\u0105tk\u00f3w Dost\u0119p do p\u00f3l Specyfikator Dost\u0119pu Klasa Podklasa z tego samego pakietu Podklasy z innego pakietu Wszystkie klasy private \u2714\ufe0f protected \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f public \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f (package) \u2714\ufe0f \u2714\ufe0f *Tylko przy odwo\u0142aniu niejawnym do p\u00f3l klasy bazowej Pole i metoda jednej klasy mog\u0105 nosi\u0107 tak\u0105 sam\u0105 nazw\u0119: public class CircularBuffer { private float [] buffer ; // pole buffer private float [] buffer (); // metoda buffer }","title":"Pola klasy"},{"location":"Java%E2%98%95/java_podstawy/#inicjalizacja","text":"Sk\u0142adowe zwyk\u0142e i statyczne mog\u0105 by\u0107 inicjalizowane w miejscu deklaracji. Np.: public class StaticInit { static int MAX_LINES = 1000 ; int maxLines = 300 ; } Ograniczenia inicjalizowania w miejscu deklaracji: wykonywana tyko operatorem przypisania. tylko wyra\u017ceniem, kt\u00f3re nie deklaruje, \u017ce mo\u017ce zg\u0142osi\u0107 wyj\u0105tek. wyst\u0105pienie wyj\u0105tku w wyra\u017ceniu ko\u0144czy program. W ka\u017cdym innym przypadku trzeba u\u017cy\u0107 bloku statycznej inicjalizacji lub konstruktora. public class StaticInit { static int MAX_LINES ; static { //Przyk\u0142ad dla bloku inicjalizacji try { MAX_LINES = Integer . parseInt ( new java . util . Properties (). getProperty ( \"maxLinesLimit\" )); } catch ( Exception e ){ // obs\u0142uga wyj\u0105tku } } } Liczba blok\u00f3w statycznej inicjalizacji w programie jest dowolna (wykonywane wg ich kolejno\u015bci wyst\u0105pienia w kodzie \u017ar\u00f3d\u0142owym).","title":"Inicjalizacja"},{"location":"Java%E2%98%95/java_podstawy/#metody","text":"Deklaracja metody \u2013 specyfikacja poziomu dost\u0119pu typu wyniku nazwy listy argument\u00f3w formalnych (typy proste lub referencje do obiekt\u00f3w) public Object push(Object item) Wszystkie mo\u017cliwe elementy nag\u0142\u00f3wka definicji metody (w ich kolejno\u015bci) poziom dost\u0119pu - public , protected , package , private static - deklaruje metod\u0119 jako statyczn\u0105 abstract \u2013 metoda nie posiada definicji, jej klasa musi by\u0107 abstrakcyjna final - nie mo\u017ce by\u0107 nadpisana przez metody klas pochodnych native - metoda rodzima, napisana w innym j\u0119zyku programowania synchronized \u2013 mo\u017ce by\u0107 jednocze\u015bnie wykonywana (na rzecz konkretnego obiektu) tylko przez jeden w\u0105tek typ wyniku OBOWI\u0104ZKOWE nazwa metody OBOWI\u0104ZKOWE lista parametr\u00f3w (w nawiasach) OBOWI\u0104ZKOWE throws wyj\u0105tki - lista wyj\u0105tk\u00f3w zg\u0142aszanych przez metod\u0119 Wynik metody Mo\u017cna zwr\u00f3ci\u0107 nic - void return; zmienn\u0105 np int return 10; obiekt (referencja) np. return new String(); Metody przeci\u0105\u017cone r\u00f3\u017cni\u0105 si\u0119 liczb\u0105 lub typem parametr\u00f3w Metoda nadpisana (polimorficzna) ma t\u0119 sam\u0105 sygnatur\u0119, co metoda w klasie bazowej. Nie mo\u017ce rozszerza\u0107 zbioru zg\u0142aszanych wyj\u0105tk\u00f3w. Odwo\u0142ania w metodach this -odwo\u0142anie do obiektu, na rzecz kt\u00f3rego wykonywana jest metoda super - odwo\u0142anie do \"nadobiektu\", okre\u015blonego przez klas\u0119 bazow\u0105","title":"Metody"},{"location":"Java%E2%98%95/java_podstawy/#dziedziczenie","text":"Mo\u017cna dziedziczy\u0107 (extends) tylko z jednej klasy Wszystkie obiekty dziedzicz\u0105 (niejawnie, obowi\u0105zkowo, po\u015brednio lub bezpo\u015brednio) z klasy java.lang.Object Klasa pochodna dziedziczy wszystkie sk\u0142adowe, kt\u00f3re s\u0105 dost\u0119pne dla niej i kt\u00f3rych sama nie przes\u0142ania (pola) lub nie nadpisuje (metody) Konstruktor\u00f3w nie dziedziczy si\u0119 Nadpisana metoda mo\u017ce deklarowa\u0107 zg\u0142aszanie tylko podzbioru wyj\u0105tk\u00f3w zg\u0142aszanych przez metod\u0119 dziedziczon\u0105. Specyfikator dost\u0119pu do metody nadpisanej mo\u017ce zezwoli\u0107 na wi\u0119kszy dost\u0119p ni\u017c metoda dziedziczona ale nie na mniejszy. Np. metoda chroniona (protected) w klasie bazowej mo\u017ce zosta\u0107 upubliczniona, ale nie \"uprywatniona\" Metody klasy bazowej, kt\u00f3rych nie mo\u017cna nadpisa\u0107 w klasie pochodnej: metoda zadeklarowana jako final w klasie bazowej metoda statyczna (mo\u017cna jedynie ukry\u0107 metod\u0119 statyczn\u0105 dziedziczon\u0105 przez jej ponowne zadeklarowanie) Metody klasy bazowej, kt\u00f3re musz\u0105 zosta\u0107 nadpisane w klasie pochodnej: metody zadeklarowane jako abstrakcyjne w klasie bazowej wszystkie metody bazowej klasy abstrakcyjnej Dziedziczenie po java.lang.Object Metody klasy Object, kt\u00f3re mog\u0105 by\u0107 nadpisane: clone equals, hashCode - por\u00f3wnywanie obiekt\u00f3w finalize - destruktor toString - zamienia obiekt w klas\u0119 String pozwalaj\u0105c na \"tekstowy wydruk\" zawarto\u015bci za pomoc\u0105 System.out.println Metody final (nie mog\u0105 by\u0107 nadpisane): getClass -Metoda zwraca reprezentacj\u0119 \"run-time\" klasy obiektu w postaci obiektu typu Class. Mo\u017cna dowiedzie\u0107 si\u0119 z niego o nazwie klasy, jej klasie bazowej i interfejsach, kt\u00f3re implementuje klasa void PrintClassName ( Object obj ) { System . out . println ( \"Klasa obiektu to \" + obj . getClass (). getName ()); } Object createNewInstanceOf ( Object obj ) { return obj . getClass (). newInstance (); //Nowa instancja tego samego obiektu } notify notifyAll wait","title":"Dziedziczenie"},{"location":"Java%E2%98%95/java_podstawy/#interfejs","text":"Interfejs \u2013 typ referencyjny, zawieraj\u0105cy deklaracje metod, implementacje domy\u015blne metod, pola sta\u0142e, metody statyczne, interfejsy i klasy [ modyfikatory ] interface NazwaInterfejsu [ extends Interfejs1 , \u2026 ] { // cia\u0142o interfejsu } Interfejs jest domy\u015blnie publiczny i obowi\u0105zkowo abstrakcyjny Metody interfejsu \u2013 domy\u015blnie publiczne ; albo abstrakcyjne, albo domy\u015blne, albo statyczne Pola interfejsu \u2013 domy\u015blnie publiczne , statyczne i finalne. Przyk\u0142ad interface A { int i = 2 ;} interface B { void foo ();} interface C extends A , B { int i = 3 ; //przes\u0142oni to i z interfejsu A } class D implements C { void foo (){ System . out . println ( i );} } implementacje domy\u015blne i statyczne metod public interface Addressable { String getStreet (); String getCity (); default String getFullAddress () { return getStreet () + \", \" + getCity (); } static void foo (){ System . out . println ( \"foo\" ); } Umo\u017cliwiaj\u0105 zdefiniowanie metod, kt\u00f3rych dzia\u0142anie jest niezale\u017cne od potencjalnych sposob\u00f3w implementacji interfejsu. Metody domy\u015blne mog\u0105 by\u0107 nadpisywane w klasach implementuj\u0105cych interfejs.","title":"Interfejs"},{"location":"Java%E2%98%95/java_podstawy/#wyjatki","text":"Java wymaga, aby metody obs\u0142ugiwa\u0142y lub specyfikowa\u0142y wszystkie sprawdzalne wyj\u0105tki, kt\u00f3re mog\u0105 wyst\u0105pi\u0107 podczas wykonania programu. Wyj\u0105tki, kt\u00f3re s\u0105 powodowane przez z\u0142\u0105 logik\u0119 samego programu (np. b\u0142\u0119dy arytmetyczne lub b\u0142\u0119dy dost\u0119pu do pami\u0119ci danych programu), nie s\u0105 sprawdzane przez kompilator. Nie ma wymogu ich obs\u0142ugi lub deklarowania ich wyst\u0105pienia. Np. s\u0105 nimi: wyj\u0105tki arytmetyczne (np. dzielenie przez zero), wyj\u0105tki wskaza\u0144 (np. pr\u00f3ba odwo\u0142ania do obiektu poprzez zerow\u0105 referencj\u0119, pr\u00f3ba rzutowania na obiekt niew\u0142a\u015bciwej klasy), wyj\u0105tki indeksowania (np. odwo\u0142anie do elementu tablicy poprzez z\u0142y indeks). Wyrzucenie wyj\u0105tku: throw obiekt Obs\u0142uga: try { instrukcje // tu mo\u017ce wyst\u0105pi\u0107 throw } catch ( typ_wyj\u0105tku | inny_typ nazwa ) { // obs\u0142uga wyj\u0105tk\u00f3w dw\u00f3ch typ\u00f3w instrukcje } finally { // wykonywana zawsze niezale\u017cnie od zaistnienia wyj\u0105tku instrukcje } Jako wyj\u0105tek mo\u017ce by\u0107 zg\u0142oszony jedynie obiekt klasy Throwable lub klasy pochodnej od Throwable. W innym razie wyst\u0105pi b\u0142\u0105d kompilacji Hierarchia klas wyj\u0105tk\u00f3w Error . B\u0142\u0105d dynamicznej konsolidacji programu lub inny \"ci\u0119\u017cki\" b\u0142\u0105d w JVM. Programy nie powinny obs\u0142ugiwa\u0107 ani zg\u0142asza\u0107 takich wyj\u0105tk\u00f3w. (b\u0142\u0105d w maszynie albo np brak pami\u0119ci itp.) Exception . Jest to klasa bazowa wyj\u0105tk\u00f3w w programach Javy. S\u0105 ju\u017c liczne klasy pochodne tej klasy, np. IllegalAccessException, NegativeArraySizeException. RuntimeException . Specjalna klasa pochodna od Exception, kt\u00f3ra dotyczy wyj\u0105tk\u00f3w niesprawdzalnych, zg\u0142aszanych przez Runtime (\u015brodowisko czasu wykonania programu). np dzielenie przez 0 Delegowanie wyj\u0105tk\u00f3w \"w g\u00f3r\u0119\" public class Example3 { public static void notMainYet ( String [] args ) throws IOException { try ( BufferedReader br = new BufferedReader ( new FileReader ( \"/testing.txt\" ))) { String line ; while (( line = br . readLine ()) != null ) { System . out . println ( line ); } } } try { notMainYet ( null ); } catch ( IOException e ){ e . getSuppressed (); // zwraca tablic\u0119 wyj\u0105tk\u00f3w powsta\u0142ych przy zwalnianiu zasob\u00f3w } Kompilator automatycznie generuje niejawny blok finally z kodem bezpiecznie zamykaj\u0105cym zasoby.","title":"Wyj\u0105tki"},{"location":"Java%E2%98%95/java_podstawy/#modu","text":"Modu\u0142 grupuje powi\u0105zane ze sob\u0105 pakiety, okre\u015blaj\u0105c, kt\u00f3re z nich zostan\u0105 udost\u0119pnione oraz to jakie pakiety i modu\u0142y s\u0105 jemu potrzebne. Budowa: Katalog bazowy (root direcotry) modu\u0142u nazwany tak samo jak nazwa modu\u0142u. deskryptor modu\u0142u module-info.java -zawiera opis modu\u0142u module com . mycompany . factories { exports com . mycompany . interfaces ; //exports opisuje kt\u00f3re paczki maj\u0105 by\u0107 dost\u0119pne w pozosta\u0142ych modu\u0142ach exports com . mycompany . factories ; requires modulename ; //requires opisujeod jakich modu\u0142\u00f3w zale\u017cy ten modu\u0142 } exports and exports\u2026to. An exports module directive specifies one of the module\u2019s packages whose public types (and their nested public and protected types) should be accessible to code in all other modules. An exports\u2026to directive enables you to specify in a comma-separated list precisely which module\u2019s or modules\u2019 code can access the exported package\u2014this is known as a qualified export. uses. A uses module directive specifies a service used by this module\u2014making the module a service consumer. A service is an object of a class that implements the interface or extends the abstract class specified in the uses directive. provides\u2026with. A provides\u2026with module directive specifies that a module provides a service implementation\u2014making the module a service provider. The provides part of the directive specifies an interface or abstract class listed in a module\u2019s uses directive and the with part of the directive specifies the name of the service provider class that implements the interface or extends the abstract class. //TODO javac --module-source-path . -d out -m com.mycompany.factories import com.mycompany.interfaces.* ; import com.mycompany.factories.* ; public class Test { public static void main ( String args [] ){ RestClientInterface i = RestClientFactory (). makeClient ( null , null ); String [] query = { \"key?2389fg38\" , \"loc:21.1,50.9\" }; i . runQuery ( query ); } } Kompilacja: javac --module-path out --add-modules com.mycompany.factories Test.java Uruchomienie: java --module-path out --add-modules com.mycompany.factories Test //TODO Beans + Swing (w3 i w4 w6)","title":"Modu\u0142"},{"location":"Java%E2%98%95/java_podstawy/#programowanie-wspobiezne","text":"Uruchomienie nowego w\u0105tku \u2013 zadanie do wykonania przez nowy w\u0105tek zdefiniowane w metodzie run() S\u0105 2 sposoby: Klasa implementuj\u0105ca Runnable public class MyRunnable implements Runnable { public void run () { System . out . println ( \"Hello from a thread!\" ); } public static void main ( String args [] ) { ( new Thread ( new MyRunnable ())). start (); } } Klasa dziedzicz\u0105ca po Thread public class HelloThread extends Thread { public void run () { System . out . println ( \"Hello from a thread!\" ); } public static void main ( String args [] ) { ( new HelloThread ()). start (); } }","title":"Programowanie wsp\u00f3\u0142bie\u017cne"},{"location":"Java%E2%98%95/java_podstawy/#diagram-stanow-watku","text":"class MyThread extends Thread { public void run (){ \u2026 }}","title":"Diagram stan\u00f3w w\u0105tku"},{"location":"Java%E2%98%95/java_podstawy/#przyczyny-blokowania-watkow","text":"III public class Test3 { public static void main ( String args [] ) { Thread p = new Producent (); p . setDaemon ( true ); p . start (); try { p . join (); //join-oczekiwanie } catch ( InterruptedException e ) { e . printStackTrace (); } } } IV s\u0142owo kluczowe synchronized sprawia, \u017ce dane obiekty /metody nie mog\u0105 by\u0107 u\u017cywane dednocze\u015bnie przez kilka w\u0105tk\u00f3w i je\u017celi jeden w\u0105tek w\u0142a\u015bnie korzysta z takiego obiektu to wszystkie pozosta\u0142e musz\u0105 poczeka\u0107 class Schowek { int wartosc = - 1 ;} class Producent [ \u2026 ] Schowek schowek ; Producent ( Schowek s ) { schowek = s }; public void run [ \u2026 ] System . out . print ( \" p\" + i ); synchronized ( schowek ) { schowek . wartosc = i ; } [ \u2026 ] class Konsument [ \u2026 ] public void run () { try { for ( int i = 0 ; i < 6 ; i ++ ) { int w ; synchronized ( schowek ) { w = schowek . wartosc ; } System . out . print ( \" k\" + w ); sleep (( long )( Math . random () * 3000 )); } } [ \u2026 ] public static void main ( String args [] ) { Schowek s = new Schowek (); Thread p = new Producent ( s ); Thread k = new Konsument ( s ); [ \u2026 ] V Tak jak ma to miejsce w monitorach class Schowek [ \u2026 ] boolean jestZapelniony = false ; [ \u2026 ] class Producent [ \u2026 ] synchronized ( schowek ) { while ( schowek . jestZapelniony ) schowek . wait (); schowek . wartosc = i ; schowek . jestZapelniony = true ; schowek . notifyAll (); } [ \u2026 ] class Konsument [ \u2026 ] synchronized ( schowek ) { while ( ! schowek . jestZapelniony ) schowek . wait (); w = schowek . wartosc ; schowek . jestZapelniony = false ; schowek . notifyAll (); } Przy takim schemacie dzia\u0142ania nale\u017cy zawsze: Sprawdza\u0107 zmienn\u0105 warunkow\u0105 w schemacie while(warunek) wait() [\u2026] notify/All() Pami\u0119ta\u0107 o nadaniu zmiennej warunkowej odpowiedniej warto\u015bci (unikanie zakleszcze\u0144) Obs\u0142ugiwa\u0107 monitor po zaj\u0119ciu zamka (IllegalStateException)","title":"Przyczyny blokowania w\u0105tk\u00f3w"},{"location":"Java%E2%98%95/java_podstawy/#javautilconcurrentlocks","text":"Obiekty u\u0142atwiaj\u0105ce synchronizacj\u0119 w\u0105tk\u00f3w - Po\u0142\u0105czenie funkcjonalno\u015bci zamka i monitora w jednym obiekcie, implementuj\u0105cym interfejs Lock U\u0142atwienie podzia\u0142u i obs\u0142ugi w\u0105tk\u00f3w oczekuj\u0105cych na zas\u00f3b ze zr\u00f3\u017cnicowanymi warunkami wznowienia \u2013 obiekt Condition Dodatkowe mo\u017cliwo\u015bci, w zale\u017cno\u015bci od implementacji \u2013 np. wyb\u00f3r strategii aktywacji w\u0105tk\u00f3w wznawianych do wykonania ( ReentrantLock ) void schowaj ( int i ) [ \u2026 ] zamek . lock (); while ( ! warunek_zapisu ) zapis . await (); [ \u2026 ] // zapis do bufora odczyt . signal (); [ \u2026 ] finally { zamek . unlock ();} void schowaj ( int i ) [ \u2026 ] zamek . lock (); while ( ! warunek_zapisu ) zapis . await (); [ \u2026 ] // zapis do bufora odczyt . signal (); [ \u2026 ] finally { zamek . unlock ();} //TODO fork/join","title":"java.util.concurrent.locks.*"},{"location":"Java%E2%98%95/java_podstawy/#siec","text":"Dwa podstawowe rodzaje protoko\u0142\u00f3w oparte na IP: \u25aa TCP \u2013 Transmission Control Protocol \u2013 po\u0142\u0105czeniowy kontroluje poprawno\u015b\u0107 przes\u0142anych danych, dostosowuje si\u0119 do przepustowo\u015bci \u0142\u0105cza, wymagaj\u0105c informacji zwrotnej od odbiorcy \u25aa UDP \u2013 User Datagram Protocol \u2013 bezpo\u0142\u0105czeniowy ca\u0142e sterowanie transmisj\u0105 pozostawione u\u017cytkownikowi, mo\u017cliwo\u015b\u0107 transmisji rozg\u0142oszeniowej Pakiet java.net zawiera podstawowe klasy zwi\u0105zane z komunikacj\u0105 sieciow\u0105: URL, socket i pochodne, itp TCP - przyk\u0142adowy serwer: import ... public class MyHttpServer { public static void main ( String [] args ) throws Exception { ServerSocket sSocket = new ServerSocket ( 1777 ); while ( true ) { Socket newSocket = sSocket . accept (); //zawiesza w oczekiwaniu na po\u0142\u0105czenie OutputStream os = newSocket . getOutputStream (); StringBuffer sb = new StringBuffer (); sb . append ( \"HTTPServer works!\" ); byte [] byteArray = sb . toString (). getBytes (); os . write ( \"HTTP/1.0 200 OK\\n\" . getBytes ()); os . write ( new String ( \"Content-Length: \" + byteArray . length + \"\\n\" ). getBytes ()); os . write ( \"Content-Type: text/html\\n\\n\" . getBytes ()); os . write ( byteArray ); os . flush (); os . close (); br . close (); newSocket . close (); } } } http://www.java2s.com/Code/Java/Network-Protocol/BufferedReaderforServerSocket.htm","title":"Sie\u0107"},{"location":"Java%E2%98%95/java_podstawy/#rmi-remote-method-invocation","text":"Pozwala odnosi\u0107 si\u0119 poprzez referencj\u0119 do obiekt\u00f3w na innych maszynach Hello world of RMI \u2013 wywo\u0142anie zwrotne Klient udost\u0119pnia us\u0142ug\u0119: public interface Callback extends Remote { public void callback () throws RemoteException ; } public static class CallbackImpl extends UnicastRemoteObject implements Callback { protected CallbackImpl () throws RemoteException { super (); } public void callback (){ System . out . println ( \"Hello from the callback\" ); } } Serwer definiuje now\u0105 us\u0142ug\u0119 (asynchroniczn\u0105): public void hello ( Object o ) throws RemoteException { (( Client . Callback ) o ). callback (); } Wywo\u0142anie u klienta: worker . hello ( UnicastRemoteObject . toStub ( new CallbackImpl ()));","title":"RMI - Remote Method Invocation"},{"location":"Java%E2%98%95/java_podstawy/#java-messaging-system-jms","text":"Komunikacja pomi\u0119dzy wieloma JVM \u2013 typowe zadania: \u25aa kolejka komunikat\u00f3w (z buforowaniem) \u25aa transmisja rozg\u0142oszeniowa do wybranych odbiorc\u00f3w \u25aa filtrowanie komunikat\u00f3w w transmisji rozg\u0142oszeniowej \u25aa synchroniczne i asynchroniczne modele komunikacji \u25aa zarz\u0105dzanie trwa\u0142o\u015bci\u0105 i wa\u017cno\u015bci\u0105 komunikat\u00f3w (data wa\u017cno\u015bci, priorytet, przechowywanie, gdy nie ma odbiorcy) \u25aa gwarancja dostarczenia \u25aa grupowanie serii komunikat\u00f3w w niepodzieln\u0105 transakcj\u0119 \u25aa r\u00f3wnie\u017c: komunikacja z komponentami stworzonymi w innych j\u0119zykach //TODO jms","title":"Java Messaging System (JMS)"},{"location":"Java%E2%98%95/java_podstawy/#atrybuty-systemowe","text":"S\u0105 to dane na temat \u015brodowiska takie jak: nazwa komputera nazwa u\u017cytkownika katalog roboczy identyfikator systemu operacyjnego itp Atrybuty przechowywane w postaci par: (nazwa,warto\u015b\u0107). Ustawiane na trzy sposoby: \u0142adowane przez klas\u0119 java.util.Properties \u2013 na spos\u00f3b trwa\u0142y mi\u0119dzy uruchomieniami maszyny wirtualnej poprzez argumenty wiersza polece\u0144 \u2013 na czas wykonania aplikacji -Dnazwa=warto\u015b\u0107 poprzez parametry apletu \u2013 na czas wykonania apletu Metody klasy Properties: contains(Object value) , containsKey(Object key) \u2013 sprawdzaj\u0105, czy obiekt zawiera dan\u0105 warto\u015b\u0107 b\u0105d\u017a nazw\u0119 atrybutu (podawane jako String) getProperty(String key) , getProperty(String key, String default) \u2013zwraca warto\u015b\u0107 danego atrybutu / warto\u015b\u0107 domy\u015bln\u0105 je\u015bli atrybut nie istnieje setProperty(String key, String value) \u2013 zapisuje warto\u015b\u0107 atrybutu list(PrintStream s) , list(PrintWriter w) \u2013 zapisuje wszystkie w\u0142asno\u015bci do strumienia elements() , keys() \u2013 zwraca iteratory warto\u015bci i nazw atrybut\u00f3w load(From)/store(ToXML) \u2013 umo\u017cliwia pobranie/zapis atrybut\u00f3w (w formacie XML) Za\u0142adowanie atrybut\u00f3w przy starcie Properties p = new Properties (); FileInputStream is = new FileInputStream ( \"my.properties\" ); p . load ( is ); is . close (); Odczyt/wykorzystanie/modyfikacja atrybut\u00f3w podczas pracy programu Zapami\u0119tanie (zmodyfikowanych) atrybut\u00f3w przy wyj\u015bciu z programu FileOutputStream os = new FileOutputStream ( \"my.properties\" ); p . store ( os , \"---No Comment---\" ); os . close (); Nazwa atrybutu Opis file.separator separator nazw plik\u00f3w i katalog\u00f3w java.class.path \u015bcie\u017cka przeszukiwania klas Javy java.class.version wersja biblioteki systemowej Javy java.home katalog, w kt\u00f3rym zainstalowano Jav\u0119 java.vendor nazwa producenta u\u017cywanego JRE java.vendor.url adres www producenta u\u017cywanego JRE java.version wersja Javy line.separator separator wierszy tj. znak nowego wiersza os.arch architektura sprz\u0119towa syst. operacyjnego os.name nazwa systemu operacyjnego os.version wersja systemu operacyjnego path.separator separator wpis\u00f3w na \u015bcie\u017cce (set) user.dir katalog roboczy user.home katalog domowy u\u017cytkownika user.name nazwa u\u017cytkownika uruchamiaj\u0105cego JRE","title":"Atrybuty Systemowe"},{"location":"Java%E2%98%95/java_podstawy/#runtime","text":"Wi\u0119kszo\u015b\u0107 potrzeb aplikacji dost\u0119pu do systemu obs\u0142uguje klasa System. W rzadkich przypadkach aplikacja mo\u017ce odwo\u0142a\u0107 si\u0119 bezpo\u015brednio do \u015brodowiska czasu wykonania, reprezentowanego przez jeden obiekt klasy java.lang.Runtime, b\u0119d\u0105cy sprz\u0119giem aplikacji ze \u015brodowiskiem wykonania VM w systemie operacyjnym. public static Runtime getRuntime (); //zwraca akt. obiekt Runtime Obiekt Runtime umo\u017cliwia m.in. \u2022 wykonanie programu funkcj\u0105 systemow\u0105 exec \u2022 pobranie informacji o liczbie dost\u0119pnych procesor\u00f3w, pami\u0119ci operacyjnej \u2022 zlecenie za\u0142adowania biblioteki dynamicznej \u2022 bezwarunkowe zatrzymanie maszyny wirtualnej //TODO wy\u017cej te\u017c s\u0105 todo","title":"Runtime"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/","text":"Bash - podstawowe komendy \u015bci\u0105gawka Szukanie pomocy Sprawdzanie co jest czym oraz do czego s\u0142u\u017cy man - manual apropos - wyszukujemy nim s\u0142\u00f3w kluczowych (np w opisach program\u00f3w etc) whatis - file - opisuje typ pliku Wyra\u017cenia regularne link do regex\u00f3w Pliki Szukanie plik\u00f3w find -name a*n.java Rozmiary folder\u00f3w domy\u015blne ls ni pokauje rozmiar\u00f3w folder\u00f3w. Do tego nale\u017cy u\u017cy\u0107 komandy du du -s /home/ja Przydatne flagi: -s -poka\u017c tylko wybrany folder bez podfolder\u00f3\u0153 -h - human readable, zaokr\u0105gla do GB, MB etc. --max-depth=2 - maksymalna g\u0142\u0119boko\u015b\u0107 przy pokazywaniu podfolder\u00f3w Pisanie do plik\u00f3w Ka\u017cda aplikacja ma wej\u015bcie ( stdin ) oraz dwa wyj\u015bcia ( stdout -zwyk\u0142e i stderr -dla b\u0142\u0119d\u00f3w) Z pomoc\u0105 poni\u017cszych komend mo\u017cemy przekierowywa\u0107 wyj\u015bcia program\u00f3w do urz\u0105dze\u0144 lub plik\u00f3w Komenda Dzia\u0142anie < deviceredirects stdin to the device >> deviceredirects stdout to the device (appends to the end) > device redirects stdout to the device (overwrites previous content) 2> device redirects stderr to the device (overwrites previous content) 2>&1 redirects stderr to the device associated to stdout cat logi.log | grep \"10-10-2022\" > logs_from_10-10-2022.log Obr\u00f3bka tekstu Wyszukiwanie wzorca cat PLIKI | grep wyszukiwane_slowo grep -r . #przeszukanie wszystkich plik\u00f3w (nawet binarnych) w danym folderze strings s\u0142u\u017cy do wypisywania string\u00f3w z plik\u00f3w binarnych (dobrze wsp\u00f3\u0142dzia\u0142a z grep) strings PLIK Inne przydatne flagi grepa -v --invert-match odwr\u00f3cony grep, przekazuje tylko to, co nie pasuje -B , --before-context=ILE Wypisz ILE linii po przed znaleziskiem wy\u015bwietli\u0107 -A , --after-context=ILE Wypisz ILE linii po znalezisku wy\u015bwietli\u0107 Dzielenie d\u0142u\u017cszych \u0142a\u0144cuch\u00f3w znak\u00f3w cut - proste wycinanie fragment\u00f3w tekstu -b byte - wydziela poszczeg\u00f3lne bajty echo \"abcdefgh\" | cut -b 1 ,3,5-6 # acef echo \"qwer tyui xxx\" | cut -d \" \" -f 2 #-d delimiter (separator) -f pole #tyui -f przyjmuje liczby w nast\u0119puj\u0105cych formatach: N , N-M , -M , N- , X,Y,Z head - s\u0142u\u017cy do pokazywania tylko wybranych linii. cat ./dlugi_plik.log | head -n 100 #drukuje tylko 100 pierwszych linii W wypadku, gdy chcemy wydzieli\u0107 sam\u0105 nazw\u0119 pliku ze \u015bcie\u017cki warto u\u017cy\u0107 komendy basename basename /sciezka/do/pliku/plik.txt # plik.txt Manipulacja tekstem sed s\u0142u\u017cy do nieco bardziej zaawansowanych manipulacji echo \"abcdefbc\" | sed \"s/bc/BC/\" # zamie\u0144 pierwszy pasuj\u0105cy ci\u0105g (bc) na BC #aBCdefbc TODO Zmienne Zmienn\u0105 tworzymy za pomoc\u0105 znaku = , kt\u00f3ry przypisuje warto\u015b\u0107 do dane identyfikatora. identyfikator=warto\u015b\u0107 . Aby uzyska\u0107 dost\u0119p do zawarto\u015bci u\u017cywamy $ przed nazw\u0105 zmiennej. $ msg = \u201dHello World\u201d $ echo $msg Hello World Wstawianie zmiennych w tekst Jest kilka sposob\u00f3w, aby mie\u0107 w sktyptach tekst, kt\u00f3ry jest zale\u017cny od sytuacji. Mo\u017cemy do tego wykorzystywa\u0107: Zmienne /my/path/to/${EDITED_FILE} Wyniki funkcji ` dsd Argumenty Ka\u017cda funkcja, czy te\u017c skrypt bashowy mo\u017ce mie\u0107 przekazywane poprzez proste podanie ich po wywo\u0142aniu. Dla skryptu: #!/bin/bash wyprintuj_argument () { #tutaj odwo\u0142ujemy si\u0119 do pierwszego argumentu przekazanego do funkcji #a nie do skryptu echo \"argument $1 \" } wyprintuj_argument $1 wyprintuj_argument $2 przy wywo\u0142aniu ./skr.sh Hello 222 Otrzymamy argument Hello argument 222 Zwroty przydatne przy obs\u0142udze argument\u00f3w $0 Nazwa wo\u0142anej komendy/skryptu $1 $2 $3 poszczeg\u00f3lne argumenty (pierwszy, drugi, trzeci) $# Liczba argument\u00f3w $* Wszystkie argumenty jako jeden string $@ Wszystkie argumenty jako lista xargs Je\u015bli chcemy wykorzystywa\u0107 wyj\u015bcia mechanizm strumieni do przekazywania argument\u00f3w to mo\u017cemy u\u017cy\u0107 tak\u017ce komendy xargs #Wywo\u0142anie komendy rm dla ka\u017cdego znalezionego pliku find /path -type f -print | xargs rm Flagi: -n - maksymalna liczba argument\u00f3w -d , --delimiter - podzia\u0142 na cz\u0119\u015bci (komenda zostanie wywo\u0142ana wielokrotnie) echo -n 123 -456-7890 | xargs echo #> 123-456-7890 echo -n \"123-456-789\" | xargs -n 1 -d - echo #> 123 #> 456 #> 789 -I , -i , --replace= pozwala na elastyczne wstawianie otrzymanego argumentu #Stworzy pliki 123.txt 456.txt 789.txt echo -n \"123-456-789\" | xargs -d - -n 1 -I {} echo {} .txt Procesy \u0141\u0105czniki: && -wykonaj kolejny proces, je\u015bli poprzedni si\u0119 powiedzie (retcode 0) || - wykonaj nast\u0119pny, gdy poprzedni to pora\u017cka & - proces jest utuchamiany w tle (jego pid mo\u017cna zdoby\u0107 za pomoc\u0105 $! ) TODO wi\u0119cej Warunki Warunki sprawdza si\u0119 za pomoc\u0105 komendy test z odpowiednimi flagami. Mo\u017cna to tak\u017ce robi\u0107 za pomoc\u0105 wmieszczaj\u0105c warunek w nawiasach [] . Mo\u017cliwy jest te\u017c wariant z dwoma nawiasami [[ co\u015btam ]] jest on wspierany przez wszystkie nowsze systemy u\u017cywaj\u0105ce Basha, ale mimo wszystko mo\u017ce byc on niekompatybilny ze starszymi. Warto pami\u0119ta\u0107, \u017ce bardzo wa\u017cne tu s\u0105 spacje i aby o nich nie zapomnie\u0107. Samo test jako komenda nie robi nic po prostu sprawdza warunek i zale\u017cnie od niego zwraca jaki\u015b kod. [ 1 -gt 100 ] echo \"Ret: $? \" #zwraca kod ostatnio dzia\u0142aj\u0105cej aplikacji # Ret: 1 [ 100 -gt 1 ] echo \"Ret: $? \" # Ret: 0 Operator Description ! EXPRESSION The EXPRESSION is false. -n STRING The length of STRING is greater than zero. -z STRING The lengh of STRING is zero (ie it is empty). STRING1 = STRING2 STRING1 is equal to STRING2 STRING1 != STRING2 STRING1 is not equal to STRING2 INTEGER1 -eq INTEGER2 INTEGER1 is numerically equal to INTEGER2 INTEGER1 -gt INTEGER2 INTEGER1 is numerically greater than INTEGER2 INTEGER1 -lt INTEGER2 INTEGER1 is numerically less than INTEGER2 -d FILE FILE exists and is a directory. -e FILE FILE exists. -r FILE FILE exists and the read permission is granted. -s FILE FILE exists and it's size is greater than zero (ie. it is not empty). -w FILE FILE exists and the write permission is granted. -x FILE FILE exists and the execute permission is granted. Dopiero po po\u0142\u0105czeniu z wyra\u017ceniami warunkowymi si\u0119 przydaje. Uwagi = oraz -eq dzia\u0142aj\u0105 inaczej np 01 = 1 da fa\u0142sz, ale 01 -eq 1 da prawd\u0119 Warunki if #nie musi tu by\u0107 koniecznie test, mo\u017ce to by\u0107 dowolna. Je\u015bli zwraca ona 0 to mamy sukces i wchodzimy do \u015brodka if apka_zwracaj\u0105ca_jaki\u015b_kod then komendy fi #wariant z else if apka_zwracaj\u0105ca_jaki\u015b_kod then komendy else inne komendy fi P\u0119tle for - iteruje po li\u015bcie for variable in valuelist do something done List\u0105 mog\u0105 by\u0107 argumenty programu #!/bin/bash echo The number of arguments is: $# echo The entered command line is: $0 $@ echo The command arguments are: for i in \" $@ \" do echo $i done ... albo pliki w folderze for k in * do cp $k $k .bak echo $k copy created done lub wynik komendy (u\u017cywamy do tego $() ) for i in $( ls ) do echo $i done //TODO opis skr\u00f3t\u00f3w klawiszowych Ctrl-C Ctrl-D etc // https://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/","title":"Bash - podstawowe komendy \u015bci\u0105gawka"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#bash-podstawowe-komendy-sciagawka","text":"","title":"Bash - podstawowe komendy \u015bci\u0105gawka"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#szukanie-pomocy","text":"Sprawdzanie co jest czym oraz do czego s\u0142u\u017cy man - manual apropos - wyszukujemy nim s\u0142\u00f3w kluczowych (np w opisach program\u00f3w etc) whatis - file - opisuje typ pliku","title":"Szukanie pomocy"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#wyrazenia-regularne","text":"link do regex\u00f3w","title":"Wyra\u017cenia regularne"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#pliki","text":"","title":"Pliki"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#szukanie-plikow","text":"find -name a*n.java","title":"Szukanie plik\u00f3w"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#rozmiary-folderow","text":"domy\u015blne ls ni pokauje rozmiar\u00f3w folder\u00f3w. Do tego nale\u017cy u\u017cy\u0107 komandy du du -s /home/ja Przydatne flagi: -s -poka\u017c tylko wybrany folder bez podfolder\u00f3\u0153 -h - human readable, zaokr\u0105gla do GB, MB etc. --max-depth=2 - maksymalna g\u0142\u0119boko\u015b\u0107 przy pokazywaniu podfolder\u00f3w","title":"Rozmiary folder\u00f3w"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#pisanie-do-plikow","text":"Ka\u017cda aplikacja ma wej\u015bcie ( stdin ) oraz dwa wyj\u015bcia ( stdout -zwyk\u0142e i stderr -dla b\u0142\u0119d\u00f3w) Z pomoc\u0105 poni\u017cszych komend mo\u017cemy przekierowywa\u0107 wyj\u015bcia program\u00f3w do urz\u0105dze\u0144 lub plik\u00f3w Komenda Dzia\u0142anie < deviceredirects stdin to the device >> deviceredirects stdout to the device (appends to the end) > device redirects stdout to the device (overwrites previous content) 2> device redirects stderr to the device (overwrites previous content) 2>&1 redirects stderr to the device associated to stdout cat logi.log | grep \"10-10-2022\" > logs_from_10-10-2022.log","title":"Pisanie do plik\u00f3w"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#obrobka-tekstu","text":"","title":"Obr\u00f3bka tekstu"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#wyszukiwanie-wzorca","text":"cat PLIKI | grep wyszukiwane_slowo grep -r . #przeszukanie wszystkich plik\u00f3w (nawet binarnych) w danym folderze strings s\u0142u\u017cy do wypisywania string\u00f3w z plik\u00f3w binarnych (dobrze wsp\u00f3\u0142dzia\u0142a z grep) strings PLIK Inne przydatne flagi grepa -v --invert-match odwr\u00f3cony grep, przekazuje tylko to, co nie pasuje -B , --before-context=ILE Wypisz ILE linii po przed znaleziskiem wy\u015bwietli\u0107 -A , --after-context=ILE Wypisz ILE linii po znalezisku wy\u015bwietli\u0107","title":"Wyszukiwanie wzorca"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#dzielenie-duzszych-ancuchow-znakow","text":"cut - proste wycinanie fragment\u00f3w tekstu -b byte - wydziela poszczeg\u00f3lne bajty echo \"abcdefgh\" | cut -b 1 ,3,5-6 # acef echo \"qwer tyui xxx\" | cut -d \" \" -f 2 #-d delimiter (separator) -f pole #tyui -f przyjmuje liczby w nast\u0119puj\u0105cych formatach: N , N-M , -M , N- , X,Y,Z head - s\u0142u\u017cy do pokazywania tylko wybranych linii. cat ./dlugi_plik.log | head -n 100 #drukuje tylko 100 pierwszych linii W wypadku, gdy chcemy wydzieli\u0107 sam\u0105 nazw\u0119 pliku ze \u015bcie\u017cki warto u\u017cy\u0107 komendy basename basename /sciezka/do/pliku/plik.txt # plik.txt","title":"Dzielenie d\u0142u\u017cszych \u0142a\u0144cuch\u00f3w znak\u00f3w"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#manipulacja-tekstem","text":"sed s\u0142u\u017cy do nieco bardziej zaawansowanych manipulacji echo \"abcdefbc\" | sed \"s/bc/BC/\" # zamie\u0144 pierwszy pasuj\u0105cy ci\u0105g (bc) na BC #aBCdefbc TODO","title":"Manipulacja tekstem"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#zmienne","text":"Zmienn\u0105 tworzymy za pomoc\u0105 znaku = , kt\u00f3ry przypisuje warto\u015b\u0107 do dane identyfikatora. identyfikator=warto\u015b\u0107 . Aby uzyska\u0107 dost\u0119p do zawarto\u015bci u\u017cywamy $ przed nazw\u0105 zmiennej. $ msg = \u201dHello World\u201d $ echo $msg Hello World","title":"Zmienne"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#wstawianie-zmiennych-w-tekst","text":"Jest kilka sposob\u00f3w, aby mie\u0107 w sktyptach tekst, kt\u00f3ry jest zale\u017cny od sytuacji. Mo\u017cemy do tego wykorzystywa\u0107: Zmienne /my/path/to/${EDITED_FILE}","title":"Wstawianie zmiennych w tekst"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#wyniki-funkcji-dsd","text":"","title":"Wyniki funkcji ` dsd"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#argumenty","text":"Ka\u017cda funkcja, czy te\u017c skrypt bashowy mo\u017ce mie\u0107 przekazywane poprzez proste podanie ich po wywo\u0142aniu. Dla skryptu: #!/bin/bash wyprintuj_argument () { #tutaj odwo\u0142ujemy si\u0119 do pierwszego argumentu przekazanego do funkcji #a nie do skryptu echo \"argument $1 \" } wyprintuj_argument $1 wyprintuj_argument $2 przy wywo\u0142aniu ./skr.sh Hello 222 Otrzymamy argument Hello argument 222 Zwroty przydatne przy obs\u0142udze argument\u00f3w $0 Nazwa wo\u0142anej komendy/skryptu $1 $2 $3 poszczeg\u00f3lne argumenty (pierwszy, drugi, trzeci) $# Liczba argument\u00f3w $* Wszystkie argumenty jako jeden string $@ Wszystkie argumenty jako lista","title":"Argumenty"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#xargs","text":"Je\u015bli chcemy wykorzystywa\u0107 wyj\u015bcia mechanizm strumieni do przekazywania argument\u00f3w to mo\u017cemy u\u017cy\u0107 tak\u017ce komendy xargs #Wywo\u0142anie komendy rm dla ka\u017cdego znalezionego pliku find /path -type f -print | xargs rm Flagi: -n - maksymalna liczba argument\u00f3w -d , --delimiter - podzia\u0142 na cz\u0119\u015bci (komenda zostanie wywo\u0142ana wielokrotnie) echo -n 123 -456-7890 | xargs echo #> 123-456-7890 echo -n \"123-456-789\" | xargs -n 1 -d - echo #> 123 #> 456 #> 789 -I , -i , --replace= pozwala na elastyczne wstawianie otrzymanego argumentu #Stworzy pliki 123.txt 456.txt 789.txt echo -n \"123-456-789\" | xargs -d - -n 1 -I {} echo {} .txt","title":"xargs"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#procesy","text":"\u0141\u0105czniki: && -wykonaj kolejny proces, je\u015bli poprzedni si\u0119 powiedzie (retcode 0) || - wykonaj nast\u0119pny, gdy poprzedni to pora\u017cka & - proces jest utuchamiany w tle (jego pid mo\u017cna zdoby\u0107 za pomoc\u0105 $! ) TODO wi\u0119cej","title":"Procesy"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#warunki","text":"Warunki sprawdza si\u0119 za pomoc\u0105 komendy test z odpowiednimi flagami. Mo\u017cna to tak\u017ce robi\u0107 za pomoc\u0105 wmieszczaj\u0105c warunek w nawiasach [] . Mo\u017cliwy jest te\u017c wariant z dwoma nawiasami [[ co\u015btam ]] jest on wspierany przez wszystkie nowsze systemy u\u017cywaj\u0105ce Basha, ale mimo wszystko mo\u017ce byc on niekompatybilny ze starszymi. Warto pami\u0119ta\u0107, \u017ce bardzo wa\u017cne tu s\u0105 spacje i aby o nich nie zapomnie\u0107. Samo test jako komenda nie robi nic po prostu sprawdza warunek i zale\u017cnie od niego zwraca jaki\u015b kod. [ 1 -gt 100 ] echo \"Ret: $? \" #zwraca kod ostatnio dzia\u0142aj\u0105cej aplikacji # Ret: 1 [ 100 -gt 1 ] echo \"Ret: $? \" # Ret: 0 Operator Description ! EXPRESSION The EXPRESSION is false. -n STRING The length of STRING is greater than zero. -z STRING The lengh of STRING is zero (ie it is empty). STRING1 = STRING2 STRING1 is equal to STRING2 STRING1 != STRING2 STRING1 is not equal to STRING2 INTEGER1 -eq INTEGER2 INTEGER1 is numerically equal to INTEGER2 INTEGER1 -gt INTEGER2 INTEGER1 is numerically greater than INTEGER2 INTEGER1 -lt INTEGER2 INTEGER1 is numerically less than INTEGER2 -d FILE FILE exists and is a directory. -e FILE FILE exists. -r FILE FILE exists and the read permission is granted. -s FILE FILE exists and it's size is greater than zero (ie. it is not empty). -w FILE FILE exists and the write permission is granted. -x FILE FILE exists and the execute permission is granted. Dopiero po po\u0142\u0105czeniu z wyra\u017ceniami warunkowymi si\u0119 przydaje. Uwagi = oraz -eq dzia\u0142aj\u0105 inaczej np 01 = 1 da fa\u0142sz, ale 01 -eq 1 da prawd\u0119","title":"Warunki"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#warunki-if","text":"#nie musi tu by\u0107 koniecznie test, mo\u017ce to by\u0107 dowolna. Je\u015bli zwraca ona 0 to mamy sukces i wchodzimy do \u015brodka if apka_zwracaj\u0105ca_jaki\u015b_kod then komendy fi #wariant z else if apka_zwracaj\u0105ca_jaki\u015b_kod then komendy else inne komendy fi","title":"Warunki if"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/bash_cheatsheet/#petle","text":"for - iteruje po li\u015bcie for variable in valuelist do something done List\u0105 mog\u0105 by\u0107 argumenty programu #!/bin/bash echo The number of arguments is: $# echo The entered command line is: $0 $@ echo The command arguments are: for i in \" $@ \" do echo $i done ... albo pliki w folderze for k in * do cp $k $k .bak echo $k copy created done lub wynik komendy (u\u017cywamy do tego $() ) for i in $( ls ) do echo $i done //TODO opis skr\u00f3t\u00f3w klawiszowych Ctrl-C Ctrl-D etc // https://www.howtogeek.com/howto/ubuntu/keyboard-shortcuts-for-bash-command-shell-for-ubuntu-debian-suse-redhat-linux-etc/","title":"P\u0119tle"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/o_systemie/","text":"Zarz\u0105dzanie systemem Serwisy i demony /etc/systemd/system/ systemctl TODO Dom\u015blne foldery systemowe TODO opisz te najwa\u017cniejsze dla mnie /home/ /mnt /tmp / Firewalle i sie\u0107 TODO","title":"Zarz\u0105dzanie systemem"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/o_systemie/#zarzadzanie-systemem","text":"","title":"Zarz\u0105dzanie systemem"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/o_systemie/#serwisy-i-demony","text":"/etc/systemd/system/ systemctl TODO","title":"Serwisy i demony"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/o_systemie/#domslne-foldery-systemowe","text":"TODO opisz te najwa\u017cniejsze dla mnie /home/ /mnt /tmp /","title":"Dom\u015blne foldery systemowe"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/o_systemie/#firewalle-i-siec","text":"TODO","title":"Firewalle i sie\u0107"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/","text":"Screen Otwarcie nowej sesji screeen [] Wyj\u015bcie z sesji Ctrl+a , potem lista aktywnych sesji screen -ls There is a screen on: 21512.pts-4.komp-pc (07.08.2020 12:54:54) (Attached) 1 Socket in /run/screen/S-komp. Do\u0142\u0105cz do jednej z sesji screen -r [numer_sesji] Uruchom skrypt w sesji i od\u0142\u0105cz si\u0119 od sesji (dobre do startupu) screen -d -m moj_skrypt_albo_komenda Wi\u0119kszo\u015b\u0107 komend wewn\u0105trz obs\u0142uguje si\u0119 za pomoc\u0105 kombinacji Ctrl+a (C-a) i po puszczeniu wci\u015bni\u0119ciu danego przycisku. Podstawowe: C-a + d -detach, wyjd\u017a z sesji nie zamykaj\u0105c jej (sesja to nie terminal/ekran) C-a + N - wy\u015bwietl numer obecnego ekranu C-a c / C-a C-c - utw\u00f3rz nowy ekran C-a + [0-9] - przejd\u017a do ekranu o danym numerze C-a + C-a - prze\u0142\u0105cz na poprzedni ekran C-a \\ - zakmnij wszystkie okna i zako\u0144cz sesj\u0119 Inne u\u017cyteczne (pe\u0142na lista jest w man screen ): \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502C-a ' \u2502 (select) \u2502 Prompt for a window name or number to switch to. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a \" \u2502 (windowlist -b)\u2502 Present a list of all windows for selection. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a digit \u2502 (select 0-9) \u2502 Switch to window number 0 - 9 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a C-a \u2502 (other) \u2502 Toggle to the window displayed previously. Note \u2502 \u2502 \u2502 \u2502 that this binding defaults to the command character \u2502 \u2502 \u2502 \u2502 typed twice, unless overridden. For instance, if \u2502 \u2502 \u2502 \u2502 you use the option \"-e]x\", this command becomes \u2502 \u2502 \u2502 \u2502 \"]]\". \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a A \u2502 (title) \u2502 Allow the user to enter a name for the current win\u2010 \u2502 \u2502 \u2502 \u2502 dow. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a c, \u2502 (screen) \u2502 Create a new window with a shell and switch to that \u2502 \u2502C-a C-c \u2502 \u2502 window. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a C \u2502 (clear) \u2502 Clear the screen. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a d, \u2502 (detach) \u2502 Detach screen from this terminal. \u2502 \u2502C-a C-d \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a D D \u2502 (pow_detach) \u2502 Detach and logout. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a space, \u2502 (next) \u2502 Switch to the next window. \u2502 \u2502C-a n, \u2502 \u2502 \u2502 \u2502C-a C-n \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a N \u2502 (number) \u2502 Show the number (and title) of the current window. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a backspace,\u2502 (prev) \u2502 Switch to the previous window (opposite of C-a n). \u2502 \u2502C-a C-h, \u2502 \u2502 \u2502 \u2502C-a p, \u2502 \u2502 \u2502 \u2502C-a C-p \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a q, \u2502 (xon) \u2502 Send a control-q to the current window. \u2502 \u2502C-a C-q \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a Q \u2502 (only) \u2502 Delete all regions but the current one. See also \u2502 \u2502 \u2502 \u2502 split, remove, focus. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a r, \u2502 (wrap) \u2502 Toggle the current window's line-wrap setting (turn \u2502 \u2502C-a C-r \u2502 \u2502 the current window's automatic margins on and off). \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a s, \u2502 (xoff) \u2502 Send a control-s to the current window. \u2502 \u2502C-a C-s; \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a S \u2502 (split) \u2502 Split the current region horizontally into two new \u2502 \u2502 \u2502 \u2502 ones. See also only, remove, focus. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a t, \u2502 (time) \u2502 Show system information. \u2502 \u2502C-a C-t \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a v \u2502 (version) \u2502 Display the version and compilation date. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a C-v \u2502 (digraph) \u2502 Enter digraph. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a w, \u2502 (windows) \u2502 Show a list of window. \u2502 \u2502C-a C-w \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a X \u2502 (remove) \u2502 Kill the current region. See also split, only, \u2502 \u2502 \u2502 \u2502 focus. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a z, \u2502 (suspend) \u2502 Suspend screen. Your system must support BSD-style \u2502 \u2502C-a C-z \u2502 \u2502 job-control. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a ? \u2502 (help) \u2502 Show key bindings. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a \\ \u2502 (quit) \u2502 Kill all windows and terminate screen. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a {, \u2502 (history) \u2502 Copy and paste a previous (command) line. \u2502 \u2502C-a } \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a | \u2502 (split -v) \u2502 Split the current region vertically into two new \u2502 \u2502 \u2502 \u2502 ones. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a * \u2502 (displays) \u2502 Show a listing of all currently attached displays. \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 Zdobywanie informacji o systemie Og\u00f3lne informacje o systemie uname przydaje si\u0119 do og\u00f3lnych informacji o systemi operacyjnym, architekturze procesora i kernelu. uname Miejsce na dyskach df #df --block-size=1M poda ci rozmiar w gigabajtach Mo\u017ce by\u0107 przydatne w bombinacji z du , kt\u00f3re mo\u017ce pokazywa\u0107 ile miejsca zajmuj\u0105 dane foldery i pliki. (terminalowa alternatywa dla apki baobab link ) du -d 1 # 1760 ./docs # 9876 ./.git # 12 ./.github # 8 ./.vscode # 11672 . Hardware lsusb - przydatne do sprawdzania tego, jakie urz\u0105dzenia usb mamy pod\u0142\u0105czone lsusb Networking ip - kombajn do sieci\u00f3wki w Linuxie ifconfig (ju\u017c przestarza\u0142e) - zwraca informacje o wszystkich odst\u0119pnych interfejsach sieciowych, IP, adresy MAC etc. Zamiast niego zaleca si\u0119 ip addr Listowanie urz\u0105dze\u0144 w sieci lokalnej sudo nmap -sn 192.168.1.0/24 Wypisywanie port\u00f3w na kt\u00f3rych maszyna nas\u0142uchuje ss apka do badania gniazd ss -plnt #p - procesy l-listening n-numeric t-tcp Montowanie mount TODO SSH SSH s\u0142u\u017cy do zdalnego pod\u0142\u0105cznia si\u0119 do pow\u0142oki system\u00f3w. \u0141\u0105czymy si\u0119 komend\u0105 ssh login@adres Na przyk\u0142ad marian@192.168.0.32 root@serwer.moj.pl # Tutaj loginem jest pracownik@firma.com a adresem serwer.com pracownik@firma.com@serwer.com SSH klucze Po zalogowaniu na og\u00f3\u0142 musimy r\u0119cznie wpisywa\u0107 has\u0142o. Aby tego nie robi\u0107 mo\u017cemy doda\u0107 klucz publiczny do naszej maszyny. Dodatanie klucza do maszyny ssh-copy-id login@adres Aby upro\u015bci\u0107 wpisywanie adres\u00f3w maszyn (oraz konfiguracj\u0119) w terminalu mo\u017cemy dopisa\u0107 je do pliku ~/.ssh/config Host fajnyserwer HostName 198.43.32.33 User pawel Port 9999 SSH tunelowanie Inn\u0105 przydatn\u0105 rzecz\u0105 jest tunelowanie port\u00f3w za pomoc\u0105 ssh. Pozwala to na dost\u0119p do zdalnych us\u0142ug na danych portach tak, jakby by\u0142y u nas lokalnie. link do artyku\u0142u Na przyk\u0142ad komenda: ssh -L 9999 :localhost:9090 marian@moj_serwer Sprawi, \u017ce na naszej lokalnej maszynie pod portem 9999 b\u0119dzie dost\u0119pna us\u0142uga, kt\u00f3ra jest dost\u0119pna pod portem 9090 naszego serwera. Mo\u017cliwe jest tak\u017ce odwr\u00f3cone tunelowanie port\u00f3w za pomoc\u0105 SSH ssh -R [ REMOTE: ] REMOTE_PORT:DESTINATION:DESTINATION_PORT [ USER@ ] SSH_SERVER Na przyk\u0142ad komenda ssh -R 3000:192.168.1.11:9090 marian@moj_serwer sprawi, \u017ce na serwerze pod porcie 3000 b\u0119dzie dost\u0119pna us\u0142uga widoczna u nas pod adresem 192.168.1.11:9090 Jest on najcz\u0119\u015bciej u\u017cywany, aby da\u0107 komu\u015b z zewn\u0105trz dost\u0119p do wewn\u0119trznego serwisu. Razem z tymi komendami przydaj\u0105 si\u0119 flagi: -N - sprawia, \u017ce nie wykonujemy \u017cadnych zdalnych komend bashowych -f - uruchamia ssh w tle Np: ssh -R 8080:127.0.0.1:3000 -N -f user@remote.host W wypadku tunelowania czasem mog\u0105 by\u0107 problemy przy dost\u0119pie z zewn\u0119trznych maszyn do udost\u0119pnionych port\u00f3w link SSH aplikacje okienkowe W niekt\u00f3rych wypadkach mo\u017cemy potrzebobowa\u0107 jakiej\u015b aplikacji okienkowej, wtedy u\u017cywamy flagi -X (forwardowanie dla X11) ssh -X jkowalski@adres Wtedy po uruchomieniu w tym terminalu aplikacji z GUI jak np gedit to b\u0119dziemy mogli zobaczy\u0107 jej okienko na naszej maszynie.","title":"Programy"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#screen","text":"Otwarcie nowej sesji screeen [] Wyj\u015bcie z sesji Ctrl+a , potem lista aktywnych sesji screen -ls There is a screen on: 21512.pts-4.komp-pc (07.08.2020 12:54:54) (Attached) 1 Socket in /run/screen/S-komp. Do\u0142\u0105cz do jednej z sesji screen -r [numer_sesji] Uruchom skrypt w sesji i od\u0142\u0105cz si\u0119 od sesji (dobre do startupu) screen -d -m moj_skrypt_albo_komenda Wi\u0119kszo\u015b\u0107 komend wewn\u0105trz obs\u0142uguje si\u0119 za pomoc\u0105 kombinacji Ctrl+a (C-a) i po puszczeniu wci\u015bni\u0119ciu danego przycisku. Podstawowe: C-a + d -detach, wyjd\u017a z sesji nie zamykaj\u0105c jej (sesja to nie terminal/ekran) C-a + N - wy\u015bwietl numer obecnego ekranu C-a c / C-a C-c - utw\u00f3rz nowy ekran C-a + [0-9] - przejd\u017a do ekranu o danym numerze C-a + C-a - prze\u0142\u0105cz na poprzedni ekran C-a \\ - zakmnij wszystkie okna i zako\u0144cz sesj\u0119 Inne u\u017cyteczne (pe\u0142na lista jest w man screen ): \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502C-a ' \u2502 (select) \u2502 Prompt for a window name or number to switch to. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a \" \u2502 (windowlist -b)\u2502 Present a list of all windows for selection. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a digit \u2502 (select 0-9) \u2502 Switch to window number 0 - 9 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a C-a \u2502 (other) \u2502 Toggle to the window displayed previously. Note \u2502 \u2502 \u2502 \u2502 that this binding defaults to the command character \u2502 \u2502 \u2502 \u2502 typed twice, unless overridden. For instance, if \u2502 \u2502 \u2502 \u2502 you use the option \"-e]x\", this command becomes \u2502 \u2502 \u2502 \u2502 \"]]\". \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a A \u2502 (title) \u2502 Allow the user to enter a name for the current win\u2010 \u2502 \u2502 \u2502 \u2502 dow. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a c, \u2502 (screen) \u2502 Create a new window with a shell and switch to that \u2502 \u2502C-a C-c \u2502 \u2502 window. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a C \u2502 (clear) \u2502 Clear the screen. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a d, \u2502 (detach) \u2502 Detach screen from this terminal. \u2502 \u2502C-a C-d \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a D D \u2502 (pow_detach) \u2502 Detach and logout. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a space, \u2502 (next) \u2502 Switch to the next window. \u2502 \u2502C-a n, \u2502 \u2502 \u2502 \u2502C-a C-n \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a N \u2502 (number) \u2502 Show the number (and title) of the current window. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a backspace,\u2502 (prev) \u2502 Switch to the previous window (opposite of C-a n). \u2502 \u2502C-a C-h, \u2502 \u2502 \u2502 \u2502C-a p, \u2502 \u2502 \u2502 \u2502C-a C-p \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a q, \u2502 (xon) \u2502 Send a control-q to the current window. \u2502 \u2502C-a C-q \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a Q \u2502 (only) \u2502 Delete all regions but the current one. See also \u2502 \u2502 \u2502 \u2502 split, remove, focus. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a r, \u2502 (wrap) \u2502 Toggle the current window's line-wrap setting (turn \u2502 \u2502C-a C-r \u2502 \u2502 the current window's automatic margins on and off). \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a s, \u2502 (xoff) \u2502 Send a control-s to the current window. \u2502 \u2502C-a C-s; \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a S \u2502 (split) \u2502 Split the current region horizontally into two new \u2502 \u2502 \u2502 \u2502 ones. See also only, remove, focus. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a t, \u2502 (time) \u2502 Show system information. \u2502 \u2502C-a C-t \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a v \u2502 (version) \u2502 Display the version and compilation date. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a C-v \u2502 (digraph) \u2502 Enter digraph. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a w, \u2502 (windows) \u2502 Show a list of window. \u2502 \u2502C-a C-w \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a X \u2502 (remove) \u2502 Kill the current region. See also split, only, \u2502 \u2502 \u2502 \u2502 focus. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a z, \u2502 (suspend) \u2502 Suspend screen. Your system must support BSD-style \u2502 \u2502C-a C-z \u2502 \u2502 job-control. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a ? \u2502 (help) \u2502 Show key bindings. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a \\ \u2502 (quit) \u2502 Kill all windows and terminate screen. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a {, \u2502 (history) \u2502 Copy and paste a previous (command) line. \u2502 \u2502C-a } \u2502 \u2502 \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a | \u2502 (split -v) \u2502 Split the current region vertically into two new \u2502 \u2502 \u2502 \u2502 ones. \u2502 \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 \u2502C-a * \u2502 (displays) \u2502 Show a listing of all currently attached displays. \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518","title":"Screen"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#zdobywanie-informacji-o-systemie","text":"","title":"Zdobywanie informacji o systemie"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#ogolne-informacje-o-systemie","text":"uname przydaje si\u0119 do og\u00f3lnych informacji o systemi operacyjnym, architekturze procesora i kernelu. uname","title":"Og\u00f3lne informacje o systemie"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#miejsce-na-dyskach","text":"df #df --block-size=1M poda ci rozmiar w gigabajtach Mo\u017ce by\u0107 przydatne w bombinacji z du , kt\u00f3re mo\u017ce pokazywa\u0107 ile miejsca zajmuj\u0105 dane foldery i pliki. (terminalowa alternatywa dla apki baobab link ) du -d 1 # 1760 ./docs # 9876 ./.git # 12 ./.github # 8 ./.vscode # 11672 .","title":"Miejsce na dyskach"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#hardware","text":"lsusb - przydatne do sprawdzania tego, jakie urz\u0105dzenia usb mamy pod\u0142\u0105czone lsusb","title":"Hardware"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#networking","text":"ip - kombajn do sieci\u00f3wki w Linuxie ifconfig (ju\u017c przestarza\u0142e) - zwraca informacje o wszystkich odst\u0119pnych interfejsach sieciowych, IP, adresy MAC etc. Zamiast niego zaleca si\u0119 ip addr","title":"Networking"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#listowanie-urzadzen-w-sieci-lokalnej","text":"sudo nmap -sn 192.168.1.0/24","title":"Listowanie urz\u0105dze\u0144 w sieci lokalnej"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#wypisywanie-portow-na-ktorych-maszyna-nasuchuje","text":"ss apka do badania gniazd ss -plnt #p - procesy l-listening n-numeric t-tcp","title":"Wypisywanie port\u00f3w na kt\u00f3rych maszyna nas\u0142uchuje"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#montowanie","text":"mount TODO","title":"Montowanie"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#ssh","text":"SSH s\u0142u\u017cy do zdalnego pod\u0142\u0105cznia si\u0119 do pow\u0142oki system\u00f3w. \u0141\u0105czymy si\u0119 komend\u0105 ssh login@adres Na przyk\u0142ad marian@192.168.0.32 root@serwer.moj.pl # Tutaj loginem jest pracownik@firma.com a adresem serwer.com pracownik@firma.com@serwer.com","title":"SSH"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#ssh-klucze","text":"Po zalogowaniu na og\u00f3\u0142 musimy r\u0119cznie wpisywa\u0107 has\u0142o. Aby tego nie robi\u0107 mo\u017cemy doda\u0107 klucz publiczny do naszej maszyny. Dodatanie klucza do maszyny ssh-copy-id login@adres Aby upro\u015bci\u0107 wpisywanie adres\u00f3w maszyn (oraz konfiguracj\u0119) w terminalu mo\u017cemy dopisa\u0107 je do pliku ~/.ssh/config Host fajnyserwer HostName 198.43.32.33 User pawel Port 9999","title":"SSH klucze"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#ssh-tunelowanie","text":"Inn\u0105 przydatn\u0105 rzecz\u0105 jest tunelowanie port\u00f3w za pomoc\u0105 ssh. Pozwala to na dost\u0119p do zdalnych us\u0142ug na danych portach tak, jakby by\u0142y u nas lokalnie. link do artyku\u0142u Na przyk\u0142ad komenda: ssh -L 9999 :localhost:9090 marian@moj_serwer Sprawi, \u017ce na naszej lokalnej maszynie pod portem 9999 b\u0119dzie dost\u0119pna us\u0142uga, kt\u00f3ra jest dost\u0119pna pod portem 9090 naszego serwera. Mo\u017cliwe jest tak\u017ce odwr\u00f3cone tunelowanie port\u00f3w za pomoc\u0105 SSH ssh -R [ REMOTE: ] REMOTE_PORT:DESTINATION:DESTINATION_PORT [ USER@ ] SSH_SERVER Na przyk\u0142ad komenda ssh -R 3000:192.168.1.11:9090 marian@moj_serwer sprawi, \u017ce na serwerze pod porcie 3000 b\u0119dzie dost\u0119pna us\u0142uga widoczna u nas pod adresem 192.168.1.11:9090 Jest on najcz\u0119\u015bciej u\u017cywany, aby da\u0107 komu\u015b z zewn\u0105trz dost\u0119p do wewn\u0119trznego serwisu. Razem z tymi komendami przydaj\u0105 si\u0119 flagi: -N - sprawia, \u017ce nie wykonujemy \u017cadnych zdalnych komend bashowych -f - uruchamia ssh w tle Np: ssh -R 8080:127.0.0.1:3000 -N -f user@remote.host W wypadku tunelowania czasem mog\u0105 by\u0107 problemy przy dost\u0119pie z zewn\u0119trznych maszyn do udost\u0119pnionych port\u00f3w link","title":"SSH tunelowanie"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/programy/#ssh-aplikacje-okienkowe","text":"W niekt\u00f3rych wypadkach mo\u017cemy potrzebobowa\u0107 jakiej\u015b aplikacji okienkowej, wtedy u\u017cywamy flagi -X (forwardowanie dla X11) ssh -X jkowalski@adres Wtedy po uruchomieniu w tym terminalu aplikacji z GUI jak np gedit to b\u0119dziemy mogli zobaczy\u0107 jej okienko na naszej maszynie.","title":"SSH aplikacje okienkowe"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/regex/","text":"Wyra\u017cenia regularne (Regexy) \u015awietna strona do ekspreymentowania z wyra\u017ceniami regularnymi Regex101 \u015aci\u0105gawka z BulldogJobs https://bulldogjob.pl/readme/samouczek-regex-sciagawka-z-przykladami Znaki symbol Opis \\s whitespace \\S nie whitespace \\d cyfra \\D nie cyfra \\w s\u0142owo \\W nie s\u0142owo \\n nowa linia \\t tabulacja \\A Pocz\u0105tek wyra\u017cenia $ koniec wyra\u017cenia lub/EOL/EOF \\Z koniec wyra\u017cenia . Jakikolwiek znak (nie licz\u0105c nowej linii \\n) \\. Kropka . (w grepie jednak trzeba da\u0107 \\\\. Znaki specjalne: ^ [ . $ { * ( \\+ ) | ? < > Do ich escape'owania na og\u00f3\u0142 wystarcza \\ . Grupy i zakresy [a-c] znaki z zakresu a-c. Mog\u0105 by\u0107 \u0142\u0105czone w wi\u0119ksze grupy (np. [a-deA-D1-4]) [^a-c] Zaprzeczenie znakom z danego zakresu (nie a nie b i nie c) (aIbIc) Alternatywa a lub lub c (zamiast I powinny tam by\u0107 linie pionowe) * Znak/wyra\u017cenie znajduj\u0105cy si\u0119 przed gwiazdk\u0105 mo\u017ce pojawi\u0107 si\u0119 dowoln\u0105 ilo\u015b\u0107 razy + Znak/wyra\u017cenie sprzed plusa pojawi si\u0119 dowolnie wiele razy (ale co najmniej 1 raz) ? Znak/wyra\u017cenie pojawia si\u0119 0 lub 1 raz (?!slowo) zaprzeczenie - wyklucz wyniki zawieraj\u0105ce slowo (negative lookahead) I alternatywa(nie litera i, lecz beleczka) - rzecz polewej albo po prawej Podmienianie znak\u00f3w U\u017cywaj\u0105c regex\u00f3w mo\u017cna w \u0142atwy spos\u00f3b podmienia\u0107 cz\u0119\u015bci naszych wyra\u017ce\u0144 na inne. Wystarczy tutaj opakowa\u0107 cz\u0119\u015b\u0107 wyra\u017cenia, kt\u00f3r\u0105 chcemy wymieni\u0107 w nawiasy () i potem w wyra\u017ceniu docelowym mo\u017cemy si\u0119 odwo\u0142ywa\u0107 do zawarto\u015bci poszczeg\u00f3lnych nawias\u00f3w. Najbardziej przydatne odwo\u0142ania: $1 , $2 Pierwszy, drugi nawias $& Ca\u0142e wyra\u017cenie Find Carrots(With)Dip(Are)Yummy Replace Bananas$1Mustard$2Gross Result BananasWithMustardAreGross","title":"Wyra\u017cenia regularne (Regexy)"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/regex/#wyrazenia-regularne-regexy","text":"\u015awietna strona do ekspreymentowania z wyra\u017ceniami regularnymi Regex101 \u015aci\u0105gawka z BulldogJobs https://bulldogjob.pl/readme/samouczek-regex-sciagawka-z-przykladami","title":"Wyra\u017cenia regularne (Regexy)"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/regex/#znaki","text":"symbol Opis \\s whitespace \\S nie whitespace \\d cyfra \\D nie cyfra \\w s\u0142owo \\W nie s\u0142owo \\n nowa linia \\t tabulacja \\A Pocz\u0105tek wyra\u017cenia $ koniec wyra\u017cenia lub/EOL/EOF \\Z koniec wyra\u017cenia . Jakikolwiek znak (nie licz\u0105c nowej linii \\n) \\. Kropka . (w grepie jednak trzeba da\u0107 \\\\. Znaki specjalne: ^ [ . $ { * ( \\+ ) | ? < > Do ich escape'owania na og\u00f3\u0142 wystarcza \\ .","title":"Znaki"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/regex/#grupy-i-zakresy","text":"[a-c] znaki z zakresu a-c. Mog\u0105 by\u0107 \u0142\u0105czone w wi\u0119ksze grupy (np. [a-deA-D1-4]) [^a-c] Zaprzeczenie znakom z danego zakresu (nie a nie b i nie c) (aIbIc) Alternatywa a lub lub c (zamiast I powinny tam by\u0107 linie pionowe) * Znak/wyra\u017cenie znajduj\u0105cy si\u0119 przed gwiazdk\u0105 mo\u017ce pojawi\u0107 si\u0119 dowoln\u0105 ilo\u015b\u0107 razy + Znak/wyra\u017cenie sprzed plusa pojawi si\u0119 dowolnie wiele razy (ale co najmniej 1 raz) ? Znak/wyra\u017cenie pojawia si\u0119 0 lub 1 raz (?!slowo) zaprzeczenie - wyklucz wyniki zawieraj\u0105ce slowo (negative lookahead) I alternatywa(nie litera i, lecz beleczka) - rzecz polewej albo po prawej","title":"Grupy i zakresy"},{"location":"Linux%F0%9F%90%A7%20i%20Bash/regex/#podmienianie-znakow","text":"U\u017cywaj\u0105c regex\u00f3w mo\u017cna w \u0142atwy spos\u00f3b podmienia\u0107 cz\u0119\u015bci naszych wyra\u017ce\u0144 na inne. Wystarczy tutaj opakowa\u0107 cz\u0119\u015b\u0107 wyra\u017cenia, kt\u00f3r\u0105 chcemy wymieni\u0107 w nawiasy () i potem w wyra\u017ceniu docelowym mo\u017cemy si\u0119 odwo\u0142ywa\u0107 do zawarto\u015bci poszczeg\u00f3lnych nawias\u00f3w. Najbardziej przydatne odwo\u0142ania: $1 , $2 Pierwszy, drugi nawias $& Ca\u0142e wyra\u017cenie Find Carrots(With)Dip(Are)Yummy Replace Bananas$1Mustard$2Gross Result BananasWithMustardAreGross","title":"Podmienianie znak\u00f3w"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/","text":"Docker\ud83d\udc0b Docker jest jednym z najpopularniejszych obecnie system\u00f3w do wirtualizacji systemu operacyjnego. Pozwala w prosty spos\u00f3b stworzy\u0107 instancj\u0119 systemu b\u0119d\u0105c\u0105 niemal\u017ce zupe\u0142nie niezale\u017cnym bytem od systemu maszyny na kt\u00f3rej si\u0119 znajduje, mo\u017ce mie\u0107 ona zainstalowane zupe\u0142nie inne oprogramowanie, r\u00f3\u017cni\u0107 si\u0119 konfiguracj\u0105 sieciow\u0105 etc. R\u00f3\u017cni si\u0119 on od zwyczajnej maszyny wirtualnej tym, \u017ce taki kontener jest du\u017co bardziej elastyczny od maszyny wirtualnej, poniewa\u017c nie ma na sta\u0142e przydzielonych zasob\u00f3w takich jak RAM, CPU etc. Docker cz\u0119sto jest wykorzystywany do pracy z r\u00f3\u017cnorodnym oprogramowaniem bez niepotrzebnego za\u015bmiecania \u015brodowiska deweloperskiego. Jest to tak\u017ce jeden ze sposob\u00f3w unikni\u0119cia piek\u0142a zale\u017cno\u015bci. Podstawowe Poj\u0119cia Obraz/Image - obrazy dockerowe s\u0105 ju\u017c gotowymi, wcze\u015bniej przygotowanymi paczkami zawieraj\u0105ce systemy w dockerze. Przyk\u0142adem obrazu jest ubuntu:latest . Kontener/Container - jest to uruchomiona instancja naszego dockera bazuj\u0105ca na danym obrazie. Zawiera on konfiguracj\u0119 oraz wszystkie dane unikalne dla danej instancji. Repozytorium - miejsce z kt\u00f3rego pobierane s\u0105 obrazy oraz ich aktualizacje. Jest to dockerhub , ale mo\u017cna te\u017c pobiera\u0107 z innych repozytori\u00f3w (np z gitlaba). Obs\u0142uga Mamy kilka grup komend Grupa Opis config Zarz\u0105dzanie konfiguracj\u0105 container Operacje na kontenerach context Contexts for distributed deployment (k8s, \u2026) image Zarz\u0105dzanie obrazami network Zarz\u0105dzanie sieci\u0105 service Service (i.e. multiple containers that run the same image) management in distributed deployments (e.g.with docker-compose or docker swarm) system Global management volume Secondary storage management Do zarz\u0105dzania mo\u017cemy te\u017c u\u017cywa\u0107 apek GUI, albo plugin\u00f3w do IDE. Zarz\u0105dzanie obrazami Do zarz\u0105dzania obrazami na naszej maszynie s\u0142u\u017cy polecenie docker image . Nowy obraz Baza W wi\u0119kszo\u015bci wypadk\u00f3w warto wykorzystywa\u0107 obrazy znajduj\u0105ce si\u0119 na stronie hub.docker.com - zawiera ona zar\u00f3wno obrazy wi\u0119kszo\u015bci dystrybucji Linuxa, jak i obrazy z systemami zawieraj\u0105ce ju\u017c przygotowane narz\u0119dzia deweloperskie (np obrazy zawieraj\u0105ce zainstalowane i skonfigurowane bazy danych). Aby pobra\u0107 taki obraz na nasz\u0105 maszyn\u0119 nale\u017cy u\u017cy\u0107 komendy: docker image pull [ OPTIONS ] NAME [ :TAG | @DIGEST ] Na przyk\u0142ad: docker image pull alpine:latest # pobiera najnowszy obraz systemu alpine Budowanie z konfiguracji Je\u015bli potrzebujemy stworzy\u0107 w\u0142asny obraz to mo\u017cemy go samodzielnie zbudowa\u0107 za pomoc\u0105 komendy: docker image build . Pozwala ona zbudowa\u0107 nam w\u0142asny obraz dockerowy na bazie pliku dockerfile . ( Opis sk\u0142adni ) Stworzenie poprzez commita Do wygenerowania nowego obrazu mo\u017cemy te\u017c wykorzysta\u0107 ju\u017c istniej\u0105cy kontener, wystarczy u\u017cy\u0107 komendy commit docker commit containerName ImageName Zarz\u0105dzanie posiadanymi obrazami Za pomocy komendy docker image ls mo\u017cemy \u0142atwo wypisa\u0107 lokalnie pobrane obrazy. docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE 93c4e800ab68 2 weeks ago 677MB postgres 11 -alpine ec1e25ef56d1 5 weeks ago 156MB alpine latest 6dbb9cc54074 5 weeks ago 5 .61MB nginx 1 .19.0-alpine 7d0cdcc60a96 11 months ago 21 .3MB docker image rm usuwa dany obraz. docker image rm [ OPTIONS ] IMAGE [ IMAGE... ] Ale do czyszczenia jednak lepsze jest docker image prune , kt\u00f3re usuwa wszystkie \"wisz\u0105ce\" (dangling) obrazy, czyli np stare kopie obraz\u00f3w, kt\u00f3re zosta\u0142y ju\u017c przebudowane (na li\u015bcie obraz\u00f3w podpisane s\u0105 jako ). Dodanie flagi -a usuwa tak\u017ce wszystkie obrazy, kt\u00f3re s\u0105 nie s\u0105 u\u017cywane przez \u017cadne kontenery. $ docker image prune -a WARNING! This will remove all images without at least one container associated to them. Are you sure you want to continue ? [ y/N ] y Deleted Images: untagged: alpine:latest Zarz\u0105dzanie kontenerami docker container ls - wypisuje kontenery obecnie uruchomione w systemie, dodanie flagi -a sprawia, \u017ce pokazuje tak\u017ce te wy\u0142\u0105czone. $ docker container ls -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bd1415cdc985 server_nginx \"/docker-entrypoint.\u2026\" 25 hours ago Exited ( 0 ) 24 hours ago server_nginx_1 2474e0650b34 registry.gitlab.com/toolkit/server:latest \"sh -c 'python manag\u2026\" 25 hours ago Exited ( 0 ) 25 hours ago server_web_1 ce6a641e20c1 postgres:11-alpine \"docker-entrypoint.s\u2026\" 2 weeks ago Exited ( 0 ) 21 hours ago server_db_1 Uruchamianie Do podstawowej pracy z kontenerem mo\u017cemy u\u017cywa\u0107 komend: docker container run albo te\u017c docker run docker container create docker container pause / unpause - wstrzymuje (i wznawia) procesy w kontenerze docker container start / stop - zabija wszystkie procesy w kontenerze i go zamyka docker container restart docker commit containerName ImageName -zapisujemy zmiany wprowadzone w danym kontenerze jako nowy obraz Do usuwania kontener\u00f3w s\u0142u\u017c\u0105 docker container prune i docker container rm . docker container create [OPTIONS] IMAGE [COMMAND] [ARG...] - tworzy nam nowy kontener bazuj\u0105cy na danym obrazie, mo\u017cemy tak\u017ce wybra\u0107 jaka komenda ma zosta\u0107 w nim uruchomiona. (ale go nie uruchamia) Mo\u017cemy go potem uruchomi\u0107 komend\u0105 docker container start ID . Do stworzenia nowego kontenera i natychmiastowego uruchomienia s\u0142u\u017cy docker container run . Przydatne flagi dla docker run [flagi] nazwa-obrazu : -rm usuwa kontener po zako\u0144czeniu pracy -i , --interactive po odpaleniu nadal mamy pod\u0142\u0105czone STDIN -t , --tty Pod\u0142\u0105czamy si\u0119 terminalem do kontenera (warto u\u017cy\u0107 razem z -i ) -d , --detach Uruchom kontener w tle i wypisz jego ID -e , --env Jakie zmienne \u015brodowiskowe maj\u0105 by\u0107 w naszym kontenerze (np docker run -e BROKER_PORT=9999 client ) -p , --publish udost\u0119pnij wewn\u0119trzne porty obrazu na portach hosta np -p 8089:80 wystawia port 80 z wn\u0119trza kontenera na porcie 8089 hosta. (mo\u017cemy teraz na naszej maszynie otworzy\u0107 to pod adresem localhost:8089) -v , --volume okre\u015bla jakie pliki/foldery z hosta mamy udost\u0119pni\u0107 kontenerowi i pod jakimi adresami np -v /tmp/logs.log:/tmp/runlog sprawi \u017ce apka w kontenerze pisz\u0105c do plik\u00f3w w folderze tmp/runlog/ b\u0119dzie tak na prawd\u0119 pisa\u0107 do folderu /tmp/logs.log/ na ho\u015bcie. --rm - usuwa kontener po zako\u0144czeniu --device - pozwala na udost\u0119pnienie urz\u0105dze\u0144 kontenerowi dockerowemu (np. kamery) --device=/dev/video0:/dev/video0 link docker container run -i -t ubuntu bash Interakcje z dzia\u0142aj\u0105cym kontenerem attach - podpinanie stdin i stdouta to dzia\u0142aj\u0105cego kontenera. docker attach [OPTIONS] CONTAINER lub docker container attach cp - kopiowanie plik\u00f3w exec - uruchom w ju\u017c dzia\u0142aj\u0105cym kontenerze. Bardzo przydatne gdy chcemy np wej\u015b\u0107 tam z shellem. docker exec [OPTIONS] CONTAINER COMMAND [ARG...] lub docker container exec ... docker exec -it worker bash #-it podpina input i output Sk\u0142adnia pliku dockerfile Plik dockerfile opisuje kolejne operacje pokazuj\u0105ce, jak powinien by\u0107 zbudowany nasz obraz. Przyk\u0142adowy plik dockerfile: # wybierz obraz bazowy od kt\u00f3rego zaczynasz konstruowanie FROM ubuntu:latest # Ustaw zmienne \u015brodowiskowe ENV APP_USER = user # Wykonaj dan\u0105 komend\u0119, np zainstaluj potrzebne pakiety etc. RUN apt install -y firefox # okre\u015bl po\u0142o\u017cenie folderu roboczego w kt\u00f3rym odpalane s\u0105 komendy WORKDIR /home/user # Kopiuj pliki z hosta do systemu plik\u00f3w wewn\u0105trz kontenera COPY ./plik /home/user/ Tak zdefiniowany obraz budujemy komend\u0105 docker build ./sciezka/folderu . Ka\u017cda nowa linia/polecenie zaczyna si\u0119 od komendy DU\u017bYMI_LITERAMI (taka konwencja). Komendy: FROM imageBase to jest zawsze pierwsza instrukcja pokazuj\u0105ca na jakim innym obrazie ma bazowa\u0107 nasz nowy obraz RUN command wykonuje komendy w pow\u0142oce kontenera przy budowaniu ENV variable value ustawia warto\u015bci w \u015brodowisku (mog\u0105 by\u0107 u\u017cywane przez wszystko co b\u0119dzie od teraz chodzi\u0107 w kontenerze) COPY source destination kopiuje pliki ze \u017ar\u00f3d\u0142a (URL, plik, folder) do miejsca w kontenerze (UWAGA! z przycyn bezpiecze\u0144stwa pozwala on tylko na kopie rzeczy tylko z folderu w kt\u00f3rym uruchamiamy komend\u0119, czyli nie mo\u017cemy np skopiowa\u0107 sobie czego\u015b z katalogu /home/jkowalski/pobrane ) ADD source destination to samo co ADD z r\u00f3\u017cnic\u0105, \u017ce gdy potrafi zorpakowa\u0107 archiwum, gdy jest ono podane jako plik WORKDIR path okre\u015bla folder roboczy w kt\u00f3rym maj\u0105 si\u0119 wykonywa\u0107 pozosta\u0142e komendy jak RUN , CMD , ENTRYPOINT CMD command arg1 arg2 ... dostarcza domy\u015blnych komend i warto\u015bci argument\u00f3w, kt\u00f3re zostan\u0105 uruchomione w kontenerze ENTRYPOINT command arg1 arg2 ... uruchamia t\u0105 komend\u0119, kiedy kontener jest uruchamiany (kontener jest zamykany kiedy ta komenda si\u0119 ko\u0144czy) EXPOSE port pokazuje na jakim porcie s\u0142ucha kontaner, sama go nie wystawia, pe\u0142ni raczej funkcj\u0119 informacyjn\u0105 dla u\u017cytkownika link VOLUME pozwala kontenerowi pod\u0142\u0105czy\u0107 si\u0119 do innego systemu plik\u00f3w wi\u0119cej info Uwaga - w pliku dockerowym mo\u017ce by\u0107 tylko jeden CMD albo ENTRYPOINT , jak nie to tylko ENTRYPOINT jest u\u017cywany (na og\u00f3\u0142). ENTRYPOINT i CMD ENTRYPOINT ma 2 warianty bazuj\u0105cy na samej komendzie ENTRYPOINT node app.js 9000 9001 u\u017cywany razem z CMD ENTRYPOINT [ \"/bin/node\" , \"app.js\" ] CMD [ \"9000\" , \"9001\" ] I mo\u017cemy to potem odpali\u0107 tak docker build -t app docker run app docker run app 5555 5556 # gdy chcemy u\u017cy\u0107 w\u0142asnych argument\u00f3w Mo\u017cliwe jest te\u017c ustawienie w\u0142asnego entrypointa przy uruchomieniu. # Executes bash -c \"ls /\" docker run --entrypoint bash my-image:latest -c \"ls /\" Docker compose Jest on wykorzystywany, kiedy potrzebujemy uruchomi\u0107 wiele aplikacji, kt\u00f3re b\u0119d\u0105 si\u0119 ze sob\u0105 komunikowa\u0107 (a odpalenie w dockerze skryptu, kt\u00f3ry wszystko nam poodpala nie jest opcj\u0105). Quick start Wyobra\u017amy sobie, \u017ce potrzebujemy 3 apek, kt\u00f3re gadaj\u0105 ze sob\u0105. Tworzymy plik docker-compose.yml version : '2' services : #Ka\u017cdy z serwis\u00f3w jest tutaj oddzielony cli : image : client #obraz z kt\u00f3rego korzystamy build : ./client/ links : - bro environment : - BROKER_HOST=bro - BROKER_PORT=9998 wor : image : worker build : ./worker/ links : - bro environment : - BROKER_HOST=bro - BROKER_PORT=9999 bro : image : broker build : ./broker/ # z wn\u0119trza kontenera bro wystawiamy porty 9998 i 9999 aby inne # kontenery w composie mog\u0142y si\u0119 do nich podpi\u0105\u0107 (ale maszyna hosta nie) expose : - \"9998\u201c - \" 9999\" I uruchamiamy komend\u0119 docker-compose up -d , kt\u00f3ra: Buduje wszystkie wymagane obrazy (je\u015bli ich nie mamy) Uruchamia kolejne instancje ka\u017cdego z nich w odpowiedniej kolejno\u015bci Do wy\u0142\u0105czenia tego, co uruchomili\u015bmy wystarczy komenda docker-compose down Plik konfiguracyjny //TODO opisz dok\u0142adniej syntax docker-compose na podstawie pliku tsr-ud04-eng-DockerReferenceDocs2122.pdf oraz https://docs.docker.com/compose/compose-file/ Plik docker-compose.yml s\u0142u\u017cy do zdefiniowania ca\u0142ych grup kontener\u00f3w, kt\u00f3ra maj\u0105 by\u0107 odpalone razem na jednej maszynie ( pe\u0142na dokumentacja ).Zawiera on opisy kolejno: serwis\u00f3w ( services: ) - czyli poszczeg\u00f3lnych obraz\u00f3w dockerowych, kt\u00f3re maj\u0105 tworzy\u0107 ca\u0142o\u015b\u0107 (to jedyna obowi\u0105zkowa cz\u0119\u015b\u0107, pozosta\u0142e s\u0105 opcjonalne) sieci ( networks ) - czyli poszczeg\u00f3lnych sieci wolumin\u00f3w ( volumes ) - trwa\u0142ych miejsc do przechowywania plik\u00f3w sekret\u00f3w ( secrets ) konfiguracji ( configs ) Przyk\u0142adowy docker compose services : frontend : image : awesome/webapp ports : - \"443:8043\" networks : - front-tier - back-tier configs : - httpd-config secrets : - server-certificate backend : image : awesome/database volumes : - db-data:/etc/data networks : - back-tier volumes : db-data : driver : flocker driver_opts : size : \"10GiB\" configs : httpd-config : external : true secrets : server-certificate : external : true networks : # The presence of these objects is sufficient to define them front-tier : {} back-tier : {} serwisy Podstawowe parametry dla serwis\u00f3w dokumentacja : image - obraz, kt\u00f3rego ma u\u017cywa\u0107 dany serwis expose - lista port\u00f3w, kt\u00f3re maj\u0105 by\u0107 udost\u0119pnione innym serwisom wewn\u0105trz dockera (host ich nie widzi) ports - lista port\u00f3w wystawionych na zewn\u0105trz dockera (s\u0105 one tak\u017ce dost\u0119pne dla innych serwis\u00f3w w dockerze) links - lista serwis\u00f3w, kt\u00f3re musz\u0105 zosta\u0107 wystartowane przed uruchomieniem tego serwisu environment - lista zmiennych \u015brodowiskowych w danym kontenerze build - \u015bcie\u017cka do folderu z plikiem Dockerfile , aby go zbudowa\u0107, gdyby jeszcze nie by\u0142o odpowiedniego obrazu //TODO dopisz przyk\u0142ady Inne parametry dla serwis\u00f3w: extra_hosts - lista mapowa\u0144 adres\u00f3w na nazwy (pojawi\u0105 si\u0119 w pliku /etc/hosts na maszynie) link extra_hosts : - \"somehost:162.242.195.82\" - \"innyhost.local:50.31.209.229\" Wolumeny Za ich pomoc\u0105 mo\u017cemy tworzy\u0107 trwa\u0142e miejsca do przechowywania danych. Trwa\u0142ych, czyli takich, kt\u00f3re nie ulegaj\u0105 skasowaniu, kiedy usuwany jest kontener. Dlatego cz\u0119sto s\u0105 one wykorzystywane min. do przechowywania baz danych, aby\u015bmy nic nie tracili wtdy, kiedy np. przy aktualizacji b\u0119dziemy chcieli zmieni\u0107 wersj\u0119 kontenera na \u015bwie\u017csz\u0105. Kolejn\u0105 zalet\u0105 wolumen\u00f3w w kontek\u015bcie compose'a jest to, \u017ce mog\u0105 one by\u0107 wsp\u00f3\u0142dzielone pomi\u0119dzy poszczeg\u00f3lnymi serwisami. dokumentacja Przyk\u0142ad: services : backend : image : awesome/database volumes : - db-data:/etc/data #db-data b\u0119dzie zamontowane w backendzie pod \u015bcie\u017ck\u0105 /etc/data backup : image : backup-service volumes : - db-data:/var/lib/backup/data #db-data to automatycznie zdefioniowany wolumen #system stworzy go sobie najpewniej w lokacji /var/lib/docker volumes : db-data : Uruchamiaj\u0105c docker compose up docker tworzy wolument je\u015bli jeszcze nie istnieje. Warto tytaj wiedzie\u0107 o atrybutach takich jak: external (true, false) - okre\u015bla, czy ten wolumen jest zarz\u0105dzany poza danym serwerem. Je\u015bli ustawiony na true to wszystkie pozosta\u0142e flagi s\u0105 ignorowane (za wyj\u0105tkiem name). Je\u015bli taki wolumen nie istnieje to zwracany jest b\u0142\u0105d, je\u015bli istnieje to jest on pod\u0142\u0105czany. volumes : db-data : external : true #szukamy czy volume o nazwie db-data istnieje driver_opts - pozwala na zamontowanie wolumentu za pomoc\u0105 jakiego\u015b sterownika. Pozwala np. na stworzenie wolumenu znajduj\u0105cego si\u0119 na serwerze NFS volumes : example : driver_opts : type : \"nfs\" o : \"addr=10.40.0.199,nolock,soft,rw\" device : \":/docker/example\" lub zwyczajne okre\u015blenie na jaki folder hosta ma by\u0107 on zmapowany volumes : cvat_share : driver_opts : type : none device : /mnt/duzy_dysk/pliki_dla_cvata/ o : bind inne //TODO opisz pozosta\u0142e Komendy UWAGA wkr\u00f3tce komenda docker-ckompose powinna zosta\u0107 zmieniona na docker compose link docker-compose up - Parametry: --scale service=num pozwala odpali\u0107 wi\u0119cej instancji danego serwisu (jednak gdy skalujemy serwisy, kt\u00f3re wystawiaj\u0105 porty expose to tylko jedna z instancji b\u0119dzie widoczna dla innych) //TODO sprawd\u017a to -d -//TODO -f - flaga do uruchamiania wielu plik\u00f3w docker compose jednocze\u015bnie Je\u015bli wszystkie wysecyfikowane pliki znajduj\u0105 si\u0119 w tym samym folderze wtedy docker \u0142\u0105czy je w jedn\u0105 wsp\u00f3ln\u0105 konfiguracj\u0119. przyk\u0142ad apki z wt\u00f3rej w dodatkowym pliku jest dodane szyfrowanie HTTPS: docker compose -f docker-compose.yml -f docker-compose.https.yml up -d docker-compose down - zatrzymuje i usuwa kontenery z danego compose'a docker compose stop - zatrzymuje, ale bez usuwania docker compose start - uruchamia istniej\u0105ce kontenery dla serwisu Przydatne snippety Tworzenie u\u017cytkownika RUN useradd -ms /bin/bash -G sudo,inna_grupa dockeruser #Wy\u0142\u0105czenie promptu o has\u0142o przy sudo RUN echo \"dockeruser ALL=(ALL) NOPASSWD: ALL\" > /etc/sudoers.d/ubuntu #ustawienie kolorowego terminala ENV TERM = xterm-256color #prze\u0142\u0105czenie na u\u017cytkownika przy dalszych komendach USER dockeruser WORKDIR /home/dockeruser Uruchamianie z dost\u0119pem do GUI W wypadku aplikacji dockerowych mo\u017cliwe jest ich uruchamianie aplikacji GUI z ich poziomu. Wymaga to najpierw nadania uprawnie\u0144 do otwierania okien xhost +local: #Ta opcja jest aktywna do restartu komputera Poza tym nale\u017cy da\u0107 dockerowi dost\u0119p do odpowiedniego gniazda oraz ustawi\u0107 zmienn\u0105 DISPLAY docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY = $DISPLAY ubuntu bash Do przetestowania dzia\u0142ania ca\u0142o\u015bci warto u\u017cy\u0107 aplikacji xeyes zjanduj\u0105c\u0105 si\u0119 w pakiecie x11-apps dla Ubuntu.","title":"Docker\ud83d\udc0b"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#docker","text":"Docker jest jednym z najpopularniejszych obecnie system\u00f3w do wirtualizacji systemu operacyjnego. Pozwala w prosty spos\u00f3b stworzy\u0107 instancj\u0119 systemu b\u0119d\u0105c\u0105 niemal\u017ce zupe\u0142nie niezale\u017cnym bytem od systemu maszyny na kt\u00f3rej si\u0119 znajduje, mo\u017ce mie\u0107 ona zainstalowane zupe\u0142nie inne oprogramowanie, r\u00f3\u017cni\u0107 si\u0119 konfiguracj\u0105 sieciow\u0105 etc. R\u00f3\u017cni si\u0119 on od zwyczajnej maszyny wirtualnej tym, \u017ce taki kontener jest du\u017co bardziej elastyczny od maszyny wirtualnej, poniewa\u017c nie ma na sta\u0142e przydzielonych zasob\u00f3w takich jak RAM, CPU etc. Docker cz\u0119sto jest wykorzystywany do pracy z r\u00f3\u017cnorodnym oprogramowaniem bez niepotrzebnego za\u015bmiecania \u015brodowiska deweloperskiego. Jest to tak\u017ce jeden ze sposob\u00f3w unikni\u0119cia piek\u0142a zale\u017cno\u015bci.","title":"Docker\ud83d\udc0b"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#podstawowe-pojecia","text":"Obraz/Image - obrazy dockerowe s\u0105 ju\u017c gotowymi, wcze\u015bniej przygotowanymi paczkami zawieraj\u0105ce systemy w dockerze. Przyk\u0142adem obrazu jest ubuntu:latest . Kontener/Container - jest to uruchomiona instancja naszego dockera bazuj\u0105ca na danym obrazie. Zawiera on konfiguracj\u0119 oraz wszystkie dane unikalne dla danej instancji. Repozytorium - miejsce z kt\u00f3rego pobierane s\u0105 obrazy oraz ich aktualizacje. Jest to dockerhub , ale mo\u017cna te\u017c pobiera\u0107 z innych repozytori\u00f3w (np z gitlaba).","title":"Podstawowe Poj\u0119cia"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#obsuga","text":"Mamy kilka grup komend Grupa Opis config Zarz\u0105dzanie konfiguracj\u0105 container Operacje na kontenerach context Contexts for distributed deployment (k8s, \u2026) image Zarz\u0105dzanie obrazami network Zarz\u0105dzanie sieci\u0105 service Service (i.e. multiple containers that run the same image) management in distributed deployments (e.g.with docker-compose or docker swarm) system Global management volume Secondary storage management Do zarz\u0105dzania mo\u017cemy te\u017c u\u017cywa\u0107 apek GUI, albo plugin\u00f3w do IDE.","title":"Obs\u0142uga"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#zarzadzanie-obrazami","text":"Do zarz\u0105dzania obrazami na naszej maszynie s\u0142u\u017cy polecenie docker image .","title":"Zarz\u0105dzanie obrazami"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#nowy-obraz","text":"","title":"Nowy obraz"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#baza","text":"W wi\u0119kszo\u015bci wypadk\u00f3w warto wykorzystywa\u0107 obrazy znajduj\u0105ce si\u0119 na stronie hub.docker.com - zawiera ona zar\u00f3wno obrazy wi\u0119kszo\u015bci dystrybucji Linuxa, jak i obrazy z systemami zawieraj\u0105ce ju\u017c przygotowane narz\u0119dzia deweloperskie (np obrazy zawieraj\u0105ce zainstalowane i skonfigurowane bazy danych). Aby pobra\u0107 taki obraz na nasz\u0105 maszyn\u0119 nale\u017cy u\u017cy\u0107 komendy: docker image pull [ OPTIONS ] NAME [ :TAG | @DIGEST ] Na przyk\u0142ad: docker image pull alpine:latest # pobiera najnowszy obraz systemu alpine","title":"Baza"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#budowanie-z-konfiguracji","text":"Je\u015bli potrzebujemy stworzy\u0107 w\u0142asny obraz to mo\u017cemy go samodzielnie zbudowa\u0107 za pomoc\u0105 komendy: docker image build . Pozwala ona zbudowa\u0107 nam w\u0142asny obraz dockerowy na bazie pliku dockerfile . ( Opis sk\u0142adni )","title":"Budowanie z konfiguracji"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#stworzenie-poprzez-commita","text":"Do wygenerowania nowego obrazu mo\u017cemy te\u017c wykorzysta\u0107 ju\u017c istniej\u0105cy kontener, wystarczy u\u017cy\u0107 komendy commit docker commit containerName ImageName","title":"Stworzenie poprzez commita"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#zarzadzanie-posiadanymi-obrazami","text":"Za pomocy komendy docker image ls mo\u017cemy \u0142atwo wypisa\u0107 lokalnie pobrane obrazy. docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE 93c4e800ab68 2 weeks ago 677MB postgres 11 -alpine ec1e25ef56d1 5 weeks ago 156MB alpine latest 6dbb9cc54074 5 weeks ago 5 .61MB nginx 1 .19.0-alpine 7d0cdcc60a96 11 months ago 21 .3MB docker image rm usuwa dany obraz. docker image rm [ OPTIONS ] IMAGE [ IMAGE... ] Ale do czyszczenia jednak lepsze jest docker image prune , kt\u00f3re usuwa wszystkie \"wisz\u0105ce\" (dangling) obrazy, czyli np stare kopie obraz\u00f3w, kt\u00f3re zosta\u0142y ju\u017c przebudowane (na li\u015bcie obraz\u00f3w podpisane s\u0105 jako ). Dodanie flagi -a usuwa tak\u017ce wszystkie obrazy, kt\u00f3re s\u0105 nie s\u0105 u\u017cywane przez \u017cadne kontenery. $ docker image prune -a WARNING! This will remove all images without at least one container associated to them. Are you sure you want to continue ? [ y/N ] y Deleted Images: untagged: alpine:latest","title":"Zarz\u0105dzanie posiadanymi obrazami"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#zarzadzanie-kontenerami","text":"docker container ls - wypisuje kontenery obecnie uruchomione w systemie, dodanie flagi -a sprawia, \u017ce pokazuje tak\u017ce te wy\u0142\u0105czone. $ docker container ls -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bd1415cdc985 server_nginx \"/docker-entrypoint.\u2026\" 25 hours ago Exited ( 0 ) 24 hours ago server_nginx_1 2474e0650b34 registry.gitlab.com/toolkit/server:latest \"sh -c 'python manag\u2026\" 25 hours ago Exited ( 0 ) 25 hours ago server_web_1 ce6a641e20c1 postgres:11-alpine \"docker-entrypoint.s\u2026\" 2 weeks ago Exited ( 0 ) 21 hours ago server_db_1","title":"Zarz\u0105dzanie kontenerami"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#uruchamianie","text":"Do podstawowej pracy z kontenerem mo\u017cemy u\u017cywa\u0107 komend: docker container run albo te\u017c docker run docker container create docker container pause / unpause - wstrzymuje (i wznawia) procesy w kontenerze docker container start / stop - zabija wszystkie procesy w kontenerze i go zamyka docker container restart docker commit containerName ImageName -zapisujemy zmiany wprowadzone w danym kontenerze jako nowy obraz Do usuwania kontener\u00f3w s\u0142u\u017c\u0105 docker container prune i docker container rm . docker container create [OPTIONS] IMAGE [COMMAND] [ARG...] - tworzy nam nowy kontener bazuj\u0105cy na danym obrazie, mo\u017cemy tak\u017ce wybra\u0107 jaka komenda ma zosta\u0107 w nim uruchomiona. (ale go nie uruchamia) Mo\u017cemy go potem uruchomi\u0107 komend\u0105 docker container start ID . Do stworzenia nowego kontenera i natychmiastowego uruchomienia s\u0142u\u017cy docker container run . Przydatne flagi dla docker run [flagi] nazwa-obrazu : -rm usuwa kontener po zako\u0144czeniu pracy -i , --interactive po odpaleniu nadal mamy pod\u0142\u0105czone STDIN -t , --tty Pod\u0142\u0105czamy si\u0119 terminalem do kontenera (warto u\u017cy\u0107 razem z -i ) -d , --detach Uruchom kontener w tle i wypisz jego ID -e , --env Jakie zmienne \u015brodowiskowe maj\u0105 by\u0107 w naszym kontenerze (np docker run -e BROKER_PORT=9999 client ) -p , --publish udost\u0119pnij wewn\u0119trzne porty obrazu na portach hosta np -p 8089:80 wystawia port 80 z wn\u0119trza kontenera na porcie 8089 hosta. (mo\u017cemy teraz na naszej maszynie otworzy\u0107 to pod adresem localhost:8089) -v , --volume okre\u015bla jakie pliki/foldery z hosta mamy udost\u0119pni\u0107 kontenerowi i pod jakimi adresami np -v /tmp/logs.log:/tmp/runlog sprawi \u017ce apka w kontenerze pisz\u0105c do plik\u00f3w w folderze tmp/runlog/ b\u0119dzie tak na prawd\u0119 pisa\u0107 do folderu /tmp/logs.log/ na ho\u015bcie. --rm - usuwa kontener po zako\u0144czeniu --device - pozwala na udost\u0119pnienie urz\u0105dze\u0144 kontenerowi dockerowemu (np. kamery) --device=/dev/video0:/dev/video0 link docker container run -i -t ubuntu bash","title":"Uruchamianie"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#interakcje-z-dziaajacym-kontenerem","text":"attach - podpinanie stdin i stdouta to dzia\u0142aj\u0105cego kontenera. docker attach [OPTIONS] CONTAINER lub docker container attach cp - kopiowanie plik\u00f3w exec - uruchom w ju\u017c dzia\u0142aj\u0105cym kontenerze. Bardzo przydatne gdy chcemy np wej\u015b\u0107 tam z shellem. docker exec [OPTIONS] CONTAINER COMMAND [ARG...] lub docker container exec ... docker exec -it worker bash #-it podpina input i output","title":"Interakcje z dzia\u0142aj\u0105cym kontenerem"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#skadnia-pliku-dockerfile","text":"Plik dockerfile opisuje kolejne operacje pokazuj\u0105ce, jak powinien by\u0107 zbudowany nasz obraz. Przyk\u0142adowy plik dockerfile: # wybierz obraz bazowy od kt\u00f3rego zaczynasz konstruowanie FROM ubuntu:latest # Ustaw zmienne \u015brodowiskowe ENV APP_USER = user # Wykonaj dan\u0105 komend\u0119, np zainstaluj potrzebne pakiety etc. RUN apt install -y firefox # okre\u015bl po\u0142o\u017cenie folderu roboczego w kt\u00f3rym odpalane s\u0105 komendy WORKDIR /home/user # Kopiuj pliki z hosta do systemu plik\u00f3w wewn\u0105trz kontenera COPY ./plik /home/user/ Tak zdefiniowany obraz budujemy komend\u0105 docker build ./sciezka/folderu . Ka\u017cda nowa linia/polecenie zaczyna si\u0119 od komendy DU\u017bYMI_LITERAMI (taka konwencja). Komendy: FROM imageBase to jest zawsze pierwsza instrukcja pokazuj\u0105ca na jakim innym obrazie ma bazowa\u0107 nasz nowy obraz RUN command wykonuje komendy w pow\u0142oce kontenera przy budowaniu ENV variable value ustawia warto\u015bci w \u015brodowisku (mog\u0105 by\u0107 u\u017cywane przez wszystko co b\u0119dzie od teraz chodzi\u0107 w kontenerze) COPY source destination kopiuje pliki ze \u017ar\u00f3d\u0142a (URL, plik, folder) do miejsca w kontenerze (UWAGA! z przycyn bezpiecze\u0144stwa pozwala on tylko na kopie rzeczy tylko z folderu w kt\u00f3rym uruchamiamy komend\u0119, czyli nie mo\u017cemy np skopiowa\u0107 sobie czego\u015b z katalogu /home/jkowalski/pobrane ) ADD source destination to samo co ADD z r\u00f3\u017cnic\u0105, \u017ce gdy potrafi zorpakowa\u0107 archiwum, gdy jest ono podane jako plik WORKDIR path okre\u015bla folder roboczy w kt\u00f3rym maj\u0105 si\u0119 wykonywa\u0107 pozosta\u0142e komendy jak RUN , CMD , ENTRYPOINT CMD command arg1 arg2 ... dostarcza domy\u015blnych komend i warto\u015bci argument\u00f3w, kt\u00f3re zostan\u0105 uruchomione w kontenerze ENTRYPOINT command arg1 arg2 ... uruchamia t\u0105 komend\u0119, kiedy kontener jest uruchamiany (kontener jest zamykany kiedy ta komenda si\u0119 ko\u0144czy) EXPOSE port pokazuje na jakim porcie s\u0142ucha kontaner, sama go nie wystawia, pe\u0142ni raczej funkcj\u0119 informacyjn\u0105 dla u\u017cytkownika link VOLUME pozwala kontenerowi pod\u0142\u0105czy\u0107 si\u0119 do innego systemu plik\u00f3w wi\u0119cej info Uwaga - w pliku dockerowym mo\u017ce by\u0107 tylko jeden CMD albo ENTRYPOINT , jak nie to tylko ENTRYPOINT jest u\u017cywany (na og\u00f3\u0142).","title":"Sk\u0142adnia pliku dockerfile"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#entrypoint-i-cmd","text":"ENTRYPOINT ma 2 warianty bazuj\u0105cy na samej komendzie ENTRYPOINT node app.js 9000 9001 u\u017cywany razem z CMD ENTRYPOINT [ \"/bin/node\" , \"app.js\" ] CMD [ \"9000\" , \"9001\" ] I mo\u017cemy to potem odpali\u0107 tak docker build -t app docker run app docker run app 5555 5556 # gdy chcemy u\u017cy\u0107 w\u0142asnych argument\u00f3w Mo\u017cliwe jest te\u017c ustawienie w\u0142asnego entrypointa przy uruchomieniu. # Executes bash -c \"ls /\" docker run --entrypoint bash my-image:latest -c \"ls /\"","title":"ENTRYPOINT i CMD"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#docker-compose","text":"Jest on wykorzystywany, kiedy potrzebujemy uruchomi\u0107 wiele aplikacji, kt\u00f3re b\u0119d\u0105 si\u0119 ze sob\u0105 komunikowa\u0107 (a odpalenie w dockerze skryptu, kt\u00f3ry wszystko nam poodpala nie jest opcj\u0105).","title":"Docker compose"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#quick-start","text":"Wyobra\u017amy sobie, \u017ce potrzebujemy 3 apek, kt\u00f3re gadaj\u0105 ze sob\u0105. Tworzymy plik docker-compose.yml version : '2' services : #Ka\u017cdy z serwis\u00f3w jest tutaj oddzielony cli : image : client #obraz z kt\u00f3rego korzystamy build : ./client/ links : - bro environment : - BROKER_HOST=bro - BROKER_PORT=9998 wor : image : worker build : ./worker/ links : - bro environment : - BROKER_HOST=bro - BROKER_PORT=9999 bro : image : broker build : ./broker/ # z wn\u0119trza kontenera bro wystawiamy porty 9998 i 9999 aby inne # kontenery w composie mog\u0142y si\u0119 do nich podpi\u0105\u0107 (ale maszyna hosta nie) expose : - \"9998\u201c - \" 9999\" I uruchamiamy komend\u0119 docker-compose up -d , kt\u00f3ra: Buduje wszystkie wymagane obrazy (je\u015bli ich nie mamy) Uruchamia kolejne instancje ka\u017cdego z nich w odpowiedniej kolejno\u015bci Do wy\u0142\u0105czenia tego, co uruchomili\u015bmy wystarczy komenda docker-compose down","title":"Quick start"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#plik-konfiguracyjny","text":"//TODO opisz dok\u0142adniej syntax docker-compose na podstawie pliku tsr-ud04-eng-DockerReferenceDocs2122.pdf oraz https://docs.docker.com/compose/compose-file/ Plik docker-compose.yml s\u0142u\u017cy do zdefiniowania ca\u0142ych grup kontener\u00f3w, kt\u00f3ra maj\u0105 by\u0107 odpalone razem na jednej maszynie ( pe\u0142na dokumentacja ).Zawiera on opisy kolejno: serwis\u00f3w ( services: ) - czyli poszczeg\u00f3lnych obraz\u00f3w dockerowych, kt\u00f3re maj\u0105 tworzy\u0107 ca\u0142o\u015b\u0107 (to jedyna obowi\u0105zkowa cz\u0119\u015b\u0107, pozosta\u0142e s\u0105 opcjonalne) sieci ( networks ) - czyli poszczeg\u00f3lnych sieci wolumin\u00f3w ( volumes ) - trwa\u0142ych miejsc do przechowywania plik\u00f3w sekret\u00f3w ( secrets ) konfiguracji ( configs ) Przyk\u0142adowy docker compose services : frontend : image : awesome/webapp ports : - \"443:8043\" networks : - front-tier - back-tier configs : - httpd-config secrets : - server-certificate backend : image : awesome/database volumes : - db-data:/etc/data networks : - back-tier volumes : db-data : driver : flocker driver_opts : size : \"10GiB\" configs : httpd-config : external : true secrets : server-certificate : external : true networks : # The presence of these objects is sufficient to define them front-tier : {} back-tier : {}","title":"Plik konfiguracyjny"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#serwisy","text":"Podstawowe parametry dla serwis\u00f3w dokumentacja : image - obraz, kt\u00f3rego ma u\u017cywa\u0107 dany serwis expose - lista port\u00f3w, kt\u00f3re maj\u0105 by\u0107 udost\u0119pnione innym serwisom wewn\u0105trz dockera (host ich nie widzi) ports - lista port\u00f3w wystawionych na zewn\u0105trz dockera (s\u0105 one tak\u017ce dost\u0119pne dla innych serwis\u00f3w w dockerze) links - lista serwis\u00f3w, kt\u00f3re musz\u0105 zosta\u0107 wystartowane przed uruchomieniem tego serwisu environment - lista zmiennych \u015brodowiskowych w danym kontenerze build - \u015bcie\u017cka do folderu z plikiem Dockerfile , aby go zbudowa\u0107, gdyby jeszcze nie by\u0142o odpowiedniego obrazu //TODO dopisz przyk\u0142ady Inne parametry dla serwis\u00f3w: extra_hosts - lista mapowa\u0144 adres\u00f3w na nazwy (pojawi\u0105 si\u0119 w pliku /etc/hosts na maszynie) link extra_hosts : - \"somehost:162.242.195.82\" - \"innyhost.local:50.31.209.229\"","title":"serwisy"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#wolumeny","text":"Za ich pomoc\u0105 mo\u017cemy tworzy\u0107 trwa\u0142e miejsca do przechowywania danych. Trwa\u0142ych, czyli takich, kt\u00f3re nie ulegaj\u0105 skasowaniu, kiedy usuwany jest kontener. Dlatego cz\u0119sto s\u0105 one wykorzystywane min. do przechowywania baz danych, aby\u015bmy nic nie tracili wtdy, kiedy np. przy aktualizacji b\u0119dziemy chcieli zmieni\u0107 wersj\u0119 kontenera na \u015bwie\u017csz\u0105. Kolejn\u0105 zalet\u0105 wolumen\u00f3w w kontek\u015bcie compose'a jest to, \u017ce mog\u0105 one by\u0107 wsp\u00f3\u0142dzielone pomi\u0119dzy poszczeg\u00f3lnymi serwisami. dokumentacja Przyk\u0142ad: services : backend : image : awesome/database volumes : - db-data:/etc/data #db-data b\u0119dzie zamontowane w backendzie pod \u015bcie\u017ck\u0105 /etc/data backup : image : backup-service volumes : - db-data:/var/lib/backup/data #db-data to automatycznie zdefioniowany wolumen #system stworzy go sobie najpewniej w lokacji /var/lib/docker volumes : db-data : Uruchamiaj\u0105c docker compose up docker tworzy wolument je\u015bli jeszcze nie istnieje. Warto tytaj wiedzie\u0107 o atrybutach takich jak: external (true, false) - okre\u015bla, czy ten wolumen jest zarz\u0105dzany poza danym serwerem. Je\u015bli ustawiony na true to wszystkie pozosta\u0142e flagi s\u0105 ignorowane (za wyj\u0105tkiem name). Je\u015bli taki wolumen nie istnieje to zwracany jest b\u0142\u0105d, je\u015bli istnieje to jest on pod\u0142\u0105czany. volumes : db-data : external : true #szukamy czy volume o nazwie db-data istnieje driver_opts - pozwala na zamontowanie wolumentu za pomoc\u0105 jakiego\u015b sterownika. Pozwala np. na stworzenie wolumenu znajduj\u0105cego si\u0119 na serwerze NFS volumes : example : driver_opts : type : \"nfs\" o : \"addr=10.40.0.199,nolock,soft,rw\" device : \":/docker/example\" lub zwyczajne okre\u015blenie na jaki folder hosta ma by\u0107 on zmapowany volumes : cvat_share : driver_opts : type : none device : /mnt/duzy_dysk/pliki_dla_cvata/ o : bind","title":"Wolumeny"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#inne","text":"//TODO opisz pozosta\u0142e","title":"inne"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#komendy","text":"UWAGA wkr\u00f3tce komenda docker-ckompose powinna zosta\u0107 zmieniona na docker compose link docker-compose up - Parametry: --scale service=num pozwala odpali\u0107 wi\u0119cej instancji danego serwisu (jednak gdy skalujemy serwisy, kt\u00f3re wystawiaj\u0105 porty expose to tylko jedna z instancji b\u0119dzie widoczna dla innych) //TODO sprawd\u017a to -d -//TODO -f - flaga do uruchamiania wielu plik\u00f3w docker compose jednocze\u015bnie Je\u015bli wszystkie wysecyfikowane pliki znajduj\u0105 si\u0119 w tym samym folderze wtedy docker \u0142\u0105czy je w jedn\u0105 wsp\u00f3ln\u0105 konfiguracj\u0119. przyk\u0142ad apki z wt\u00f3rej w dodatkowym pliku jest dodane szyfrowanie HTTPS: docker compose -f docker-compose.yml -f docker-compose.https.yml up -d docker-compose down - zatrzymuje i usuwa kontenery z danego compose'a docker compose stop - zatrzymuje, ale bez usuwania docker compose start - uruchamia istniej\u0105ce kontenery dla serwisu","title":"Komendy"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#przydatne-snippety","text":"","title":"Przydatne snippety"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#tworzenie-uzytkownika","text":"RUN useradd -ms /bin/bash -G sudo,inna_grupa dockeruser #Wy\u0142\u0105czenie promptu o has\u0142o przy sudo RUN echo \"dockeruser ALL=(ALL) NOPASSWD: ALL\" > /etc/sudoers.d/ubuntu #ustawienie kolorowego terminala ENV TERM = xterm-256color #prze\u0142\u0105czenie na u\u017cytkownika przy dalszych komendach USER dockeruser WORKDIR /home/dockeruser","title":"Tworzenie u\u017cytkownika"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/docker/#uruchamianie-z-dostepem-do-gui","text":"W wypadku aplikacji dockerowych mo\u017cliwe jest ich uruchamianie aplikacji GUI z ich poziomu. Wymaga to najpierw nadania uprawnie\u0144 do otwierania okien xhost +local: #Ta opcja jest aktywna do restartu komputera Poza tym nale\u017cy da\u0107 dockerowi dost\u0119p do odpowiedniego gniazda oraz ustawi\u0107 zmienn\u0105 DISPLAY docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY = $DISPLAY ubuntu bash Do przetestowania dzia\u0142ania ca\u0142o\u015bci warto u\u017cy\u0107 aplikacji xeyes zjanduj\u0105c\u0105 si\u0119 w pakiecie x11-apps dla Ubuntu.","title":"Uruchamianie z dost\u0119pem do GUI"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/git/","text":"Przydatne komendy git W\u0142\u0105czanie i wy\u0142\u0105czanie ignorowania zmian dla danego pliku git update-index --skip-worktree default_values.txt git update-index --no-skip-worktree default_values.txt #list of files marked as skipped git ls-files -v . | grep ^S Albo: git update-index --assume-unchanged #i aby cofn\u0105\u0107 git update-index --no-assume-unchanged Sprz\u0105tanie git reset #unstage all of files git checkout . #revert all local uncommitted changes git clean -fdx #remove all local untracked files Usuwa wszystkie niezacommitowane zmiany. Sprz\u0105tanie w commitach (interactive rebase) Inspirowane artyku\u0142em . git rebase -i JAK_DALEKO #np git rebase -i HEAD~3 #3 commity do ty\u0142u #lub git rebase -i master To jak g\u0142\u0119boki ma by\u0107 nasz rebase mo\u017cemy okre\u015bli\u0107 jako ilo\u015b\u0107 commit\u00f3w ( HEAD~9 - czyli 9 commit\u00f3w do ty\u0142u), czy te\u017c wzgl\u0119dem innego brancha (np. maj\u0105c feature branch wychodz\u0119cy z mastera mo\u017cemy zrobi\u0107 rebase wzgl\u0119dem mastera). Po zatwierdzeniu otrzymujemy list\u0119 commit\u00f3w z kt\u00f3rymi decydujemy co zrobi\u0107. pick 56dc78c Poprawki do manipulacji tekstem pick 57d9877 Podstawy templatek pick b0675c9 Wykluczanie s\u0142\u00f3w w regexach pick 1c30565 Cockpit dodany do narz\u0119dzi # Przestawianie 578f646..1c30565 na 1c30565 (4 polecenia) # # Polecenia: # p, pick = dobierz zapis # r, reword = u\u017cyj zapisu, ale przeredaguj jego komunikat # e, edit = u\u017cyj zapisu, ale zatrzymaj si\u0119, \u017ceby go poprawi\u0107 # s, squash = u\u017cyj zapisu, ale po\u0142\u0105cz go z poprzednim (sp\u0142aszcz) # f, fixup = jak \u201esquash\u201d, ale odrzu\u0107 komunikat tego zapisu # x, exec = wykonaj polecenie (reszt\u0119 wiersza) w pow\u0142oce # b, break = zatrzymaj si\u0119 tu (kontynuuj przestawianie przez \u201egit rebase --continue\u201d) # d, drop = usu\u0144 zapis # l, label = nazwij bie\u017c\u0105ce HEAD # t, reset = zresetuj HEAD do etykietki # m, merge [-C | -c ] [# ] # . utw\u00f3rz zapis scalenia u\u017cywaj\u0105c pierwotnego komunikatu scalenia # . (albo , je\u015bli nie podano pierwotnego zapisu scalenia. # . U\u017cyj -c , aby przeredagowa\u0107 komunikat zapisu. # Kolejno\u015b\u0107 wierszy mo\u017ce by\u0107 zmieniona; s\u0105 wykonywane z g\u00f3ry na d\u00f3\u0142. # # Je\u015bli usuniesz tutaj wiersz, TEN ZAPIS B\u0118DZIE STRACONY. # # Je\u015bli jednak usuniesz wszystko, przestawianie zostanie przerwane. # # Zwa\u017c, \u017ce puste zapisy s\u0105 wykomentowane Nast\u0119pnie po wybraniu operacji zatwierdzamy i rozpoczynamy zmiany.","title":"Przydatne komendy git"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/git/#przydatne-komendy-git","text":"","title":"Przydatne komendy git"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/git/#waczanie-i-wyaczanie-ignorowania-zmian-dla-danego-pliku","text":"git update-index --skip-worktree default_values.txt git update-index --no-skip-worktree default_values.txt #list of files marked as skipped git ls-files -v . | grep ^S Albo: git update-index --assume-unchanged #i aby cofn\u0105\u0107 git update-index --no-assume-unchanged ","title":"W\u0142\u0105czanie i wy\u0142\u0105czanie ignorowania zmian dla danego pliku"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/git/#sprzatanie","text":"git reset #unstage all of files git checkout . #revert all local uncommitted changes git clean -fdx #remove all local untracked files Usuwa wszystkie niezacommitowane zmiany.","title":"Sprz\u0105tanie"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/git/#sprzatanie-w-commitach-interactive-rebase","text":"Inspirowane artyku\u0142em . git rebase -i JAK_DALEKO #np git rebase -i HEAD~3 #3 commity do ty\u0142u #lub git rebase -i master To jak g\u0142\u0119boki ma by\u0107 nasz rebase mo\u017cemy okre\u015bli\u0107 jako ilo\u015b\u0107 commit\u00f3w ( HEAD~9 - czyli 9 commit\u00f3w do ty\u0142u), czy te\u017c wzgl\u0119dem innego brancha (np. maj\u0105c feature branch wychodz\u0119cy z mastera mo\u017cemy zrobi\u0107 rebase wzgl\u0119dem mastera). Po zatwierdzeniu otrzymujemy list\u0119 commit\u00f3w z kt\u00f3rymi decydujemy co zrobi\u0107. pick 56dc78c Poprawki do manipulacji tekstem pick 57d9877 Podstawy templatek pick b0675c9 Wykluczanie s\u0142\u00f3w w regexach pick 1c30565 Cockpit dodany do narz\u0119dzi # Przestawianie 578f646..1c30565 na 1c30565 (4 polecenia) # # Polecenia: # p, pick = dobierz zapis # r, reword = u\u017cyj zapisu, ale przeredaguj jego komunikat # e, edit = u\u017cyj zapisu, ale zatrzymaj si\u0119, \u017ceby go poprawi\u0107 # s, squash = u\u017cyj zapisu, ale po\u0142\u0105cz go z poprzednim (sp\u0142aszcz) # f, fixup = jak \u201esquash\u201d, ale odrzu\u0107 komunikat tego zapisu # x, exec = wykonaj polecenie (reszt\u0119 wiersza) w pow\u0142oce # b, break = zatrzymaj si\u0119 tu (kontynuuj przestawianie przez \u201egit rebase --continue\u201d) # d, drop = usu\u0144 zapis # l, label = nazwij bie\u017c\u0105ce HEAD # t, reset = zresetuj HEAD do etykietki # m, merge [-C | -c ] [# ] # . utw\u00f3rz zapis scalenia u\u017cywaj\u0105c pierwotnego komunikatu scalenia # . (albo , je\u015bli nie podano pierwotnego zapisu scalenia. # . U\u017cyj -c , aby przeredagowa\u0107 komunikat zapisu. # Kolejno\u015b\u0107 wierszy mo\u017ce by\u0107 zmieniona; s\u0105 wykonywane z g\u00f3ry na d\u00f3\u0142. # # Je\u015bli usuniesz tutaj wiersz, TEN ZAPIS B\u0118DZIE STRACONY. # # Je\u015bli jednak usuniesz wszystko, przestawianie zostanie przerwane. # # Zwa\u017c, \u017ce puste zapisy s\u0105 wykomentowane Nast\u0119pnie po wybraniu operacji zatwierdzamy i rozpoczynamy zmiany.","title":"Sprz\u0105tanie w commitach (interactive rebase)"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/narzedzia/","text":"Zbi\u00f3r r\u00f3\u017cnych u\u017cytecznych narz\u0119dzi, framework\u00f3w , stron i bibliotek z kt\u00f3ymi si\u0119 spotka\u0142em Dokumentacja doxygen https://readthedocs.org/ mkdocs https://jekyllrb.com/ Daux.io Statystyki githuba i repozytori\u00f3w statystyki pobra\u0144 projekt\u00f3w - github-release-stats i GithubStats najaktywniejsze forki danego repo - legacy , nowa wersja ststystyki u\u017cytkownika - Coderstats Graf gwiazdek - star-history Liczenie linii kodu cloc (lokalnie) lub https://codetabs.com/count-loc/count-loc-online.html Regex https://regexr.com/ Inne SearchCode - przeszukiwanie baz z kodem \u017ar\u00f3d\u0142owym. Przydatne, gdy chcesz znale\u017a\u0107 przyk\u0142ady wywo\u0142ywania danej funkcji. zerotier - chyba najprostszy VPN Gdy chcemy w sieci zerotiera postawi\u0107 serwer DNS https://github.com/zerotier/zeronsd Xonsh - odmiana shella (zamiennik dla klasycznego basha) bazuj\u0105cy na pythonie len ( $ ( curl - L https : // xon . sh )) for filename in ` .* ` : print ( filename ) du - sh @ ( filename )","title":"Zbi\u00f3r r\u00f3\u017cnych u\u017cytecznych narz\u0119dzi, framework\u00f3w , stron i bibliotek z kt\u00f3ymi si\u0119 spotka\u0142em"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/narzedzia/#zbior-roznych-uzytecznych-narzedzi-frameworkow-stron-i-bibliotek-z-ktoymi-sie-spotkaem","text":"","title":"Zbi\u00f3r r\u00f3\u017cnych u\u017cytecznych narz\u0119dzi, framework\u00f3w , stron i bibliotek z kt\u00f3ymi si\u0119 spotka\u0142em"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/narzedzia/#dokumentacja","text":"doxygen https://readthedocs.org/ mkdocs https://jekyllrb.com/ Daux.io","title":"Dokumentacja"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/narzedzia/#statystyki-githuba-i-repozytoriow","text":"statystyki pobra\u0144 projekt\u00f3w - github-release-stats i GithubStats najaktywniejsze forki danego repo - legacy , nowa wersja ststystyki u\u017cytkownika - Coderstats Graf gwiazdek - star-history Liczenie linii kodu cloc (lokalnie) lub https://codetabs.com/count-loc/count-loc-online.html Regex https://regexr.com/","title":"Statystyki githuba i repozytori\u00f3w"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/narzedzia/#inne","text":"SearchCode - przeszukiwanie baz z kodem \u017ar\u00f3d\u0142owym. Przydatne, gdy chcesz znale\u017a\u0107 przyk\u0142ady wywo\u0142ywania danej funkcji. zerotier - chyba najprostszy VPN Gdy chcemy w sieci zerotiera postawi\u0107 serwer DNS https://github.com/zerotier/zeronsd Xonsh - odmiana shella (zamiennik dla klasycznego basha) bazuj\u0105cy na pythonie len ( $ ( curl - L https : // xon . sh )) for filename in ` .* ` : print ( filename ) du - sh @ ( filename )","title":"Inne"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/serwery_i_homelaby/","text":"Narz\u0119dzia serwerowe\u2601\ufe0f Na dobry pocz\u0105tek mo\u017cna zajrze\u0107 na wiki reddita homelab Monitoring i zarz\u0105dzanie infrastruktur\u0105 Przydatne narz\u0119dzia dla ka\u017cdej osoby, kt\u00f3ra zamierza rozpocz\u0105\u0107 swoj\u0105 przygod\u0119 z serwerami/homelabem. cockpit - pozwala w prosty spos\u00f3b monitorowa\u0107 serwer (poprzez apk\u0119 webow\u0105 mo\u017cemy si\u0119 zalogowa\u0107, uruchomi\u0107 terminal, sprawdza\u0107 obci\u0105\u017cenie, logi etc) ( link to konfiguracji ) Je\u015bli chcemy w cockpicie wygodnie zarz\u0105dza\u0107 tak\u017ce portami warto doinstalowa\u0107 linux-dash - nieco prostsza alternatywa od cockpita Narz\u0119dzia do monitorowania - d\u0142uga lista https://www.ubuntupit.com/most-comprehensive-list-of-linux-monitoring-tools-for-sysadmin/ Cockpit + cloudflare tunnel Wymagana edycja pliku cat /etc/cockpit/cockpit.conf [WebService] Origins = https://dashboard.xxxxx.ca wss://dashboard.xxxxx.ca ProtocolHeader = X-Forwarded-Proto AllowUnencrypted = true Potem w panelu Cloudflate mapujemy nasz adres na http://localhost:9090 \u017ar\u00f3d\u0142o Inn\u0105 wa\u017cn\u0105 rzecz\u0105 jest ograniczenie poziomu domeny. Nie powinno si\u0119 u\u017cywa\u0107 pod-poddomen. mo\u017ce by\u0107 cockpit-serwer.domena.pl , ale nie cockpit.serwer.domena.pl \u017cr\u00f3d\u0142o Monitorowanie docker\u00f3w \ud83d\udc0b portainer aplikacja s\u0142u\u017c\u0105ca do wygodnej pracy oraz monitorowania docker\u00f3w w systemie Yacht - alternatywa dla portainera (troch\u0119 m\u0142odszy i prostszy projekt) Sie\u0107, \u0142\u0105czenie si\u0119 i udost\u0119pnianie ngrok - pozwala \u0142atwo udost\u0119pnia\u0107 serwisy z urz\u0105dze\u0144 w sieci lokalnej. Dobre do prototypowania oraz prostych stron cloudflare - must-have gdy masz jak\u0105\u015b domen\u0119 i ni\u0105 zarz\u0105dzasz Cloudflare Proxy - zwi\u0119ksza wydajno\u015b\u0107 twoich stron oraz pozwala tunelowa\u0107 ruch IPv4 na adresy PIv6 Tunelowanie - pozwala wystawia\u0107 do sieci serwery z sieci lokalnych pozbawione publicznych adres\u00f3w. Mo\u017cna u\u017cy\u0107 tego chocia\u017cby do udost\u0119pnienia cockpita, czy te\u017c SSH (instrukcje) VPN-y Wireguard - jeden z dw\u00f3ch popularnych protoko\u0142\u00f3w VPNa. OpenVPN - r\u00f3wnie\u017c popularny, lecz troche przestarza\u0142y protok\u00f3\u0142 VPNa PiVPN - prosty i uniwersalny VPN. Ma UI webowe oraz wpiera Wireguarda i OpenVPN-a. Obs\u0142uga PiVPN-a i Wireguarda Zak\u0142adam, \u017ce PiVPN jest skonfigurowany z Wireguardem. Aby doda\u0107 nowego nowe po\u0142\u0105czenie do naszego serwera wireguarda nalezy wywo\u0142a\u0107 komend\u0119 pivpn add , tam okre\u015blamy nazw\u0119 po\u0142\u0105czenia. pawel@amd:~$ pivpn add Enter a Name for the Client: superserwer ::: Client Keys generated ::: Client config generated ::: Updated server config ::: WireGuard reloaded ====================================================================== ::: Done! superserwer.conf successfully created! ::: superserwer.conf was copied to /home/opc/configs for easytransfer. ::: Please use this profile only on one device and create additional ::: profiles for other devices. You can also use pivpn -qr ::: to generate a QR Code you can scan with the mobile app. ====================================================================== Konfigi s\u0105 te\u017c zapisywane w /etc/wireguard/configs Instrukcja pod\u0142\u0105czenia si\u0119 - Aby si\u0119 pod\u0142\u0105czy\u0107 na maszynie klienckiej umieszczamy ten konfig w folderze /etc/wireguard/ i wo\u0142amy komend\u0119 wg-quick up nazwapliku \ud83d\udfe9 any wystartowa\u0107 i wg-quick down nazwapliku \ud83d\udfe5 aby zatrzyma\u0107. (przyda\u0107 si\u0119 mo\u017ce paczka resolvconf) Storage TrueNAS - system operacyjny dedykowany maszynm maj\u0105cym s\u0142u\u017cy\u0107 jako storage Wtyczka do Cockpitu pozwalaj\u0105ca na \u0142atwe udost\u0119pnianie zawarto\u015bci, jest te\u017c inna wtyczka do przegl\u0105dania plik\u00f3w Dla chc\u0105cych postawi\u0107 sobie jaki\u015b serwer Poszukiwanie VPS-a: mikr.us - fajne i tanie serwery dla amator\u00f3w, jest troch\u0119 dokumentacji i fajna spo\u0142eczno\u015b\u0107 ( FB i Discord ) Oracle free tier - darmowe serwery VPS or oracle. Om\u00f3wienie: link pepper SIDENOTE : je\u015bli instancje s\u0105 nieu\u017cywane to mog\u0105 by\u0107 automatyucznie wy\u0142\u0105czane: link serverhunter - wyszukiwarka tanich VPS\u00f3w (gdy mikrus nie starcza) Oracle odblokowywanie port\u00f3w Jako, \u017ce maszyny od Oracle maj\u0105 domy\u015blnie publiczne IP to maj\u0105 domy\u015blnie nieco bardziej restrykcyjny firewall. link do dokumentacji Najpierw trzeba zmieni\u0107 ustawienia w panelu na stronie oracle, a potem jeszcze doda\u0107 zasad\u0119 do iptables sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT i je\u015bli to dzia\u0142a to mo\u017cemy zapisa\u0107 nasz\u0105 zmian\u0119 sudo netfilter-persistent save Oganianie domen: tld-list - por\u00f3wnywarka cen domen seohost - moim zdaniem najlepszy dostawca domen w Polsce","title":"Narz\u0119dzia serwerowe\u2601\ufe0f"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/serwery_i_homelaby/#narzedzia-serwerowe","text":"Na dobry pocz\u0105tek mo\u017cna zajrze\u0107 na wiki reddita homelab","title":"Narz\u0119dzia serwerowe\u2601\ufe0f"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/serwery_i_homelaby/#monitoring-i-zarzadzanie-infrastruktura","text":"Przydatne narz\u0119dzia dla ka\u017cdej osoby, kt\u00f3ra zamierza rozpocz\u0105\u0107 swoj\u0105 przygod\u0119 z serwerami/homelabem. cockpit - pozwala w prosty spos\u00f3b monitorowa\u0107 serwer (poprzez apk\u0119 webow\u0105 mo\u017cemy si\u0119 zalogowa\u0107, uruchomi\u0107 terminal, sprawdza\u0107 obci\u0105\u017cenie, logi etc) ( link to konfiguracji ) Je\u015bli chcemy w cockpicie wygodnie zarz\u0105dza\u0107 tak\u017ce portami warto doinstalowa\u0107 linux-dash - nieco prostsza alternatywa od cockpita Narz\u0119dzia do monitorowania - d\u0142uga lista https://www.ubuntupit.com/most-comprehensive-list-of-linux-monitoring-tools-for-sysadmin/ Cockpit + cloudflare tunnel Wymagana edycja pliku cat /etc/cockpit/cockpit.conf [WebService] Origins = https://dashboard.xxxxx.ca wss://dashboard.xxxxx.ca ProtocolHeader = X-Forwarded-Proto AllowUnencrypted = true Potem w panelu Cloudflate mapujemy nasz adres na http://localhost:9090 \u017ar\u00f3d\u0142o Inn\u0105 wa\u017cn\u0105 rzecz\u0105 jest ograniczenie poziomu domeny. Nie powinno si\u0119 u\u017cywa\u0107 pod-poddomen. mo\u017ce by\u0107 cockpit-serwer.domena.pl , ale nie cockpit.serwer.domena.pl \u017cr\u00f3d\u0142o Monitorowanie docker\u00f3w \ud83d\udc0b portainer aplikacja s\u0142u\u017c\u0105ca do wygodnej pracy oraz monitorowania docker\u00f3w w systemie Yacht - alternatywa dla portainera (troch\u0119 m\u0142odszy i prostszy projekt)","title":"Monitoring i zarz\u0105dzanie infrastruktur\u0105"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/serwery_i_homelaby/#siec-aczenie-sie-i-udostepnianie","text":"ngrok - pozwala \u0142atwo udost\u0119pnia\u0107 serwisy z urz\u0105dze\u0144 w sieci lokalnej. Dobre do prototypowania oraz prostych stron cloudflare - must-have gdy masz jak\u0105\u015b domen\u0119 i ni\u0105 zarz\u0105dzasz Cloudflare Proxy - zwi\u0119ksza wydajno\u015b\u0107 twoich stron oraz pozwala tunelowa\u0107 ruch IPv4 na adresy PIv6 Tunelowanie - pozwala wystawia\u0107 do sieci serwery z sieci lokalnych pozbawione publicznych adres\u00f3w. Mo\u017cna u\u017cy\u0107 tego chocia\u017cby do udost\u0119pnienia cockpita, czy te\u017c SSH (instrukcje) VPN-y Wireguard - jeden z dw\u00f3ch popularnych protoko\u0142\u00f3w VPNa. OpenVPN - r\u00f3wnie\u017c popularny, lecz troche przestarza\u0142y protok\u00f3\u0142 VPNa PiVPN - prosty i uniwersalny VPN. Ma UI webowe oraz wpiera Wireguarda i OpenVPN-a.","title":"Sie\u0107, \u0142\u0105czenie si\u0119 i udost\u0119pnianie"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/serwery_i_homelaby/#obsuga-pivpn-a-i-wireguarda","text":"Zak\u0142adam, \u017ce PiVPN jest skonfigurowany z Wireguardem. Aby doda\u0107 nowego nowe po\u0142\u0105czenie do naszego serwera wireguarda nalezy wywo\u0142a\u0107 komend\u0119 pivpn add , tam okre\u015blamy nazw\u0119 po\u0142\u0105czenia. pawel@amd:~$ pivpn add Enter a Name for the Client: superserwer ::: Client Keys generated ::: Client config generated ::: Updated server config ::: WireGuard reloaded ====================================================================== ::: Done! superserwer.conf successfully created! ::: superserwer.conf was copied to /home/opc/configs for easytransfer. ::: Please use this profile only on one device and create additional ::: profiles for other devices. You can also use pivpn -qr ::: to generate a QR Code you can scan with the mobile app. ====================================================================== Konfigi s\u0105 te\u017c zapisywane w /etc/wireguard/configs Instrukcja pod\u0142\u0105czenia si\u0119 - Aby si\u0119 pod\u0142\u0105czy\u0107 na maszynie klienckiej umieszczamy ten konfig w folderze /etc/wireguard/ i wo\u0142amy komend\u0119 wg-quick up nazwapliku \ud83d\udfe9 any wystartowa\u0107 i wg-quick down nazwapliku \ud83d\udfe5 aby zatrzyma\u0107. (przyda\u0107 si\u0119 mo\u017ce paczka resolvconf)","title":"Obs\u0142uga PiVPN-a i Wireguarda"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/serwery_i_homelaby/#storage","text":"TrueNAS - system operacyjny dedykowany maszynm maj\u0105cym s\u0142u\u017cy\u0107 jako storage Wtyczka do Cockpitu pozwalaj\u0105ca na \u0142atwe udost\u0119pnianie zawarto\u015bci, jest te\u017c inna wtyczka do przegl\u0105dania plik\u00f3w","title":"Storage"},{"location":"Narz%C4%99dzia%F0%9F%9B%A0%EF%B8%8F/serwery_i_homelaby/#dla-chcacych-postawic-sobie-jakis-serwer","text":"Poszukiwanie VPS-a: mikr.us - fajne i tanie serwery dla amator\u00f3w, jest troch\u0119 dokumentacji i fajna spo\u0142eczno\u015b\u0107 ( FB i Discord ) Oracle free tier - darmowe serwery VPS or oracle. Om\u00f3wienie: link pepper SIDENOTE : je\u015bli instancje s\u0105 nieu\u017cywane to mog\u0105 by\u0107 automatyucznie wy\u0142\u0105czane: link serverhunter - wyszukiwarka tanich VPS\u00f3w (gdy mikrus nie starcza) Oracle odblokowywanie port\u00f3w Jako, \u017ce maszyny od Oracle maj\u0105 domy\u015blnie publiczne IP to maj\u0105 domy\u015blnie nieco bardziej restrykcyjny firewall. link do dokumentacji Najpierw trzeba zmieni\u0107 ustawienia w panelu na stronie oracle, a potem jeszcze doda\u0107 zasad\u0119 do iptables sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT i je\u015bli to dzia\u0142a to mo\u017cemy zapisa\u0107 nasz\u0105 zmian\u0119 sudo netfilter-persistent save Oganianie domen: tld-list - por\u00f3wnywarka cen domen seohost - moim zdaniem najlepszy dostawca domen w Polsce","title":"Dla chc\u0105cych postawi\u0107 sobie jaki\u015b serwer"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/","text":"Podstawy Pythona \ud83d\udc0d Quickstart Shebang Jest to pierwsza linia skryptu (nie tylko w pythonie), kt\u00f3ra okre\u015bla za pomoc\u0105 czego ma by\u0107 wykonany skrypt (mo\u017ce by\u0107 to bash, zsh, python) Mamy tutaj 2 mo\u017cliwo\u015bci: Ta bardziej uniwersalna (dzia\u0142a z wieloma systemami operacyjnymi) #!/usr/bin/env python3 Ta mniej uniwersalna, ale pozwalaj\u0105ca u\u017cywa\u0107 pythona z r\u00f3\u017cnymi parametrami #!/usr/bin/python3 Np z po dodaniu parametru -i nadal pozostaniemy w pythonie po wykonaniu skryptu, co pozwoli nam np zajrze\u0107 do zmiennych, kt\u00f3re by\u0142y u\u017cyte, lub \u0142atwo u\u017cy\u0107 klas, albo metod, kt\u00f3re zosta\u0142y zdefiniowane w skrypcie. Funkcja main wykonuje si\u0119, gdy skrypt jest uruchamiany jako samodzielny program, a nie jako modu\u0142 czego\u015b innego #!/usr/bin/python3 #warto to da\u0107, aby system widzia\u0142, \u017ce to skrypt w pythonie a nie np. w shellu def main (): print ( \"Witaj \u015bwiecie!\" ) if __name__ == \"__main__\" : main () Argumenty programu # Print total number of arguments print ( 'Total number of arguments:' , format ( len ( sys . argv ))) # Print all arguments print ( 'Argument List:' , str ( sys . argv )) # Print arguments one by one print ( 'First argument:' , str ( sys . argv [ 0 ])) print ( 'Second argument:' , str ( sys . argv [ 1 ])) Do parsowania bardziej skomplikowanych argument\u00f3w warto u\u017cy\u0107 biblioteki argparse Zwracanie warto\u015bci sys . exit ( numer ) Funkcje we/wy pobrany_napis = input () print ( \"Tw\u00f3j napis to: \" + pobrany_napis ) input() jest funkcj\u0105, kt\u00f3ra pobiera napis podany przez u\u017cytkownika ze standardowego wej\u015bcia (do entera) zwraca zmienn\u0105 typu str Dla strumieni: import sys for line in sys . stdin : sys . stdout . write ( line ) Importowanie bibliotek etc TODO Przyk\u0142adowe importy. import math from collections import namedtuple from django.contrib.auth.forms import ( AuthenticationForm , PasswordChangeForm , PasswordResetForm , SetPasswordForm , ) wi\u0119cej informacji w opisie paczek . Podstawy Komentarze \"\"\" Komentarz na kilka linii \"\"\" #komentarz na jedn\u0105 lini\u0119 Zmienne Deklarujemy je be okre\u015blania ich typu a=5 (interpreter automatycznie uzna, \u017ce to b\u0119dzie int) W odr\u00f3\u017cnieniu od takich j\u0119zyk\u00f3w jak C++, C# czy Java, w j\u0119zyku Python wyst\u0119puje typowanie dynamiczne. Oznacza to, \u017ce konkretny identyfikator, konkretna zmienna, np. a, mo\u017ce raz przechowywa\u0107 napis (\"Ala ma kota\") by po chwili przechowywa\u0107 liczb\u0119 ca\u0142kowit\u0105 (3). Do sprawdzania typu danych s\u0142u\u017cy funkcja type() . logiczna = True print ( type ( logiczna )) ## Najwa\u017cniejsze typy zmiennych: bool , warto\u015b\u0107 logiczna, tak lub nie, prawda (True) albo fa\u0142sz (False) int , liczba ca\u0142kowita, np. -7, 0 czy 3: float , czyli warto\u015b\u0107 zmiennopozycyjna, mo\u017cna j\u0105 uto\u017csamia\u0107 z warto\u015bciami rzeczywistymi, np. -0.67, 1.0, 3.14 complex , czyli liczba zespolona, np. -7+8.5j. Warto pami\u0119ta\u0107, \u017ce w Pythonie jednostk\u0105 urojon\u0105 jest j, a nie i str , powszechnie znany w innych j\u0119zykach jako string, czyli napis. Napis poznajemy g\u0142\u00f3wnie po tym, \u017ce jest zapisany w cudzys\u0142owie (i to odr\u00f3\u017cnia go cho\u0107by od nazwy zmiennej czy liczby, kt\u00f3re nie s\u0105 w cudzys\u0142owach). Dodamy, \u017ce w j\u0119zyku Python nie ma znaczenia, czy pos\u0142ugujemy si\u0119 pojedynczymi (') czy podw\u00f3jnymi (\") cudzys\u0142owami Konwersja typ\u00f3w analogiczna dla przyk\u0142adu poni\u017cej print ( int ( 5.3 )) ## 5 Operatory: dodawanie ( + ) odejmowanie ( - ) mno\u017cenie ( * ) dzielenie ( / ) reszta z dzielenia, modulo ( % ) Analogiczne co C operatory -= , *= , /= , %= ... UWAGA! Brak operator\u00f3w ++ i -- ** pot\u0119ga 2+3j liczba zespolona Operatory Logiczne zwracaj\u0105 warto\u015b\u0107 logiczn\u0105 (True/False) < - mniejsze <= - mniejsze r\u00f3wne, zwr\u00f3\u0107my uwag\u0119, \u017ce zapisujemy tak jak czytamy, nie ma operatora =< (r\u00f3wne mniejsze) > - wi\u0119ksze >= - wi\u0119ksze r\u00f3wne == - r\u00f3wna si\u0119. Tutaj bardzo wa\u017cne jest, aby odr\u00f3\u017cnia\u0107 operator przypisania (=) od operatora por\u00f3wnania r\u00f3wna si\u0119 (==). To bardzo cz\u0119sty b\u0142\u0105d w\u015br\u00f3d pocz\u0105tkuj\u0105cych programist\u00f3w. Operator = nie jest symetryczny, ma na celu przekopiowanie warto\u015bci z prawej do lewej. W niekt\u00f3rych j\u0119zykach zapisuje si\u0119 go jako <- (ale nie w Pythonie). Operator = nie ma nic wsp\u00f3lnego z warto\u015bciami logicznymi. Za to operator == jest operatorem zwracaj\u0105cym warto\u015b\u0107 logiczn\u0105, a co wi\u0119cej, jest on operatorem symetrycznym (nie ma znaczenia zamienienie kolejno\u015bci\u0105 argument\u00f3w). != - nie r\u00f3wna si\u0119 Operator koniunkcji, and , uto\u017csamiany z polskim i. Zwraca warto\u015b\u0107 True wtedy i tylko wtedy, gdy oba argumenty s\u0105 r\u00f3wne True Operator alternatywy, or , uto\u017csamiany z polskim lub. Zwraca warto\u015b\u0107 True wtedy i tylko wtedy, gdy przynajmniej jeden argument jest r\u00f3wny True Operator zaprzeczenia, not , uto\u017csamiany z polskim nie. Zwraca warto\u015b\u0107 przeciwn\u0105, ni\u017c argument Mo\u017cna \u0142\u0105czy\u0107 kilka operator\u00f3w np: czy_wiek_produkcyjny = 18 <= wiek <= 65 - w pythonie por\u00f3wnania rozwijane s\u0105 tak jak w matematyce, czyli np mo\u017cemy te\u017c napisa\u0107 2 <= 4 < 8 , co zwr\u00f3ci nam True Inne operatory: is - czy dwie zmienne s\u0105 r\u00f3\u017cnymi instancjami tego samego obiektu s1 = {} s2 = {} s1 == s2 #True s1 is s2 #False ##poniewa\u017c to nie jest ten sam s\u0142ownik in u\u017cywany do sprawdzenia, czy dana warto\u015b\u0107/obiekt zawiera si\u0119 w li\u015bcie/s\u0142owniku/secie... zbior = { 1 , 3 , 5 } zbior_pusty = {} print ( 1 in zbiorPusty ) ## False print ( 1 in zbior ) ## True Instrukcja warunkowa if if warunek : instrukcja1 instrukcja2 elif warunek2 : # gdy warunek nieprawdziwy, sprawd\u017a warunek2 instrukcja3 instrukcja4 elif warunek3 : #gdy warunek2 nieprawdziwy, sprawd\u017a warunek3 instrukcja5 instrukcja6 else : #gdy zaden z warunk\u00f3w nie byl prawdziwy instrukcja7 instrukcja8 Warto tak\u017ce pami\u0119ta\u0107 o jedno-linijkowym wariancie if-a: # a if condition else b print ( \"Prawda\" ) if True else print ( \"Fa\u0142sz\" ) #Prawda Pusta zmienna Czasem _ jest u\u017cywane jako pusta zmienna jest to swego rodzaju odpowiednik /dev/null TODO dopisa\u0107 i om\u00f3wi\u0107 przyk\u0142ady: https://stackoverflow.com/questions/5893163/what-is-the-purpose-of-the-single-underscore-variable-in-python P\u0119tle Po for ( foreach ) mo\u017ce si\u0119 znajdowa\u0107 lista (obr\u00f3t dla ka\u017cdego elementu) Po while warunek logiczny (obroty dop\u00f3ki prawda) for i in range ( 0 , 4 ): print ( i ) ## 0 ## 1 ## 2 ## 3 #lub i = 0 while i < 4 : print ( i ) i += 1 liczby = [ 2 , 3 , 5 ] for liczba in liczby : print ( liczba ) ## 2 ## 3 ## 5 S\u0142owo kluczowe continue przerywa dany obr\u00f3t p\u0119tli S\u0142owo kluczowe break przerywa ca\u0142\u0105 p\u0119tl\u0119 Je\u015bli iterujemy po li\u015bcie krotek mo\u017cemy sobie je rozbi\u0107 for i , line in enumerate ( strings_list ): #enumerate zwraca dla danej listy krotk\u0119 zawieraj\u0105c\u0105 numer i element z listy ###jaki\u015b kod P\u0119tle jednolinijkowe (List Comprehensions) Jednolinijkowe p\u0119tle zwracaj\u0105ce np list\u0119 dobre dla prostych operacji, u\u017cyteczne do szybkiego generowania tablic. newlist = [ expression for item in iterable if condition == True ] #albo bez if-a newlist = [ x for x in range ( 10 )] fruits = [ \"apple\" , \"banana\" , \"cherry\" , \"kiwi\" , \"mango\" ] newlist = [] for x in fruits : if \"a\" in x : newlist . append ( x ) #daje to samo co: newlist = [ x for x in fruits if \"a\" in x ] Krotka (tuple) Pewn\u0105 specyficzn\u0105 dla j\u0119zyka Python struktur\u0105 jest krotka. Polega ona na grupowaniu paru warto\u015bci w jeden byt. Warto zaznaczy\u0107, \u017ce krotka, kt\u00f3ra raz zosta\u0142a stworzona, nie mo\u017ce by\u0107 modyfikowana: nie mo\u017cemy podmieni\u0107 jednej ze sk\u0142adowych krotki krotka = ( 2 , 3 ) print ( krotka ) ## (2, 3) Gdyby\u015bmy chcieli uzyska\u0107 poszczeg\u00f3lne sk\u0142adowe krotki, mo\u017cemy to zrobi\u0107 przy u\u017cyciu operatora kwadratowych nawias\u00f3w. W Pythonie, tak jak w wielu j\u0119zykach programowania, numerujemy sk\u0142adowe od 0: pierwsza = krotka [ 0 ] druga = krotka [ 1 ] print ( pierwsza ) ## 2 print ( druga ) ## 3 W krotce mo\u017cemy miesza\u0107 typy danych : krotka = ( 2 , \"Napis\" ) print ( krotka ) ## (2, 'Napis') len ( krotka ) #d\u0142ugo\u015b\u0107 krotki ## 2 Kiedy krotka mo\u017ce by\u0107 przydatna? Np. gdy chcemy zwr\u00f3ci\u0107 wi\u0119cej ni\u017c jedn\u0105 warto\u015b\u0107 w funkcji. def f ( x ): y0 = x + 1 y1 = x * 3 y2 = y0 ** y3 return ( y0 , y1 , y2 ) Je\u015bli chcemy mo\u017cemy rozbi\u0107 krotk\u0119 na poszczeg\u00f3lne zmienne a , b , c = ( 1 , 2 , 3 ) named tuple Specjalne obiekty dzia\u0142aj\u0105ce jak krotki i kompatybilne z nimi. from collections import namedtuple Point = namedtuple ( 'Point' , 'x y' ) pt1 = Point ( 1.0 , 5.0 ) pt2 = Point ( 2.5 , 1.5 ) from math import sqrt # wskazanie poprzez indeks line_length = sqrt (( pt1 [ 0 ] - pt2 [ 0 ]) ** 2 + ( pt1 [ 1 ] - pt2 [ 1 ]) ** 2 ) # rozpakowanie krotki x1 , y1 = pt1 Funkcja zip Do operowania na krotkach przydatna jest funkcja wbudowana zip zwracaj\u0105ca iterator (nie list\u0119) pozwalaj\u0105cy iterowa\u0107 po krotkach tworzonych z obiekt\u00f3w danych w funkcji. a = ( \"John\" , \"Charles\" , \"Mike\" ) b = ( \"Jenny\" , \"Christy\" , \"Monica\" , \"Vicky\" ) # warto\u015bci nadmiarowe s\u0105 pomijane for kr in zip ( a , b ): print ( kr ) #('John', 'Jenny') #('Charles', 'Christy') #('Mike', 'Monica') Lista Podobn\u0105, przynajmniej na poz\u00f3r, struktur\u0105 danych do krotki jest lista. Tutaj tak\u017ce mo\u017cemy grupowa\u0107 dane oraz nie musz\u0105 one by\u0107 tego samego typu. Jednak g\u0142\u00f3wn\u0105 r\u00f3\u017cnic\u0105 jest to, \u017ce list\u0119 mo\u017cemy modyfikowa\u0107. Mo\u017cemy dodawa\u0107 nowe elementy czy zast\u0119powa\u0107 dotychczasowe. lista = [ 1 , False , \"Napis\" ] print ( lista ) ## [1, False, 'Napis'] print ( len ( lista )) ## 3 lista . append ( 2.5 + 3.7 j ) print ( lista ) ## [1, False, 'Napis', (2.5+3.7j)] lista . extend ([ 97 , 98 , 99 ]) # metoda podobna po append, kt\u00f3ra przyjmuje jako argument ca\u0142\u0105 list\u0119 i dodaje z niej kolejne elementy print ( lista ) ## [1, False, 'Napis', (2.5+3.7j), 97, 98, 99] Operatory + i * maj\u0105 zdefiniowane dzia\u0142anie w kontek\u015bcie list. + , tak jak w przypadku napisu, to konkatenacja, czyli po\u0142\u0105czenie dw\u00f3ch list w jedn\u0105 * za\u015b pozwala nam powieli\u0107 dan\u0105 list\u0119: print ( lista + [ 7 , 8 , 9 ]) ## [1, False, 'Napis', (2.5+3.7j), 97, 98, 99, 7, 8, 9] print ([ 7 , 8 , 9 ] * 3 ) ## [7, 8, 9, 7, 8, 9, 7, 8, 9] Odwo\u0142anie si\u0119 do konkretnego elementu nast\u0119puje tak jak w krotce: print ( lista [ 2 ]) ## Napis ! ujemne indeksy oznaczaj\u0105 pozycje liczone od ty\u0142u print ( lista [ - 1 ]) ## 99 Odwo\u0142ywanie si\u0119 do wycinka listy print ( lista [ 2 : 5 ]) ## ['Nowy', (2.5+3.7j), 97] Elementy o numerach 2 , 3 , 4 ( bez 5 ) \"ala ma kota\" [ - 4 ::] #elementy od trzeciego od ko\u0144ca a\u017c do ostatniego #\"kota\" Podmiana lista [ 0 : 3 ] = [ 98 , 99 , 101 , 102 ] print ( lista ) ## [98, 99, 101, 102, (2.5+3.7j), 97, 98, 99] Usuwa 3 pierwsze elementy i na ich miejsce wstawia te podane Wstawienie elementu w innym miejscufor klucz in bazaDanychPolakow.keys(): print ( klucz ) for wartosc in bazaDanychPolakow . values (): print ( wartosc ) for klucz , wartosc in bazaDanychPolakow . items (): ##Tutaj items() zwraca krotk\u0119 print ( klucz ) print ( wartosc ) print ( \"-----\" ) lista . insert ( 1 , \"Nowy2\" ) print ( lista ) ## [98, 'Nowy2', 99, 101, 102, (2.5+3.7j), 97, 98, 99] Usuni\u0119cie elementu del lista [ 1 ] print ( lista ) ## [98, 99, 101, 102, (2.5+3.7j), 97, 98, 99] Napisy Zmienna w napisie zmienna = 7 napis = f \"warto\u015b\u0107 zmiennej to { zmienna } \" print ( napis ) ## warto\u015b\u0107 zmiennej to 7 wieleWierszy = \"\"\"Tutaj pierwszy a tu drugi tutaj trzeci\"\"\" print ( wieleWierszy ) ## Tutaj pierwszy ## a tu drugi ## tutaj trzeci Kolejno\u015b\u0107 alfabetyczna print ( \"a\" < \"b\" ) ## True Wi\u0119cej na: https://www.kodolamacz.pl/blog/wyzwanie-python-3-algorytmy-i-struktury-danych/ Zbi\u00f3r (set) to tablica (tyle, \u017ce bez indeksowania), w kt\u00f3rych nie ma dw\u00f3ch lub wi\u0119cej identycznych element\u00f3w. (jest szybszy od listy) zbiorPusty = set () zbior = { 1 , 3 , 5 } print ( zbiorPusty ) ## set() print ( zbior ) ## {1, 3, 5} zbior . add ( 2 ) ##Dodawanie elementu zbior . discard ( 2 ) ##Usuwanie elementu Mo\u017cna w nim \u0142atwo sprawdza\u0107 , czy dany element nale\u017cy do zbioru print ( 1 in zbiorPusty ) ## False print ( 1 in zbior ) ## True print ( 1 not in zbiorPusty ) ## True Mo\u017cemy na nich wykona\u0107 typowe operacje teoriomnogo\u015bciowe, jak suma, r\u00f3\u017cnica czy przeci\u0119cie dw\u00f3ch zbior\u00f3w print ({ 1 , 5 , 8 } | { 1 , 5 , 9 }) # suma ## {1, 5, 8, 9} print ({ 1 , 5 , 8 } - { 1 , 5 , 9 }) # r\u00f3\u017cnica ## {8} print ({ 1 , 5 , 8 } & { 1 , 5 , 9 }) # przeci\u0119cie ## {1, 5} Mo\u017cna zapyta\u0107 , czy jeden zbi\u00f3r jest podzbiorem drugiego print ({ 1 , 5 } . issubset ({ 1 , 5 , 9 })) ## True S\u0142ownik Jest to rozszerzenie idei zbioru. S\u0142ownik zawiera pary klucz-warto\u015b\u0107. Wyszukiwanie po kluczu jest szybkie, tak jak w zbiorze, jednak gdy ju\u017c odnajdziemy klucz, mo\u017cemy odzyska\u0107 tak\u017ce stowarzyszon\u0105 z nim warto\u015b\u0107. Gdy usuniemy ze s\u0142ownika warto\u015bci, a zostawimy same klucze, otrzymamy zbi\u00f3r. Tak jak w zbiorze, w s\u0142owniku klucze nie mog\u0105 si\u0119 powtarza\u0107. bazaDanychPolakow = { \"89082911111\" : [ \"Jan\" , \"Kowalski\" , 29 ], \"95092200000\" : [ \"Ania\" , \"Nowak\" , 23 ], \"98122422222\" : [ \"Adam\" , \"Mickiewicz\" , 220 ] } bazaDanychPolakow [ \"88081244444\" ] = [ \"Magda\" , \"K\" , 30 ] #Dodanie nowej pary klucz-warto\u015b\u0107 del bazaDanychPolakow [ \"88081244444\" ] #Usuni\u0119cie danej pary Tak jak w zbiorze mo\u017cemy sprawdza\u0107, czy klucz znajduje si\u0119 w s\u0142owniku. Uzyskanie warto\u015bci stowarzyszonej z kluczem print ( bazaDanychPolakow [ \"98122422222\" ]) ## ['Adam', 'Mickiewicz', 220] Gdy chcemy zabezpieczy\u0107 si\u0119 przed odwo\u0142aniem do nieistniej\u0105cego elementu ( i w tym wypadku zwr\u00f3ci\u0107 warto\u015b\u0107 domy\u015bln\u0105 ), u\u017cyjemy metody get (): print ( bazaDanychPolakow . get ( \"89082911111\" , \"warto\u015b\u0107 domy\u015blna\" )) ## ['Jan', 'Kowalski', 29] print ( bazaDanychPolakow . get ( \"95092200022\" , \"warto\u015b\u0107 domy\u015blna\" )) ## warto\u015b\u0107 domy\u015blna Przej\u015bcie w p\u0119tli for klucz in bazaDanychPolakow . keys (): print ( klucz ) for wartosc in bazaDanychPolakow . values (): print ( wartosc ) for klucz , wartosc in bazaDanychPolakow . items (): ##Tutaj items() zwraca krotk\u0119 print ( klucz ) print ( wartosc ) print ( \"-----\" ) Przy printowaniu s\u0142ownik\u00f3w (zw\u0142aszcza tych skomplikowanych) warto u\u017cy\u0107 pprint import pprint pprint . pprint ( duzy_slownik ) Funkcje Funkcje def nazwaFunkcji ( parametry , oddzielone , przecinkami ): return wynik Warto\u015bci domy\u015blne parametr\u00f3w def potega ( podstawa , wykladnik = 1 ): #cia\u0142o funkcji Argumenty nazwane Mo\u017cemy podawa\u0107 argumenty w dowolnej kolejno\u015bci , gdy podamy ich nazwy print ( potega ( wykladnik = 4 , podstawa = 3 )) ## 81 def printinfo ( name , age = 35 ): \"Prosta funkcja z domy\u015blnymi warto\u015bciami\" print ( \"Name: \" , name ) print ( \"Age \" , age ) return Funkcja mo\u017ce tak\u017ce przyjmowa\u0107 wiele argument\u00f3w #** - zmienne b\u0119d\u0105 interpretowane jako krotka def printinfo ( arg1 , * krotka ): print ( \"Output is: \" ) print ( arg1 ) for var in krotka : print ( var ) return #** - zmienne b\u0119d\u0105 interpretowane jako s\u0142ownik def printinfo2 ( arg1 , ** slownik ): print ( \"Output is: \" ) print ( arg1 ) for key in slownik . keys (): print ( key ) return printinfo ( 10 ) printinfo ( 70 , 60 , 50 ) printinfo2 ( \"argum1\" , klucz1 = wart1 , klucz2 = wart2 , klucz3 = 523 , pusty = None ) #wa\u017cne, aby s\u0142ownik by\u0142 definiowany jako s\u0142ownik, czyli klucz=wartosc W pythonie jedna funkcja mo\u017ce zwraca\u0107 r\u00f3\u017cne rzeczy, obiekty, zmienne, nic. def returnOrNot ( return_bool = True ): if return_bool : return True return Adnotacje W wypadku funkcji mo\u017cemy te\u017c doda\u0107 adnotacje (typowanie zmiennych) do ich argument\u00f3w oraz warto\u015bci zwracanych (nie s\u0105 one wykorzystywane przez interpreter, ale u\u0142atwiaj\u0105 dokumentowanie). (Uwaga, tej funkcji nie ma w pythonie 2, dla niego jest workaround o nazwie type comments ) def funkcja ( liczba1 : 99 = 12 , slowo1 : str = \"sl\" , slowo2 : \"inne slowo\" = \"inne\" ) -> str : #some code return \"slowo\" slowo : str = \"inne_slowo\" Mo\u017cna potem je sprawdzi\u0107 poprzez si\u0119gni\u0119cie do atrybutu __annotations__ >>> funkcja . __annotations__ { 'liczba1' : 99 , 'slowo1' : < class ' str '>, ' slowo2 ': ' inne slowo ', ' return ': } W niekt\u00f3rych wypadkach mo\u017ce pojawi\u0107 si\u0119 potrzeba zaimportowania oczekiwanych element\u00f3w from typing import Tuple def foo ( x : int , y : int ) -> Tuple [ int , int ]: return ( x * y , y // 2 ) Mo\u017cliwe s\u0105 te\u017c adnotacje dla element\u00f3w klasy PEP-526 class Starship : stats : ClassVar [ dict [ str , int ]] = {} # class variable - pole klasy damage : int = 10 # instance variable - pole instancji W razie problem\u00f3w spowodowanych kolejno\u015bci\u0105 deklaracji r\u00f3\u017cnych element\u00f3w w pliku warto u\u017cy\u0107 specjalnego importu from __future__ import annotations # bez niego poni\u017cszy kod by nie dzia\u0142a\u0142 def fun ( i : A ): #mogliby\u015bmy otzyma\u0107 b\u0142\u0105d m\u00f3wi\u0105cy o odnoszeniu si\u0119 do nieistniej\u0105cej klasy pass class A : pass Wyra\u017cenia lambda Lambdy to s\u0105 funkcje, kt\u00f3re mo\u017cna w do\u015b\u0107 podr\u0119czny spos\u00f3b zdefiniowa\u0107 #Og\u00f3lna definicja lambda arg1 , arg2 , arg3 : nasze_wyrazenie #ta lambda zwr\u00f3ci warto\u015b\u0107 naszego wyra\u017cenia nasza_lambda = lambda x : x * 2 nasza_lambda ( 2 ) #>4 Argumenty w lambdach mo\u017cna zapisywa\u0107 tak samo jak w zwyk\u0142ych funkcjach, mog\u0105 tam by\u0107 warto\u015bci domy\u015blne, Zasi\u0119g i zmienne globalne W pythonie na og\u00f3\u0142 funkcje nie mog\u0105 edytowa\u0107 (mog\u0105 mie\u0107 dost\u0119p, ale nie edytowa\u0107) zmienne poza swoim zakresem. c = 1 # global variable def add (): print ( c ) c = c + 2 # increment c by 2 print ( c ) add () #>2 #>UnboundLocalError: local variable 'c' referenced before assignment Aby m\u00f3c je jednak zmienia\u0107 jest u\u017cywane s\u0142owo kluczowe global . c = 0 # global variable def add (): global c c = c + 2 # increment by 2 print ( \"Inside add():\" , c ) add () print ( \"In main:\" , c ) #>Inside add(): 2 #>In main: 2 Przekazywanie dowolnych argument\u00f3w (**kwargs i *args) Pozwalaj\u0105 one na umieszczeanie argument\u00f3w o dowolnej liczbie i nazwie w naszej funkcji. args przyjmuje je jako list\u0119 kolejnych element\u00f3w, za\u015b kwargs przyjmuje je jak s\u0142ownik. def parametr_args ( * args ): print ( \"zawarto\u015b\u0107 args: {} \" . format ( args )) parametr_args ( 'python' , 'spam' , 'eggs' , 'test' ) ###zawarto\u015b\u0107 args: ('spam', 'eggs', 'test') def parametr_kwargs ( argument , ** kwargs ): print ( \"argument: {} \" . format ( argument )) print ( \"zawarto\u015b\u0107 kwargs: {} \" . format ( kwargs )) parametr_kwargs ( dodatkowy = 48 , nastepny = 111 , argument = 12 ) # argument: 12 # zawarto\u015b\u0107 kwargs: {'dodatkowy': 48, 'nastepny': 111} //TODO https://printpython.pl/poczatki/zadanie-z-gwiazdka/ Dekoratory funkcji Jest to element pozwalaj\u0105cy na opakowanie naszej funkcji za pomoc\u0105 innej funkcji, aby wzbogaci\u0107 jej funkcjonalno\u015b\u0107. Funkcja dekoruj\u0105ca najcz\u0119\u015bciej przyjmuje funkcj\u0119 dekorowan\u0105 i zwraca now\u0105, wynikow\u0105 funkcj\u0119, kt\u00f3ra ma zosta\u0107 wykonana. #foo jest dekoratorem, kt\u00f3ry wzbogaci nasz\u0105 funkcj\u0119 def foo ( to_be_wrapped ): def new_func ( args , ** kwargs ): print ( \"uwaga, b\u0119dzie sze\u015bcian\" ) return to_be_wrapped ( * args , ** kwargs ) # warto je doda\u0107 aby argumenty zosta\u0142y przekazane dalej do funkcji docelowej return new_func @foo #je\u015bli dodamy ten dekorator to u\u017cycie tej funkcji zostanie zmienione, tzn zamiast oryginalnej funkcji cube() otrzymamy \"wzbogacone\" cube drukuj\u0105ce komunikat przed drukowaniem def cube ( d ): return d ** 3 #podniesienie do pot\u0119gi 3 cube ( 2 ) #uwaga, b\u0119dzie sze\u015bcian #8 Ale warto pami\u0119ta\u0107, \u017ce je\u015bli chcemy przygotowywa\u0107 takie dekoratory wewn\u0105trz klas to musimy pami\u0119ta\u0107, \u017c\u0119 nieco inaczej wygl\u0105da dost\u0119p do self class Myclass : # wydaje mi si\u0119, \u017ce tutaj dekorator musi by\u0107 zdefiniowany jako pierwszy def _add_loaded_location_to_token ( decorated_fun , * args , ** kwargs ): def output_fun ( * args , ** kwargs ): t = decorated_fun ( * args , ** kwargs ) t . location = args [ 0 ] . current_location # po prostu self jest schowany pod pierwszym z argument\u00f3w return t return output_fun @_add_loaded_location_to_token def get_token ( self ): #kod return token Statyczne pola funkcji Odpowiednikiem zmiennych typu static wewn\u0105trz funkcji jest pole funkcji. \u017ar\u00f3d\u0142o def myfunc (): myfunc . counter += 1 print myfunc . counter # atrybut musi by\u0107 gdzie\u015b zainicjalizowany myfunc . counter = 0 Mo\u017cna te\u017c doda\u0107 atrybut w ten spos\u00f3b: def myfunc (): if not hasattr ( myfunc , \"counter\" ): myfunc . counter = 0 # it doesn't exist yet, so initialize it myfunc . counter += 1 Obiekt\u00f3wka Obiekt class Osoba : #Definicja klasy o nazwie Osoba ile = 0 # pole klasy imie : str # adnotacja typu dla pola instancji def __init__ ( self , imie , nazwisko , wiek ): #Definicja konstruktora self . imie = imie self . nazwisko = nazwisko self . wiek = wiek def przedstaw_sie ( self ): print ( f \"Jestem { self . imie } { self . nazwisko } . Mam { self . wiek } lat.\" ) def urodziny ( self ): wiek_przed = self . wiek self . wiek += 1 return wiek_przed def __del__ ( self ): # destruktor, czyli kod, kt\u00f3ry wykonuje si\u0119 podczas niszczenia obiektu @staticmethod def policz (): return Osoba . ile Obiekty w pythonie nie maj\u0105 p\u00f3l statycznych dzia\u0142aj\u0105cych tak jak w innych j\u0119zykach (jak np C++). Tutaj zmiana pola klasy nie zmienia warto\u015bci tego pola dla innych instancji link . Metody Metod\u0119 mo\u017cemy pozna\u0107 min. tak\u017ce po pierwszym argumencie: self . W j\u0119zyku Python metody przyjmuj\u0105 jako pierwszy parametr obiekt, na rzecz kt\u00f3rego s\u0105 wywo\u0142ywane. W samym wywo\u0142aniu nie musimy go sami podawa\u0107. Wystarczy, \u017ce metoda jest napisana po kropce. Nast\u0119pnie nast\u0119puj\u0105 trzy zwyk\u0142e parametry: imie, nazwisko oraz wiek. Konstruktor i destruktor Jest to taka metoda, kt\u00f3ra jest wywo\u0142ywana, gdy obiekt jest tworzony. Jej celem jest zainicjowanie p\u00f3l w instancji. Tu s\u0105 definiowane parametry klasy. Konstruktor poznajemy po jego specjalnej nazwie: __init__ . Analogicznie dzia\u0142a destruktor (nazwa: __del__ ) Przy wywo\u0142aniu pomijamy argument self. Jan = Osoba ( \"Jan\" , \"Nowak\" , 48 ) Jan = None #Wymuszenie destrukcji obiektu W\u0142asne operatory W pythonie mo\u017cna w prosty spos\u00f3b dodawa\u0107 w\u0142asne operatory do klas. Mo\u017cemy w prosty spos\u00f3b sprawi\u0107, \u017ce korzystanie z naszych klas b\u0119dzie wygodniejsze. class C : __str__ ( self ): Operator Nazwa funkcji Opis str() __str__(self) Funkcja generuj\u0105ca stringa dla danej klasy. Przydatne do debugowania i nie tylko + __add__(a,b) Dodawanie [] __getitem__(self,index) Te kilka jest potrzebne do poprawnego zaimplementowania operatora [] [] __setitem__(self,index,item) [] __delitem__(self.index) Pe\u0142niejsza lista operator\u00f3w TODO popraw i rozbuduj Widoczno\u015b\u0107 element\u00f3w W j\u0119zyku Python nie ma p\u00f3l prywatnych w klasie: nie jeste\u015bmy w stanie w praktyce czegokolwiek \u201cukry\u0107\u201d. Jednak s\u0105 pewne zasady nazewnictwa, kt\u00f3re dzia\u0142aj\u0105 raczej na zasadzie porozumienia, ni\u017c b\u0119d\u0105ce prawdziw\u0105 barier\u0105. I tak, gdy poprzedzimy nazw\u0119 jednym znakiem podkre\u015blenia _ , oznajmiamy, \u017ce dany element nie jest uwzgl\u0119dniony w dokumentacji, mo\u017ce si\u0119 zmieni\u0107, raczej nie nale\u017cy z niego korzysta\u0107, a \u015brodowisko programistyczne nie b\u0119dzie nam go podpowiada\u0107. Przyk\u0142adowo pole _imie , np. self._imie , czy self._metoda() . Gdy u\u017cyjemy dw\u00f3ch znak\u00f3w podkre\u015blenia __ , zachowanie jest troch\u0119 inne: dane pole czy metoda nie b\u0119dzie widoczna pod t\u0105 nazw\u0105 wcale, ale za to b\u0119dzie mo\u017cna si\u0119 do niego odwo\u0142a\u0107 (dla nazwy __element ) poprzez _nazwaklasy.__element . Statyczne Dla odmiany s\u0105 one tworzone poza konstruktorem. Do pola tego odwo\u0142ujemy si\u0119 poprzez nazw\u0119 klasy. Np Osoba.ile Sama metoda statyczna ma nad sob\u0105 napis @staticmethod . To tzw. dekorator . Metoda statyczna nie mo\u017ce odwo\u0142ywa\u0107 si\u0119 do instancyjnych p\u00f3l (czyli tych zwyk\u0142ych, jak imie z poprzedniego przyk\u0142adu), a jedynie do statycznych. Wynika to z faktu, \u017ce metoda statyczna nie jest wywo\u0142ywana na rzecz konkretnego obiektu, kt\u00f3ry by takie w\u0142a\u015bnie pola mia\u0142. Je\u015bli jednak chcemy aby nasza metoda mia\u0142a jakie\u015b informacje na temat naszej klasy mo\u017cna u\u017cy\u0107 dekoratora @classmethod , kt\u00f3ry r\u00f3\u017cni si\u0119 tym, \u017ce klasaobiektu (nie instancja) jest przekazywana dalej. Por\u00f3wnanie na stacku class A ( object ): def foo ( self , x ): print ( f \"executing foo( { self } , { x } )\" ) @classmethod def class_foo ( cls , x ): print ( f \"executing class_foo( { cls } , { x } )\" ) @staticmethod def static_foo ( x ): print ( f \"executing static_foo( { x } )\" ) Dziedziczenie class Zwierze : def __init__ ( self , nazwa , wiek , waga ): self . nazwa = nazwa self . wiek = wiek self . waga = waga def przedstaw_sie ( self ): print ( f \"Jestem zwierz\u0119ciem { self . nazwa } , mam { self . wiek } lat oraz waz\u0119 { self . waga } kg.\" ) def urodziny ( self ): self . wiek += 1 class Mrowka ( Zwierze ): pass #Oznacza, \u017ce cia\u0142o jest puste class Slon ( Zwierze ): def przedstaw_sie ( self ): print ( f \"Jestem s\u0142oniem { self . nazwa } , mam { self . wiek } lat oraz waz\u0119 { self . waga } kg.\" ) class Lew ( Zwierze ): def przedstaw_sie ( self ): super () . przedstaw_sie () print ( \"A tak w og\u00f3le to jestem lwem\" ) class Papuga ( Zwierze ): def __init__ ( self , nazwa , wiek , waga , kolor ): super () . __init__ ( nazwa , wiek , waga ) self . kolor = kolor def przedstaw_sie ( self ): super () . przedstaw_sie () print ( f \"Jako papuga m\u00f3j kolor to { self . kolor } \" ) super() zwraca nam instancj\u0119 klasy bazowej: s\u0105 to wszystkie pola i metody naszego obiektu, jakie otrzymali\u015bmy dzi\u0119ki klasie bazowej. Polimorfizm Pozwala na u\u017cywanie klasy dziedzicz\u0105cej wsz\u0119dzie tam, gdzie mo\u017ce by\u0107 u\u017cyta klasa bazowa. Oznacza to, \u017ce instancja klasy dziedzicz\u0105cej jest uznawana za instancj\u0119 klasy bazowej. W j\u0119zyku Python sprawdzenie przynale\u017cno\u015bci danego obiektu do klasy wykonuje si\u0119 metod\u0105 isinstance(): def main (): Dumboo = Slon ( \"Dumboo\" , 77 , 6000 ) Simba = Lew ( \"Simba\" , 24 , 100 ) Jago = Papuga ( \"Jago\" , 32 , 3 , \"czerwony\" ) jakis_zwierz = Zwierze ( \"Katarzyna\" , 31 , 80 ) print ( f \"isinstance(Dumboo, Slon): { isinstance ( Dumboo , Slon ) } \" ) print ( f \"isinstance(Dumboo, Lew): { isinstance ( Dumboo , Lew ) } \" ) print ( f \"isinstance(Jago, Papuga): { isinstance ( Jago , Papuga ) } \" ) print ( f \"isinstance(Jago, Zwierze): { isinstance ( Jago , Zwierze ) } \" ) print ( f \"isinstance(jakis_zwierz, Zwierze): { isinstance ( jakis_zwierz , Zwierze ) } \" ) print ( f \"isinstance(jakis_zwierz, Papuga): { isinstance ( jakis_zwierz , Papuga ) } \" ) if __name__ == \"__main__\" : main () ## isinstance(Dumboo, Slon): True ## isinstance(Dumboo, Lew): False ## isinstance(Jago, Papuga): True ## isinstance(Jago, Zwierze): True ## isinstance(jakis_zwierz, Zwierze): True ## isinstance(jakis_zwierz, Papuga): False Abstrakcja Uniemo\u017cliwia tworzenie instancji danej klasy. Przydatne przy klasach bazowych dokumentacja from abc import ABC class Zwierze ( ABC ): def __init__ ( self , nazwa , wiek , waga ): self . nazwa = nazwa self . wiek = wiek self . waga = waga @abstractmethod #tutaj wymuszamy implementacj\u0119 tej metody w klasach pochodnych def nazwa_gatunku ( self ): pass def przedstaw_sie ( self ): print ( f \"Jestem { self . nazwa_gatunku () } . Mam na imi\u0119 { self . nazwa } , mam { self . wiek } lat oraz waz\u0119 { self . waga } kg.\" ) def urodziny ( self ): self . wiek += 1 class Slon ( Zwierze ): def nazwa_gatunku ( self ): return \"S\u0142o\u0144\" class Lew ( Zwierze ): def nazwa_gatunku ( self ): return \"Lew\" Niestety, mechanizm klas i metod abstrakcyjnych (klasa jest abstrakcyjna gdy ma co najmniej jedn\u0105 metod\u0119 abstrakcyjn\u0105) w j\u0119zyku Python jest wprowadzony troch\u0119 sztucznie. Klasa bazowa (abstrakcyjna) musi dziedziczy\u0107 po sztucznej klasie ABC, a metoda abstrakcyjna jest opatrzona dekoratorem @abstractmethod . Zwr\u00f3\u0107my uwag\u0119, \u017ce jedno i drugie zosta\u0142o zaimportowane. Jednak po tych czynno\u015bciach rzeczywi\u015bcie nie jeste\u015bmy w stanie stworzy\u0107 instancji klasy bazowej. Zwr\u00f3\u0107my uwag\u0119 na ten zaawansowany mechanizm: w klasie Zwierze tworzymy metod\u0119, zak\u0142adamy, co ta metoda b\u0119dzie zwraca\u0107, a nast\u0119pnie korzystamy z niej w innej metodzie, pomimo, \u017ce prawdziwa jej implementacja nast\u0105pi dopiero w klasie pochodnej. Dzi\u0119ki temu musimy napisa\u0107 mniej kodu w klasach pochodnych: musimy jedynie zaimplementowa\u0107 metod\u0119 nazwa_gatunku(), jednak nie musimy ju\u017c od zera pisa\u0107 kodu na przedstawienie zwierz\u0119ta. Jedynie w klasie Papuga, gdzie wprowadzili\u015bmy nowe pole, dopisujemy kod odpowiedzialny za wypisanie jego warto\u015bci. /TODO jak poradzi\u0107 sobie z tym? class Zwierze ( ABC ): def __init__ ( self , nazwa , wiek , waga ): self . nazwa = nazwa self . wiek = wiek self . waga = waga @abstractmethod #tutaj wymuszamy implementacj\u0119 tej metody w klasach pochodnych def nazwa_gatunku ( self ): pass def urodziny ( self ): self . wiek += 1 class Slon ( Zwierze ): def __init__ ( self , nazwa , wiek , waga ): syper () . __init__ ( self , nazwa , wiek , waga ) def nazwa_gatunku ( self ): return self . nazwa class Slon ( Zwierze ): def __init__ ( self , nazwa , wiek , waga ): syper () . __init__ ( self , nazwa , wiek , waga ) # def nazwa_gatunku(self): bez implementowania nazwy, bo przecie\u017c zwyk\u0142y sko\u0144 ma dobr\u0105 # return self.nazwa Hermetyzacja Polega na odcinanie u\u017cytkownikowi dost\u0119pu do p\u00f3l, aby operowa\u0142 tylko metodami klasy. Jednak oczywi\u015bcie u\u017cywanie metod, zw\u0142aszcza z przedrostkiem get, czy set, jest mniej wygodne. Dlatego nowoczesne j\u0119zyki programowania umo\u017cliwiaj\u0105 tworzenie tzw. w\u0142a\u015bciwo\u015bci (ang. property). Z punktu widzenia mo\u017cliwo\u015bci, s\u0105 to po prostu metody, jednak z punktu widzenia zapisu i wygody, przypominaj\u0105 one pola. class Zwierze : def __init__ ( self , wiek ): self . wiek = wiek @property def wiek ( self ): return self . __wiek @wiek . setter def wiek ( self , wiek ): if wiek < 0 : self . __wiek = 0 elif wiek > 200 : self . __wiek = 200 else : self . __wiek = wiek def main (): jakis_zwierz = Zwierze ( 202 ) print ( jakis_zwierz . wiek ) jakis_zwierz . wiek = - 10 print ( jakis_zwierz . wiek ) jakis_zwierz . wiek = 30 print ( jakis_zwierz . wiek ) if __name__ == \"__main__\" : main () ## 200 ## 0 ## 30 Specjalne typy obiekt\u00f3w Jest lika szczeg\u00f3lnie u\u017cytecznych typ\u00f3w obiekt\u00f3w nad kt\u00f3rymi warto si\u0119 pochyli\u0107 Enum - Obiekty wyliczeniowe. Jest kilka rodzaj\u00f3w enum\u00f3w: Enum , IntEnum , Flag oraz IntFlag . link from enum import Enum , auto class Color ( Enum ): RED = auto () BLUE = auto () GREEN = auto () dataclass - specjalny dekorator dla obiektu dodaj\u0105cy automatycznie wiele dodatkowych udogodnie\u0144 pozwalaj\u0105cych unikn\u0105\u0107 mozolnego pisania logiki. link from dataclasses import dataclass @dataclass class InventoryItem : \"\"\"Class for keeping track of an item in inventory.\"\"\" name : str unit_price : float quantity_on_hand : int = 0 tags : List [ str ] = = field ( default_factory = list ) def total_cost ( self ) -> float : return self . unit_price * self . quantity_on_hand Mo\u017cliwe jest tutaj podawanie spodziewanych typ\u00f3w oraz domy\u015blnych warto\u015bci (ale w wypadku typ\u00f3w mutowalnych nale\u017cy u\u017cy\u0107 fabryk ) Taki obiekt mo\u017ce otrzyma\u0107 (w zale\u017cno\u015bci od paramter\u00f3w): automatycznie wygenerowany konstruktor: def __init__ ( self , name : str , unit_price : float , quantity_on_hand : int = 0 ): self . name = name self . unit_price = unit_price self . quantity_on_hand = quantity_on_hand operatory por\u00f3wnania ( = , < , > etc.) funkcj\u0119 haszuj\u0105c\u0105 etc... Inne Wyj\u0105tki def silnia ( n ): if n < 0 : raise ValueError ( \"silnia niezdefiniowana dla liczb ujemnych\" ) wynik = 1 for i in range ( 1 , n + 1 ): wynik *= i return wynik try : print ( \"Pozyskuj\u0119 zas\u00f3b\" ) print ( f \"Silnia z -5 to { silnia ( - 5 ) } \" ) except ValueError as e : print ( \"Och nie, co\u015b posz\u0142o nie tak! Szczeg\u00f3\u0142y poni\u017cej:\" ) print ( e ) else : print ( \"Oby\u0142o si\u0119 bez wyj\u0105tk\u00f3w\" ) finally : print ( \"Zwalniam zas\u00f3b\" ) Gdy spodziewamy si\u0119, \u017ce dany fragment kodu mo\u017ce rzuca\u0107 wyj\u0105tkami, opakowujemy go w konstrukcj\u0119 try-except. Kod, kt\u00f3ry chcemy wykona\u0107, a kt\u00f3ry mo\u017ce rzuci\u0107 wyj\u0105tek, zapisujemy po try:. Nast\u0119pnie, na dole tego kodu, piszemy except, po czym piszemy nazw\u0119 klasy wyj\u0105tku, a tak\u017ce as, po kt\u00f3rym m\u00f3wimy, jakim identyfikatorem (w jakiej zmiennej) chcemy si\u0119 odnosi\u0107 do instancji tego wyj\u0105tku. Najwa\u017cniejsza jest nazwa klasy, aby ustali\u0107, jaki typ b\u0142\u0119d\u00f3w \u0142apiemy. Konkretna instancja, w przyk\u0142adzie e, przydaje si\u0119, gdy np. chcemy wy\u015bwietli\u0107 komunikat b\u0142\u0119du na ekran. Teoretycznie instancja ma swoje pola, do kt\u00f3rych mo\u017cemy si\u0119 odnie\u015b\u0107, jednak rzadko si\u0119 z nich korzysta. List\u0119 wbudowanych klas wyj\u0105tk\u00f3w znajdziemy tutaj . Szczeg\u00f3lnej uwadze polecamy IndexError, gdy odwo\u0142ujemy si\u0119 do nieistniej\u0105cego elementu listy, FileNotFoundError, gdy plik nie istnieje, ZeroDivisionError dla dzielenia przez zero i wymieniony w przyk\u0142adzie ValueError, gdy argumenty funkcji s\u0105 b\u0142\u0119dne try : fun () except RuntimeError as err : print ( f \"Dostali\u015bmy wyj\u0105tek Runtime o tre\u015bci: { err . args [ 0 ] } \" ) except TypeError as err : print ( \"Niedozwolona operacja\" ) except ( MojError , NameError ): print ( \"Wyst\u0105pi\u0142 jeszcze inny error\" ) finally : print ( \"Podczas wykonywania wyst\u0105pi\u0142 b\u0142\u0105d, zamykam apk\u0119\" ) # ten wykona si\u0119 po ka\u017cdym z wyj\u0105tk\u00f3w With S\u0142owo kluczowe with pozwala na alternatywn\u0105 (czystsz\u0105 i czytelniejsz\u0105 obs\u0142ug\u0119 wyj\u0105tk\u00f3w) # file handling # 1) without using with statement file = open ( 'file' , 'w' ) file . write ( 'hello world !' ) file . close () # 2) without using with statement file = open ( 'file' , 'w' ) try : file . write ( 'hello world' ) finally : file . close () # using with statement with open ( 'file' , 'w' ) as file : file . write ( 'hello world !' ) S\u0142owo with pozwala na automatyczne zwalnianie zasob\u00f3w (na przyk\u0142adzie powy\u017cej wida\u0107, \u017ce nie trzeba wo\u0142a\u0107 close() ) przy wyj\u0105tku. Mechanizm ten korzysta z metod __enter__() i __exit__() dla u\u017cywanego obiektu. Mo\u017cemy wykorzysta\u0107 ten mechanizm we w\u0142asnych klasach # a simple file writer object class Manager ( object ): def __init__ ( self , file_name ): self . file_name = file_name def __enter__ ( self ): self . file = open ( self . file_name , 'w' ) return self . file def __exit__ ( self ): self . file . close () with Manager ( 'file.txt' ) as xfile : xfile . write ( 'hello world' ) Pliki \u015bcie\u017cka_do_pliku = r \"C:\\przykladowy.txt\" #r sprawia, \u017ce / nie jest znakiem specjalnym f = open ( sciezka_do_pliku ) print ( f . read ()) f . close () Tutaj mamy wszystko: open() s\u0142u\u017cy otworzeniu po\u0142\u0105czenia do pliku. Jest to wspomniane wcze\u015bniej pozyskanie zasobu. Nast\u0119pnie nast\u0119puje u\u017cycie metody read(). Odczytuje ona ca\u0142\u0105 tre\u015b\u0107 pliku za jednym zamachu. Po pojedynczym odczytaniu, drugie wywo\u0142anie zwr\u00f3ci nam napis pusty. Na ko\u0144cu jest close() , zamkni\u0119cie po\u0142\u0105czenia do pliku. Jest to zwolnienie zasobu. Jednak istnieje jeszcze drugi zapis. U\u017cywamy s\u0142owa kluczowego with . Wtedy definiujemy zas\u00f3b, m\u00f3wimy co chcemy zrobi\u0107, (open/write) gdy go pozyskamy, a na ko\u0144cu, po wykonaniu ca\u0142ej klauzuli, zas\u00f3b jest zwolniony, niezale\u017cnie od tego, czy wydarzy\u0142a si\u0119 sytuacja wyj\u0105tkowa czy te\u017c nie try : with open ( sciezka_do_pliku ) as f : print ( f . read ()) print ( 2 / 0 ) except ZeroDivisionError as e : print ( e ) with open ( sciezka_do_pliku , 'w' ) as f : f . write ( \"Trzeci wiersz\" ) f . write ( \"Czwarty wiersz\" ) #je\u017celi nie damy \\n to oba wiersze s\u0105 zapisane w tej samej linijce #Pozosta\u0142e przydatne metody f . readline () f . read () f . closed #informuje czy ju\u017c zamkni\u0119te With open flagi: r -read w -write otwiera plik (i nadpisuje, je\u017celi tam ju\u017c co\u015b jest) a -append (otwiera do zapisu i zaczyna na ko\u0144cu tzn dopisuje) Dane o plikach import os print ( os . path . exists ( sciezka_do_pliku )) ## True print ( os . listdir ( \"C: \\f older \\\" )) ## ['Wyzwanie6', 'pomysly.txt', inne pliki...] print ( os . path . join ( \"folder1\" , \"folder2\" , \"plik.txt\" )) ## folder1/folder2/plik.txt #funkcja ta wstawia \\ / zale\u017cnie od systemu os . remove ( sciezka_do_pliku ) #usuwamy plik import datetime ( mode , ino , dev , nlink , uid , gid , size , atime , mtime , ctime ) = os . stat ( sciezka_do_pliku ) data_modyfikacji = datetime . datetime . fromtimestamp ( mtime ) print ( data_modyfikacji ) ## 2018-12-21 10:46:54 Poprawianie wydajno\u015bci Najcz\u0119\u015bciej, aby poprawi\u0107 wydajno\u015b\u0107 aplikacji pisanych w pythonie trzeba si\u0119 skoncentrowa\u0107 na pe\u0142niejszym wykorzystaniu mocy procesora. Jest na to kilka sposob\u00f3w. Wielow\u0105tkowo\u015b\u0107 Wielow\u0105tkowo\u015b\u0107 w pythonie jest nieco \u015bliskim tematem , poniewa\u017c w najpopularniejszej implementacji pythona (CPython) mamy do czynienie z mechanizmem GIL, kt\u00f3ry uniemo\u017cliwia prac\u0119 wielu w\u0105tkom jednocze\u015bnie. d\u0142u\u017cszy artyku\u0142 Z tego powodu domy\u015blnie w\u0105tki s\u0105 dobrym pomys\u0142em w wypadku operacji IO, czy te\u017c innych zadaniach, kt\u00f3re dzia\u0142aj\u0105c w tle nie konsumuj\u0105 czasu procesora. Je\u015bli za\u015b chcemy w naszej pracy wykorzysta\u0107 wiele rdzeni procesora r\u00f3wnocze\u015bnie to warto u\u017cy\u0107 biblioteki multiprocessing import threading def foo ( argument ): print ( \"Hello threading! with argument: \" , argument ) my_thread = threading . Thread ( target = foo , args = ( \"slowo\" )) my_thread . start () #>> Hello threading with argument: slowo # kolejne uruchomienie za pomoc\u0105 start rzuci nam RuntimeError Przy d\u0142u\u017cszym czasie wykonywania mo\u017cemy poczeka\u0107 na w\u0105tki za pomoc\u0105 join my_thread . join () lub my_thread . join ( timeout = 10 ) Wieloprocesowo\u015b\u0107 Biblioteka multiprocessing opiera si\u0119 na obrabianiu danych w ramach r\u00f3\u017cnych proces\u00f3w, dzi\u0119ki czemu ka\u017cdy proces ma w\u0142asnego GIL-a, kt\u00f3ry nie wchodzi w drog\u0119 innym procesom. Poza tym jest w obs\u0142udze do\u015b\u0107 podobna do w\u0105tk\u00f3w. (niby s\u0105 takie metody w bibliotece jak os.fork() , ale s\u0105 one do\u015b\u0107 niskopoziomowe i niezbyt przeno\u015bne) from multiprocessing import Process import os def work ( id ): print ( f 'this is process { os . getpid () } called by { id } ' ) def main (): procesy = [ Process ( target = work , args = ( number , )) for number in range ( 5 )] for proces in procesy : proces . start () while procesy : procesy . pop () . join () #> this is process 10749 called by 0 #> this is process 10750 called by 1 #> this is process 10751 called by 2 #> this is process 10753 called by 4 #> this is process 10752 called by 3 Komunikacja mi\u0119dzyprocesowa W tym wypadku nie mamy ju\u017c wsp\u00f3lnej pami\u0119ci z kt\u00f3rej mo\u017cemy korzysta\u0107. Dlatego stworzone s\u0105 nast\u0119puj\u0105ce mechanizmy: multiprocessing.Queque - prawie to samo co zwyk\u0142a kolejka ( queque.Queque . Praktycznie nie ma r\u00f3\u017cnic w u\u017cyciu. multiprocessing.Pipe - mechanizm nieco zbli\u017cony do gniazd sieciowych multiprocessing.sharedtypes - pozwala stworzy\u0107 typy z C we wsp\u00f3lnej puli pami\u0119ci mi\u0119dzyprocesowej Do \u0142atwego zarz\u0105dzani pul\u0105 dost\u0119pnych proces\u00f3w mamy obiekt Pool . Pozwala ustali\u0107 liczb\u0119 proces\u00f3w, kt\u00f3re mo\u017cemy stworzy\u0107 jednocze\u015bnie. Dla wygody pracy i \u0142atwego prze\u0142\u0105czania si\u0119 mi\u0119dzy procesami i w\u0105tkami przy u\u017cyciu tego API mamy paczk\u0119 multiprocessing.dummy.Pool (te same interfejsy, tylko, \u017ce dzia\u0142a na w\u0105tkach). Pipe Pipe - jest to w pe\u0142ni dupleksowe po\u0142\u0105czenie dzia\u0142aj\u0105ce podobnie do gniazd (patrz socket module ) z t\u0105 r\u00f3\u017cnic\u0105, \u017ce pozwala on na wysy\u0142anie nie tylko ci\u0105g\u00f3w bajt\u00f3w, lecz tak\u017ce serializowalne obiekty (patrz pickle ). Konstruktor tworzy dwa obiekty do odbioru i nadawania, kt\u00f3re mo\u017cemy przekaza\u0107 do naszego procesu. from multiprocessing import Process , Pipe def f ( conn ): conn . send ([ 42 , None , 'hello' ]) conn . close () if __name__ == '__main__' : parent_conn , child_conn = Pipe () p = Process ( target = f , args = ( child_conn ,)) p . start () print ( parent_conn . recv ()) # prints \"[42, None, 'hello']\" p . join () Sharedtypes Mamy tutaj klasy Value i Array , warto tu pami\u0119ta\u0107 o tym, \u017ce aby zabezpieczy\u0107 si\u0119 przed r\u00f3wnoczesnym pisaniem i czytaniem trzeba u\u017cywa\u0107 do\u0142\u0105czonych mutex\u00f3w ( Lock , RLock , Semaphore ). class Point ( Structure ): _fields_ = [( 'x' , c_double ), ( 'y' , c_double )] def modify ( n , x , s , A ): n . value **= 2 x . value **= 2 s . value = s . value . upper () for a in A : a . x **= 2 a . y **= 2 if __name__ == '__main__' : lock = Lock () n = Value ( 'i' , 7 ) x = Value ( c_double , 1.0 / 3.0 , lock = False ) s = Array ( 'c' , b 'hello world' , lock = lock ) A = Array ( Point , [( 1.875 , - 6.25 ), ( - 5.75 , 2.0 ), ( 2.375 , 9.5 )], lock = lock ) p = Process ( target = modify , args = ( n , x , s , A )) p . start () p . join () print ( n . value ) print ( x . value ) print ( s . value ) print ([( a . x , a . y ) for a in A ]) #> 49 #> 0.1111111111111111 #> HELLO WORLD #> [(3.515625, 39.0625), (33.0625, 4.0), (5.640625, 90.25)] Asynchroniczno\u015b\u0107 Wykorzystuje ona korutyny ( coroutines ). Bibliotek\u0105 wykorzystywan\u0105 do asynchroniczno\u015bci jest asyncio. Tutoriale pythondocs , realpython . >>> import asyncio >>> async def main (): ... print ( 'hello' ) ... await asyncio . sleep ( 1 ) #w tym momencie oddajemy kontrol\u0119 na sekund\u0119 #w tym czasie CPU mo\u017ce popracowa\u0107 nad czym\u015b innym ... print ( 'world' ) >>> asyncio . run ( main ()) hello world S\u0142owa kluczowe: async i async with - s\u0142u\u017c\u0105 do oznaczania funkcji, kt\u00f3re s\u0105 korutynami await - s\u0142u\u017cy do oznaczania momentu w kt\u00f3rym musimy poczeka\u0107 na wykonanie jakiej\u015b korutyny. W tym momencie przekazujemy kontrol\u0119 do p\u0119tli zdarze\u0144. async def g (): # Pause here and come back to g() when f() is ready r = await f () return r async def main (): task1 = asyncio . create_task ( say_after ( 1 , 'hello' )) task2 = asyncio . create_task ( say_after ( 2 , 'world' )) print ( f \"started at { time . strftime ( ' %X ' ) } \" ) # Wait until both tasks are completed (should take # around 2 seconds.) await task1 await task2 print ( f \"finished at { time . strftime ( ' %X ' ) } \" ) TODO uko\u0144czy\u0107 ten rozdzia\u0142 Rzeczy na kt\u00f3re nale\u017cy uwa\u017ca\u0107\u26a0\ufe0f R\u00f3\u017cne cechy oraz w\u0142a\u015bciwo\u015bci pythona na kt\u00f3re trzeba uwa\u017ca\u0107 podczas pisania w pythonie zw\u0142aszcza, gdy nie jest on pierwszym j\u0119zykiem. Wszystko jest referencj\u0105 Warto pami\u0119ta\u0107, \u017ce w pythonie prawie wszystko jest referencj\u0105. Np przekazuj\u0105c co\u015b do funkcji przekazujemy tan naprawd\u0119 referencj\u0119 do tego obiektu, z tego powodu wewn\u0105trz funkcji nasz obiekt mo\u017ce ulec zmianie. Warto tutaj zapozna\u0107 si\u0119 z poj\u0119ciem mutowalno\u015bci . Obiekty niemutowalne to takie, kt\u00f3rych nowe instancje s\u0105 tworzone podczas zmiany warto\u015bci. def fun ( x ): print ( id ( x )) #id() wypisuje identyfikator danej zmiennej x += 1 print ( id ( x )) num = 32 print ( id ( num )) fun ( num ) >> 9789984 >> 9789984 # Wida\u0107 tutaj, \u017ce funkcja operuje na tej samej instancji liczby >> 9790016 # po zmianie warto\u015bci do identyfikatora x jest ju\u017c przypisany inny obiekt Z tego powodu przekazywanie mutowalnej warto\u015bci do funkcji mo\u017cna traktowa\u0107 jako przekazanie kopii, a przekazanie niemutowalnej jako przekazanie referencji lub wska\u017anika (w j\u0119zyku C++). Niemutowalne Mutowalne int lista float s\u0142ownik complex bytearray bool obiekty u\u017cytkownika string tuple range frozenset bytes Przyk\u0142ady dzia\u0142ania: def fun ( num ): num = num + 10 print ( num ) liczba = 1 fun ( liczba ) # 10 print ( liczba ) #1 class Numer : def __init__ ( self , num ): self . num = num n = Numer ( 1 ) def fun2 ( numer ): numer . num = numer . num + 10 print ( numer . num ) print ( n . num ) # 1 fun2 ( n ) # 11 print ( n . num ) # 11 Je\u015bli chcemy tutaj zapobiec takim problemom warto zastanowi\u0107 si\u0119 nad u\u017cyciem modu\u0142u copy import copy x = copy . copy ( y ) # p\u0142ytka kopia x = copy . deepcopy ( y ) # kopia g\u0142\u0119boka rekursywnie kopiuj\u0105ca wszystkie elementy naszej klasy Inicjalizowanie zmiennych Skoro wszystko jest referencj\u0105 to trzeba te\u017c o tym pami\u0119ta\u0107 przy podawaniu domy\u015blnych warto\u015bci dla funkcji. link from dataclasses import dataclass @dataclass class Node ( object ): num : int children : list def __init__ ( self , num , children = []): self . num = num self . children = children n1 = Node ( 1 ) n2 = Node ( 2 ) print ( n1 ) # Node(num=1, children=[]) print ( n2 ) # Node(num=2, children=[]) n1 . children . append ( 3 ) print ( n1 ) #Node(num=1, children=[3]) print ( n2 ) #Node(num=2, children=[3]) Dlatego te\u017c wielu uwa\u017ca, \u017ce lepiej da\u0107 None jako domy\u015bln\u0105 warto\u015b\u0107 i inicjalizowa\u0107 to dopiero, wewn\u0105trz konstruktora. //TODO lista: mixin, importowanie, biblioteka sys, instance methods // yield, operator := // from future import annotations (ewaluacja definicji z kodu, kt\u00f3re pojawiaj\u0105 si\u0119 p\u00f3\u017aniej)","title":"Podstawy Pythona \ud83d\udc0d"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#podstawy-pythona","text":"","title":"Podstawy Pythona \ud83d\udc0d"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#quickstart","text":"","title":"Quickstart"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#shebang","text":"Jest to pierwsza linia skryptu (nie tylko w pythonie), kt\u00f3ra okre\u015bla za pomoc\u0105 czego ma by\u0107 wykonany skrypt (mo\u017ce by\u0107 to bash, zsh, python) Mamy tutaj 2 mo\u017cliwo\u015bci: Ta bardziej uniwersalna (dzia\u0142a z wieloma systemami operacyjnymi) #!/usr/bin/env python3 Ta mniej uniwersalna, ale pozwalaj\u0105ca u\u017cywa\u0107 pythona z r\u00f3\u017cnymi parametrami #!/usr/bin/python3 Np z po dodaniu parametru -i nadal pozostaniemy w pythonie po wykonaniu skryptu, co pozwoli nam np zajrze\u0107 do zmiennych, kt\u00f3re by\u0142y u\u017cyte, lub \u0142atwo u\u017cy\u0107 klas, albo metod, kt\u00f3re zosta\u0142y zdefiniowane w skrypcie.","title":"Shebang"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#funkcja-main","text":"wykonuje si\u0119, gdy skrypt jest uruchamiany jako samodzielny program, a nie jako modu\u0142 czego\u015b innego #!/usr/bin/python3 #warto to da\u0107, aby system widzia\u0142, \u017ce to skrypt w pythonie a nie np. w shellu def main (): print ( \"Witaj \u015bwiecie!\" ) if __name__ == \"__main__\" : main ()","title":"Funkcja main"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#argumenty-programu","text":"# Print total number of arguments print ( 'Total number of arguments:' , format ( len ( sys . argv ))) # Print all arguments print ( 'Argument List:' , str ( sys . argv )) # Print arguments one by one print ( 'First argument:' , str ( sys . argv [ 0 ])) print ( 'Second argument:' , str ( sys . argv [ 1 ])) Do parsowania bardziej skomplikowanych argument\u00f3w warto u\u017cy\u0107 biblioteki argparse","title":"Argumenty programu"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#zwracanie-wartosci","text":"sys . exit ( numer )","title":"Zwracanie warto\u015bci"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#funkcje-wewy","text":"pobrany_napis = input () print ( \"Tw\u00f3j napis to: \" + pobrany_napis ) input() jest funkcj\u0105, kt\u00f3ra pobiera napis podany przez u\u017cytkownika ze standardowego wej\u015bcia (do entera) zwraca zmienn\u0105 typu str Dla strumieni: import sys for line in sys . stdin : sys . stdout . write ( line )","title":"Funkcje we/wy"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#importowanie-bibliotek-etc","text":"TODO Przyk\u0142adowe importy. import math from collections import namedtuple from django.contrib.auth.forms import ( AuthenticationForm , PasswordChangeForm , PasswordResetForm , SetPasswordForm , ) wi\u0119cej informacji w opisie paczek .","title":"Importowanie bibliotek etc"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#podstawy","text":"","title":"Podstawy"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#komentarze","text":"\"\"\" Komentarz na kilka linii \"\"\" #komentarz na jedn\u0105 lini\u0119","title":"Komentarze"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#zmienne","text":"Deklarujemy je be okre\u015blania ich typu a=5 (interpreter automatycznie uzna, \u017ce to b\u0119dzie int) W odr\u00f3\u017cnieniu od takich j\u0119zyk\u00f3w jak C++, C# czy Java, w j\u0119zyku Python wyst\u0119puje typowanie dynamiczne. Oznacza to, \u017ce konkretny identyfikator, konkretna zmienna, np. a, mo\u017ce raz przechowywa\u0107 napis (\"Ala ma kota\") by po chwili przechowywa\u0107 liczb\u0119 ca\u0142kowit\u0105 (3). Do sprawdzania typu danych s\u0142u\u017cy funkcja type() . logiczna = True print ( type ( logiczna )) ## Najwa\u017cniejsze typy zmiennych: bool , warto\u015b\u0107 logiczna, tak lub nie, prawda (True) albo fa\u0142sz (False) int , liczba ca\u0142kowita, np. -7, 0 czy 3: float , czyli warto\u015b\u0107 zmiennopozycyjna, mo\u017cna j\u0105 uto\u017csamia\u0107 z warto\u015bciami rzeczywistymi, np. -0.67, 1.0, 3.14 complex , czyli liczba zespolona, np. -7+8.5j. Warto pami\u0119ta\u0107, \u017ce w Pythonie jednostk\u0105 urojon\u0105 jest j, a nie i str , powszechnie znany w innych j\u0119zykach jako string, czyli napis. Napis poznajemy g\u0142\u00f3wnie po tym, \u017ce jest zapisany w cudzys\u0142owie (i to odr\u00f3\u017cnia go cho\u0107by od nazwy zmiennej czy liczby, kt\u00f3re nie s\u0105 w cudzys\u0142owach). Dodamy, \u017ce w j\u0119zyku Python nie ma znaczenia, czy pos\u0142ugujemy si\u0119 pojedynczymi (') czy podw\u00f3jnymi (\") cudzys\u0142owami Konwersja typ\u00f3w analogiczna dla przyk\u0142adu poni\u017cej print ( int ( 5.3 )) ## 5 Operatory: dodawanie ( + ) odejmowanie ( - ) mno\u017cenie ( * ) dzielenie ( / ) reszta z dzielenia, modulo ( % ) Analogiczne co C operatory -= , *= , /= , %= ... UWAGA! Brak operator\u00f3w ++ i -- ** pot\u0119ga 2+3j liczba zespolona Operatory Logiczne zwracaj\u0105 warto\u015b\u0107 logiczn\u0105 (True/False) < - mniejsze <= - mniejsze r\u00f3wne, zwr\u00f3\u0107my uwag\u0119, \u017ce zapisujemy tak jak czytamy, nie ma operatora =< (r\u00f3wne mniejsze) > - wi\u0119ksze >= - wi\u0119ksze r\u00f3wne == - r\u00f3wna si\u0119. Tutaj bardzo wa\u017cne jest, aby odr\u00f3\u017cnia\u0107 operator przypisania (=) od operatora por\u00f3wnania r\u00f3wna si\u0119 (==). To bardzo cz\u0119sty b\u0142\u0105d w\u015br\u00f3d pocz\u0105tkuj\u0105cych programist\u00f3w. Operator = nie jest symetryczny, ma na celu przekopiowanie warto\u015bci z prawej do lewej. W niekt\u00f3rych j\u0119zykach zapisuje si\u0119 go jako <- (ale nie w Pythonie). Operator = nie ma nic wsp\u00f3lnego z warto\u015bciami logicznymi. Za to operator == jest operatorem zwracaj\u0105cym warto\u015b\u0107 logiczn\u0105, a co wi\u0119cej, jest on operatorem symetrycznym (nie ma znaczenia zamienienie kolejno\u015bci\u0105 argument\u00f3w). != - nie r\u00f3wna si\u0119 Operator koniunkcji, and , uto\u017csamiany z polskim i. Zwraca warto\u015b\u0107 True wtedy i tylko wtedy, gdy oba argumenty s\u0105 r\u00f3wne True Operator alternatywy, or , uto\u017csamiany z polskim lub. Zwraca warto\u015b\u0107 True wtedy i tylko wtedy, gdy przynajmniej jeden argument jest r\u00f3wny True Operator zaprzeczenia, not , uto\u017csamiany z polskim nie. Zwraca warto\u015b\u0107 przeciwn\u0105, ni\u017c argument Mo\u017cna \u0142\u0105czy\u0107 kilka operator\u00f3w np: czy_wiek_produkcyjny = 18 <= wiek <= 65 - w pythonie por\u00f3wnania rozwijane s\u0105 tak jak w matematyce, czyli np mo\u017cemy te\u017c napisa\u0107 2 <= 4 < 8 , co zwr\u00f3ci nam True Inne operatory: is - czy dwie zmienne s\u0105 r\u00f3\u017cnymi instancjami tego samego obiektu s1 = {} s2 = {} s1 == s2 #True s1 is s2 #False ##poniewa\u017c to nie jest ten sam s\u0142ownik in u\u017cywany do sprawdzenia, czy dana warto\u015b\u0107/obiekt zawiera si\u0119 w li\u015bcie/s\u0142owniku/secie... zbior = { 1 , 3 , 5 } zbior_pusty = {} print ( 1 in zbiorPusty ) ## False print ( 1 in zbior ) ## True Instrukcja warunkowa if if warunek : instrukcja1 instrukcja2 elif warunek2 : # gdy warunek nieprawdziwy, sprawd\u017a warunek2 instrukcja3 instrukcja4 elif warunek3 : #gdy warunek2 nieprawdziwy, sprawd\u017a warunek3 instrukcja5 instrukcja6 else : #gdy zaden z warunk\u00f3w nie byl prawdziwy instrukcja7 instrukcja8 Warto tak\u017ce pami\u0119ta\u0107 o jedno-linijkowym wariancie if-a: # a if condition else b print ( \"Prawda\" ) if True else print ( \"Fa\u0142sz\" ) #Prawda","title":"Zmienne"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#pusta-zmienna","text":"Czasem _ jest u\u017cywane jako pusta zmienna jest to swego rodzaju odpowiednik /dev/null TODO dopisa\u0107 i om\u00f3wi\u0107 przyk\u0142ady: https://stackoverflow.com/questions/5893163/what-is-the-purpose-of-the-single-underscore-variable-in-python","title":"Pusta zmienna"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#petle","text":"Po for ( foreach ) mo\u017ce si\u0119 znajdowa\u0107 lista (obr\u00f3t dla ka\u017cdego elementu) Po while warunek logiczny (obroty dop\u00f3ki prawda) for i in range ( 0 , 4 ): print ( i ) ## 0 ## 1 ## 2 ## 3 #lub i = 0 while i < 4 : print ( i ) i += 1 liczby = [ 2 , 3 , 5 ] for liczba in liczby : print ( liczba ) ## 2 ## 3 ## 5 S\u0142owo kluczowe continue przerywa dany obr\u00f3t p\u0119tli S\u0142owo kluczowe break przerywa ca\u0142\u0105 p\u0119tl\u0119 Je\u015bli iterujemy po li\u015bcie krotek mo\u017cemy sobie je rozbi\u0107 for i , line in enumerate ( strings_list ): #enumerate zwraca dla danej listy krotk\u0119 zawieraj\u0105c\u0105 numer i element z listy ###jaki\u015b kod","title":"P\u0119tle"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#petle-jednolinijkowe-list-comprehensions","text":"Jednolinijkowe p\u0119tle zwracaj\u0105ce np list\u0119 dobre dla prostych operacji, u\u017cyteczne do szybkiego generowania tablic. newlist = [ expression for item in iterable if condition == True ] #albo bez if-a newlist = [ x for x in range ( 10 )] fruits = [ \"apple\" , \"banana\" , \"cherry\" , \"kiwi\" , \"mango\" ] newlist = [] for x in fruits : if \"a\" in x : newlist . append ( x ) #daje to samo co: newlist = [ x for x in fruits if \"a\" in x ]","title":"P\u0119tle jednolinijkowe (List Comprehensions)"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#krotka-tuple","text":"Pewn\u0105 specyficzn\u0105 dla j\u0119zyka Python struktur\u0105 jest krotka. Polega ona na grupowaniu paru warto\u015bci w jeden byt. Warto zaznaczy\u0107, \u017ce krotka, kt\u00f3ra raz zosta\u0142a stworzona, nie mo\u017ce by\u0107 modyfikowana: nie mo\u017cemy podmieni\u0107 jednej ze sk\u0142adowych krotki krotka = ( 2 , 3 ) print ( krotka ) ## (2, 3) Gdyby\u015bmy chcieli uzyska\u0107 poszczeg\u00f3lne sk\u0142adowe krotki, mo\u017cemy to zrobi\u0107 przy u\u017cyciu operatora kwadratowych nawias\u00f3w. W Pythonie, tak jak w wielu j\u0119zykach programowania, numerujemy sk\u0142adowe od 0: pierwsza = krotka [ 0 ] druga = krotka [ 1 ] print ( pierwsza ) ## 2 print ( druga ) ## 3 W krotce mo\u017cemy miesza\u0107 typy danych : krotka = ( 2 , \"Napis\" ) print ( krotka ) ## (2, 'Napis') len ( krotka ) #d\u0142ugo\u015b\u0107 krotki ## 2 Kiedy krotka mo\u017ce by\u0107 przydatna? Np. gdy chcemy zwr\u00f3ci\u0107 wi\u0119cej ni\u017c jedn\u0105 warto\u015b\u0107 w funkcji. def f ( x ): y0 = x + 1 y1 = x * 3 y2 = y0 ** y3 return ( y0 , y1 , y2 ) Je\u015bli chcemy mo\u017cemy rozbi\u0107 krotk\u0119 na poszczeg\u00f3lne zmienne a , b , c = ( 1 , 2 , 3 )","title":"Krotka (tuple)"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#named-tuple","text":"Specjalne obiekty dzia\u0142aj\u0105ce jak krotki i kompatybilne z nimi. from collections import namedtuple Point = namedtuple ( 'Point' , 'x y' ) pt1 = Point ( 1.0 , 5.0 ) pt2 = Point ( 2.5 , 1.5 ) from math import sqrt # wskazanie poprzez indeks line_length = sqrt (( pt1 [ 0 ] - pt2 [ 0 ]) ** 2 + ( pt1 [ 1 ] - pt2 [ 1 ]) ** 2 ) # rozpakowanie krotki x1 , y1 = pt1","title":"named tuple"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#funkcja-zip","text":"Do operowania na krotkach przydatna jest funkcja wbudowana zip zwracaj\u0105ca iterator (nie list\u0119) pozwalaj\u0105cy iterowa\u0107 po krotkach tworzonych z obiekt\u00f3w danych w funkcji. a = ( \"John\" , \"Charles\" , \"Mike\" ) b = ( \"Jenny\" , \"Christy\" , \"Monica\" , \"Vicky\" ) # warto\u015bci nadmiarowe s\u0105 pomijane for kr in zip ( a , b ): print ( kr ) #('John', 'Jenny') #('Charles', 'Christy') #('Mike', 'Monica')","title":"Funkcja zip"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#lista","text":"Podobn\u0105, przynajmniej na poz\u00f3r, struktur\u0105 danych do krotki jest lista. Tutaj tak\u017ce mo\u017cemy grupowa\u0107 dane oraz nie musz\u0105 one by\u0107 tego samego typu. Jednak g\u0142\u00f3wn\u0105 r\u00f3\u017cnic\u0105 jest to, \u017ce list\u0119 mo\u017cemy modyfikowa\u0107. Mo\u017cemy dodawa\u0107 nowe elementy czy zast\u0119powa\u0107 dotychczasowe. lista = [ 1 , False , \"Napis\" ] print ( lista ) ## [1, False, 'Napis'] print ( len ( lista )) ## 3 lista . append ( 2.5 + 3.7 j ) print ( lista ) ## [1, False, 'Napis', (2.5+3.7j)] lista . extend ([ 97 , 98 , 99 ]) # metoda podobna po append, kt\u00f3ra przyjmuje jako argument ca\u0142\u0105 list\u0119 i dodaje z niej kolejne elementy print ( lista ) ## [1, False, 'Napis', (2.5+3.7j), 97, 98, 99] Operatory + i * maj\u0105 zdefiniowane dzia\u0142anie w kontek\u015bcie list. + , tak jak w przypadku napisu, to konkatenacja, czyli po\u0142\u0105czenie dw\u00f3ch list w jedn\u0105 * za\u015b pozwala nam powieli\u0107 dan\u0105 list\u0119: print ( lista + [ 7 , 8 , 9 ]) ## [1, False, 'Napis', (2.5+3.7j), 97, 98, 99, 7, 8, 9] print ([ 7 , 8 , 9 ] * 3 ) ## [7, 8, 9, 7, 8, 9, 7, 8, 9] Odwo\u0142anie si\u0119 do konkretnego elementu nast\u0119puje tak jak w krotce: print ( lista [ 2 ]) ## Napis ! ujemne indeksy oznaczaj\u0105 pozycje liczone od ty\u0142u print ( lista [ - 1 ]) ## 99 Odwo\u0142ywanie si\u0119 do wycinka listy print ( lista [ 2 : 5 ]) ## ['Nowy', (2.5+3.7j), 97] Elementy o numerach 2 , 3 , 4 ( bez 5 ) \"ala ma kota\" [ - 4 ::] #elementy od trzeciego od ko\u0144ca a\u017c do ostatniego #\"kota\" Podmiana lista [ 0 : 3 ] = [ 98 , 99 , 101 , 102 ] print ( lista ) ## [98, 99, 101, 102, (2.5+3.7j), 97, 98, 99] Usuwa 3 pierwsze elementy i na ich miejsce wstawia te podane Wstawienie elementu w innym miejscufor klucz in bazaDanychPolakow.keys(): print ( klucz ) for wartosc in bazaDanychPolakow . values (): print ( wartosc ) for klucz , wartosc in bazaDanychPolakow . items (): ##Tutaj items() zwraca krotk\u0119 print ( klucz ) print ( wartosc ) print ( \"-----\" ) lista . insert ( 1 , \"Nowy2\" ) print ( lista ) ## [98, 'Nowy2', 99, 101, 102, (2.5+3.7j), 97, 98, 99] Usuni\u0119cie elementu del lista [ 1 ] print ( lista ) ## [98, 99, 101, 102, (2.5+3.7j), 97, 98, 99] Napisy Zmienna w napisie zmienna = 7 napis = f \"warto\u015b\u0107 zmiennej to { zmienna } \" print ( napis ) ## warto\u015b\u0107 zmiennej to 7 wieleWierszy = \"\"\"Tutaj pierwszy a tu drugi tutaj trzeci\"\"\" print ( wieleWierszy ) ## Tutaj pierwszy ## a tu drugi ## tutaj trzeci Kolejno\u015b\u0107 alfabetyczna print ( \"a\" < \"b\" ) ## True Wi\u0119cej na: https://www.kodolamacz.pl/blog/wyzwanie-python-3-algorytmy-i-struktury-danych/","title":"Lista"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#zbior-set","text":"to tablica (tyle, \u017ce bez indeksowania), w kt\u00f3rych nie ma dw\u00f3ch lub wi\u0119cej identycznych element\u00f3w. (jest szybszy od listy) zbiorPusty = set () zbior = { 1 , 3 , 5 } print ( zbiorPusty ) ## set() print ( zbior ) ## {1, 3, 5} zbior . add ( 2 ) ##Dodawanie elementu zbior . discard ( 2 ) ##Usuwanie elementu Mo\u017cna w nim \u0142atwo sprawdza\u0107 , czy dany element nale\u017cy do zbioru print ( 1 in zbiorPusty ) ## False print ( 1 in zbior ) ## True print ( 1 not in zbiorPusty ) ## True Mo\u017cemy na nich wykona\u0107 typowe operacje teoriomnogo\u015bciowe, jak suma, r\u00f3\u017cnica czy przeci\u0119cie dw\u00f3ch zbior\u00f3w print ({ 1 , 5 , 8 } | { 1 , 5 , 9 }) # suma ## {1, 5, 8, 9} print ({ 1 , 5 , 8 } - { 1 , 5 , 9 }) # r\u00f3\u017cnica ## {8} print ({ 1 , 5 , 8 } & { 1 , 5 , 9 }) # przeci\u0119cie ## {1, 5} Mo\u017cna zapyta\u0107 , czy jeden zbi\u00f3r jest podzbiorem drugiego print ({ 1 , 5 } . issubset ({ 1 , 5 , 9 })) ## True","title":"Zbi\u00f3r (set)"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#sownik","text":"Jest to rozszerzenie idei zbioru. S\u0142ownik zawiera pary klucz-warto\u015b\u0107. Wyszukiwanie po kluczu jest szybkie, tak jak w zbiorze, jednak gdy ju\u017c odnajdziemy klucz, mo\u017cemy odzyska\u0107 tak\u017ce stowarzyszon\u0105 z nim warto\u015b\u0107. Gdy usuniemy ze s\u0142ownika warto\u015bci, a zostawimy same klucze, otrzymamy zbi\u00f3r. Tak jak w zbiorze, w s\u0142owniku klucze nie mog\u0105 si\u0119 powtarza\u0107. bazaDanychPolakow = { \"89082911111\" : [ \"Jan\" , \"Kowalski\" , 29 ], \"95092200000\" : [ \"Ania\" , \"Nowak\" , 23 ], \"98122422222\" : [ \"Adam\" , \"Mickiewicz\" , 220 ] } bazaDanychPolakow [ \"88081244444\" ] = [ \"Magda\" , \"K\" , 30 ] #Dodanie nowej pary klucz-warto\u015b\u0107 del bazaDanychPolakow [ \"88081244444\" ] #Usuni\u0119cie danej pary Tak jak w zbiorze mo\u017cemy sprawdza\u0107, czy klucz znajduje si\u0119 w s\u0142owniku. Uzyskanie warto\u015bci stowarzyszonej z kluczem print ( bazaDanychPolakow [ \"98122422222\" ]) ## ['Adam', 'Mickiewicz', 220] Gdy chcemy zabezpieczy\u0107 si\u0119 przed odwo\u0142aniem do nieistniej\u0105cego elementu ( i w tym wypadku zwr\u00f3ci\u0107 warto\u015b\u0107 domy\u015bln\u0105 ), u\u017cyjemy metody get (): print ( bazaDanychPolakow . get ( \"89082911111\" , \"warto\u015b\u0107 domy\u015blna\" )) ## ['Jan', 'Kowalski', 29] print ( bazaDanychPolakow . get ( \"95092200022\" , \"warto\u015b\u0107 domy\u015blna\" )) ## warto\u015b\u0107 domy\u015blna Przej\u015bcie w p\u0119tli for klucz in bazaDanychPolakow . keys (): print ( klucz ) for wartosc in bazaDanychPolakow . values (): print ( wartosc ) for klucz , wartosc in bazaDanychPolakow . items (): ##Tutaj items() zwraca krotk\u0119 print ( klucz ) print ( wartosc ) print ( \"-----\" ) Przy printowaniu s\u0142ownik\u00f3w (zw\u0142aszcza tych skomplikowanych) warto u\u017cy\u0107 pprint import pprint pprint . pprint ( duzy_slownik )","title":"S\u0142ownik"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#funkcje","text":"Funkcje def nazwaFunkcji ( parametry , oddzielone , przecinkami ): return wynik Warto\u015bci domy\u015blne parametr\u00f3w def potega ( podstawa , wykladnik = 1 ): #cia\u0142o funkcji Argumenty nazwane Mo\u017cemy podawa\u0107 argumenty w dowolnej kolejno\u015bci , gdy podamy ich nazwy print ( potega ( wykladnik = 4 , podstawa = 3 )) ## 81 def printinfo ( name , age = 35 ): \"Prosta funkcja z domy\u015blnymi warto\u015bciami\" print ( \"Name: \" , name ) print ( \"Age \" , age ) return Funkcja mo\u017ce tak\u017ce przyjmowa\u0107 wiele argument\u00f3w #** - zmienne b\u0119d\u0105 interpretowane jako krotka def printinfo ( arg1 , * krotka ): print ( \"Output is: \" ) print ( arg1 ) for var in krotka : print ( var ) return #** - zmienne b\u0119d\u0105 interpretowane jako s\u0142ownik def printinfo2 ( arg1 , ** slownik ): print ( \"Output is: \" ) print ( arg1 ) for key in slownik . keys (): print ( key ) return printinfo ( 10 ) printinfo ( 70 , 60 , 50 ) printinfo2 ( \"argum1\" , klucz1 = wart1 , klucz2 = wart2 , klucz3 = 523 , pusty = None ) #wa\u017cne, aby s\u0142ownik by\u0142 definiowany jako s\u0142ownik, czyli klucz=wartosc W pythonie jedna funkcja mo\u017ce zwraca\u0107 r\u00f3\u017cne rzeczy, obiekty, zmienne, nic. def returnOrNot ( return_bool = True ): if return_bool : return True return","title":"Funkcje"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#adnotacje","text":"W wypadku funkcji mo\u017cemy te\u017c doda\u0107 adnotacje (typowanie zmiennych) do ich argument\u00f3w oraz warto\u015bci zwracanych (nie s\u0105 one wykorzystywane przez interpreter, ale u\u0142atwiaj\u0105 dokumentowanie). (Uwaga, tej funkcji nie ma w pythonie 2, dla niego jest workaround o nazwie type comments ) def funkcja ( liczba1 : 99 = 12 , slowo1 : str = \"sl\" , slowo2 : \"inne slowo\" = \"inne\" ) -> str : #some code return \"slowo\" slowo : str = \"inne_slowo\" Mo\u017cna potem je sprawdzi\u0107 poprzez si\u0119gni\u0119cie do atrybutu __annotations__ >>> funkcja . __annotations__ { 'liczba1' : 99 , 'slowo1' : < class ' str '>, ' slowo2 ': ' inne slowo ', ' return ': } W niekt\u00f3rych wypadkach mo\u017ce pojawi\u0107 si\u0119 potrzeba zaimportowania oczekiwanych element\u00f3w from typing import Tuple def foo ( x : int , y : int ) -> Tuple [ int , int ]: return ( x * y , y // 2 ) Mo\u017cliwe s\u0105 te\u017c adnotacje dla element\u00f3w klasy PEP-526 class Starship : stats : ClassVar [ dict [ str , int ]] = {} # class variable - pole klasy damage : int = 10 # instance variable - pole instancji W razie problem\u00f3w spowodowanych kolejno\u015bci\u0105 deklaracji r\u00f3\u017cnych element\u00f3w w pliku warto u\u017cy\u0107 specjalnego importu from __future__ import annotations # bez niego poni\u017cszy kod by nie dzia\u0142a\u0142 def fun ( i : A ): #mogliby\u015bmy otzyma\u0107 b\u0142\u0105d m\u00f3wi\u0105cy o odnoszeniu si\u0119 do nieistniej\u0105cej klasy pass class A : pass","title":"Adnotacje"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#wyrazenia-lambda","text":"Lambdy to s\u0105 funkcje, kt\u00f3re mo\u017cna w do\u015b\u0107 podr\u0119czny spos\u00f3b zdefiniowa\u0107 #Og\u00f3lna definicja lambda arg1 , arg2 , arg3 : nasze_wyrazenie #ta lambda zwr\u00f3ci warto\u015b\u0107 naszego wyra\u017cenia nasza_lambda = lambda x : x * 2 nasza_lambda ( 2 ) #>4 Argumenty w lambdach mo\u017cna zapisywa\u0107 tak samo jak w zwyk\u0142ych funkcjach, mog\u0105 tam by\u0107 warto\u015bci domy\u015blne,","title":"Wyra\u017cenia lambda"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#zasieg-i-zmienne-globalne","text":"W pythonie na og\u00f3\u0142 funkcje nie mog\u0105 edytowa\u0107 (mog\u0105 mie\u0107 dost\u0119p, ale nie edytowa\u0107) zmienne poza swoim zakresem. c = 1 # global variable def add (): print ( c ) c = c + 2 # increment c by 2 print ( c ) add () #>2 #>UnboundLocalError: local variable 'c' referenced before assignment Aby m\u00f3c je jednak zmienia\u0107 jest u\u017cywane s\u0142owo kluczowe global . c = 0 # global variable def add (): global c c = c + 2 # increment by 2 print ( \"Inside add():\" , c ) add () print ( \"In main:\" , c ) #>Inside add(): 2 #>In main: 2","title":"Zasi\u0119g i zmienne globalne"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#przekazywanie-dowolnych-argumentow-kwargs-i-args","text":"Pozwalaj\u0105 one na umieszczeanie argument\u00f3w o dowolnej liczbie i nazwie w naszej funkcji. args przyjmuje je jako list\u0119 kolejnych element\u00f3w, za\u015b kwargs przyjmuje je jak s\u0142ownik. def parametr_args ( * args ): print ( \"zawarto\u015b\u0107 args: {} \" . format ( args )) parametr_args ( 'python' , 'spam' , 'eggs' , 'test' ) ###zawarto\u015b\u0107 args: ('spam', 'eggs', 'test') def parametr_kwargs ( argument , ** kwargs ): print ( \"argument: {} \" . format ( argument )) print ( \"zawarto\u015b\u0107 kwargs: {} \" . format ( kwargs )) parametr_kwargs ( dodatkowy = 48 , nastepny = 111 , argument = 12 ) # argument: 12 # zawarto\u015b\u0107 kwargs: {'dodatkowy': 48, 'nastepny': 111} //TODO https://printpython.pl/poczatki/zadanie-z-gwiazdka/","title":"Przekazywanie dowolnych argument\u00f3w (**kwargs i *args)"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#dekoratory-funkcji","text":"Jest to element pozwalaj\u0105cy na opakowanie naszej funkcji za pomoc\u0105 innej funkcji, aby wzbogaci\u0107 jej funkcjonalno\u015b\u0107. Funkcja dekoruj\u0105ca najcz\u0119\u015bciej przyjmuje funkcj\u0119 dekorowan\u0105 i zwraca now\u0105, wynikow\u0105 funkcj\u0119, kt\u00f3ra ma zosta\u0107 wykonana. #foo jest dekoratorem, kt\u00f3ry wzbogaci nasz\u0105 funkcj\u0119 def foo ( to_be_wrapped ): def new_func ( args , ** kwargs ): print ( \"uwaga, b\u0119dzie sze\u015bcian\" ) return to_be_wrapped ( * args , ** kwargs ) # warto je doda\u0107 aby argumenty zosta\u0142y przekazane dalej do funkcji docelowej return new_func @foo #je\u015bli dodamy ten dekorator to u\u017cycie tej funkcji zostanie zmienione, tzn zamiast oryginalnej funkcji cube() otrzymamy \"wzbogacone\" cube drukuj\u0105ce komunikat przed drukowaniem def cube ( d ): return d ** 3 #podniesienie do pot\u0119gi 3 cube ( 2 ) #uwaga, b\u0119dzie sze\u015bcian #8 Ale warto pami\u0119ta\u0107, \u017ce je\u015bli chcemy przygotowywa\u0107 takie dekoratory wewn\u0105trz klas to musimy pami\u0119ta\u0107, \u017c\u0119 nieco inaczej wygl\u0105da dost\u0119p do self class Myclass : # wydaje mi si\u0119, \u017ce tutaj dekorator musi by\u0107 zdefiniowany jako pierwszy def _add_loaded_location_to_token ( decorated_fun , * args , ** kwargs ): def output_fun ( * args , ** kwargs ): t = decorated_fun ( * args , ** kwargs ) t . location = args [ 0 ] . current_location # po prostu self jest schowany pod pierwszym z argument\u00f3w return t return output_fun @_add_loaded_location_to_token def get_token ( self ): #kod return token","title":"Dekoratory funkcji"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#statyczne-pola-funkcji","text":"Odpowiednikiem zmiennych typu static wewn\u0105trz funkcji jest pole funkcji. \u017ar\u00f3d\u0142o def myfunc (): myfunc . counter += 1 print myfunc . counter # atrybut musi by\u0107 gdzie\u015b zainicjalizowany myfunc . counter = 0 Mo\u017cna te\u017c doda\u0107 atrybut w ten spos\u00f3b: def myfunc (): if not hasattr ( myfunc , \"counter\" ): myfunc . counter = 0 # it doesn't exist yet, so initialize it myfunc . counter += 1","title":"Statyczne pola funkcji"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#obiektowka","text":"","title":"Obiekt\u00f3wka"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#obiekt","text":"class Osoba : #Definicja klasy o nazwie Osoba ile = 0 # pole klasy imie : str # adnotacja typu dla pola instancji def __init__ ( self , imie , nazwisko , wiek ): #Definicja konstruktora self . imie = imie self . nazwisko = nazwisko self . wiek = wiek def przedstaw_sie ( self ): print ( f \"Jestem { self . imie } { self . nazwisko } . Mam { self . wiek } lat.\" ) def urodziny ( self ): wiek_przed = self . wiek self . wiek += 1 return wiek_przed def __del__ ( self ): # destruktor, czyli kod, kt\u00f3ry wykonuje si\u0119 podczas niszczenia obiektu @staticmethod def policz (): return Osoba . ile Obiekty w pythonie nie maj\u0105 p\u00f3l statycznych dzia\u0142aj\u0105cych tak jak w innych j\u0119zykach (jak np C++). Tutaj zmiana pola klasy nie zmienia warto\u015bci tego pola dla innych instancji link .","title":"Obiekt"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#metody","text":"Metod\u0119 mo\u017cemy pozna\u0107 min. tak\u017ce po pierwszym argumencie: self . W j\u0119zyku Python metody przyjmuj\u0105 jako pierwszy parametr obiekt, na rzecz kt\u00f3rego s\u0105 wywo\u0142ywane. W samym wywo\u0142aniu nie musimy go sami podawa\u0107. Wystarczy, \u017ce metoda jest napisana po kropce. Nast\u0119pnie nast\u0119puj\u0105 trzy zwyk\u0142e parametry: imie, nazwisko oraz wiek.","title":"Metody"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#konstruktor-i-destruktor","text":"Jest to taka metoda, kt\u00f3ra jest wywo\u0142ywana, gdy obiekt jest tworzony. Jej celem jest zainicjowanie p\u00f3l w instancji. Tu s\u0105 definiowane parametry klasy. Konstruktor poznajemy po jego specjalnej nazwie: __init__ . Analogicznie dzia\u0142a destruktor (nazwa: __del__ ) Przy wywo\u0142aniu pomijamy argument self. Jan = Osoba ( \"Jan\" , \"Nowak\" , 48 ) Jan = None #Wymuszenie destrukcji obiektu","title":"Konstruktor i destruktor"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#wasne-operatory","text":"W pythonie mo\u017cna w prosty spos\u00f3b dodawa\u0107 w\u0142asne operatory do klas. Mo\u017cemy w prosty spos\u00f3b sprawi\u0107, \u017ce korzystanie z naszych klas b\u0119dzie wygodniejsze. class C : __str__ ( self ): Operator Nazwa funkcji Opis str() __str__(self) Funkcja generuj\u0105ca stringa dla danej klasy. Przydatne do debugowania i nie tylko + __add__(a,b) Dodawanie [] __getitem__(self,index) Te kilka jest potrzebne do poprawnego zaimplementowania operatora [] [] __setitem__(self,index,item) [] __delitem__(self.index) Pe\u0142niejsza lista operator\u00f3w TODO popraw i rozbuduj","title":"W\u0142asne operatory"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#widocznosc-elementow","text":"W j\u0119zyku Python nie ma p\u00f3l prywatnych w klasie: nie jeste\u015bmy w stanie w praktyce czegokolwiek \u201cukry\u0107\u201d. Jednak s\u0105 pewne zasady nazewnictwa, kt\u00f3re dzia\u0142aj\u0105 raczej na zasadzie porozumienia, ni\u017c b\u0119d\u0105ce prawdziw\u0105 barier\u0105. I tak, gdy poprzedzimy nazw\u0119 jednym znakiem podkre\u015blenia _ , oznajmiamy, \u017ce dany element nie jest uwzgl\u0119dniony w dokumentacji, mo\u017ce si\u0119 zmieni\u0107, raczej nie nale\u017cy z niego korzysta\u0107, a \u015brodowisko programistyczne nie b\u0119dzie nam go podpowiada\u0107. Przyk\u0142adowo pole _imie , np. self._imie , czy self._metoda() . Gdy u\u017cyjemy dw\u00f3ch znak\u00f3w podkre\u015blenia __ , zachowanie jest troch\u0119 inne: dane pole czy metoda nie b\u0119dzie widoczna pod t\u0105 nazw\u0105 wcale, ale za to b\u0119dzie mo\u017cna si\u0119 do niego odwo\u0142a\u0107 (dla nazwy __element ) poprzez _nazwaklasy.__element .","title":"Widoczno\u015b\u0107 element\u00f3w"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#statyczne","text":"Dla odmiany s\u0105 one tworzone poza konstruktorem. Do pola tego odwo\u0142ujemy si\u0119 poprzez nazw\u0119 klasy. Np Osoba.ile Sama metoda statyczna ma nad sob\u0105 napis @staticmethod . To tzw. dekorator . Metoda statyczna nie mo\u017ce odwo\u0142ywa\u0107 si\u0119 do instancyjnych p\u00f3l (czyli tych zwyk\u0142ych, jak imie z poprzedniego przyk\u0142adu), a jedynie do statycznych. Wynika to z faktu, \u017ce metoda statyczna nie jest wywo\u0142ywana na rzecz konkretnego obiektu, kt\u00f3ry by takie w\u0142a\u015bnie pola mia\u0142. Je\u015bli jednak chcemy aby nasza metoda mia\u0142a jakie\u015b informacje na temat naszej klasy mo\u017cna u\u017cy\u0107 dekoratora @classmethod , kt\u00f3ry r\u00f3\u017cni si\u0119 tym, \u017ce klasaobiektu (nie instancja) jest przekazywana dalej. Por\u00f3wnanie na stacku class A ( object ): def foo ( self , x ): print ( f \"executing foo( { self } , { x } )\" ) @classmethod def class_foo ( cls , x ): print ( f \"executing class_foo( { cls } , { x } )\" ) @staticmethod def static_foo ( x ): print ( f \"executing static_foo( { x } )\" )","title":"Statyczne"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#dziedziczenie","text":"class Zwierze : def __init__ ( self , nazwa , wiek , waga ): self . nazwa = nazwa self . wiek = wiek self . waga = waga def przedstaw_sie ( self ): print ( f \"Jestem zwierz\u0119ciem { self . nazwa } , mam { self . wiek } lat oraz waz\u0119 { self . waga } kg.\" ) def urodziny ( self ): self . wiek += 1 class Mrowka ( Zwierze ): pass #Oznacza, \u017ce cia\u0142o jest puste class Slon ( Zwierze ): def przedstaw_sie ( self ): print ( f \"Jestem s\u0142oniem { self . nazwa } , mam { self . wiek } lat oraz waz\u0119 { self . waga } kg.\" ) class Lew ( Zwierze ): def przedstaw_sie ( self ): super () . przedstaw_sie () print ( \"A tak w og\u00f3le to jestem lwem\" ) class Papuga ( Zwierze ): def __init__ ( self , nazwa , wiek , waga , kolor ): super () . __init__ ( nazwa , wiek , waga ) self . kolor = kolor def przedstaw_sie ( self ): super () . przedstaw_sie () print ( f \"Jako papuga m\u00f3j kolor to { self . kolor } \" ) super() zwraca nam instancj\u0119 klasy bazowej: s\u0105 to wszystkie pola i metody naszego obiektu, jakie otrzymali\u015bmy dzi\u0119ki klasie bazowej.","title":"Dziedziczenie"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#polimorfizm","text":"Pozwala na u\u017cywanie klasy dziedzicz\u0105cej wsz\u0119dzie tam, gdzie mo\u017ce by\u0107 u\u017cyta klasa bazowa. Oznacza to, \u017ce instancja klasy dziedzicz\u0105cej jest uznawana za instancj\u0119 klasy bazowej. W j\u0119zyku Python sprawdzenie przynale\u017cno\u015bci danego obiektu do klasy wykonuje si\u0119 metod\u0105 isinstance(): def main (): Dumboo = Slon ( \"Dumboo\" , 77 , 6000 ) Simba = Lew ( \"Simba\" , 24 , 100 ) Jago = Papuga ( \"Jago\" , 32 , 3 , \"czerwony\" ) jakis_zwierz = Zwierze ( \"Katarzyna\" , 31 , 80 ) print ( f \"isinstance(Dumboo, Slon): { isinstance ( Dumboo , Slon ) } \" ) print ( f \"isinstance(Dumboo, Lew): { isinstance ( Dumboo , Lew ) } \" ) print ( f \"isinstance(Jago, Papuga): { isinstance ( Jago , Papuga ) } \" ) print ( f \"isinstance(Jago, Zwierze): { isinstance ( Jago , Zwierze ) } \" ) print ( f \"isinstance(jakis_zwierz, Zwierze): { isinstance ( jakis_zwierz , Zwierze ) } \" ) print ( f \"isinstance(jakis_zwierz, Papuga): { isinstance ( jakis_zwierz , Papuga ) } \" ) if __name__ == \"__main__\" : main () ## isinstance(Dumboo, Slon): True ## isinstance(Dumboo, Lew): False ## isinstance(Jago, Papuga): True ## isinstance(Jago, Zwierze): True ## isinstance(jakis_zwierz, Zwierze): True ## isinstance(jakis_zwierz, Papuga): False","title":"Polimorfizm"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#abstrakcja","text":"Uniemo\u017cliwia tworzenie instancji danej klasy. Przydatne przy klasach bazowych dokumentacja from abc import ABC class Zwierze ( ABC ): def __init__ ( self , nazwa , wiek , waga ): self . nazwa = nazwa self . wiek = wiek self . waga = waga @abstractmethod #tutaj wymuszamy implementacj\u0119 tej metody w klasach pochodnych def nazwa_gatunku ( self ): pass def przedstaw_sie ( self ): print ( f \"Jestem { self . nazwa_gatunku () } . Mam na imi\u0119 { self . nazwa } , mam { self . wiek } lat oraz waz\u0119 { self . waga } kg.\" ) def urodziny ( self ): self . wiek += 1 class Slon ( Zwierze ): def nazwa_gatunku ( self ): return \"S\u0142o\u0144\" class Lew ( Zwierze ): def nazwa_gatunku ( self ): return \"Lew\" Niestety, mechanizm klas i metod abstrakcyjnych (klasa jest abstrakcyjna gdy ma co najmniej jedn\u0105 metod\u0119 abstrakcyjn\u0105) w j\u0119zyku Python jest wprowadzony troch\u0119 sztucznie. Klasa bazowa (abstrakcyjna) musi dziedziczy\u0107 po sztucznej klasie ABC, a metoda abstrakcyjna jest opatrzona dekoratorem @abstractmethod . Zwr\u00f3\u0107my uwag\u0119, \u017ce jedno i drugie zosta\u0142o zaimportowane. Jednak po tych czynno\u015bciach rzeczywi\u015bcie nie jeste\u015bmy w stanie stworzy\u0107 instancji klasy bazowej. Zwr\u00f3\u0107my uwag\u0119 na ten zaawansowany mechanizm: w klasie Zwierze tworzymy metod\u0119, zak\u0142adamy, co ta metoda b\u0119dzie zwraca\u0107, a nast\u0119pnie korzystamy z niej w innej metodzie, pomimo, \u017ce prawdziwa jej implementacja nast\u0105pi dopiero w klasie pochodnej. Dzi\u0119ki temu musimy napisa\u0107 mniej kodu w klasach pochodnych: musimy jedynie zaimplementowa\u0107 metod\u0119 nazwa_gatunku(), jednak nie musimy ju\u017c od zera pisa\u0107 kodu na przedstawienie zwierz\u0119ta. Jedynie w klasie Papuga, gdzie wprowadzili\u015bmy nowe pole, dopisujemy kod odpowiedzialny za wypisanie jego warto\u015bci. /TODO jak poradzi\u0107 sobie z tym? class Zwierze ( ABC ): def __init__ ( self , nazwa , wiek , waga ): self . nazwa = nazwa self . wiek = wiek self . waga = waga @abstractmethod #tutaj wymuszamy implementacj\u0119 tej metody w klasach pochodnych def nazwa_gatunku ( self ): pass def urodziny ( self ): self . wiek += 1 class Slon ( Zwierze ): def __init__ ( self , nazwa , wiek , waga ): syper () . __init__ ( self , nazwa , wiek , waga ) def nazwa_gatunku ( self ): return self . nazwa class Slon ( Zwierze ): def __init__ ( self , nazwa , wiek , waga ): syper () . __init__ ( self , nazwa , wiek , waga ) # def nazwa_gatunku(self): bez implementowania nazwy, bo przecie\u017c zwyk\u0142y sko\u0144 ma dobr\u0105 # return self.nazwa","title":"Abstrakcja"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#hermetyzacja","text":"Polega na odcinanie u\u017cytkownikowi dost\u0119pu do p\u00f3l, aby operowa\u0142 tylko metodami klasy. Jednak oczywi\u015bcie u\u017cywanie metod, zw\u0142aszcza z przedrostkiem get, czy set, jest mniej wygodne. Dlatego nowoczesne j\u0119zyki programowania umo\u017cliwiaj\u0105 tworzenie tzw. w\u0142a\u015bciwo\u015bci (ang. property). Z punktu widzenia mo\u017cliwo\u015bci, s\u0105 to po prostu metody, jednak z punktu widzenia zapisu i wygody, przypominaj\u0105 one pola. class Zwierze : def __init__ ( self , wiek ): self . wiek = wiek @property def wiek ( self ): return self . __wiek @wiek . setter def wiek ( self , wiek ): if wiek < 0 : self . __wiek = 0 elif wiek > 200 : self . __wiek = 200 else : self . __wiek = wiek def main (): jakis_zwierz = Zwierze ( 202 ) print ( jakis_zwierz . wiek ) jakis_zwierz . wiek = - 10 print ( jakis_zwierz . wiek ) jakis_zwierz . wiek = 30 print ( jakis_zwierz . wiek ) if __name__ == \"__main__\" : main () ## 200 ## 0 ## 30","title":"Hermetyzacja"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#specjalne-typy-obiektow","text":"Jest lika szczeg\u00f3lnie u\u017cytecznych typ\u00f3w obiekt\u00f3w nad kt\u00f3rymi warto si\u0119 pochyli\u0107 Enum - Obiekty wyliczeniowe. Jest kilka rodzaj\u00f3w enum\u00f3w: Enum , IntEnum , Flag oraz IntFlag . link from enum import Enum , auto class Color ( Enum ): RED = auto () BLUE = auto () GREEN = auto () dataclass - specjalny dekorator dla obiektu dodaj\u0105cy automatycznie wiele dodatkowych udogodnie\u0144 pozwalaj\u0105cych unikn\u0105\u0107 mozolnego pisania logiki. link from dataclasses import dataclass @dataclass class InventoryItem : \"\"\"Class for keeping track of an item in inventory.\"\"\" name : str unit_price : float quantity_on_hand : int = 0 tags : List [ str ] = = field ( default_factory = list ) def total_cost ( self ) -> float : return self . unit_price * self . quantity_on_hand Mo\u017cliwe jest tutaj podawanie spodziewanych typ\u00f3w oraz domy\u015blnych warto\u015bci (ale w wypadku typ\u00f3w mutowalnych nale\u017cy u\u017cy\u0107 fabryk ) Taki obiekt mo\u017ce otrzyma\u0107 (w zale\u017cno\u015bci od paramter\u00f3w): automatycznie wygenerowany konstruktor: def __init__ ( self , name : str , unit_price : float , quantity_on_hand : int = 0 ): self . name = name self . unit_price = unit_price self . quantity_on_hand = quantity_on_hand operatory por\u00f3wnania ( = , < , > etc.) funkcj\u0119 haszuj\u0105c\u0105 etc...","title":"Specjalne typy obiekt\u00f3w"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#inne","text":"","title":"Inne"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#wyjatki","text":"def silnia ( n ): if n < 0 : raise ValueError ( \"silnia niezdefiniowana dla liczb ujemnych\" ) wynik = 1 for i in range ( 1 , n + 1 ): wynik *= i return wynik try : print ( \"Pozyskuj\u0119 zas\u00f3b\" ) print ( f \"Silnia z -5 to { silnia ( - 5 ) } \" ) except ValueError as e : print ( \"Och nie, co\u015b posz\u0142o nie tak! Szczeg\u00f3\u0142y poni\u017cej:\" ) print ( e ) else : print ( \"Oby\u0142o si\u0119 bez wyj\u0105tk\u00f3w\" ) finally : print ( \"Zwalniam zas\u00f3b\" ) Gdy spodziewamy si\u0119, \u017ce dany fragment kodu mo\u017ce rzuca\u0107 wyj\u0105tkami, opakowujemy go w konstrukcj\u0119 try-except. Kod, kt\u00f3ry chcemy wykona\u0107, a kt\u00f3ry mo\u017ce rzuci\u0107 wyj\u0105tek, zapisujemy po try:. Nast\u0119pnie, na dole tego kodu, piszemy except, po czym piszemy nazw\u0119 klasy wyj\u0105tku, a tak\u017ce as, po kt\u00f3rym m\u00f3wimy, jakim identyfikatorem (w jakiej zmiennej) chcemy si\u0119 odnosi\u0107 do instancji tego wyj\u0105tku. Najwa\u017cniejsza jest nazwa klasy, aby ustali\u0107, jaki typ b\u0142\u0119d\u00f3w \u0142apiemy. Konkretna instancja, w przyk\u0142adzie e, przydaje si\u0119, gdy np. chcemy wy\u015bwietli\u0107 komunikat b\u0142\u0119du na ekran. Teoretycznie instancja ma swoje pola, do kt\u00f3rych mo\u017cemy si\u0119 odnie\u015b\u0107, jednak rzadko si\u0119 z nich korzysta. List\u0119 wbudowanych klas wyj\u0105tk\u00f3w znajdziemy tutaj . Szczeg\u00f3lnej uwadze polecamy IndexError, gdy odwo\u0142ujemy si\u0119 do nieistniej\u0105cego elementu listy, FileNotFoundError, gdy plik nie istnieje, ZeroDivisionError dla dzielenia przez zero i wymieniony w przyk\u0142adzie ValueError, gdy argumenty funkcji s\u0105 b\u0142\u0119dne try : fun () except RuntimeError as err : print ( f \"Dostali\u015bmy wyj\u0105tek Runtime o tre\u015bci: { err . args [ 0 ] } \" ) except TypeError as err : print ( \"Niedozwolona operacja\" ) except ( MojError , NameError ): print ( \"Wyst\u0105pi\u0142 jeszcze inny error\" ) finally : print ( \"Podczas wykonywania wyst\u0105pi\u0142 b\u0142\u0105d, zamykam apk\u0119\" ) # ten wykona si\u0119 po ka\u017cdym z wyj\u0105tk\u00f3w","title":"Wyj\u0105tki"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#with","text":"S\u0142owo kluczowe with pozwala na alternatywn\u0105 (czystsz\u0105 i czytelniejsz\u0105 obs\u0142ug\u0119 wyj\u0105tk\u00f3w) # file handling # 1) without using with statement file = open ( 'file' , 'w' ) file . write ( 'hello world !' ) file . close () # 2) without using with statement file = open ( 'file' , 'w' ) try : file . write ( 'hello world' ) finally : file . close () # using with statement with open ( 'file' , 'w' ) as file : file . write ( 'hello world !' ) S\u0142owo with pozwala na automatyczne zwalnianie zasob\u00f3w (na przyk\u0142adzie powy\u017cej wida\u0107, \u017ce nie trzeba wo\u0142a\u0107 close() ) przy wyj\u0105tku. Mechanizm ten korzysta z metod __enter__() i __exit__() dla u\u017cywanego obiektu. Mo\u017cemy wykorzysta\u0107 ten mechanizm we w\u0142asnych klasach # a simple file writer object class Manager ( object ): def __init__ ( self , file_name ): self . file_name = file_name def __enter__ ( self ): self . file = open ( self . file_name , 'w' ) return self . file def __exit__ ( self ): self . file . close () with Manager ( 'file.txt' ) as xfile : xfile . write ( 'hello world' )","title":"With"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#pliki","text":"\u015bcie\u017cka_do_pliku = r \"C:\\przykladowy.txt\" #r sprawia, \u017ce / nie jest znakiem specjalnym f = open ( sciezka_do_pliku ) print ( f . read ()) f . close () Tutaj mamy wszystko: open() s\u0142u\u017cy otworzeniu po\u0142\u0105czenia do pliku. Jest to wspomniane wcze\u015bniej pozyskanie zasobu. Nast\u0119pnie nast\u0119puje u\u017cycie metody read(). Odczytuje ona ca\u0142\u0105 tre\u015b\u0107 pliku za jednym zamachu. Po pojedynczym odczytaniu, drugie wywo\u0142anie zwr\u00f3ci nam napis pusty. Na ko\u0144cu jest close() , zamkni\u0119cie po\u0142\u0105czenia do pliku. Jest to zwolnienie zasobu. Jednak istnieje jeszcze drugi zapis. U\u017cywamy s\u0142owa kluczowego with . Wtedy definiujemy zas\u00f3b, m\u00f3wimy co chcemy zrobi\u0107, (open/write) gdy go pozyskamy, a na ko\u0144cu, po wykonaniu ca\u0142ej klauzuli, zas\u00f3b jest zwolniony, niezale\u017cnie od tego, czy wydarzy\u0142a si\u0119 sytuacja wyj\u0105tkowa czy te\u017c nie try : with open ( sciezka_do_pliku ) as f : print ( f . read ()) print ( 2 / 0 ) except ZeroDivisionError as e : print ( e ) with open ( sciezka_do_pliku , 'w' ) as f : f . write ( \"Trzeci wiersz\" ) f . write ( \"Czwarty wiersz\" ) #je\u017celi nie damy \\n to oba wiersze s\u0105 zapisane w tej samej linijce #Pozosta\u0142e przydatne metody f . readline () f . read () f . closed #informuje czy ju\u017c zamkni\u0119te With open flagi: r -read w -write otwiera plik (i nadpisuje, je\u017celi tam ju\u017c co\u015b jest) a -append (otwiera do zapisu i zaczyna na ko\u0144cu tzn dopisuje)","title":"Pliki"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#dane-o-plikach","text":"import os print ( os . path . exists ( sciezka_do_pliku )) ## True print ( os . listdir ( \"C: \\f older \\\" )) ## ['Wyzwanie6', 'pomysly.txt', inne pliki...] print ( os . path . join ( \"folder1\" , \"folder2\" , \"plik.txt\" )) ## folder1/folder2/plik.txt #funkcja ta wstawia \\ / zale\u017cnie od systemu os . remove ( sciezka_do_pliku ) #usuwamy plik import datetime ( mode , ino , dev , nlink , uid , gid , size , atime , mtime , ctime ) = os . stat ( sciezka_do_pliku ) data_modyfikacji = datetime . datetime . fromtimestamp ( mtime ) print ( data_modyfikacji ) ## 2018-12-21 10:46:54","title":"Dane o plikach"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#poprawianie-wydajnosci","text":"Najcz\u0119\u015bciej, aby poprawi\u0107 wydajno\u015b\u0107 aplikacji pisanych w pythonie trzeba si\u0119 skoncentrowa\u0107 na pe\u0142niejszym wykorzystaniu mocy procesora. Jest na to kilka sposob\u00f3w.","title":"Poprawianie wydajno\u015bci"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#wielowatkowosc","text":"Wielow\u0105tkowo\u015b\u0107 w pythonie jest nieco \u015bliskim tematem , poniewa\u017c w najpopularniejszej implementacji pythona (CPython) mamy do czynienie z mechanizmem GIL, kt\u00f3ry uniemo\u017cliwia prac\u0119 wielu w\u0105tkom jednocze\u015bnie. d\u0142u\u017cszy artyku\u0142 Z tego powodu domy\u015blnie w\u0105tki s\u0105 dobrym pomys\u0142em w wypadku operacji IO, czy te\u017c innych zadaniach, kt\u00f3re dzia\u0142aj\u0105c w tle nie konsumuj\u0105 czasu procesora. Je\u015bli za\u015b chcemy w naszej pracy wykorzysta\u0107 wiele rdzeni procesora r\u00f3wnocze\u015bnie to warto u\u017cy\u0107 biblioteki multiprocessing import threading def foo ( argument ): print ( \"Hello threading! with argument: \" , argument ) my_thread = threading . Thread ( target = foo , args = ( \"slowo\" )) my_thread . start () #>> Hello threading with argument: slowo # kolejne uruchomienie za pomoc\u0105 start rzuci nam RuntimeError Przy d\u0142u\u017cszym czasie wykonywania mo\u017cemy poczeka\u0107 na w\u0105tki za pomoc\u0105 join my_thread . join () lub my_thread . join ( timeout = 10 )","title":"Wielow\u0105tkowo\u015b\u0107"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#wieloprocesowosc","text":"Biblioteka multiprocessing opiera si\u0119 na obrabianiu danych w ramach r\u00f3\u017cnych proces\u00f3w, dzi\u0119ki czemu ka\u017cdy proces ma w\u0142asnego GIL-a, kt\u00f3ry nie wchodzi w drog\u0119 innym procesom. Poza tym jest w obs\u0142udze do\u015b\u0107 podobna do w\u0105tk\u00f3w. (niby s\u0105 takie metody w bibliotece jak os.fork() , ale s\u0105 one do\u015b\u0107 niskopoziomowe i niezbyt przeno\u015bne) from multiprocessing import Process import os def work ( id ): print ( f 'this is process { os . getpid () } called by { id } ' ) def main (): procesy = [ Process ( target = work , args = ( number , )) for number in range ( 5 )] for proces in procesy : proces . start () while procesy : procesy . pop () . join () #> this is process 10749 called by 0 #> this is process 10750 called by 1 #> this is process 10751 called by 2 #> this is process 10753 called by 4 #> this is process 10752 called by 3","title":"Wieloprocesowo\u015b\u0107"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#komunikacja-miedzyprocesowa","text":"W tym wypadku nie mamy ju\u017c wsp\u00f3lnej pami\u0119ci z kt\u00f3rej mo\u017cemy korzysta\u0107. Dlatego stworzone s\u0105 nast\u0119puj\u0105ce mechanizmy: multiprocessing.Queque - prawie to samo co zwyk\u0142a kolejka ( queque.Queque . Praktycznie nie ma r\u00f3\u017cnic w u\u017cyciu. multiprocessing.Pipe - mechanizm nieco zbli\u017cony do gniazd sieciowych multiprocessing.sharedtypes - pozwala stworzy\u0107 typy z C we wsp\u00f3lnej puli pami\u0119ci mi\u0119dzyprocesowej Do \u0142atwego zarz\u0105dzani pul\u0105 dost\u0119pnych proces\u00f3w mamy obiekt Pool . Pozwala ustali\u0107 liczb\u0119 proces\u00f3w, kt\u00f3re mo\u017cemy stworzy\u0107 jednocze\u015bnie. Dla wygody pracy i \u0142atwego prze\u0142\u0105czania si\u0119 mi\u0119dzy procesami i w\u0105tkami przy u\u017cyciu tego API mamy paczk\u0119 multiprocessing.dummy.Pool (te same interfejsy, tylko, \u017ce dzia\u0142a na w\u0105tkach).","title":"Komunikacja mi\u0119dzyprocesowa"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#pipe","text":"Pipe - jest to w pe\u0142ni dupleksowe po\u0142\u0105czenie dzia\u0142aj\u0105ce podobnie do gniazd (patrz socket module ) z t\u0105 r\u00f3\u017cnic\u0105, \u017ce pozwala on na wysy\u0142anie nie tylko ci\u0105g\u00f3w bajt\u00f3w, lecz tak\u017ce serializowalne obiekty (patrz pickle ). Konstruktor tworzy dwa obiekty do odbioru i nadawania, kt\u00f3re mo\u017cemy przekaza\u0107 do naszego procesu. from multiprocessing import Process , Pipe def f ( conn ): conn . send ([ 42 , None , 'hello' ]) conn . close () if __name__ == '__main__' : parent_conn , child_conn = Pipe () p = Process ( target = f , args = ( child_conn ,)) p . start () print ( parent_conn . recv ()) # prints \"[42, None, 'hello']\" p . join ()","title":"Pipe"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#sharedtypes","text":"Mamy tutaj klasy Value i Array , warto tu pami\u0119ta\u0107 o tym, \u017ce aby zabezpieczy\u0107 si\u0119 przed r\u00f3wnoczesnym pisaniem i czytaniem trzeba u\u017cywa\u0107 do\u0142\u0105czonych mutex\u00f3w ( Lock , RLock , Semaphore ). class Point ( Structure ): _fields_ = [( 'x' , c_double ), ( 'y' , c_double )] def modify ( n , x , s , A ): n . value **= 2 x . value **= 2 s . value = s . value . upper () for a in A : a . x **= 2 a . y **= 2 if __name__ == '__main__' : lock = Lock () n = Value ( 'i' , 7 ) x = Value ( c_double , 1.0 / 3.0 , lock = False ) s = Array ( 'c' , b 'hello world' , lock = lock ) A = Array ( Point , [( 1.875 , - 6.25 ), ( - 5.75 , 2.0 ), ( 2.375 , 9.5 )], lock = lock ) p = Process ( target = modify , args = ( n , x , s , A )) p . start () p . join () print ( n . value ) print ( x . value ) print ( s . value ) print ([( a . x , a . y ) for a in A ]) #> 49 #> 0.1111111111111111 #> HELLO WORLD #> [(3.515625, 39.0625), (33.0625, 4.0), (5.640625, 90.25)]","title":"Sharedtypes"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#asynchronicznosc","text":"Wykorzystuje ona korutyny ( coroutines ). Bibliotek\u0105 wykorzystywan\u0105 do asynchroniczno\u015bci jest asyncio. Tutoriale pythondocs , realpython . >>> import asyncio >>> async def main (): ... print ( 'hello' ) ... await asyncio . sleep ( 1 ) #w tym momencie oddajemy kontrol\u0119 na sekund\u0119 #w tym czasie CPU mo\u017ce popracowa\u0107 nad czym\u015b innym ... print ( 'world' ) >>> asyncio . run ( main ()) hello world S\u0142owa kluczowe: async i async with - s\u0142u\u017c\u0105 do oznaczania funkcji, kt\u00f3re s\u0105 korutynami await - s\u0142u\u017cy do oznaczania momentu w kt\u00f3rym musimy poczeka\u0107 na wykonanie jakiej\u015b korutyny. W tym momencie przekazujemy kontrol\u0119 do p\u0119tli zdarze\u0144. async def g (): # Pause here and come back to g() when f() is ready r = await f () return r async def main (): task1 = asyncio . create_task ( say_after ( 1 , 'hello' )) task2 = asyncio . create_task ( say_after ( 2 , 'world' )) print ( f \"started at { time . strftime ( ' %X ' ) } \" ) # Wait until both tasks are completed (should take # around 2 seconds.) await task1 await task2 print ( f \"finished at { time . strftime ( ' %X ' ) } \" ) TODO uko\u0144czy\u0107 ten rozdzia\u0142","title":"Asynchroniczno\u015b\u0107"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#rzeczy-na-ktore-nalezy-uwazac","text":"R\u00f3\u017cne cechy oraz w\u0142a\u015bciwo\u015bci pythona na kt\u00f3re trzeba uwa\u017ca\u0107 podczas pisania w pythonie zw\u0142aszcza, gdy nie jest on pierwszym j\u0119zykiem.","title":"Rzeczy na kt\u00f3re nale\u017cy uwa\u017ca\u0107\u26a0\ufe0f"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#wszystko-jest-referencja","text":"Warto pami\u0119ta\u0107, \u017ce w pythonie prawie wszystko jest referencj\u0105. Np przekazuj\u0105c co\u015b do funkcji przekazujemy tan naprawd\u0119 referencj\u0119 do tego obiektu, z tego powodu wewn\u0105trz funkcji nasz obiekt mo\u017ce ulec zmianie. Warto tutaj zapozna\u0107 si\u0119 z poj\u0119ciem mutowalno\u015bci . Obiekty niemutowalne to takie, kt\u00f3rych nowe instancje s\u0105 tworzone podczas zmiany warto\u015bci. def fun ( x ): print ( id ( x )) #id() wypisuje identyfikator danej zmiennej x += 1 print ( id ( x )) num = 32 print ( id ( num )) fun ( num ) >> 9789984 >> 9789984 # Wida\u0107 tutaj, \u017ce funkcja operuje na tej samej instancji liczby >> 9790016 # po zmianie warto\u015bci do identyfikatora x jest ju\u017c przypisany inny obiekt Z tego powodu przekazywanie mutowalnej warto\u015bci do funkcji mo\u017cna traktowa\u0107 jako przekazanie kopii, a przekazanie niemutowalnej jako przekazanie referencji lub wska\u017anika (w j\u0119zyku C++). Niemutowalne Mutowalne int lista float s\u0142ownik complex bytearray bool obiekty u\u017cytkownika string tuple range frozenset bytes Przyk\u0142ady dzia\u0142ania: def fun ( num ): num = num + 10 print ( num ) liczba = 1 fun ( liczba ) # 10 print ( liczba ) #1 class Numer : def __init__ ( self , num ): self . num = num n = Numer ( 1 ) def fun2 ( numer ): numer . num = numer . num + 10 print ( numer . num ) print ( n . num ) # 1 fun2 ( n ) # 11 print ( n . num ) # 11 Je\u015bli chcemy tutaj zapobiec takim problemom warto zastanowi\u0107 si\u0119 nad u\u017cyciem modu\u0142u copy import copy x = copy . copy ( y ) # p\u0142ytka kopia x = copy . deepcopy ( y ) # kopia g\u0142\u0119boka rekursywnie kopiuj\u0105ca wszystkie elementy naszej klasy","title":"Wszystko jest referencj\u0105"},{"location":"Python%F0%9F%90%8D/1_ogolne_notatki/#inicjalizowanie-zmiennych","text":"Skoro wszystko jest referencj\u0105 to trzeba te\u017c o tym pami\u0119ta\u0107 przy podawaniu domy\u015blnych warto\u015bci dla funkcji. link from dataclasses import dataclass @dataclass class Node ( object ): num : int children : list def __init__ ( self , num , children = []): self . num = num self . children = children n1 = Node ( 1 ) n2 = Node ( 2 ) print ( n1 ) # Node(num=1, children=[]) print ( n2 ) # Node(num=2, children=[]) n1 . children . append ( 3 ) print ( n1 ) #Node(num=1, children=[3]) print ( n2 ) #Node(num=2, children=[3]) Dlatego te\u017c wielu uwa\u017ca, \u017ce lepiej da\u0107 None jako domy\u015bln\u0105 warto\u015b\u0107 i inicjalizowa\u0107 to dopiero, wewn\u0105trz konstruktora. //TODO lista: mixin, importowanie, biblioteka sys, instance methods // yield, operator := // from future import annotations (ewaluacja definicji z kodu, kt\u00f3re pojawiaj\u0105 si\u0119 p\u00f3\u017aniej)","title":"Inicjalizowanie zmiennych"},{"location":"Python%F0%9F%90%8D/3_modu%C5%82y_i_paczki/","text":"Podzia\u0142 na Modu\u0142y i Paczki\ud83d\udce6 Modu\u0142 - plik pythonowy zawieraj\u0105cy definicje i wyra\u017cenia, nazwa pliku jest nazw\u0105 modu\u0142u z dodanym rozszerzeniem .py ( nazwa_modu\u0142u.py ). Wewn\u0105trz modu\u0142u ta nazwa jest dost\u0119pna jako zmienna globalna __name__ . Modu\u0142 jest jednym ze sposob\u00f3w organizacji kodu w pythonie, na og\u00f3\u0142 w jednym module trzyma si\u0119 blisko powi\u0105zane ze sob\u0105 definicje funkcji, klas etc. Je\u015bli chodzi tu o grupowanie to warto zadba\u0107 tutaj o z\u0142oty \u015brodek (pliki nie musz\u0105 by\u0107 du\u017ce, ani ma\u0142e, musz\u0105 po prostu sp\u00f3jnie tworzy\u0107 logiczn\u0105 ca\u0142o\u015b\u0107). Paczka - spos\u00f3b na ustrukturyzowanie modu\u0142\u00f3w ( pozwala to \u0142atwo ustrukturyzowa\u0107 projekt) Zarz\u0105dzanie paczkami pip i pip3 #TODO Do instalacji mo\u017cna u\u017cywa\u0107 samodzielnych aplikacji pip (i pip3) pip3 install numpy Mo\u017cna te\u017c wymusi\u0107 od danej instancji pythona, aby zainstalowa\u0142 dla siebie dan\u0105 paczk\u0119 (u\u017cyteczne gdy mamy wiele wersji). python3 -m pip install numpy Tworzenie i u\u017cywanie w\u0142asnych paczek Struktura Przyk\u0142adowa struktura paczki sound/ Top-level package __init__.py Initialize the sound package formats/ Subpackage for file format conversions __init__.py wavread.py wavwrite.py aiffread.py aiffwrite.py auread.py auwrite.py ... effects/ Subpackage for sound effects __init__.py echo.py surround.py reverse.py ... filters/ Subpackage for filters __init__.py equalizer.py vocoder.py karaoke.py ... Aby wykorzysta\u0107 zawarto\u015b\u0107 pliku karaoke.py nale\u017cy zaimportowa\u0107: import sound.filters.karaoke Wewn\u0119trzne linkowanie Przy linkowaniu pomi\u0119dzy poszczeg\u00f3lnymi elementami paczki zaleca si\u0119 u\u017cywanie poni\u017cszej konwencji: #zak\u0142adamy, \u017ce jeste\u015bmy w pliku filters/karaoke.py from . import echo from .. import formats from ..filters import equalizer Wczytywanie paczki z danego folderu Kiedy nasza paczka jest w niestandardowym folderze mo\u017cna j\u0105 wczyta\u0107 tak #tu zak\u0142adam, \u017ce paczka jest umieszczona w jakim\u015b folderze umieszczonym gdzie\u015b wzgl\u0119dem pliku ze skryptem, ale module_path mo\u017ce by\u0107 dowolne module_path = os . path . dirname ( os . path . realpath ( __file__ )) + \"/..\" sys . path . append ( module_path )","title":"Podzia\u0142 na Modu\u0142y i Paczki\ud83d\udce6"},{"location":"Python%F0%9F%90%8D/3_modu%C5%82y_i_paczki/#podzia-na-moduy-i-paczki","text":"Modu\u0142 - plik pythonowy zawieraj\u0105cy definicje i wyra\u017cenia, nazwa pliku jest nazw\u0105 modu\u0142u z dodanym rozszerzeniem .py ( nazwa_modu\u0142u.py ). Wewn\u0105trz modu\u0142u ta nazwa jest dost\u0119pna jako zmienna globalna __name__ . Modu\u0142 jest jednym ze sposob\u00f3w organizacji kodu w pythonie, na og\u00f3\u0142 w jednym module trzyma si\u0119 blisko powi\u0105zane ze sob\u0105 definicje funkcji, klas etc. Je\u015bli chodzi tu o grupowanie to warto zadba\u0107 tutaj o z\u0142oty \u015brodek (pliki nie musz\u0105 by\u0107 du\u017ce, ani ma\u0142e, musz\u0105 po prostu sp\u00f3jnie tworzy\u0107 logiczn\u0105 ca\u0142o\u015b\u0107). Paczka - spos\u00f3b na ustrukturyzowanie modu\u0142\u00f3w ( pozwala to \u0142atwo ustrukturyzowa\u0107 projekt)","title":"Podzia\u0142 na Modu\u0142y i Paczki\ud83d\udce6"},{"location":"Python%F0%9F%90%8D/3_modu%C5%82y_i_paczki/#zarzadzanie-paczkami","text":"pip i pip3 #TODO Do instalacji mo\u017cna u\u017cywa\u0107 samodzielnych aplikacji pip (i pip3) pip3 install numpy Mo\u017cna te\u017c wymusi\u0107 od danej instancji pythona, aby zainstalowa\u0142 dla siebie dan\u0105 paczk\u0119 (u\u017cyteczne gdy mamy wiele wersji). python3 -m pip install numpy","title":"Zarz\u0105dzanie paczkami"},{"location":"Python%F0%9F%90%8D/3_modu%C5%82y_i_paczki/#tworzenie-i-uzywanie-wasnych-paczek","text":"","title":"Tworzenie i u\u017cywanie w\u0142asnych paczek"},{"location":"Python%F0%9F%90%8D/3_modu%C5%82y_i_paczki/#struktura","text":"Przyk\u0142adowa struktura paczki sound/ Top-level package __init__.py Initialize the sound package formats/ Subpackage for file format conversions __init__.py wavread.py wavwrite.py aiffread.py aiffwrite.py auread.py auwrite.py ... effects/ Subpackage for sound effects __init__.py echo.py surround.py reverse.py ... filters/ Subpackage for filters __init__.py equalizer.py vocoder.py karaoke.py ... Aby wykorzysta\u0107 zawarto\u015b\u0107 pliku karaoke.py nale\u017cy zaimportowa\u0107: import sound.filters.karaoke","title":"Struktura"},{"location":"Python%F0%9F%90%8D/3_modu%C5%82y_i_paczki/#wewnetrzne-linkowanie","text":"Przy linkowaniu pomi\u0119dzy poszczeg\u00f3lnymi elementami paczki zaleca si\u0119 u\u017cywanie poni\u017cszej konwencji: #zak\u0142adamy, \u017ce jeste\u015bmy w pliku filters/karaoke.py from . import echo from .. import formats from ..filters import equalizer","title":"Wewn\u0119trzne linkowanie"},{"location":"Python%F0%9F%90%8D/3_modu%C5%82y_i_paczki/#wczytywanie-paczki-z-danego-folderu","text":"Kiedy nasza paczka jest w niestandardowym folderze mo\u017cna j\u0105 wczyta\u0107 tak #tu zak\u0142adam, \u017ce paczka jest umieszczona w jakim\u015b folderze umieszczonym gdzie\u015b wzgl\u0119dem pliku ze skryptem, ale module_path mo\u017ce by\u0107 dowolne module_path = os . path . dirname ( os . path . realpath ( __file__ )) + \"/..\" sys . path . append ( module_path )","title":"Wczytywanie paczki z danego folderu"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/","text":"R\u00f3\u017cne u\u017cyteczne biblioteki i narz\u0119dzia R\u00f3\u017cne linki Stronka agreguj\u0105ca w jedny miejscu najpotrzebniejsze API z bibliotek pythonowych: https://overapi.com/python Ksi\u0105\u017cka Zanurkuj w Pythonie \ud83d\udcd6 Podstawowy tutorial ze strony learnpython Parsowanie argument\u00f3w Do parsowania argument\u00f3w na og\u00f3\u0142 korzysta si\u0119 z biblioteki argparse . Przyk\u0142adowy kod parser = argparse . ArgumentParser ( prog = 'ProgramName' , description = 'What the program does' , epilog = 'Text at the bottom of help' ) parser . add_argument ( 'filename' ) # positional argument parser . add_argument ( '-c' , '--count' ) # option that takes a value parser . add_argument ( '-v' , '--verbose' , action = 'store_true' ) # on/off flag - czyli przy podaniu -v args.verbose to true args = parser . parse_args () #parsowanie argument\u00f3w,aby uzyska\u0107 obiekt z argumentami Najwa\u017cniejsz\u0105 metod\u0105 klasy ArgumentParser jest add_argument() . Mo\u017ce przyjmowa\u0107 on r\u00f3\u017cne argumenty . Najwa\u017cniejsze wydaj\u0105 si\u0119: help - opis argumentu type - typ argumentu do jakiego warto\u015b\u0107 ma by\u0107 przekonwertowana link . mo\u017cna tutaj poda\u0107 typ ( int , str ), argparse.FileType (aby sprawdzi\u0107 poprawno\u015b\u0107 \u015bcie\u017cki do pliku), b\u0105d\u017a funkcja koonwertuj\u0105ca # kiedy chcemy sprawdzi\u0107 czy plik istnieje, ale chcemy otrzyma\u0107 stringa def _readable_file_string ( path ): reader = argparse . FileType ( \"r\" ) reader ( path ) # if not exists, then raises Exception return path parser . add_argument ( 'input_file' , type = argparse . FileType ( 'w' , encoding = 'latin-1' )) parser . add_argument ( 'file_path' , type = _readable_file_string ) default required choices nargs - ile razy mo\u017ce si\u0119 pojawi\u0107 ten argument Logowanie (logging) Wbudowane biblioteka logging w Pythonie dostarcza gotowych mechanizm\u00f3w do generowania, formatowania oraz zarz\u0105dzania logami systemowymi. Oficjalny tutorial Minimalny przyk\u0142ad: import logging logging . debug ( \"This is a debug\" ) logging . info ( \"This is an info\" ) logging . warning ( \"This is a warning\" ) logging . error ( \"This is an error\" ) logging . critical ( \"This is a critical message\" ) #> WARNING:root:This is a warning #> ERROR:root:This is an error #> CRITICAL:root:This is a critical message Dla takiego sktyptu otrzymany tylko ostatnie 3 linijki, poniewa\u017c domy\u015blny poziom log\u00f3w jest za niski. Do odpowiedniego ustawienia tego parametru mo\u017cna u\u017cy\u0107 funkcji logging.basicConfig logging . basicConfig ( level = logging . DEBUG ) logging . debug ( 'To ju\u017c si\u0119 wy\u015bwietli' ) Za pomoc\u0105 tej funkcji mo\u017cemy okre\u015bli\u0107 inne podstawowe parametry jak format, kodowanie, styl, format daty, plik z logami etc. Formatowanie log\u00f3w Format log\u00f3w mo\u017cna zdefiniowa\u0107 za pomoc\u0105 jednego stringa odpowiadaj\u0105cego okre\u015blonej sk\u0142adni. import logging logging . basicConfig ( format = ' %(asctime)s %(message)s ' ) logging . warning ( 'is when this event was logged.' ) # 2019-12-12 11:51:42,692 is when this event was logged. W definicjach log\u00f3w odwo\u0142ujemy si\u0119 do atrybut\u00f3w klasy LogRecord . Z pomoc\u0105 basicConfig mo\u017cemy te\u017c \u0142atwo okre\u015bli\u0107 u\u017cywany format czasu ( \u015bci\u0105gawka ) (milisekundy lepiej okre\u015bla\u0107 w ramach formatu z LogRecord-a) import logging logging . basicConfig ( format = ' %(asctime)s%(msecs)d %(message)s ' , datefmt = '%m/ %d /%Y %I:%M:%S.' ) logging . warning ( 'is when this event was logged.' ) #> 12/12/2010 11:46:36.423 is when this event was logged. Poziomy logowania Ka\u017cdy poziom logowania ma w\u0142asn\u0105 przyporz\u0105dkowan\u0105 warto\u015b\u0107 liczbow\u0105 link . Im wy\u017csza tym wa\u017cniejszy log (Debug to 10, CRITICAL to 50). Dzi\u0119ki temu mo\u017cliwe jest dodawanie w\u0142asnych poziom\u00f3w logowania. Mo\u017cliwe jest tutaj wykorzystanie funkcji addLevelName . #tutaj nadpisuj\u0119 aby mie\u0107 fajniejsz\u0105 nazw\u0119 logging . addLevelName ( logging . DEBUG , \"\ud83d\udc1eDEBUG\" ) # a tutaj dodaj\u0119 nowy poziom logging . addLevelName ( 15 , \"VERBOSE\" ) Manipulacja tekstem Stringi wielolinijkowe slowa = \"\"\" linia1 linia2 linia3 \"\"\" Rozbijanie string\u00f3w po s\u0142owach string.split(separator, maxsplit) - domy\u015blny separator to jakikolwiek whitespace, maxsplit- domy\u015blnie -1 (opisuje na ile fragment\u00f3w maksymalnie mo\u017cemy dzieli\u0107 stringa) slowo = \"slowo1 slowo2 sl3\" slowo . split () >>> [ 'slowo1' , 'slowo2' , 'sl3' ] Formatowanie tekstu Formatowanie tekstu nie tylko w kontek\u015bcie funkcji print() str.format() def hello ( name ): print ( \"Hello {name} \" . format ( name = name )) f-stringi (Python 3.6+) def hello ( name ): print ( f \"Hello { name } \" ) Wg dokumentacji u\u017cywaj\u0105c tej metody mo\u017cemy wprowadza\u0107 dodatkowe zmiany w tek\u015bcie width = 10 precision = 4 value = decimal . Decimal ( '12.34567' ) f 'result: { value :{ width } . { precision }} ' #12.35 Pobieranie \u015bcie\u017cki/folderu obecnego skryptu import os os . path . abspath ( '' ) # obecny folder __file__ # zmiennna zawieraj\u0105ca obecnie uruchamiany plik (nie zawsze dzia\u0142a) U\u017cywanie kodu z C++ boost lub ctypes Przyk\u0142ad dla boosta: link Przetwarzanie strumieniowe Czas import time time . sleep ( 60 ) #minuta Aplikacje webowe Wykonywanie zapyta\u0144 w HTMLu - requests Najprostsz\u0105 i najwygodniejsz\u0105 bibliotek\u0105 jest requests Mo\u017ce ona s\u0142u\u017cy\u0107 zar\u00f3wno do pobierania tre\u015bci z neta jak i do web scrappingu. import requests data = { \"name\" : \"Marian\" } response = requests . get ( \"http://127.0.0.1:5000/\" , json = data ) r . text # { \"id\": \"3123424\", ... r . json () # zwr\u00f3ci ospowied\u017a jako s\u0142ownik r . status # 200 Proste hostowanie folderu KIedy chcesz w prosty spos\u00f3b udost\u0119pni\u0107 dany folder w sieci. python -m http.server #to udost\u0119pni pod adresem 8000 #mo\u017cna te\u017c samodzielni wybra\u0107 port python -m http.server 8888 Django jest to do\u015b\u0107 du\u017ca zabawka link Flask Jeden z mikroframework\u00f3w, pozwala do\u015b\u0107 szybko napisa\u0107 jak\u0105\u015b aplikacj\u0119 REST-ow\u0105. from flask import Flask , request , response app = Flask ( __name__ ) @app . route ( '/' , methods = [ \"GET\" , \"POST\" ]) def hello_world (): if request . method == \"GET\" : return \"Hello\" if request . method == \"POST\" : return \"you posted something\" if __name__ == '__main__' : app . run () Bottle Mniejsza i du\u017co prostsza biblioteka (mie\u015bci si\u0119 w jednym pliku). Podobna do flaska. from bottle import route , run , template @route ( '/hello/' ) #@route to dekorator def index ( name ): return template ( 'Hello {{name}}
    ?' , name = name ) #otrzymamy prostego html-a #index = route('//hello/')(index) #ten sam wynik, w sytuacji bez @route run ( host = '0.0.0.0' , port = 8080 ) #nasza strona b\u0119dzie dost\u0119pna tutaj albo mo\u017cemy te\u017c chcie\u0107 wygenerowa\u0107 jsona def index ( name ): return { \"klucz\" : \"wartosc\" , \"a_tu\" :[ \"bedzie\" , \"lista\" ]} Aplikacje z GUI TODO rozpisa\u0107 si\u0119 troch\u0119 https://wiki.python.org/moin/GuiProgramming Zapisywanie Pickle - zapisywanie zmiennych Pythonowa biblioteka Pickle pozwala na zapisywanie (i odczytywanie) danych i obiekt\u00f3w w pythonie w formie binarnej poprzez serializacj\u0119. Serializacja polega na przekszta\u0142ceniu obiektu w posta\u0107, kt\u00f3ra mo\u017ce by\u0107 zapisana do pliku lub przes\u0142ana przez sie\u0107. import pickle # tworzenie obiektu do serializacji data = { 'name' : 'John Smith' , 'age' : 30 , 'country' : 'USA' } with open ( 'data.pkl' , 'wb' ) as f : # serializacja obiektu i zapis do pliku pickle . dump ( data , f ) # otwieranie pliku z serializowanym obiektem with open ( 'data.pkl' , 'rb' ) as f : # deserializacja obiektu z pliku data2 = pickle . load ( f ) print ( data2 ) # {'name': 'John Smith', 'age': 30, 'country': 'USA'} Dill -zapisywanie ca\u0142ej sesji w pythonie Rozszerzeniem do pickla jest dill, pozwala on na zapisywanie za\u0142ej sesji w pythonie do pliku, kt\u00f3ry mo\u017cna potem przywr\u00f3ci\u0107. //todo przyk\u0142ad Debugowanie pdb import pdb pdb . set_trace () #w tej linii skrypt si\u0119 zatrzyma i b\u0119dzie mo\u017cna si\u0119 rozejrze\u0107 # (Pdb) zapytania w trybie debuggera : w - where (na stosie) u -up d - down c/continue - continue args - wy\u015bwietla wszystkie argumenty, jakie dana funkcja otrzyma\u0142a (ta w kt\u00f3rej obecnie jeste\u015bmy) Poza tym reszta rzeczy odpowiada zwyk\u0142emu pisaniu w pythonie, mo\u017cemy zmienia\u0107 zmienne, printowa\u0107 je, uruchamia\u0107 p\u0119tle etc. Warto wtedy u\u017cywa\u0107 te\u017c: locals() - \u0142aduje do s\u0142ownika wszystkie obecnie dost\u0119pne funkcje inspect import inspect inspect . getsource ( xyz ) # wypisuje jak dana funkcja jest napisana ast #podobnie jak wy\u017cej import ast GDB LINK /TODO opisa\u0107 dok\u0142adniej /TODO opisa\u0107 dzia\u0142anie libki subprocess (czyli jak ogarn\u0105\u0107 prawdziw\u0105 wielow\u0105tkowo\u015b\u0107 w pythonie), oraz uruchamianie proces\u00f3w.","title":"R\u00f3\u017cne u\u017cyteczne biblioteki i narz\u0119dzia"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#rozne-uzyteczne-biblioteki-i-narzedzia","text":"","title":"R\u00f3\u017cne u\u017cyteczne biblioteki i narz\u0119dzia"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#rozne-linki","text":"Stronka agreguj\u0105ca w jedny miejscu najpotrzebniejsze API z bibliotek pythonowych: https://overapi.com/python Ksi\u0105\u017cka Zanurkuj w Pythonie \ud83d\udcd6 Podstawowy tutorial ze strony learnpython","title":"R\u00f3\u017cne linki"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#parsowanie-argumentow","text":"Do parsowania argument\u00f3w na og\u00f3\u0142 korzysta si\u0119 z biblioteki argparse . Przyk\u0142adowy kod parser = argparse . ArgumentParser ( prog = 'ProgramName' , description = 'What the program does' , epilog = 'Text at the bottom of help' ) parser . add_argument ( 'filename' ) # positional argument parser . add_argument ( '-c' , '--count' ) # option that takes a value parser . add_argument ( '-v' , '--verbose' , action = 'store_true' ) # on/off flag - czyli przy podaniu -v args.verbose to true args = parser . parse_args () #parsowanie argument\u00f3w,aby uzyska\u0107 obiekt z argumentami Najwa\u017cniejsz\u0105 metod\u0105 klasy ArgumentParser jest add_argument() . Mo\u017ce przyjmowa\u0107 on r\u00f3\u017cne argumenty . Najwa\u017cniejsze wydaj\u0105 si\u0119: help - opis argumentu type - typ argumentu do jakiego warto\u015b\u0107 ma by\u0107 przekonwertowana link . mo\u017cna tutaj poda\u0107 typ ( int , str ), argparse.FileType (aby sprawdzi\u0107 poprawno\u015b\u0107 \u015bcie\u017cki do pliku), b\u0105d\u017a funkcja koonwertuj\u0105ca # kiedy chcemy sprawdzi\u0107 czy plik istnieje, ale chcemy otrzyma\u0107 stringa def _readable_file_string ( path ): reader = argparse . FileType ( \"r\" ) reader ( path ) # if not exists, then raises Exception return path parser . add_argument ( 'input_file' , type = argparse . FileType ( 'w' , encoding = 'latin-1' )) parser . add_argument ( 'file_path' , type = _readable_file_string ) default required choices nargs - ile razy mo\u017ce si\u0119 pojawi\u0107 ten argument","title":"Parsowanie argument\u00f3w"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#logowanie-logging","text":"Wbudowane biblioteka logging w Pythonie dostarcza gotowych mechanizm\u00f3w do generowania, formatowania oraz zarz\u0105dzania logami systemowymi. Oficjalny tutorial Minimalny przyk\u0142ad: import logging logging . debug ( \"This is a debug\" ) logging . info ( \"This is an info\" ) logging . warning ( \"This is a warning\" ) logging . error ( \"This is an error\" ) logging . critical ( \"This is a critical message\" ) #> WARNING:root:This is a warning #> ERROR:root:This is an error #> CRITICAL:root:This is a critical message Dla takiego sktyptu otrzymany tylko ostatnie 3 linijki, poniewa\u017c domy\u015blny poziom log\u00f3w jest za niski. Do odpowiedniego ustawienia tego parametru mo\u017cna u\u017cy\u0107 funkcji logging.basicConfig logging . basicConfig ( level = logging . DEBUG ) logging . debug ( 'To ju\u017c si\u0119 wy\u015bwietli' ) Za pomoc\u0105 tej funkcji mo\u017cemy okre\u015bli\u0107 inne podstawowe parametry jak format, kodowanie, styl, format daty, plik z logami etc.","title":"Logowanie (logging)"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#formatowanie-logow","text":"Format log\u00f3w mo\u017cna zdefiniowa\u0107 za pomoc\u0105 jednego stringa odpowiadaj\u0105cego okre\u015blonej sk\u0142adni. import logging logging . basicConfig ( format = ' %(asctime)s %(message)s ' ) logging . warning ( 'is when this event was logged.' ) # 2019-12-12 11:51:42,692 is when this event was logged. W definicjach log\u00f3w odwo\u0142ujemy si\u0119 do atrybut\u00f3w klasy LogRecord . Z pomoc\u0105 basicConfig mo\u017cemy te\u017c \u0142atwo okre\u015bli\u0107 u\u017cywany format czasu ( \u015bci\u0105gawka ) (milisekundy lepiej okre\u015bla\u0107 w ramach formatu z LogRecord-a) import logging logging . basicConfig ( format = ' %(asctime)s%(msecs)d %(message)s ' , datefmt = '%m/ %d /%Y %I:%M:%S.' ) logging . warning ( 'is when this event was logged.' ) #> 12/12/2010 11:46:36.423 is when this event was logged.","title":"Formatowanie log\u00f3w"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#poziomy-logowania","text":"Ka\u017cdy poziom logowania ma w\u0142asn\u0105 przyporz\u0105dkowan\u0105 warto\u015b\u0107 liczbow\u0105 link . Im wy\u017csza tym wa\u017cniejszy log (Debug to 10, CRITICAL to 50). Dzi\u0119ki temu mo\u017cliwe jest dodawanie w\u0142asnych poziom\u00f3w logowania. Mo\u017cliwe jest tutaj wykorzystanie funkcji addLevelName . #tutaj nadpisuj\u0119 aby mie\u0107 fajniejsz\u0105 nazw\u0119 logging . addLevelName ( logging . DEBUG , \"\ud83d\udc1eDEBUG\" ) # a tutaj dodaj\u0119 nowy poziom logging . addLevelName ( 15 , \"VERBOSE\" )","title":"Poziomy logowania"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#manipulacja-tekstem","text":"","title":"Manipulacja tekstem"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#stringi-wielolinijkowe","text":"slowa = \"\"\" linia1 linia2 linia3 \"\"\"","title":"Stringi wielolinijkowe"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#rozbijanie-stringow-po-sowach","text":"string.split(separator, maxsplit) - domy\u015blny separator to jakikolwiek whitespace, maxsplit- domy\u015blnie -1 (opisuje na ile fragment\u00f3w maksymalnie mo\u017cemy dzieli\u0107 stringa) slowo = \"slowo1 slowo2 sl3\" slowo . split () >>> [ 'slowo1' , 'slowo2' , 'sl3' ]","title":"Rozbijanie string\u00f3w po s\u0142owach"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#formatowanie-tekstu","text":"Formatowanie tekstu nie tylko w kontek\u015bcie funkcji print()","title":"Formatowanie tekstu"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#strformat","text":"def hello ( name ): print ( \"Hello {name} \" . format ( name = name ))","title":"str.format()"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#f-stringi-python-36","text":"def hello ( name ): print ( f \"Hello { name } \" ) Wg dokumentacji u\u017cywaj\u0105c tej metody mo\u017cemy wprowadza\u0107 dodatkowe zmiany w tek\u015bcie width = 10 precision = 4 value = decimal . Decimal ( '12.34567' ) f 'result: { value :{ width } . { precision }} ' #12.35","title":"f-stringi (Python 3.6+)"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#pobieranie-sciezkifolderu-obecnego-skryptu","text":"import os os . path . abspath ( '' ) # obecny folder __file__ # zmiennna zawieraj\u0105ca obecnie uruchamiany plik (nie zawsze dzia\u0142a)","title":"Pobieranie \u015bcie\u017cki/folderu obecnego skryptu"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#uzywanie-kodu-z-c","text":"boost lub ctypes Przyk\u0142ad dla boosta: link","title":"U\u017cywanie kodu z C++"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#przetwarzanie-strumieniowe","text":"","title":"Przetwarzanie strumieniowe"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#czas","text":"import time time . sleep ( 60 ) #minuta","title":"Czas"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#aplikacje-webowe","text":"","title":"Aplikacje webowe"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#wykonywanie-zapytan-w-htmlu-requests","text":"Najprostsz\u0105 i najwygodniejsz\u0105 bibliotek\u0105 jest requests Mo\u017ce ona s\u0142u\u017cy\u0107 zar\u00f3wno do pobierania tre\u015bci z neta jak i do web scrappingu. import requests data = { \"name\" : \"Marian\" } response = requests . get ( \"http://127.0.0.1:5000/\" , json = data ) r . text # { \"id\": \"3123424\", ... r . json () # zwr\u00f3ci ospowied\u017a jako s\u0142ownik r . status # 200","title":"Wykonywanie zapyta\u0144 w HTMLu - requests"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#proste-hostowanie-folderu","text":"KIedy chcesz w prosty spos\u00f3b udost\u0119pni\u0107 dany folder w sieci. python -m http.server #to udost\u0119pni pod adresem 8000 #mo\u017cna te\u017c samodzielni wybra\u0107 port python -m http.server 8888","title":"Proste hostowanie folderu"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#django","text":"jest to do\u015b\u0107 du\u017ca zabawka link","title":"Django"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#flask","text":"Jeden z mikroframework\u00f3w, pozwala do\u015b\u0107 szybko napisa\u0107 jak\u0105\u015b aplikacj\u0119 REST-ow\u0105. from flask import Flask , request , response app = Flask ( __name__ ) @app . route ( '/' , methods = [ \"GET\" , \"POST\" ]) def hello_world (): if request . method == \"GET\" : return \"Hello\" if request . method == \"POST\" : return \"you posted something\" if __name__ == '__main__' : app . run ()","title":"Flask"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#bottle","text":"Mniejsza i du\u017co prostsza biblioteka (mie\u015bci si\u0119 w jednym pliku). Podobna do flaska. from bottle import route , run , template @route ( '/hello/' ) #@route to dekorator def index ( name ): return template ( 'Hello {{name}}
    ?' , name = name ) #otrzymamy prostego html-a #index = route('//hello/')(index) #ten sam wynik, w sytuacji bez @route run ( host = '0.0.0.0' , port = 8080 ) #nasza strona b\u0119dzie dost\u0119pna tutaj albo mo\u017cemy te\u017c chcie\u0107 wygenerowa\u0107 jsona def index ( name ): return { \"klucz\" : \"wartosc\" , \"a_tu\" :[ \"bedzie\" , \"lista\" ]}","title":"Bottle"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#aplikacje-z-gui","text":"TODO rozpisa\u0107 si\u0119 troch\u0119 https://wiki.python.org/moin/GuiProgramming","title":"Aplikacje z GUI"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#zapisywanie","text":"","title":"Zapisywanie"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#pickle-zapisywanie-zmiennych","text":"Pythonowa biblioteka Pickle pozwala na zapisywanie (i odczytywanie) danych i obiekt\u00f3w w pythonie w formie binarnej poprzez serializacj\u0119. Serializacja polega na przekszta\u0142ceniu obiektu w posta\u0107, kt\u00f3ra mo\u017ce by\u0107 zapisana do pliku lub przes\u0142ana przez sie\u0107. import pickle # tworzenie obiektu do serializacji data = { 'name' : 'John Smith' , 'age' : 30 , 'country' : 'USA' } with open ( 'data.pkl' , 'wb' ) as f : # serializacja obiektu i zapis do pliku pickle . dump ( data , f ) # otwieranie pliku z serializowanym obiektem with open ( 'data.pkl' , 'rb' ) as f : # deserializacja obiektu z pliku data2 = pickle . load ( f ) print ( data2 ) # {'name': 'John Smith', 'age': 30, 'country': 'USA'}","title":"Pickle - zapisywanie zmiennych"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#dill-zapisywanie-caej-sesji-w-pythonie","text":"Rozszerzeniem do pickla jest dill, pozwala on na zapisywanie za\u0142ej sesji w pythonie do pliku, kt\u00f3ry mo\u017cna potem przywr\u00f3ci\u0107. //todo przyk\u0142ad","title":"Dill -zapisywanie ca\u0142ej sesji w pythonie"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#debugowanie","text":"","title":"Debugowanie"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#pdb","text":"import pdb pdb . set_trace () #w tej linii skrypt si\u0119 zatrzyma i b\u0119dzie mo\u017cna si\u0119 rozejrze\u0107 # (Pdb) zapytania w trybie debuggera : w - where (na stosie) u -up d - down c/continue - continue args - wy\u015bwietla wszystkie argumenty, jakie dana funkcja otrzyma\u0142a (ta w kt\u00f3rej obecnie jeste\u015bmy) Poza tym reszta rzeczy odpowiada zwyk\u0142emu pisaniu w pythonie, mo\u017cemy zmienia\u0107 zmienne, printowa\u0107 je, uruchamia\u0107 p\u0119tle etc. Warto wtedy u\u017cywa\u0107 te\u017c: locals() - \u0142aduje do s\u0142ownika wszystkie obecnie dost\u0119pne funkcje","title":"pdb"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#inspect","text":"import inspect inspect . getsource ( xyz ) # wypisuje jak dana funkcja jest napisana","title":"inspect"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#ast","text":"#podobnie jak wy\u017cej import ast","title":"ast"},{"location":"Python%F0%9F%90%8D/4_biblioteki_i_narz%C4%99dzia/#gdb","text":"LINK /TODO opisa\u0107 dok\u0142adniej /TODO opisa\u0107 dzia\u0142anie libki subprocess (czyli jak ogarn\u0105\u0107 prawdziw\u0105 wielow\u0105tkowo\u015b\u0107 w pythonie), oraz uruchamianie proces\u00f3w.","title":"GDB"},{"location":"Python%F0%9F%90%8D/5_inne/","text":"Inne VENV - wirtualne \u015brodowisko Jest to bardzo potrzebne gdy nie chcemy przypadkiem namiesza\u0107 w naszych ju\u017c zainstalowanych paczkach pythonowych, a chcemy odpali\u0107 jaki\u015b projekt wymagaj\u0105cy konkretnych wersji danych pakiet\u00f3w. Dokumentacja Instalacja dla debian\u00f3w: sudo apt install python3-venv . Tworzenie nowego venva python3 -m venv /path/to/new/virtual/environment Aby aktywowa\u0107 venva (czyli odpali\u0107 w pythona korzystaj\u0105cego z pakiet\u00f3w w tym venvie) trzeba u\u017cy\u0107 komendy Shell Command to activate virtual environment bash/zsh $ source /bin/activate fish $ source /bin/activate.fish csh/tcsh $ source /bin/activate.csh PowerShell $ /bin/Activate.ps1 (Windows)cmd.exe C:\\> \\Scripts\\activate.bat (Windows)PowerShell PS C:\\> \\Scripts\\Activate.ps1 Uruchamianie skryptu w trybie interaktywnym Z poziomu basha: python -i ./skrypt.py Z poziomu pythona: exec ( open ( \"./first.py\" ) . read ()) Dzi\u0119ki temu po zako\u0144czeniu wykonywania nie wyjdziemy ze skryptu i b\u0119dziemy mogli kontynuowa\u0107 jego prac\u0119 u\u017cywaj\u0105c ju\u017c zaimportowanych przez niego bibliotek oraz zmiennych, kt\u00f3re utworzy\u0142. U\u017cycie modu\u0142\u00f3w z C/C++ Do tego warto u\u017cy\u0107 bibliotek booosta. Przyk\u0142adowy Github Gist zawieraj\u0105cy prosty projekt obrazuj\u0105cy dzia\u0142anie: TUTAJ Guideline'y PEP 8 Google docs Implementacje Pythonowe Warto wiedzie\u0107, \u017ce jest wiele implementacji pythona. Najbardziej znan\u0105 jest CPython napisany w C. Ze wzgl\u0119du na wydajno\u015b\u0107 warto si\u0119 zapozna\u0107 z: PyPy - kompilator typu JIT Nuitka link - o ile dobrze rozumiem to taki jakby kompilator pythona Ze wzgl\u0119du na kompatybilno\u015b\u0107: Jython (java) IronPython (C#) Pe\u0142na lista implementacji link Dokumentowanie Diagramy klas Do tego mo\u017cna u\u017cy\u0107: pyreverse - chyba najprostsze (do pobrania z pipa) pyreverse -o png moje_klasy.py","title":"Inne"},{"location":"Python%F0%9F%90%8D/5_inne/#inne","text":"","title":"Inne"},{"location":"Python%F0%9F%90%8D/5_inne/#venv-wirtualne-srodowisko","text":"Jest to bardzo potrzebne gdy nie chcemy przypadkiem namiesza\u0107 w naszych ju\u017c zainstalowanych paczkach pythonowych, a chcemy odpali\u0107 jaki\u015b projekt wymagaj\u0105cy konkretnych wersji danych pakiet\u00f3w. Dokumentacja Instalacja dla debian\u00f3w: sudo apt install python3-venv . Tworzenie nowego venva python3 -m venv /path/to/new/virtual/environment Aby aktywowa\u0107 venva (czyli odpali\u0107 w pythona korzystaj\u0105cego z pakiet\u00f3w w tym venvie) trzeba u\u017cy\u0107 komendy Shell Command to activate virtual environment bash/zsh $ source /bin/activate fish $ source /bin/activate.fish csh/tcsh $ source /bin/activate.csh PowerShell $ /bin/Activate.ps1 (Windows)cmd.exe C:\\> \\Scripts\\activate.bat (Windows)PowerShell PS C:\\> \\Scripts\\Activate.ps1","title":"VENV - wirtualne \u015brodowisko"},{"location":"Python%F0%9F%90%8D/5_inne/#uruchamianie-skryptu-w-trybie-interaktywnym","text":"Z poziomu basha: python -i ./skrypt.py Z poziomu pythona: exec ( open ( \"./first.py\" ) . read ()) Dzi\u0119ki temu po zako\u0144czeniu wykonywania nie wyjdziemy ze skryptu i b\u0119dziemy mogli kontynuowa\u0107 jego prac\u0119 u\u017cywaj\u0105c ju\u017c zaimportowanych przez niego bibliotek oraz zmiennych, kt\u00f3re utworzy\u0142.","title":"Uruchamianie skryptu w trybie interaktywnym"},{"location":"Python%F0%9F%90%8D/5_inne/#uzycie-moduow-z-cc","text":"Do tego warto u\u017cy\u0107 bibliotek booosta. Przyk\u0142adowy Github Gist zawieraj\u0105cy prosty projekt obrazuj\u0105cy dzia\u0142anie: TUTAJ","title":"U\u017cycie modu\u0142\u00f3w z C/C++"},{"location":"Python%F0%9F%90%8D/5_inne/#guideliney","text":"PEP 8 Google docs","title":"Guideline'y"},{"location":"Python%F0%9F%90%8D/5_inne/#implementacje-pythonowe","text":"Warto wiedzie\u0107, \u017ce jest wiele implementacji pythona. Najbardziej znan\u0105 jest CPython napisany w C. Ze wzgl\u0119du na wydajno\u015b\u0107 warto si\u0119 zapozna\u0107 z: PyPy - kompilator typu JIT Nuitka link - o ile dobrze rozumiem to taki jakby kompilator pythona Ze wzgl\u0119du na kompatybilno\u015b\u0107: Jython (java) IronPython (C#) Pe\u0142na lista implementacji link","title":"Implementacje Pythonowe"},{"location":"Python%F0%9F%90%8D/5_inne/#dokumentowanie","text":"","title":"Dokumentowanie"},{"location":"Python%F0%9F%90%8D/5_inne/#diagramy-klas","text":"Do tego mo\u017cna u\u017cy\u0107: pyreverse - chyba najprostsze (do pobrania z pipa) pyreverse -o png moje_klasy.py","title":"Diagramy klas"},{"location":"Python%F0%9F%90%8D/6_testowanie/","text":"Testowanie Do test\u00f3w wykorzystujemy s\u0142owo kluczowe assert x = \"hello\" #if condition returns False, AssertionError is raised: assert x == \"goodbye\" , \"x should be 'hello'\" je\u015bli to co znajdzie si\u0119 w assercie zwraca true to nic si\u0119 nie dzieje, za\u015b je\u015bli jest to fa\u0142sz to rzuca wyj\u0105tek AssertionError . Wiadommo\u015b\u0107 zawart\u0105 w tym wyj\u0105tku mo\u017cemy poda\u0107 po przecinku. W pythonie jest kilka framework\u00f3w do test\u00f3w: pytest , doctest i unittest Je\u015bli chodzi o struktur\u0119 test\u00f3w to warto zwr\u00f3ci\u0107 uwag\u0119 na to, jak s\u0105 one znajdowane. Conventions for Python test discovery (pytest) Unittest Jest to domy\u015blny spos\u00f3b testowania wbudowany w j\u0119zyk, jest te\u017c najmniej rozbudowany. Testy z doctest Jest to spos\u00f3b na pisanie test\u00f3w funkcji w jej definicji, testy stanowi\u0105 cze\u015bc opisu naszej funkcji Sk\u0142adnia: znajduje si\u0119 pomi\u0119dzy \"\"\" i \"\"\" linie kodu s\u0105 umieszczane po >>> oczekiwane wyniki wpisujemy w miejscach w kt\u00f3rych powinny si\u0119 wy\u015bwietli\u0107 po wykonaniu Np: \"\"\" This is the \"example\" module. The example module supplies one function, factorial(). For example, >>> factorial(5) 120 \"\"\" def factorial ( n ): \"\"\"Return the factorial of n, an exact integer >= 0. >>> [factorial(n) for n in range(6)] [1, 1, 2, 6, 24, 120] >>> factorial(30) 265252859812191058636308480000000 >>> factorial(-1) Traceback (most recent call last): ... ValueError: n must be >= 0 Factorials of floats are OK, but the float must be an exact integer: >>> factorial(30.1) Traceback (most recent call last): ... ValueError: n must be exact integer >>> factorial(30.0) 265252859812191058636308480000000 It must also not be ridiculously large: >>> factorial(1e100) Traceback (most recent call last): ... OverflowError: n too large \"\"\" import math if not n >= 0 : raise ValueError ( \"n must be >= 0\" ) if math . floor ( n ) != n : raise ValueError ( \"n must be exact integer\" ) if n + 1 == n : # catch a value like 1e300 raise OverflowError ( \"n too large\" ) result = 1 factor = 2 while factor <= n : result *= factor factor += 1 return result if __name__ == \"__main__\" : import doctest doctest . testmod () flaga \"-v\" przy uruchamianiu takiego skryptu sprawia, \u017ce wy\u015bwietlaj\u0105 si\u0119 tak\u017ce raporty z poprawnych test\u00f3w. Pytest Jeden z najpopularniejszych sposob\u00f3w testowania link . Pytest odpala wszystkie pliki test_*.py i *_test.py z naszego folderu. I uruchamia wszystkie funkcje zwawieraj\u0105ce test_ w nazwie (tak\u017ce metody zdefiniowanych klas). Pozwala na \u0142tew testowanie klas, wyj\u0105tk\u00f3w etc import pytest def f (): raise SystemExit ( 1 ) # sprawdzanie wyj\u0105tku def test_mytest (): with pytest . raises ( SystemExit ): f () class TestClass : def test_one ( self ): x = \"this\" assert \"h\" in x def test_two ( self ): x = \"hello\" assert hasattr ( x , \"check\" ) Pokrycie testami Przy testach mo\u017cna sobie wygenerowa\u0107 raport pokrycia kodu pytest --cov = ./nazwa_paczki/ coverage xml #konwertuje plik .coverage do raportu w xml-u","title":"Testowanie"},{"location":"Python%F0%9F%90%8D/6_testowanie/#testowanie","text":"Do test\u00f3w wykorzystujemy s\u0142owo kluczowe assert x = \"hello\" #if condition returns False, AssertionError is raised: assert x == \"goodbye\" , \"x should be 'hello'\" je\u015bli to co znajdzie si\u0119 w assercie zwraca true to nic si\u0119 nie dzieje, za\u015b je\u015bli jest to fa\u0142sz to rzuca wyj\u0105tek AssertionError . Wiadommo\u015b\u0107 zawart\u0105 w tym wyj\u0105tku mo\u017cemy poda\u0107 po przecinku. W pythonie jest kilka framework\u00f3w do test\u00f3w: pytest , doctest i unittest Je\u015bli chodzi o struktur\u0119 test\u00f3w to warto zwr\u00f3ci\u0107 uwag\u0119 na to, jak s\u0105 one znajdowane. Conventions for Python test discovery (pytest)","title":"Testowanie"},{"location":"Python%F0%9F%90%8D/6_testowanie/#unittest","text":"Jest to domy\u015blny spos\u00f3b testowania wbudowany w j\u0119zyk, jest te\u017c najmniej rozbudowany.","title":"Unittest"},{"location":"Python%F0%9F%90%8D/6_testowanie/#testy-z-doctest","text":"Jest to spos\u00f3b na pisanie test\u00f3w funkcji w jej definicji, testy stanowi\u0105 cze\u015bc opisu naszej funkcji Sk\u0142adnia: znajduje si\u0119 pomi\u0119dzy \"\"\" i \"\"\" linie kodu s\u0105 umieszczane po >>> oczekiwane wyniki wpisujemy w miejscach w kt\u00f3rych powinny si\u0119 wy\u015bwietli\u0107 po wykonaniu Np: \"\"\" This is the \"example\" module. The example module supplies one function, factorial(). For example, >>> factorial(5) 120 \"\"\" def factorial ( n ): \"\"\"Return the factorial of n, an exact integer >= 0. >>> [factorial(n) for n in range(6)] [1, 1, 2, 6, 24, 120] >>> factorial(30) 265252859812191058636308480000000 >>> factorial(-1) Traceback (most recent call last): ... ValueError: n must be >= 0 Factorials of floats are OK, but the float must be an exact integer: >>> factorial(30.1) Traceback (most recent call last): ... ValueError: n must be exact integer >>> factorial(30.0) 265252859812191058636308480000000 It must also not be ridiculously large: >>> factorial(1e100) Traceback (most recent call last): ... OverflowError: n too large \"\"\" import math if not n >= 0 : raise ValueError ( \"n must be >= 0\" ) if math . floor ( n ) != n : raise ValueError ( \"n must be exact integer\" ) if n + 1 == n : # catch a value like 1e300 raise OverflowError ( \"n too large\" ) result = 1 factor = 2 while factor <= n : result *= factor factor += 1 return result if __name__ == \"__main__\" : import doctest doctest . testmod () flaga \"-v\" przy uruchamianiu takiego skryptu sprawia, \u017ce wy\u015bwietlaj\u0105 si\u0119 tak\u017ce raporty z poprawnych test\u00f3w.","title":"Testy z doctest"},{"location":"Python%F0%9F%90%8D/6_testowanie/#pytest","text":"Jeden z najpopularniejszych sposob\u00f3w testowania link . Pytest odpala wszystkie pliki test_*.py i *_test.py z naszego folderu. I uruchamia wszystkie funkcje zwawieraj\u0105ce test_ w nazwie (tak\u017ce metody zdefiniowanych klas). Pozwala na \u0142tew testowanie klas, wyj\u0105tk\u00f3w etc import pytest def f (): raise SystemExit ( 1 ) # sprawdzanie wyj\u0105tku def test_mytest (): with pytest . raises ( SystemExit ): f () class TestClass : def test_one ( self ): x = \"this\" assert \"h\" in x def test_two ( self ): x = \"hello\" assert hasattr ( x , \"check\" )","title":"Pytest"},{"location":"Python%F0%9F%90%8D/6_testowanie/#pokrycie-testami","text":"Przy testach mo\u017cna sobie wygenerowa\u0107 raport pokrycia kodu pytest --cov = ./nazwa_paczki/ coverage xml #konwertuje plik .coverage do raportu w xml-u","title":"Pokrycie testami"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/","text":"Javascript Syntax Inne tutoriale: Java essentials Osadzanie skryptu w HTML-u W HTML-u skrypty umieszczane s\u0105 wwen\u0105trz tag\u00f3w script . W praktyce skrypty mo\u017cna tak pisa\u0107, ale nie jest to wygodne, dlatego u\u017cywa si\u0119 osadzania skrypt\u00f3w. < script src = \"plik_ze_sryptem.js\" > < script > ////Tutaj skrypty Zmienne Warning Zmienne nie mog\u0105 zaczyna\u0107 si\u0119 od liczb, ani nazywa\u0107 si\u0119 jak s\u0142owa kluczowe w JS ( new function class etc) /* let 3liczba = 43; */ /* let function = 3; */ let $function = 43 ; // ale za to $ jest dozwolony jako znak Typy zmiennych Warto pami\u0119ta\u0107, \u017ce JS ma dynamiczne typowanie, czyli nie musimy definiowa\u0107 typ\u00f3w zmiennych, poniewa\u017c to jest sprawdzane dynamicznie w trakcie pracy. Poza tym mo\u017cemy nadpisywa\u0107 zmienne innymi typami. let mojaZmienna = 43 ; mojaZmienna = \"teraz slowo\" ; Zalecane formatowanie dla zmiennych to camelCase . Podstawowe //Number - zawsze zmiennoprzecinkowa (tak\u017ce dla ca\u0142kowitych) let wiek = 22 ; //String - wartpami\u0119ta\u0107, \u017ce mo\u017cna je definiowa\u0107 na 3 sposoby \"\", '' i `` let imie = \"Marian\" ; // Boolean let isTrue = true ; //Undefined let jeszczeNieOkreslone ; // Null let nic = null ; // Symbol (ES2015) - unikatowa warto\u015b\u0107, kt\u00f3rej nie mo\u017cna zmieni\u0107 Dla sprawdzania typ\u00f3w o\u017cywamy operatora typeof let zmienna = 54 ; console . log ( typeof zmienna ); //>number typeof \"Slowo\" ; //>\"string\" let nieWiadomo ; console . log ( typeof nieWiadomo ); //>undefined Warto zwr\u00f3ci\u0107 uwag\u0119 na to co daje tutaj null . (Jest to wyj\u0105tek z kt\u00f3rym trzeba si\u0119 pogodzi\u0107) console . log ( typeof null ); //>object Tablice (arrays) S\u0105 to kontenery w kt\u00f3rych trzymamy zmienne i obiekty const liczby = [ 22 , 33 , 45 ]; const slowa = new Array ( \"slowo1\" , \"slowo2\" ); console . log ( liczby [ 0 ]); // 22 // mamy tu zbli\u017cone odliczanie do pythonowego console . log ( liczby [ - 1 ]); // 45 // co ciekawe mimo inicjalizacji jako const mo\u017cemy zmienia\u0107 warto\u015bci w tablicy liczby [ 1 ] = 32 ; //Ale nie mo\u017cemy usun\u0105\u0107 samej tablicy Tablice mog\u0105 zawiera\u0107 r\u00f3\u017cne warto\u015bci w kolejnych kom\u00f3rkach let osoba = [ \"Marian\" , \"Kowalski\" , 22 , [ \"Burek\" , \"Kulka\" ]]; Operacje na tablicach let tablica = []; // rozmiar tablicy tablica . length ; // 0 tablica . push ( 10 ); //teraz tablica zawiera 10 // 1 - zwraca ona now\u0105 d\u0142ugo\u015b\u017c naszej tablicy tablica . unshift ( 0 ); //tobi to samo co push, tylko dodaje na pocz\u0105tek tablica . pop (); //a po tej operacji jest znowu pusta // 10 - zwraca warto\u015b\u0107 z ko\u0144ca tablicy tablica . shift (); // zwraca pierwszy element rablicy const inna = [ \"pierwszy\" , \"drugi\" , \"trzeci\" ]; inna . indexOf ( \"pierwszy\" ); // 0 inna . includes ( \"trzeci\" ); // true Iterowanie po tablicach const lista = [ \"a\" , \"b\" , \"c\" ]; for ( const [ num , elem ] of lista . entries ()) { console . log ( `Indeks: ${ num } Zawartosc: ${ elem } ` ); } Rozmontowywanie tablic // tworzymy trzy zmienne (x, y, z), kt\u00f3re b\u0119z\u0105 zawiera\u0107 poszczeg\u00f3lne elementy const [ x , y , z ] = [ 1 , 2 , 3 ]; const [, dwa , , cztery ] = [ 1 , 2 , 3 , 4 , 5 ]; //nie musimy bra\u0107 wszystkich element\u00f3w z danej tablicy Mo\u017cemy te\u017c w ten spos\u00f3b definiowa\u0107 zmienne domy\u015blne (je\u015bli w tablicy nie ma danego elementu do domy\u015blnie jest Undefined) const [ x = 1 , , z = 3 ] = [ 0 , 1 ]; Ten mechanizm pozwala na \u0142atwe zwracanie wielu element\u00f3w z funkcji, podobnie do krotek z pythona. Sposoby definiowania Jest kilka sposob\u00f3w na definiowanie zmiennych. S\u0142u\u017c\u0105 do tego s\u0142owa kluczowe let , var i const . let - definiowanie zwyk\u0142ej zmienej warto\u015bci, za jego pomoc\u0105 mo\u017cna te\u017c definiowa\u0107 puste zmienne. let num = 30 ; num = 32 ; let undef ; var - podobne do let lecz jest ju\u017c przestarza\u0142e i nie zaleca si\u0119 jego u\u017cywania. Var jest du\u017co bardziej bugogenne function f () { for ( var let_i = 0 ; let_i < 5 ; let_i ++ ) { console . log ( \"let_i: \" + let_i ); } for ( var var_i = 0 ; var_i < 5 ; var_i ++ ) { console . log ( \"let_i: \" + let_i ); // to b\u0119dzie dzia\u0142a\u0107 dobrze } } Na dodatek pozwala ono u\u017cywa\u0107 zmiennej przed jej zadeklarowaniem. const - po prostu sta\u0142e zmienne const PI = 3.14 ; // PI = 1; - spowoduje TypeError // const unknown; - to te\u017c nie zadzia\u0142a (SyntaxError) Teoretycznie mo\u017cna pracowa\u0107 nawet bez definiowania zmiennych wg wymienionych wy\u017cej sposob\u00f3w. imie = \"Jan\" ; console . log ( imie ); // Jan Tylko, \u017ce ta zmienna b\u0119dzie wtedy odpowiednikiem zmiennej globalnej. Operatory Typy operator\u00f3w: Matematyczne: + - * / ** (pot\u0119gowanie) Przypisywania: = += *= -= ++ -- etc Boolowskie por\u00f3wnania: > >= < <= == != === logiczne && || ! tr\u00f3jargumentowy ? : Kolejno\u015b\u0107 operator\u00f3w jest taka jak w matematyce. Operator == i === Istniej\u0105 dwa operatory r\u00f3wno\u015bci: === - \u015bcis\u0142y - zwraca prawd\u0119 tylko i wy\u0142\u0105cznie wtedy, gdy obie strony s\u0105 takie same, nie bawi si\u0119 w \u017cadne konwersje etc. == - jest nieco lu\u017aniejszy, pozwala sobie na konwersje pomi\u0119dzy typami je\u015bli warto\u015bci s\u0105 r\u00f3\u017cnych typ\u00f3w, poza tym ma inne \"pomagaj\u0105ce\" mechanizmy, kt\u00f3re w d\u0142u\u017cszej prespektywie mog\u0105 powodowa\u0107 wi\u0119cej b\u0142\u0119d\u00f3w. (je\u015bli si\u0119 da u\u017cywaj === ) 19 === \"19\" ; // false 19 == \"19\" ; // true Podobnie do === dzia\u0142a !== Konwersja Aby dokona\u0107 konwersji trzeba po prostu u\u017cy\u0107 konstruktora danego typu. const rokStr = \"2001\" ; Number ( rokStr ); //>2001 String ( 55 ); //>\"55\" Tutaj w wypadku podania niew\u0142a\u015bciwej warto\u015bci zamiast wyj\u0105tku dla liczby mo\u017cemy dosta\u0107 NaN (Not a Number) let a = Number ( \"ff2\" ); a ; //>NaN typeof a ; // Co ciekawe ten typ jest wci\u0105\u017c numerem ( \"number\" ); Poza tym warto uwa\u017ca\u0107 na sprytn\u0105 konwersj\u0119 typ\u00f3w np przy printowaniu. Na og\u00f3\u0142 dzia\u0142a to fajnie, ale operator + mo\u017ce troch\u0119 napsu\u0107 i by\u0107 \u017ar\u00f3d\u0142em wielu b\u0142\u0119d\u00f3w. \"22\" + 10 ; // 2210 \"22\" - 10 ; // 12 \"22\" - \"10\" ; // 12 \"22\" - \"10\" + 55 ; // 67 \"22\" - \"10\" + \"55\" ; // 1255 Konwersja na Boola - warto\u015bci, kt\u00f3re przy konewrsji na boola daj\u0105 false : 0 - warto\u015b\u0107 liczbowa r\u00f3wna zero \"\" undefined null NaN Pozosta\u0142e konwertuj\u0105 si\u0119 na warto\u015b\u0107 true Praca ze stringami Mamy tutaj standardowe metody do pracy z ci\u0105gami znak\u00f3w, podobne nieco do tych pythonowych. Mamy: split(separator=\" \") replace(co,na_co) , replaceAll(co,na_co) let slowo = \"\" ; Printowanie console . log ( \"Wiadomosc1\" , 323 ); //> Wiadomosc1 323 // aby wypisa\u0107 wiadomo\u015bc mo\u017cna klasycznie po\u0142\u0105czy\u0107 stringi const wiek = 10 ; const wiadomosc = \"Hej, mam \" + wiek + \"lat\" ; console . log ( wiadomosc ); // Ale mo\u017cna to zrobi\u0107 wygodniej warto pami\u0119ta\u0107, \u017ce robimy to w ``, a nie w '' const wiadomosc2 = `Hej, mam ${ wiek } lat` ; console . log ( wiadomosc2 ); Og\u00f3lnie to obecnie ten drugi spos\u00f3b definiowania jest wygodniejszy console . log ( \"Wiele\\n\\ linii w kodzie\" ); //VS console . log ( `Wiele linii w kodzie` ); IF-y i warunki Syntax warunk\u00f3w jest zbli\u017cony do C++ const wiek = prompt ( \"podaj wiek\" ); //pojawi si\u0119 okno z pytaniem if ( wiek >= 18 ) { console . log ( \"Pe\u0142noletni\" ); } else { console . log ( \"Niepe\u0142noletni\" ); } if ( true ) console . log ( \"Nie\" ); else console . log ( \"Tak\" ); if ( true ) console . log ( \"True to prawda\" ); Mamy te\u017c tu switcha switch ( key ) { case value : fun1 (); fun2 (); break ; case value2 : case value3 : // dla tych dw\u00f3ch warto\u015bci b\u0119dzie si\u0119 dzia\u0107 to samo fun3 (); break ; default : break ; } Jest te\u017c operator tr\u00f3jargumentowy ? : wiek >= 18 ? console . log ( \"Doros\u0142y\" ) : log . console ( \"Nie Doros\u0142y\" ); // Albo console . log ( wiek >= 18 ? \"Doros\u0142y\" : \"Nie Doros\u0142y\" ); P\u0119tle Nic ciekawego mamy 2 zwyk\u0142e typy p\u0119tli, for i while . for ( let num = 0 ; num < 10 ; num ++ ) { if ( num === 5 ) continue ; //ale skipujemy dla 5 console . log ( `Printujemy po raz ${ num + 1 } ` ); } while ( true ) { //nigdy nie ko\u0144cz\u0105ca si\u0119 p\u0119tla break ; //no chyba, \u017ce u\u017cyj\u0119 break } Poza tym mamy jeszcze forEach w dw\u00f3ch wariantach. const tablica = [ 0 , 11 , 22 , 33 , 44 ]; for ( const i of tablica ) { console . log ( i ); } // Metoda forEach tablica . forEach ( function ( i ) { console . log ( i ); }); Funkcje Definiujemy je u\u017cywaj\u0105c s\u0142owa kluczowego function . Tak\u017ce s\u0105 na og\u00f3\u0142 formatowane jako camelCase . Warning Niestety JS nie wspiera przeci\u0105\u017cania funkcji. Poni\u017cej zwyk\u0142e deklaracje funkcji (function declaration). function printHello () { console . log ( \"Hello\" ); } printHello (); // Hello function isApple ( fruit ) { if ( fruit == \"apple\" ) return true ; else return false ; } Argumenty funkcji Funckcj\u0119 maj\u0105c\u0105 n argument\u00f3w mo\u017cemy wywo\u0142a\u0107 u\u017cywaj\u0105c: n argument\u00f3w printHello ( 23 ); // Hello wi\u0119cej ni\u017c n argument\u00f3w - nieoczekiwane argumenty s\u0105 ignorowane isApple ( \"apple\" , 43 ); //drugi argument jest ignorowany // true mniej ni\u017c n argument\u00f3w - brakuj\u0105ce maj\u0105 warto\u015b\u0107 undefined isApple (); //pierwszy argument ma warto\u015b\u0107 \"undefined\" // false Mo\u017cemy tak\u017ce przekaza\u0107 do funkcji list\u0119 argument\u00f3w, kt\u00f3re b\u0119d\u0105 zmapowane na kolejne argumenty let vector = [ \"apple\" , 2 , 3 , 4 ]; isApple (... vector ); Do argument\u00f3w mo\u017cemy odwo\u0142a\u0107 si\u0119 poprzez: nazw\u0119 pseudo-list\u0119 arguments function greetings () { for ( let i = 0 ; i < arguments . length ; i ++ ) { console . log ( \"Hi, \" + arguments [ i ]); } //Hi, Tom } W razie potrzeby mo\u017cemy wymusi\u0107 liczb\u0119 argument\u00f3w function f ( x , y ) { if ( arguments . length != 2 )... W\u0142a\u015bnie przez ten \u015bmietnik nie mamy przeci\u0105\u017cania funkcji. Funkcje anonimowe Tym okre\u015bleniem okre\u015blamy funkcje, kt\u00f3re s\u0105 przechowywane w zmiennych. Okre\u015blane tak\u017ce jako function expression . let myFun = function () { lonsole . log ( \"HelloFun\" ); }; myFun (); // HelloFun Funkcje strza\u0142kowe Funkcje strza\u0142kowe (arrow functions) to po prostu inny format funkcji przypominaj\u0105cy wyra\u017cenia lambda z innych j\u0119zyk\u00f3w. Pozwala na kr\u00f3tszy zapis funkcji. const arrowFun = ( value ) => value + 12 ; arrowFun ( 10 ); // 22 const arrowFunMultiline = ( imie ) => { console . log ( `imie to ${ imie } ` ); return imie ; }; arrowFunMultiline ( \"Jan\" ); // imie to Jan // \"Jan\" const linkNames = ( imie , nazwisko ) => imie + \" \" + nazwisko ; Maj\u0105 one do\u015b\u0107 elastyczny zapis, w wypadku jednego argumentu nie musimy u\u017cywa\u0107 nawias\u00f3w pocz\u0105tkowych, podobnie wygl\u0105da sytuacja z klamerkami w kt\u00f3\u00a9ych zawieramy nasze funkcje. R\u00f3\u017cni\u0105 si\u0119 te\u017c nieco implementacj\u0105, nie jest dla nich tworzony this , ani obiekt arguments . const fun1 = function () { console . log ( this ); // undefined }; const fun2 = () => { console . log ( this ); // zwr\u00f3ci globalny obiekt window }; Kolejno\u015b\u0107 (hoisting) Przy deklarowaniu funkcji nie musimy si\u0119 martwi\u0107 kolejno\u015bci\u0105 ich deklaracji, poniewa\u017c ich deklaracje s\u0105 doczytywane wcze\u015bniej (ale na ich u\u017cycie musimy poczeka\u0107). const fun1 = function () { fun2 (); }; const fun2 = function () { console . log ( \"ok\" ); }; fun1 (); //ale ta ju\u017c musi by\u0107 po deklaracji Dost\u0119p do zmiennych w funkcji zagnie\u017cd\u017conej Funkcjie zdefiniowane we wn\u0119trzu innuch funkcji maj\u0105 dost\u0119p do wszystkich zmiennych kt\u00f3re s\u0105 dost\u0119pne w wybranym zakresie. var global = \"this is global\" ; function scopeFunction () { alsoGlobal = \"This is also global!\" ; var notGlobal = \"This is private to scopeFunction!\" ; function subFunction () { alert ( notGlobal ); // We can still access notGlobal in this child function. stillGlobal = \"No var keyword so this is global!\" ; var isPrivate = \"This is private to subFunction!\" ; } alert ( stillGlobal ); // This is an error since we haven't executed subfunction subFunction (); // execute subfunction alert ( stillGlobal ); // This will output 'No var keyword so this is global!' alert ( isPrivate ); // This generate an error since isPrivate is private to // subfunction(). alert ( global ); // outputs: 'this is global' } alert ( global ); // outputs: 'this is global' alert ( alsoGlobal ); // generates an error since we haven't run scopeFunction yet. scopeFunction (); alert ( alsoGlobal ); // outputs: 'This is also global!'; alert ( notGlobal ); // generates an error. Zmienne proste vs z\u0142o\u017cone (kopia vs referencja) Przy pracy ze zmiennymi warto pami\u0119ta\u0107 o tym, \u017ce jedynie proste typy zmiennych s\u0105 kopiowane przy przekazywaniu dalej (Number, String, Boolean, Undefined, Null, Symbol, BigInt), w pozosta\u0142ych przypadkach przekazywana jest referencja. let x = 1 ; let y = x ; y = 2 ; console . log ( x ); // 1 console . log ( y ); // 2 let d1 = { x : 1 }; let d2 = d1 ; d2 . x = 2 ; //niechc\u0105cy nadpisali\u015bmy warto\u015b\u0107 x obiektu d1 console . log ( d1 ); //{ x: 2 } console . log ( d2 ); //{ x: 2 } Aby temu zapobiec mo\u017cna u\u017cy\u0107 operatora Object.assign() - \u0142\u0105czy on ze sob\u0105 2 obiekty, wystarczy po\u0142\u0105czy\u0107 nasz z jakim\u015b pustym. Tworzy on jednak tylko p\u0142ytk\u0105 kopi\u0119. let kopia = Object . assign ({}, d1 ); Obiekty Obiekty mog\u0105 by\u0107 tworzone na dwa sposoby. Tworzenie Jako wyra\u017cenie (expression) - spos\u00f3b nieco zbli\u017cony do opisu s\u0142ownika. Otrzymujemy od razu gotow\u0105 instancj\u0119 naszej klasy. const osoba = { imie : \"Marian\" , nazwisko : \"Nowak\" , ur : 1999 , getAge : function () { return 2021 - this . ur ; }, }; Poszczeg\u00f3lne elementy powinny by\u0107 oddzielone przecinkami. Deklaracja - tworzymy deklaracj\u0119 klasy i potem mo\u017cemy (u\u017cywaj\u0105c operatora new tworzy\u0107 jej instancje) class Rectangle { constructor ( height , width ) { this . height = height ; this . width = width ; } } let instancja = new Rectangle ( 0 , 0 ); Dost\u0119p do element\u00f3w danej klasy uzyskujemy za pomoc\u0105 s\u0142owa this . // Dane mo\u017cna pozyskiwa\u0107 na 2 sposoby osoba . imie ; //Marian //Ten spos\u00f3b jest nieco bardziej elastyczny i pozwala na nieco \u0142atwiejsze zarz\u0105dzanie polami osoba [ \"imie\" ]; //Marian // Mo\u017cemy tutaj te\u017c \u0142\u0105two edytowa\u0107 pola w klasie osoba . drugie_imie = \"Zbigniew\" ; osoba ; // Object { imie: \"Marian\", nazwisko: \"Nowak\", wiek: 25, drugie_imie: \"Zbigniew\" } osoba . getAge (); // 22 Prototypy Prototyp jest deklaracj\u0105 zawieraj\u0105c\u0105 definicje, kt\u00f3re s\u0105 wsp\u00f3\u0142dzielone mi\u0119dzy instancjami. Ka\u017cda instancja ma dost\u0119p do p\u00f3l i metod prototypu. Jest to przydatne, gdy chcemy co\u015b zmieni\u0107 we wszystkich instancjach danego obiektu bez ingerowania w niego. class Rectangle { constructor ( height , width ) { this . height = height ; this . width = width ; } } let rect = new Rectangle ( 10 , 10 ); // dla obiektu prototype dla instancji __proto__ Rectangle . prototype . field = function () { return this . height * this . width ; }; rect . field (); // to nam zwr\u00f3ci 100 Rectangle . __proto__ ; //zwr\u00f3ci nam prototyp bazowego obiektu Gettery i settery Pozwalaj\u0105 na u\u017cywanie niekt\u00f3rych metod tak, jakby by\u0142y polami. Settery s\u0105 bardzo przydatne podczas walidacji danych. const account = { owner : \"Jonas\" , movements : [ 200 , 530 , 120 , 300 ], get latest () { return this . movements . slice ( - 1 ). pop (); }, set latest ( mov ) { this . movements . push ( mov ); }, }; account . latest = 23 ; account . latest ; Dziedziczenie U\u017cywaj\u0105c s\u0142owa kluczowego extends mo\u017cemy tak\u017ce tworzey\u0107 hiererchie klas class Animal { // nazwa; constructor ( nazwa ) { this . nazwa = nazwa ; } habla () {} nazwaAnimal () { return this . nazwa ; } } class Pies extends Animal { constructor () { super ( \"Pies\" ); } habla () { return \"hau\" ; } } let perro = new Perro (); console . log ( perro . nazwaAnimal () + \" dice \" + perro . habla ()); Komunikacja zewn\u0119trzna i funkcje asynchroniczne Aby zapobiec marnowaniu czasu niekt\u00f3re funkcje w JS-ie zosta\u0142y zaimplementowane asynchronicznie. const img = document . querySelector ( \".dog\" ); img . src = \"dog.jpg\" ; // I w\u0142a\u015bnie to wczytywanie b\u0119dzie asynchroniczne //Jak ju\u017c si\u0119 wczyta to odpalony zostanie ten event img . addEventListener ( \"load\" , function () { console . log ( \"Wczytano\" ); }); Warto pami\u0119ta\u0107, \u017ce eventy z p\u0119tli zdarze\u0144 maj\u0105 miejsce tylko wtedy, gdy w g\u0142\u00f3wnym w\u0105tku nic nie jest przetwarzane. Po dok\u0142adniejsze wyja\u015bnienia zajrzyj do Javascript - Inne informacje AJAX AJAX - Async JavaScript And XML. Pozwala asynchronicznie komunikowa\u0107 si\u0119 z zewn\u0119trznymi serwerami (wysy\u0142a\u0107 \u017c\u0105dania etc). Kiedy\u015b opiera\u0142o si\u0119 to na u\u017cyciu XML-a, ale od ilu\u015b lat u\u017cywa si\u0119 jednak JSONa (teraz to podstawa REST-a ). Na potrzeby przyk\u0142ad\u00f3w korzystamy z darmowych API st\u0105d . Wcze\u015bniej u\u017cywa\u0142o si\u0119 do tego XMLHttpRequest. const request = new XMLHttpRequest (); request . open ( \"GET\" , \"https://restcountries.eu/rest/v2/name/poland\" ); wynik = request . send (); var polska ; request . addEventListener ( \"load\" , () => { console . log ( this . responseText ); //po otrzymaniu wy\u015bwietli nam si\u0119 ca\u0142y surowy tekst JSONa, //kt\u00f3ry trzeba przekszta\u0142ci\u0107 w jaki\u015b sensowny obiekt [ polska ] = JSON . parse ( this . responseText ); //json parse zwraca list\u0119 obiekt\u00f3w, wi\u0119c bierzemy tylko pierwszy }); Jednak obecnie ta metoda jest przestarza\u0142a i zamiast tego u\u017cywa si\u0119 fetch, kt\u00f3re zwraca nam Obietnic\u0119 (promise). Jest to tymczasowy obiekt w kt\u00f3rym znajdziemy wynik operacji asynchronicznej jak ju\u017c si\u0119 wykona. Dzi\u0119ki takiemu podej\u015bciu nie musimy polega\u0107 na callbackach, kt\u00f3re mog\u0105 by\u0107 problematyczne. const promise = fetch ( \"https://restcountries.eu/rest/v2/name/poland\" ); Taka obietnica po zako\u0144czeniu zadania mo\u017ce zmieni\u0107 sw\u00f3j stan na spe\u0142nion\u0105, lub odrzucon\u0105. Jak ju\u017c zosta\u0142a wykonana to mo\u017cemy j\u0105 skonsumowa\u0107. Do tego warto u\u017cywa\u0107 metody then do kt\u00f3rej przekazujemy co ma zosta\u0107 zrobione z otrzymanymi danymi. then ( onFulfilled ); then ( onFulfilled , onRejected ); then ( ( value ) => { /* fulfillment handler */ }, ( reason ) => { /* rejection handler */ } ); W wypadku b\u0142\u0119du, lud odrzucenia rz\u0105dania mo\u017cemy te\u017c wykorzysta\u0107 catch() na ko\u0144cu \u0142a\u0144cuszka. fetch ( \"https://restcountries.eu/rest/v2/name/poland\" ). then ( function ( response ) { console . log ( response ); //wypisze nam ca\u0142\u0105 klas\u0119 odpowiedzi z kodem statusu etc const new_promise = response . json (); //zwraca sparsowany obiekt, ale jest te\u017c kolejn\u0105 obietnic\u0105 }); U\u017cywaj\u0105c tych mechanizm\u00f3w mo\u017cna \u0142atwo \u0142\u0105czy\u0107 wiele \u017c\u0105da\u0144 w ci\u0105gi. const getCountryData = function ( country ) { fetch ( `https://restcountries.eu/rest/v2/name/ ${ country } ` ) . then (( response ) => { response . json (); }) //po otrzymaniu odpowiedzi parsujemy j\u0105 asynchronicznie . then (( data ) => { console . log ( data ); }); //po sparsowaniu w ko\u0144cu mo\u017cemy j\u0105 wy\u015bwietli\u0107 }; Mamy tu jedno \u017c\u0105danie, kt\u00f3re po wykonaniu ma zwr\u00f3ci\u0107 kolejn\u0105 obietnic\u0119, kt\u00f3ra po spe\u0142nieniu ma nam wy\u015bwietli\u0107 sparsowany wynik. Wysy\u0142anie \u017c\u0105da\u0144 z zawarto\u015bci\u0105 Wysy\u0142anie \u017c\u0105dania zawieraj\u0105cego JSONa Stary spos\u00f3b: let xhr = new XMLHttpRequest (); let url = \"https://httpbin.org/post\" ; xhr . open ( \"POST\" , url , true ); //true m\u00f3wi, \u017ce ma by\u0107 asynchronicznie xhr . setRequestHeader ( \"Content-Type\" , \"application/json\" ); //kiedy jsona trzeba okre\u015bli\u0107 jaki to typ zawarto\u015bci xhr . onreadystatechange = function () { console . log ( \"Jest git\" ); console . log ( this . responseText ); }; var data = JSON . stringify ({ imie : \"Jan\" , wiek : 12 }); xhr . send ( data ); Nowy spos\u00f3b: fetch ( \"https://httpbin.org/post\" , { method : \"post\" , headers : { Accept : \"application/json, text/plain\" , \"Content-Type\" : \"application/json\" , }, body : JSON . stringify ({ imie : \"Jan\" , wiek : 12 }), }) . then (( res ) => res . json ()) . then (( res ) => console . log ( res )); Tutaj drugim argumentam fetcha jest odpowiednik obiektu Request . Warto zwr\u00f3ci\u0107 tu uwag\u0119 na pola: method - okre\u015bla typ \u017c\u0105dania headers - mamy tutaj typowe nag\u0142\u00f3wki http lista , za ich pomoc\u0105 ustalamy np jaki typ danych wysy\u0142amy ( Content-Type ), czy te\u017c jakie dane jeste\u015bmy w stanie przyj\u0105\u0107 ( Accept ). body - ju\u017c samo cia\u0142o \u017c\u0105dania, tutaj warto pami\u0119ta\u0107, \u017ce najcz\u0119\u015bciej wysy\u0142amy je w postaci stringa Runkcje asynchroniczne Do zdefiniowania funkcji asynchronicznej (zwracaj\u0105cej obietnic\u0119) wykorzystujemy s\u0142owo kluczowe async . // Variation of program in slide 38... const fs = require ( \"fs\" ); function readFilePromise ( filename ) { return new Promise (( resolve , reject ) => { fs . readFile ( filename , ( err , data ) => { if ( err ) reject ( err + \"\" ); else resolve ( data + \"\" ); }); }); } async function readTwoFiles () { try { console . log ( await readFilePromise ( \"readfile.js\" )); console . log ( await readFilePromise ( \"doesntExist.js\" )); } catch ( err ) { console . error ( err + \"\" ); } } readTwoFiles (); W\u0142\u0105czanie zewn\u0119trznych bibliotek TODO","title":"Javascript Syntax"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#javascript-syntax","text":"Inne tutoriale: Java essentials","title":"Javascript Syntax"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#osadzanie-skryptu-w-html-u","text":"W HTML-u skrypty umieszczane s\u0105 wwen\u0105trz tag\u00f3w script . W praktyce skrypty mo\u017cna tak pisa\u0107, ale nie jest to wygodne, dlatego u\u017cywa si\u0119 osadzania skrypt\u00f3w. < script src = \"plik_ze_sryptem.js\" > < script > ////Tutaj skrypty ","title":"Osadzanie skryptu w HTML-u"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#zmienne","text":"Warning Zmienne nie mog\u0105 zaczyna\u0107 si\u0119 od liczb, ani nazywa\u0107 si\u0119 jak s\u0142owa kluczowe w JS ( new function class etc) /* let 3liczba = 43; */ /* let function = 3; */ let $function = 43 ; // ale za to $ jest dozwolony jako znak","title":"Zmienne"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#typy-zmiennych","text":"Warto pami\u0119ta\u0107, \u017ce JS ma dynamiczne typowanie, czyli nie musimy definiowa\u0107 typ\u00f3w zmiennych, poniewa\u017c to jest sprawdzane dynamicznie w trakcie pracy. Poza tym mo\u017cemy nadpisywa\u0107 zmienne innymi typami. let mojaZmienna = 43 ; mojaZmienna = \"teraz slowo\" ; Zalecane formatowanie dla zmiennych to camelCase .","title":"Typy zmiennych"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#podstawowe","text":"//Number - zawsze zmiennoprzecinkowa (tak\u017ce dla ca\u0142kowitych) let wiek = 22 ; //String - wartpami\u0119ta\u0107, \u017ce mo\u017cna je definiowa\u0107 na 3 sposoby \"\", '' i `` let imie = \"Marian\" ; // Boolean let isTrue = true ; //Undefined let jeszczeNieOkreslone ; // Null let nic = null ; // Symbol (ES2015) - unikatowa warto\u015b\u0107, kt\u00f3rej nie mo\u017cna zmieni\u0107 Dla sprawdzania typ\u00f3w o\u017cywamy operatora typeof let zmienna = 54 ; console . log ( typeof zmienna ); //>number typeof \"Slowo\" ; //>\"string\" let nieWiadomo ; console . log ( typeof nieWiadomo ); //>undefined Warto zwr\u00f3ci\u0107 uwag\u0119 na to co daje tutaj null . (Jest to wyj\u0105tek z kt\u00f3rym trzeba si\u0119 pogodzi\u0107) console . log ( typeof null ); //>object","title":"Podstawowe"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#tablice-arrays","text":"S\u0105 to kontenery w kt\u00f3rych trzymamy zmienne i obiekty const liczby = [ 22 , 33 , 45 ]; const slowa = new Array ( \"slowo1\" , \"slowo2\" ); console . log ( liczby [ 0 ]); // 22 // mamy tu zbli\u017cone odliczanie do pythonowego console . log ( liczby [ - 1 ]); // 45 // co ciekawe mimo inicjalizacji jako const mo\u017cemy zmienia\u0107 warto\u015bci w tablicy liczby [ 1 ] = 32 ; //Ale nie mo\u017cemy usun\u0105\u0107 samej tablicy Tablice mog\u0105 zawiera\u0107 r\u00f3\u017cne warto\u015bci w kolejnych kom\u00f3rkach let osoba = [ \"Marian\" , \"Kowalski\" , 22 , [ \"Burek\" , \"Kulka\" ]]; Operacje na tablicach let tablica = []; // rozmiar tablicy tablica . length ; // 0 tablica . push ( 10 ); //teraz tablica zawiera 10 // 1 - zwraca ona now\u0105 d\u0142ugo\u015b\u017c naszej tablicy tablica . unshift ( 0 ); //tobi to samo co push, tylko dodaje na pocz\u0105tek tablica . pop (); //a po tej operacji jest znowu pusta // 10 - zwraca warto\u015b\u0107 z ko\u0144ca tablicy tablica . shift (); // zwraca pierwszy element rablicy const inna = [ \"pierwszy\" , \"drugi\" , \"trzeci\" ]; inna . indexOf ( \"pierwszy\" ); // 0 inna . includes ( \"trzeci\" ); // true Iterowanie po tablicach const lista = [ \"a\" , \"b\" , \"c\" ]; for ( const [ num , elem ] of lista . entries ()) { console . log ( `Indeks: ${ num } Zawartosc: ${ elem } ` ); } Rozmontowywanie tablic // tworzymy trzy zmienne (x, y, z), kt\u00f3re b\u0119z\u0105 zawiera\u0107 poszczeg\u00f3lne elementy const [ x , y , z ] = [ 1 , 2 , 3 ]; const [, dwa , , cztery ] = [ 1 , 2 , 3 , 4 , 5 ]; //nie musimy bra\u0107 wszystkich element\u00f3w z danej tablicy Mo\u017cemy te\u017c w ten spos\u00f3b definiowa\u0107 zmienne domy\u015blne (je\u015bli w tablicy nie ma danego elementu do domy\u015blnie jest Undefined) const [ x = 1 , , z = 3 ] = [ 0 , 1 ]; Ten mechanizm pozwala na \u0142atwe zwracanie wielu element\u00f3w z funkcji, podobnie do krotek z pythona.","title":"Tablice (arrays)"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#sposoby-definiowania","text":"Jest kilka sposob\u00f3w na definiowanie zmiennych. S\u0142u\u017c\u0105 do tego s\u0142owa kluczowe let , var i const . let - definiowanie zwyk\u0142ej zmienej warto\u015bci, za jego pomoc\u0105 mo\u017cna te\u017c definiowa\u0107 puste zmienne. let num = 30 ; num = 32 ; let undef ; var - podobne do let lecz jest ju\u017c przestarza\u0142e i nie zaleca si\u0119 jego u\u017cywania. Var jest du\u017co bardziej bugogenne function f () { for ( var let_i = 0 ; let_i < 5 ; let_i ++ ) { console . log ( \"let_i: \" + let_i ); } for ( var var_i = 0 ; var_i < 5 ; var_i ++ ) { console . log ( \"let_i: \" + let_i ); // to b\u0119dzie dzia\u0142a\u0107 dobrze } } Na dodatek pozwala ono u\u017cywa\u0107 zmiennej przed jej zadeklarowaniem. const - po prostu sta\u0142e zmienne const PI = 3.14 ; // PI = 1; - spowoduje TypeError // const unknown; - to te\u017c nie zadzia\u0142a (SyntaxError) Teoretycznie mo\u017cna pracowa\u0107 nawet bez definiowania zmiennych wg wymienionych wy\u017cej sposob\u00f3w. imie = \"Jan\" ; console . log ( imie ); // Jan Tylko, \u017ce ta zmienna b\u0119dzie wtedy odpowiednikiem zmiennej globalnej.","title":"Sposoby definiowania"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#operatory","text":"Typy operator\u00f3w: Matematyczne: + - * / ** (pot\u0119gowanie) Przypisywania: = += *= -= ++ -- etc Boolowskie por\u00f3wnania: > >= < <= == != === logiczne && || ! tr\u00f3jargumentowy ? : Kolejno\u015b\u0107 operator\u00f3w jest taka jak w matematyce.","title":"Operatory"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#operator-i","text":"Istniej\u0105 dwa operatory r\u00f3wno\u015bci: === - \u015bcis\u0142y - zwraca prawd\u0119 tylko i wy\u0142\u0105cznie wtedy, gdy obie strony s\u0105 takie same, nie bawi si\u0119 w \u017cadne konwersje etc. == - jest nieco lu\u017aniejszy, pozwala sobie na konwersje pomi\u0119dzy typami je\u015bli warto\u015bci s\u0105 r\u00f3\u017cnych typ\u00f3w, poza tym ma inne \"pomagaj\u0105ce\" mechanizmy, kt\u00f3re w d\u0142u\u017cszej prespektywie mog\u0105 powodowa\u0107 wi\u0119cej b\u0142\u0119d\u00f3w. (je\u015bli si\u0119 da u\u017cywaj === ) 19 === \"19\" ; // false 19 == \"19\" ; // true Podobnie do === dzia\u0142a !==","title":"Operator == i ==="},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#konwersja","text":"Aby dokona\u0107 konwersji trzeba po prostu u\u017cy\u0107 konstruktora danego typu. const rokStr = \"2001\" ; Number ( rokStr ); //>2001 String ( 55 ); //>\"55\" Tutaj w wypadku podania niew\u0142a\u015bciwej warto\u015bci zamiast wyj\u0105tku dla liczby mo\u017cemy dosta\u0107 NaN (Not a Number) let a = Number ( \"ff2\" ); a ; //>NaN typeof a ; // Co ciekawe ten typ jest wci\u0105\u017c numerem ( \"number\" ); Poza tym warto uwa\u017ca\u0107 na sprytn\u0105 konwersj\u0119 typ\u00f3w np przy printowaniu. Na og\u00f3\u0142 dzia\u0142a to fajnie, ale operator + mo\u017ce troch\u0119 napsu\u0107 i by\u0107 \u017ar\u00f3d\u0142em wielu b\u0142\u0119d\u00f3w. \"22\" + 10 ; // 2210 \"22\" - 10 ; // 12 \"22\" - \"10\" ; // 12 \"22\" - \"10\" + 55 ; // 67 \"22\" - \"10\" + \"55\" ; // 1255 Konwersja na Boola - warto\u015bci, kt\u00f3re przy konewrsji na boola daj\u0105 false : 0 - warto\u015b\u0107 liczbowa r\u00f3wna zero \"\" undefined null NaN Pozosta\u0142e konwertuj\u0105 si\u0119 na warto\u015b\u0107 true","title":"Konwersja"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#praca-ze-stringami","text":"Mamy tutaj standardowe metody do pracy z ci\u0105gami znak\u00f3w, podobne nieco do tych pythonowych. Mamy: split(separator=\" \") replace(co,na_co) , replaceAll(co,na_co) let slowo = \"\" ;","title":"Praca ze stringami"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#printowanie","text":"console . log ( \"Wiadomosc1\" , 323 ); //> Wiadomosc1 323 // aby wypisa\u0107 wiadomo\u015bc mo\u017cna klasycznie po\u0142\u0105czy\u0107 stringi const wiek = 10 ; const wiadomosc = \"Hej, mam \" + wiek + \"lat\" ; console . log ( wiadomosc ); // Ale mo\u017cna to zrobi\u0107 wygodniej warto pami\u0119ta\u0107, \u017ce robimy to w ``, a nie w '' const wiadomosc2 = `Hej, mam ${ wiek } lat` ; console . log ( wiadomosc2 ); Og\u00f3lnie to obecnie ten drugi spos\u00f3b definiowania jest wygodniejszy console . log ( \"Wiele\\n\\ linii w kodzie\" ); //VS console . log ( `Wiele linii w kodzie` );","title":"Printowanie"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#if-y-i-warunki","text":"Syntax warunk\u00f3w jest zbli\u017cony do C++ const wiek = prompt ( \"podaj wiek\" ); //pojawi si\u0119 okno z pytaniem if ( wiek >= 18 ) { console . log ( \"Pe\u0142noletni\" ); } else { console . log ( \"Niepe\u0142noletni\" ); } if ( true ) console . log ( \"Nie\" ); else console . log ( \"Tak\" ); if ( true ) console . log ( \"True to prawda\" ); Mamy te\u017c tu switcha switch ( key ) { case value : fun1 (); fun2 (); break ; case value2 : case value3 : // dla tych dw\u00f3ch warto\u015bci b\u0119dzie si\u0119 dzia\u0107 to samo fun3 (); break ; default : break ; } Jest te\u017c operator tr\u00f3jargumentowy ? : wiek >= 18 ? console . log ( \"Doros\u0142y\" ) : log . console ( \"Nie Doros\u0142y\" ); // Albo console . log ( wiek >= 18 ? \"Doros\u0142y\" : \"Nie Doros\u0142y\" );","title":"IF-y i warunki"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#petle","text":"Nic ciekawego mamy 2 zwyk\u0142e typy p\u0119tli, for i while . for ( let num = 0 ; num < 10 ; num ++ ) { if ( num === 5 ) continue ; //ale skipujemy dla 5 console . log ( `Printujemy po raz ${ num + 1 } ` ); } while ( true ) { //nigdy nie ko\u0144cz\u0105ca si\u0119 p\u0119tla break ; //no chyba, \u017ce u\u017cyj\u0119 break } Poza tym mamy jeszcze forEach w dw\u00f3ch wariantach. const tablica = [ 0 , 11 , 22 , 33 , 44 ]; for ( const i of tablica ) { console . log ( i ); } // Metoda forEach tablica . forEach ( function ( i ) { console . log ( i ); });","title":"P\u0119tle"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#funkcje","text":"Definiujemy je u\u017cywaj\u0105c s\u0142owa kluczowego function . Tak\u017ce s\u0105 na og\u00f3\u0142 formatowane jako camelCase . Warning Niestety JS nie wspiera przeci\u0105\u017cania funkcji. Poni\u017cej zwyk\u0142e deklaracje funkcji (function declaration). function printHello () { console . log ( \"Hello\" ); } printHello (); // Hello function isApple ( fruit ) { if ( fruit == \"apple\" ) return true ; else return false ; }","title":"Funkcje"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#argumenty-funkcji","text":"Funckcj\u0119 maj\u0105c\u0105 n argument\u00f3w mo\u017cemy wywo\u0142a\u0107 u\u017cywaj\u0105c: n argument\u00f3w printHello ( 23 ); // Hello wi\u0119cej ni\u017c n argument\u00f3w - nieoczekiwane argumenty s\u0105 ignorowane isApple ( \"apple\" , 43 ); //drugi argument jest ignorowany // true mniej ni\u017c n argument\u00f3w - brakuj\u0105ce maj\u0105 warto\u015b\u0107 undefined isApple (); //pierwszy argument ma warto\u015b\u0107 \"undefined\" // false Mo\u017cemy tak\u017ce przekaza\u0107 do funkcji list\u0119 argument\u00f3w, kt\u00f3re b\u0119d\u0105 zmapowane na kolejne argumenty let vector = [ \"apple\" , 2 , 3 , 4 ]; isApple (... vector ); Do argument\u00f3w mo\u017cemy odwo\u0142a\u0107 si\u0119 poprzez: nazw\u0119 pseudo-list\u0119 arguments function greetings () { for ( let i = 0 ; i < arguments . length ; i ++ ) { console . log ( \"Hi, \" + arguments [ i ]); } //Hi, Tom } W razie potrzeby mo\u017cemy wymusi\u0107 liczb\u0119 argument\u00f3w function f ( x , y ) { if ( arguments . length != 2 )... W\u0142a\u015bnie przez ten \u015bmietnik nie mamy przeci\u0105\u017cania funkcji.","title":"Argumenty funkcji"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#funkcje-anonimowe","text":"Tym okre\u015bleniem okre\u015blamy funkcje, kt\u00f3re s\u0105 przechowywane w zmiennych. Okre\u015blane tak\u017ce jako function expression . let myFun = function () { lonsole . log ( \"HelloFun\" ); }; myFun (); // HelloFun","title":"Funkcje anonimowe"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#funkcje-strzakowe","text":"Funkcje strza\u0142kowe (arrow functions) to po prostu inny format funkcji przypominaj\u0105cy wyra\u017cenia lambda z innych j\u0119zyk\u00f3w. Pozwala na kr\u00f3tszy zapis funkcji. const arrowFun = ( value ) => value + 12 ; arrowFun ( 10 ); // 22 const arrowFunMultiline = ( imie ) => { console . log ( `imie to ${ imie } ` ); return imie ; }; arrowFunMultiline ( \"Jan\" ); // imie to Jan // \"Jan\" const linkNames = ( imie , nazwisko ) => imie + \" \" + nazwisko ; Maj\u0105 one do\u015b\u0107 elastyczny zapis, w wypadku jednego argumentu nie musimy u\u017cywa\u0107 nawias\u00f3w pocz\u0105tkowych, podobnie wygl\u0105da sytuacja z klamerkami w kt\u00f3\u00a9ych zawieramy nasze funkcje. R\u00f3\u017cni\u0105 si\u0119 te\u017c nieco implementacj\u0105, nie jest dla nich tworzony this , ani obiekt arguments . const fun1 = function () { console . log ( this ); // undefined }; const fun2 = () => { console . log ( this ); // zwr\u00f3ci globalny obiekt window };","title":"Funkcje strza\u0142kowe"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#kolejnosc-hoisting","text":"Przy deklarowaniu funkcji nie musimy si\u0119 martwi\u0107 kolejno\u015bci\u0105 ich deklaracji, poniewa\u017c ich deklaracje s\u0105 doczytywane wcze\u015bniej (ale na ich u\u017cycie musimy poczeka\u0107). const fun1 = function () { fun2 (); }; const fun2 = function () { console . log ( \"ok\" ); }; fun1 (); //ale ta ju\u017c musi by\u0107 po deklaracji","title":"Kolejno\u015b\u0107 (hoisting)"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#dostep-do-zmiennych-w-funkcji-zagniezdzonej","text":"Funkcjie zdefiniowane we wn\u0119trzu innuch funkcji maj\u0105 dost\u0119p do wszystkich zmiennych kt\u00f3re s\u0105 dost\u0119pne w wybranym zakresie. var global = \"this is global\" ; function scopeFunction () { alsoGlobal = \"This is also global!\" ; var notGlobal = \"This is private to scopeFunction!\" ; function subFunction () { alert ( notGlobal ); // We can still access notGlobal in this child function. stillGlobal = \"No var keyword so this is global!\" ; var isPrivate = \"This is private to subFunction!\" ; } alert ( stillGlobal ); // This is an error since we haven't executed subfunction subFunction (); // execute subfunction alert ( stillGlobal ); // This will output 'No var keyword so this is global!' alert ( isPrivate ); // This generate an error since isPrivate is private to // subfunction(). alert ( global ); // outputs: 'this is global' } alert ( global ); // outputs: 'this is global' alert ( alsoGlobal ); // generates an error since we haven't run scopeFunction yet. scopeFunction (); alert ( alsoGlobal ); // outputs: 'This is also global!'; alert ( notGlobal ); // generates an error.","title":"Dost\u0119p do zmiennych w funkcji zagnie\u017cd\u017conej"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#zmienne-proste-vs-zozone-kopia-vs-referencja","text":"Przy pracy ze zmiennymi warto pami\u0119ta\u0107 o tym, \u017ce jedynie proste typy zmiennych s\u0105 kopiowane przy przekazywaniu dalej (Number, String, Boolean, Undefined, Null, Symbol, BigInt), w pozosta\u0142ych przypadkach przekazywana jest referencja. let x = 1 ; let y = x ; y = 2 ; console . log ( x ); // 1 console . log ( y ); // 2 let d1 = { x : 1 }; let d2 = d1 ; d2 . x = 2 ; //niechc\u0105cy nadpisali\u015bmy warto\u015b\u0107 x obiektu d1 console . log ( d1 ); //{ x: 2 } console . log ( d2 ); //{ x: 2 } Aby temu zapobiec mo\u017cna u\u017cy\u0107 operatora Object.assign() - \u0142\u0105czy on ze sob\u0105 2 obiekty, wystarczy po\u0142\u0105czy\u0107 nasz z jakim\u015b pustym. Tworzy on jednak tylko p\u0142ytk\u0105 kopi\u0119. let kopia = Object . assign ({}, d1 );","title":"Zmienne proste vs z\u0142o\u017cone (kopia vs referencja)"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#obiekty","text":"Obiekty mog\u0105 by\u0107 tworzone na dwa sposoby.","title":"Obiekty"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#tworzenie","text":"Jako wyra\u017cenie (expression) - spos\u00f3b nieco zbli\u017cony do opisu s\u0142ownika. Otrzymujemy od razu gotow\u0105 instancj\u0119 naszej klasy. const osoba = { imie : \"Marian\" , nazwisko : \"Nowak\" , ur : 1999 , getAge : function () { return 2021 - this . ur ; }, }; Poszczeg\u00f3lne elementy powinny by\u0107 oddzielone przecinkami. Deklaracja - tworzymy deklaracj\u0119 klasy i potem mo\u017cemy (u\u017cywaj\u0105c operatora new tworzy\u0107 jej instancje) class Rectangle { constructor ( height , width ) { this . height = height ; this . width = width ; } } let instancja = new Rectangle ( 0 , 0 ); Dost\u0119p do element\u00f3w danej klasy uzyskujemy za pomoc\u0105 s\u0142owa this . // Dane mo\u017cna pozyskiwa\u0107 na 2 sposoby osoba . imie ; //Marian //Ten spos\u00f3b jest nieco bardziej elastyczny i pozwala na nieco \u0142atwiejsze zarz\u0105dzanie polami osoba [ \"imie\" ]; //Marian // Mo\u017cemy tutaj te\u017c \u0142\u0105two edytowa\u0107 pola w klasie osoba . drugie_imie = \"Zbigniew\" ; osoba ; // Object { imie: \"Marian\", nazwisko: \"Nowak\", wiek: 25, drugie_imie: \"Zbigniew\" } osoba . getAge (); // 22","title":"Tworzenie"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#prototypy","text":"Prototyp jest deklaracj\u0105 zawieraj\u0105c\u0105 definicje, kt\u00f3re s\u0105 wsp\u00f3\u0142dzielone mi\u0119dzy instancjami. Ka\u017cda instancja ma dost\u0119p do p\u00f3l i metod prototypu. Jest to przydatne, gdy chcemy co\u015b zmieni\u0107 we wszystkich instancjach danego obiektu bez ingerowania w niego. class Rectangle { constructor ( height , width ) { this . height = height ; this . width = width ; } } let rect = new Rectangle ( 10 , 10 ); // dla obiektu prototype dla instancji __proto__ Rectangle . prototype . field = function () { return this . height * this . width ; }; rect . field (); // to nam zwr\u00f3ci 100 Rectangle . __proto__ ; //zwr\u00f3ci nam prototyp bazowego obiektu","title":"Prototypy"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#gettery-i-settery","text":"Pozwalaj\u0105 na u\u017cywanie niekt\u00f3rych metod tak, jakby by\u0142y polami. Settery s\u0105 bardzo przydatne podczas walidacji danych. const account = { owner : \"Jonas\" , movements : [ 200 , 530 , 120 , 300 ], get latest () { return this . movements . slice ( - 1 ). pop (); }, set latest ( mov ) { this . movements . push ( mov ); }, }; account . latest = 23 ; account . latest ;","title":"Gettery i settery"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#dziedziczenie","text":"U\u017cywaj\u0105c s\u0142owa kluczowego extends mo\u017cemy tak\u017ce tworzey\u0107 hiererchie klas class Animal { // nazwa; constructor ( nazwa ) { this . nazwa = nazwa ; } habla () {} nazwaAnimal () { return this . nazwa ; } } class Pies extends Animal { constructor () { super ( \"Pies\" ); } habla () { return \"hau\" ; } } let perro = new Perro (); console . log ( perro . nazwaAnimal () + \" dice \" + perro . habla ());","title":"Dziedziczenie"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#komunikacja-zewnetrzna-i-funkcje-asynchroniczne","text":"Aby zapobiec marnowaniu czasu niekt\u00f3re funkcje w JS-ie zosta\u0142y zaimplementowane asynchronicznie. const img = document . querySelector ( \".dog\" ); img . src = \"dog.jpg\" ; // I w\u0142a\u015bnie to wczytywanie b\u0119dzie asynchroniczne //Jak ju\u017c si\u0119 wczyta to odpalony zostanie ten event img . addEventListener ( \"load\" , function () { console . log ( \"Wczytano\" ); }); Warto pami\u0119ta\u0107, \u017ce eventy z p\u0119tli zdarze\u0144 maj\u0105 miejsce tylko wtedy, gdy w g\u0142\u00f3wnym w\u0105tku nic nie jest przetwarzane. Po dok\u0142adniejsze wyja\u015bnienia zajrzyj do Javascript - Inne informacje","title":"Komunikacja zewn\u0119trzna i funkcje asynchroniczne"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#ajax","text":"AJAX - Async JavaScript And XML. Pozwala asynchronicznie komunikowa\u0107 si\u0119 z zewn\u0119trznymi serwerami (wysy\u0142a\u0107 \u017c\u0105dania etc). Kiedy\u015b opiera\u0142o si\u0119 to na u\u017cyciu XML-a, ale od ilu\u015b lat u\u017cywa si\u0119 jednak JSONa (teraz to podstawa REST-a ). Na potrzeby przyk\u0142ad\u00f3w korzystamy z darmowych API st\u0105d . Wcze\u015bniej u\u017cywa\u0142o si\u0119 do tego XMLHttpRequest. const request = new XMLHttpRequest (); request . open ( \"GET\" , \"https://restcountries.eu/rest/v2/name/poland\" ); wynik = request . send (); var polska ; request . addEventListener ( \"load\" , () => { console . log ( this . responseText ); //po otrzymaniu wy\u015bwietli nam si\u0119 ca\u0142y surowy tekst JSONa, //kt\u00f3ry trzeba przekszta\u0142ci\u0107 w jaki\u015b sensowny obiekt [ polska ] = JSON . parse ( this . responseText ); //json parse zwraca list\u0119 obiekt\u00f3w, wi\u0119c bierzemy tylko pierwszy }); Jednak obecnie ta metoda jest przestarza\u0142a i zamiast tego u\u017cywa si\u0119 fetch, kt\u00f3re zwraca nam Obietnic\u0119 (promise). Jest to tymczasowy obiekt w kt\u00f3rym znajdziemy wynik operacji asynchronicznej jak ju\u017c si\u0119 wykona. Dzi\u0119ki takiemu podej\u015bciu nie musimy polega\u0107 na callbackach, kt\u00f3re mog\u0105 by\u0107 problematyczne. const promise = fetch ( \"https://restcountries.eu/rest/v2/name/poland\" ); Taka obietnica po zako\u0144czeniu zadania mo\u017ce zmieni\u0107 sw\u00f3j stan na spe\u0142nion\u0105, lub odrzucon\u0105. Jak ju\u017c zosta\u0142a wykonana to mo\u017cemy j\u0105 skonsumowa\u0107. Do tego warto u\u017cywa\u0107 metody then do kt\u00f3rej przekazujemy co ma zosta\u0107 zrobione z otrzymanymi danymi. then ( onFulfilled ); then ( onFulfilled , onRejected ); then ( ( value ) => { /* fulfillment handler */ }, ( reason ) => { /* rejection handler */ } ); W wypadku b\u0142\u0119du, lud odrzucenia rz\u0105dania mo\u017cemy te\u017c wykorzysta\u0107 catch() na ko\u0144cu \u0142a\u0144cuszka. fetch ( \"https://restcountries.eu/rest/v2/name/poland\" ). then ( function ( response ) { console . log ( response ); //wypisze nam ca\u0142\u0105 klas\u0119 odpowiedzi z kodem statusu etc const new_promise = response . json (); //zwraca sparsowany obiekt, ale jest te\u017c kolejn\u0105 obietnic\u0105 }); U\u017cywaj\u0105c tych mechanizm\u00f3w mo\u017cna \u0142atwo \u0142\u0105czy\u0107 wiele \u017c\u0105da\u0144 w ci\u0105gi. const getCountryData = function ( country ) { fetch ( `https://restcountries.eu/rest/v2/name/ ${ country } ` ) . then (( response ) => { response . json (); }) //po otrzymaniu odpowiedzi parsujemy j\u0105 asynchronicznie . then (( data ) => { console . log ( data ); }); //po sparsowaniu w ko\u0144cu mo\u017cemy j\u0105 wy\u015bwietli\u0107 }; Mamy tu jedno \u017c\u0105danie, kt\u00f3re po wykonaniu ma zwr\u00f3ci\u0107 kolejn\u0105 obietnic\u0119, kt\u00f3ra po spe\u0142nieniu ma nam wy\u015bwietli\u0107 sparsowany wynik.","title":"AJAX"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#wysyanie-zadan-z-zawartoscia","text":"Wysy\u0142anie \u017c\u0105dania zawieraj\u0105cego JSONa Stary spos\u00f3b: let xhr = new XMLHttpRequest (); let url = \"https://httpbin.org/post\" ; xhr . open ( \"POST\" , url , true ); //true m\u00f3wi, \u017ce ma by\u0107 asynchronicznie xhr . setRequestHeader ( \"Content-Type\" , \"application/json\" ); //kiedy jsona trzeba okre\u015bli\u0107 jaki to typ zawarto\u015bci xhr . onreadystatechange = function () { console . log ( \"Jest git\" ); console . log ( this . responseText ); }; var data = JSON . stringify ({ imie : \"Jan\" , wiek : 12 }); xhr . send ( data ); Nowy spos\u00f3b: fetch ( \"https://httpbin.org/post\" , { method : \"post\" , headers : { Accept : \"application/json, text/plain\" , \"Content-Type\" : \"application/json\" , }, body : JSON . stringify ({ imie : \"Jan\" , wiek : 12 }), }) . then (( res ) => res . json ()) . then (( res ) => console . log ( res )); Tutaj drugim argumentam fetcha jest odpowiednik obiektu Request . Warto zwr\u00f3ci\u0107 tu uwag\u0119 na pola: method - okre\u015bla typ \u017c\u0105dania headers - mamy tutaj typowe nag\u0142\u00f3wki http lista , za ich pomoc\u0105 ustalamy np jaki typ danych wysy\u0142amy ( Content-Type ), czy te\u017c jakie dane jeste\u015bmy w stanie przyj\u0105\u0107 ( Accept ). body - ju\u017c samo cia\u0142o \u017c\u0105dania, tutaj warto pami\u0119ta\u0107, \u017ce najcz\u0119\u015bciej wysy\u0142amy je w postaci stringa","title":"Wysy\u0142anie \u017c\u0105da\u0144 z zawarto\u015bci\u0105"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#runkcje-asynchroniczne","text":"Do zdefiniowania funkcji asynchronicznej (zwracaj\u0105cej obietnic\u0119) wykorzystujemy s\u0142owo kluczowe async . // Variation of program in slide 38... const fs = require ( \"fs\" ); function readFilePromise ( filename ) { return new Promise (( resolve , reject ) => { fs . readFile ( filename , ( err , data ) => { if ( err ) reject ( err + \"\" ); else resolve ( data + \"\" ); }); }); } async function readTwoFiles () { try { console . log ( await readFilePromise ( \"readfile.js\" )); console . log ( await readFilePromise ( \"doesntExist.js\" )); } catch ( err ) { console . error ( err + \"\" ); } } readTwoFiles ();","title":"Runkcje asynchroniczne"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/1_javascript_syntax/#waczanie-zewnetrznych-bibliotek","text":"TODO","title":"W\u0142\u0105czanie zewn\u0119trznych bibliotek"},{"location":"Web%C3%B3wka%F0%9F%8C%8D/2_javascript_interakcje_z_dom/","text":"Javascript DOM - Interakcje i w\u0142a\u015bciwo\u015bci DOM (Document Object Model) -ustrukturyzowana reprezentacja dokument\u00f3w HTML. Pozwala Javascriptowi na dost\u0119p do jego element\u00f3w i manipulowanie nimi (zmiana stylu, tekstu, czy te\u017c stylu CSS). Jest to drzewiasta struktura \u0142\u0105cz\u0105ca elementy rodzic\u00f3w z ich dzie\u0107mi. Korzeniem tej struktury jest document . Jest to klasa dost\u0119pna w JS-ie do kt\u00f3rej si\u0119 odwo\u0142ujemy, gdy chcemy wej\u015b\u0107 w interakcj\u0119 z naszym dokumentem. Do manipulacji elementami zawartymi w dokumencie HTML wystarczy u\u017cy\u0107 metody document.querySelector , kt\u00f3ra zwr\u00f3ci nam obiekt reprezentuj\u0105cy dany element. Manipulacja elementami strony W praktyce document . querySelector ( \".message\" ); //W nawiasie podajemy jego identyfikator, analogicznie jak w CSS-ie .klasa lub #id document . querySelector ( \".message\" ). textContent ; //\"Wiadomo\u015b\u0107\" document . querySelector ( \".message\" ). textContent = \"Nowa wiadomo\u015b\u0107\" ; // w tym momencie zmieni si\u0119 tekst zawarty w tym elemencie Znajdowanie element\u00f3w document . querySelector ( \".message\" ); //szuka po nazwie i zwraca pierwszy pasuj\u0105cy document . querySelectorAll ( \".message\" ); //jak wy\u017cej, tylko zwraca list\u0119 wszystkich element\u00f3w document . documentElement ; //zwraca nam ca\u0142e drzewo dokumentu document . body ; //analogicznie document . head ; document . getElementById ( \"element1\" ); // zwraca nam element po ID (bez potrzeby u\u017cywania krokek, czy hasz\u00f3w przy nazwach) document . getElementsByTagName ( \"button\" ); //Elements - czyli zwr\u00f3ci nam list\u0119 element\u00f3w typu button document . getElementsByClassName ( \"moja_klasa\" ); Dodawanie i tworzenie element\u00f3w Do dodawanie element\u00f3w w HTML-u u\u017cywa si\u0119 metody Element.insertAdjacentHTML() albo insertAdjacentElement() . Pozwala ona nam wstawi\u0107 dowolny tekst (element) wzgl\u0119dem wybranego elementu. element . insertAdjacentHTML ( position , text ); position mo\u017ce przyjmowa\u0107 warto\u015bci: 'beforebegin': przed element -em. 'afterbegin': W \u015brodku element-u przed jego pierwszym dzieckiem. 'beforeend': W \u015brodku elementu po jego ostatnim dziecku. 'afterend': Po element-cie Odpowiadaj\u0105 one takim wstawienion: < p > foo Stworzenie elementu (kt\u00f3rego jeszcze nie dodajemy do naszego DOM-a) const my_element = document . createElement ( \"div\" ); //to co dostali\u015bmy zachowuje si\u0119 jak ka\u017cdy element zdobyty za pomoc\u0105 np query selectora document . body . prepend ( my_element ); //po wstawieniu naszego elementu do dokumentu nasz obiekt mo\u017ce by\u0107 nadal u\u017cywany //mo\u017cemy np zmieni\u0107 po\u0142o\u017cenie naszego elementu document . body . append ( my_element ); // przeniesie to nasz element bo mo\u017ce istnie\u0107 tylko jedna instancja obiektu w DOM-ie // jesli chcemy kopiowa\u0107 to trzeba u\u017cy\u0107 .cloneNode(true) my_element . remove (); // usuwa ten element W niekt\u00f3rych przypadkach zamiast createElement() trzeba u\u017cy\u0107 createElementNS() (np w wypadku element\u00f3w wewn\u0105trz svg). Edycja elementu oraz atrybut\u00f3w my_element . classList . add ( \"my-created-class\" ); my_element . textContent = \"Troch\u0119 tekstu\" ; // Ten jest chyba najbardziej uniwersalny przy prostych zastosowaniach my_element . innerHTML = \"

    Troch\u0119 tekstu tylko inaczej

    \" ; // zmiana atrybut\u00f3w element\u00f3w my_element . color = \"green\" ; // dla standardowych mo\u017cemy si\u0119 do nich dosta\u0107 przez pole w klasie my_element . setAttribute ( \"creator\" , \"Marian\" ); //to si\u0119 za to sprawdzi dla niestandardowych // jedynym wyj\u0105tkiem dla niestandardowych atrybut\u00f3w s\u0105 atrybuty data-..... //